all repos — mgba @ 525354e500b93545d16dde4d16b0ace3dd2a2d03

mGBA Game Boy Advance Emulator

GBA Core: Fix core reset without ROM
Jeffrey Pfau jeffrey@endrift.com
Sat, 30 Apr 2016 20:39:23 -0700
commit

525354e500b93545d16dde4d16b0ace3dd2a2d03

parent

9caa6f19edc638a2f7ed403cb37de2f3da92605c

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M src/gba/core.csrc/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); + } } }