all repos — mgba @ 5c744a3f133da81e5d825760849b597596631f33

mGBA Game Boy Advance Emulator

src/platform/qt/GBAOverride.cpp (view raw)

 1/* Copyright (c) 2013-2016 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#include "GBAOverride.h"
 7
 8extern "C" {
 9#include "core/core.h"
10}
11
12using namespace QGBA;
13
14void GBAOverride::apply(struct mCore* core) {
15	if (core->platform(core) != PLATFORM_GBA) {
16		return;
17	}
18	GBAOverrideApply(static_cast<GBA*>(core->board), &override);
19}
20
21void GBAOverride::identify(const struct mCore* core) {
22	if (core->platform(core) != PLATFORM_GBA) {
23		return;
24	}
25	char gameId[8];
26	core->getGameCode(core, gameId);
27	memcpy(override.id, &gameId[4], 4);
28}
29
30void GBAOverride::save(struct Configuration* config) const {
31	GBAOverrideSave(config, &override);
32}