Fully reset the MBC, for correct ROM switching. Fixes #489

This commit is contained in:
Lior Halphon 2022-08-20 13:09:08 +03:00
parent 2c7343a6ad
commit 58750424c7
1 changed files with 1 additions and 0 deletions

View File

@ -253,6 +253,7 @@ void GB_configure_cart(GB_gameboy_t *gb)
void GB_reset_mbc(GB_gameboy_t *gb)
{
memset(GB_GET_SECTION(gb, mbc), 0, GB_SECTION_SIZE(mbc));
if (gb->cartridge_type->mbc_type == GB_MMM01) {
gb->mbc_rom_bank = -1;
gb->mbc_rom0_bank = -2;