From 7a6582503fff4784d14250db3f3fa5592688bbee Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 15 Aug 2015 20:32:43 -0700 Subject: [PATCH] GBA Memory: Fix bad Load16 on big endian --- src/gba/memory.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gba/memory.c b/src/gba/memory.c index eda36f909..b97424130 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -446,8 +446,7 @@ uint32_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { } else { GBALog(gba, GBA_LOG_GAME_ERROR, "Bad memory Load16: 0x%08X", address); LOAD_BAD; - volatile uint32_t v2 = value; - LOAD_16(value, address & 2, &v2); + value = (value >> ((address & 2) * 8)) & 0xFFFF; } break; case REGION_WORKING_RAM: @@ -506,8 +505,7 @@ uint32_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { default: GBALog(gba, GBA_LOG_GAME_ERROR, "Bad memory Load16: 0x%08X", address); LOAD_BAD; - volatile uint32_t v2 = value; - LOAD_16(value, address & 2, &v2); + value = (value >> ((address & 2) * 8)) & 0xFFFF; break; }