GB MBC: Fix MMM01 detection heuristic
Vicki Pfau vi@endrift.com
Fri, 03 Aug 2018 18:39:26 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/gb/mbc.c
→
src/gb/mbc.c
@@ -141,7 +141,7 @@ const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100];
if (gb->memory.rom) { if (gb->memory.romSize >= 0x8000) { const struct GBCartridge* cartFooter = (const struct GBCartridge*) &gb->memory.rom[gb->memory.romSize - 0x7F00]; - if (doCrc32(cartFooter->logo, sizeof(cartFooter->logo)) == GB_LOGO_HASH) { + if (doCrc32(cartFooter->logo, sizeof(cartFooter->logo)) == GB_LOGO_HASH && cartFooter->type >= 0x0B && cartFooter->type <= 0x0D) { cart = cartFooter; } }