LR35902: Fix pc overflowing current region off-by-one

This commit is contained in:
Jeffrey Pfau 2017-01-11 01:35:06 -08:00
parent 712abdeb0f
commit ae12068d2f
2 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ Bugfixes:
- ARM7: Fix MLA/*MULL/*MLAL timing - ARM7: Fix MLA/*MULL/*MLAL timing
- 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
Misc: Misc:
- SDL: Remove scancode key input - SDL: Remove scancode key input
- GBA Video: Clean up unused timers - GBA Video: Clean up unused timers

View File

@ -19,7 +19,7 @@ mLOG_DEFINE_CATEGORY(GB_MEM, "GB Memory");
static void _pristineCow(struct GB* gba); static void _pristineCow(struct GB* gba);
static uint8_t GBFastLoad8(struct LR35902Core* cpu, uint16_t address) { static uint8_t GBFastLoad8(struct LR35902Core* cpu, uint16_t address) {
if (UNLIKELY(address > cpu->memory.activeRegionEnd)) { if (UNLIKELY(address >= cpu->memory.activeRegionEnd)) {
cpu->memory.setActiveRegion(cpu, address); cpu->memory.setActiveRegion(cpu, address);
return cpu->memory.cpuLoad8(cpu, address); return cpu->memory.cpuLoad8(cpu, address);
} }