mirror of https://github.com/mgba-emu/mgba.git
GB MBC: Fix ROM bank overflows getting set to bank 0
This commit is contained in:
parent
ae12068d2f
commit
0b6bc9ae82
1
CHANGES
1
CHANGES
|
@ -16,6 +16,7 @@ Bugfixes:
|
||||||
- GBA: Fix multiboot ROM loading
|
- GBA: Fix multiboot ROM loading
|
||||||
- Libretro: Fix saving in GB games (fixes mgba.io/i/486)
|
- Libretro: Fix saving in GB games (fixes mgba.io/i/486)
|
||||||
- LR35902: Fix pc overflowing current region off-by-one
|
- LR35902: Fix pc overflowing current region off-by-one
|
||||||
|
- GB MBC: Fix ROM bank overflows getting set to bank 0
|
||||||
Misc:
|
Misc:
|
||||||
- SDL: Remove scancode key input
|
- SDL: Remove scancode key input
|
||||||
- GBA Video: Clean up unused timers
|
- GBA Video: Clean up unused timers
|
||||||
|
|
|
@ -34,6 +34,9 @@ void GBMBCSwitchBank(struct GBMemory* memory, int bank) {
|
||||||
mLOG(GB_MBC, GAME_ERROR, "Attempting to switch to an invalid ROM bank: %0X", bank);
|
mLOG(GB_MBC, GAME_ERROR, "Attempting to switch to an invalid ROM bank: %0X", bank);
|
||||||
bankStart &= (memory->romSize - 1);
|
bankStart &= (memory->romSize - 1);
|
||||||
bank = bankStart / GB_SIZE_CART_BANK0;
|
bank = bankStart / GB_SIZE_CART_BANK0;
|
||||||
|
if (!bank) {
|
||||||
|
++bank;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
memory->romBank = &memory->rom[bankStart];
|
memory->romBank = &memory->rom[bankStart];
|
||||||
memory->currentBank = bank;
|
memory->currentBank = bank;
|
||||||
|
|
Loading…
Reference in New Issue