Support for certain bootlag games with malformed headers, fixes #585

This commit is contained in:
Lior Halphon 2024-01-13 18:06:22 +02:00
parent 9f53fcc30b
commit 8d063391a4
1 changed files with 8 additions and 0 deletions

View File

@ -195,6 +195,14 @@ void GB_configure_cart(GB_gameboy_t *gb)
GB_log(gb, "Cartridge type %02x is not yet supported.\n", gb->rom[0x147]);
}
}
if (!gb->cartridge_type->has_ram &&
gb->cartridge_type->mbc_type != GB_NO_MBC &&
gb->cartridge_type->mbc_type != GB_TPP1 &&
gb->rom[0x149]) {
GB_log(gb, "ROM header reports no RAM, but also reports a non-zero RAM size. Assuming cartridge has RAM.\n");
gb->cartridge_type++;
}
size_t old_mbc_ram_size = gb->mbc_ram_size;
gb->mbc_ram_size = 0;