Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions platform/common/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ extern "C" {

void Gameboy::refreshRomBank(int bank)
{
if (bank < romFile->getNumRomBanks()) {
romBank = bank;
romFile->loadRomBank(romBank);
memory[0x4] = romFile->romSlot1;
memory[0x5] = romFile->romSlot1+0x1000;
memory[0x6] = romFile->romSlot1+0x2000;
memory[0x7] = romFile->romSlot1+0x3000;
}
else
printLog("Tried to access bank %x\n", bank);
romBank = bank % romFile->getNumRomBanks();
romFile->loadRomBank(romBank);
memory[0x4] = romFile->romSlot1;
memory[0x5] = romFile->romSlot1+0x1000;
memory[0x6] = romFile->romSlot1+0x2000;
memory[0x7] = romFile->romSlot1+0x3000;
}

void Gameboy::refreshRamBank (int bank)
Expand Down Expand Up @@ -87,7 +83,7 @@ void Gameboy::initMMU()
readFunc = mbcReads[romFile->getMBC()];
writeFunc = mbcWrites[romFile->getMBC()];

/* Rockman8 by Yang Yang uses a silghtly different MBC1 variant */
/* Rockman8 by Yang Yang uses a slightly different MBC1 variant */
rockmanMapper = !strcmp(romFile->getRomTitle(), "ROCKMAN 99");

rumbleValue = 0;
Expand Down