Skip to content

Commit

Permalink
LR35902: Fix pc overflowing current region off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Jan 11, 2017
1 parent 712abde commit ae12068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -15,6 +15,7 @@ Bugfixes:
- 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
Misc:
- SDL: Remove scancode key input
- GBA Video: Clean up unused timers
Expand Down
2 changes: 1 addition & 1 deletion src/gb/memory.c
Expand Up @@ -19,7 +19,7 @@ mLOG_DEFINE_CATEGORY(GB_MEM, "GB Memory");
static void _pristineCow(struct GB* gba);

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);
return cpu->memory.cpuLoad8(cpu, address);
}
Expand Down

0 comments on commit ae12068

Please sign in to comment.