From fcd26647617d786dd18933a1f0530cbe99b35495 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 10 Feb 2022 14:23:56 -0800 Subject: [PATCH] GB: MBC cleanup --- src/gb/gb.c | 1 - src/gb/mbc.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gb/gb.c b/src/gb/gb.c index a49b641af..0da504c61 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -117,7 +117,6 @@ bool GBLoadROM(struct GB* gb, struct VFile* vf) { gb->yankedRomSize = 0; gb->memory.romSize = gb->pristineRomSize; gb->romCrc32 = doCrc32(gb->memory.rom, gb->memory.romSize); - memset(&gb->memory.mbcState, 0, sizeof(gb->memory.mbcState)); GBMBCReset(gb); if (gb->cpu) { diff --git a/src/gb/mbc.c b/src/gb/mbc.c index ffc4054e6..20ab20322 100644 --- a/src/gb/mbc.c +++ b/src/gb/mbc.c @@ -339,6 +339,10 @@ void GBMBCInit(struct GB* gb) { } gb->memory.mbcRead = NULL; gb->memory.directSramAccess = true; + gb->memory.mbcReadBank0 = false; + gb->memory.mbcReadBank1 = false; + gb->memory.mbcReadHigh = false; + gb->memory.mbcWriteHigh = false; gb->memory.cartBusDecay = 4; switch (gb->memory.mbcType) { case GB_MBC_NONE: