Skip to content

Commit 8d06339

Browse files
committed
Support for certain bootlag games with malformed headers, fixes #585
1 parent 9f53fcc commit 8d06339

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Core/mbc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ void GB_configure_cart(GB_gameboy_t *gb)
195195
GB_log(gb, "Cartridge type %02x is not yet supported.\n", gb->rom[0x147]);
196196
}
197197
}
198+
199+
if (!gb->cartridge_type->has_ram &&
200+
gb->cartridge_type->mbc_type != GB_NO_MBC &&
201+
gb->cartridge_type->mbc_type != GB_TPP1 &&
202+
gb->rom[0x149]) {
203+
GB_log(gb, "ROM header reports no RAM, but also reports a non-zero RAM size. Assuming cartridge has RAM.\n");
204+
gb->cartridge_type++;
205+
}
198206

199207
size_t old_mbc_ram_size = gb->mbc_ram_size;
200208
gb->mbc_ram_size = 0;

0 commit comments

Comments
 (0)