GB MBC: Fix ROM bank overflows getting set to bank 0
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 Jan 2017 01:35:53 -0800
2 files changed,
4 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -16,6 +16,7 @@ - ARM7: Fix MLA/*MULL/*MLAL timing
- GBA: Fix multiboot ROM loading - Libretro: Fix saving in GB games (fixes mgba.io/i/486) - LR35902: Fix pc overflowing current region off-by-one + - GB MBC: Fix ROM bank overflows getting set to bank 0 Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M
src/gb/mbc.c
→
src/gb/mbc.c
@@ -34,6 +34,9 @@ if (bankStart + GB_SIZE_CART_BANK0 > memory->romSize) {
mLOG(GB_MBC, GAME_ERROR, "Attempting to switch to an invalid ROM bank: %0X", bank); bankStart &= (memory->romSize - 1); bank = bankStart / GB_SIZE_CART_BANK0; + if (!bank) { + ++bank; + } } memory->romBank = &memory->rom[bankStart]; memory->currentBank = bank;