GBA Core: Fix core reset without ROM

This commit is contained in:
Jeffrey Pfau 2016-04-30 20:39:23 -07:00
parent 9caa6f19ed
commit 525354e500
1 changed files with 5 additions and 3 deletions

View File

@ -209,9 +209,11 @@ static void _GBACoreReset(struct mCore* core) {
struct GBACartridgeOverride override; struct GBACartridgeOverride override;
const struct GBACartridge* cart = (const struct GBACartridge*) gba->memory.rom; const struct GBACartridge* cart = (const struct GBACartridge*) gba->memory.rom;
memcpy(override.id, &cart->id, sizeof(override.id)); if (cart) {
if (GBAOverrideFind(gbacore->overrides, &override)) { memcpy(override.id, &cart->id, sizeof(override.id));
GBAOverrideApply(gba, &override); if (GBAOverrideFind(gbacore->overrides, &override)) {
GBAOverrideApply(gba, &override);
}
} }
} }