From 99944093f562f2fd39a330b2d61d14ddaa18f53e Mon Sep 17 00:00:00 2001 From: jsmolka Date: Sat, 21 Nov 2020 16:47:37 +0100 Subject: [PATCH] GBA Memory: Return correct byte in out of bounds ROM read --- src/gba/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gba/memory.c b/src/gba/memory.c index aabe8641a..d2735cf3a 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -679,7 +679,7 @@ uint32_t GBALoad8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { value = GBAVFameGetPatternValue(address, 8); } else { mLOG(GBA_MEM, GAME_ERROR, "Out of bounds ROM Load8: 0x%08X", address); - value = (address >> 1) & 0xFF; + value = ((address >> 1) >> ((address & 1) * 8)) & 0xFF; } break; case REGION_CART_SRAM: