all repos — mgba @ 0eaa9e487f94216ea1763cb62b803c43a71141ca

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
 8#include <mgba/core/core.h>
 9
10using namespace QGBA;
11
12void GBAOverride::apply(struct mCore* core) {
13	if (core->platform(core) != PLATFORM_GBA) {
14		return;
15	}
16	GBAOverrideApply(static_cast<GBA*>(core->board), &override);
17}
18
19void GBAOverride::identify(const struct mCore* core) {
20	if (core->platform(core) != PLATFORM_GBA) {
21		return;
22	}
23	char gameId[8];
24	core->getGameCode(core, gameId);
25	memcpy(override.id, &gameId[4], 4);
26}
27
28void GBAOverride::save(struct Configuration* config) const {
29	GBAOverrideSave(config, &override);
30}