GB MBC: Fix MBC1 initialization
Vicki Pfau vi@endrift.com
Wed, 17 Oct 2018 09:55:38 -0700
2 files changed,
6 insertions(+),
6 deletions(-)
M
src/gb/mbc.c
→
src/gb/mbc.c
@@ -188,11 +188,6 @@ case 1:
case 2: case 3: gb->memory.mbcType = GB_MBC1; - if (gb->memory.romSize >= GB_SIZE_CART_BANK0 * 0x31 && _isMulticart(gb->memory.rom)) { - gb->memory.mbcState.mbc1.multicartStride = 4; - } else { - gb->memory.mbcState.mbc1.multicartStride = 5; - } break; case 5: case 6:@@ -255,6 +250,11 @@ gb->memory.mbcWrite = _GBMBCNone;
break; case GB_MBC1: gb->memory.mbcWrite = _GBMBC1; + if (gb->memory.romSize >= GB_SIZE_CART_BANK0 * 0x31 && _isMulticart(gb->memory.rom)) { + gb->memory.mbcState.mbc1.multicartStride = 4; + } else { + gb->memory.mbcState.mbc1.multicartStride = 5; + } break; case GB_MBC2: gb->memory.mbcWrite = _GBMBC2;
M
src/gb/memory.c
→
src/gb/memory.c
@@ -177,8 +177,8 @@ gb->memory.hdmaEvent.priority = 0x41;
memset(&gb->memory.hram, 0, sizeof(gb->memory.hram)); - GBMBCInit(gb); memset(&gb->memory.mbcState, 0, sizeof(gb->memory.mbcState)); + GBMBCInit(gb); switch (gb->memory.mbcType) { case GB_MBC1: gb->memory.mbcState.mbc1.mode = 0;