all repos — mgba @ 99944093f562f2fd39a330b2d61d14ddaa18f53e

mGBA Game Boy Advance Emulator

GBA Memory: Return correct byte in out of bounds ROM read
jsmolka jsmolka@pm.me
Sat, 21 Nov 2020 16:47:37 +0100
commit

99944093f562f2fd39a330b2d61d14ddaa18f53e

parent

e050a2ae3df441e3fd2409a7a49e8190a6916dbd

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gba/memory.csrc/gba/memory.c

@@ -679,7 +679,7 @@ } else if (memory->vfame.cartType) {

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: