all repos — mgba @ 35a56e9507426870654ba367c969e047c5242d2f

mGBA Game Boy Advance Emulator

GB MBC: Fix MMM01 detection heuristic
Vicki Pfau vi@endrift.com
Fri, 03 Aug 2018 18:39:26 -0700
commit

35a56e9507426870654ba367c969e047c5242d2f

parent

825c70bbf7ec2c6a26f542b0bd1f3a897259a62f

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

jump to
M src/gb/mbc.csrc/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; } }