all repos — mgba @ 7a6582503fff4784d14250db3f3fa5592688bbee

mGBA Game Boy Advance Emulator

GBA Memory: Fix bad Load16 on big endian
Jeffrey Pfau jeffrey@endrift.com
Sat, 15 Aug 2015 20:32:43 -0700
commit

7a6582503fff4784d14250db3f3fa5592688bbee

parent

9cda63f6c0a6d12cbb25438d0a85fef762f46f04

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

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

@@ -446,8 +446,7 @@ }

} 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 @@ break;

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; }