GB: MBC cleanup

This commit is contained in:
Vicki Pfau 2022-02-10 14:23:56 -08:00
parent 6f697744d1
commit fcd2664761
2 changed files with 4 additions and 1 deletions

View File

@ -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) {

View File

@ -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: