GBA Core: Fix core reset without ROM
Jeffrey Pfau jeffrey@endrift.com
Sat, 30 Apr 2016 20:39:23 -0700
1 files changed,
5 insertions(+),
3 deletions(-)
jump to
M
src/gba/core.c
→
src/gba/core.c
@@ -209,9 +209,11 @@ }
struct GBACartridgeOverride override; const struct GBACartridge* cart = (const struct GBACartridge*) gba->memory.rom; - memcpy(override.id, &cart->id, sizeof(override.id)); - if (GBAOverrideFind(gbacore->overrides, &override)) { - GBAOverrideApply(gba, &override); + if (cart) { + memcpy(override.id, &cart->id, sizeof(override.id)); + if (GBAOverrideFind(gbacore->overrides, &override)) { + GBAOverrideApply(gba, &override); + } } }