all repos — mgba @ 0dc7da9a74cb6821a579ef5bba6a928937cfe0a3

mGBA Game Boy Advance Emulator

GB MBC: Fix MBC1 initialization
Vicki Pfau vi@endrift.com
Wed, 17 Oct 2018 09:55:38 -0700
commit

0dc7da9a74cb6821a579ef5bba6a928937cfe0a3

parent

a748e0c795a4ab7117eaac78349cecb303873ddf

2 files changed, 6 insertions(+), 6 deletions(-)

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