Fix reading 32-bit unaligned IO registers
Jeffrey Pfau jeffrey@endrift.com
Sun, 06 Oct 2013 12:28:48 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -143,7 +143,7 @@ case BASE_WORKING_IRAM:
value = gbaMemory->iwram[(address & (SIZE_WORKING_IRAM - 1)) >> 2]; break; case BASE_IO: - value = GBAIORead(gbaMemory->p, address & (SIZE_IO - 1)) | (GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) | 2) << 16); + value = GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) & ~2) | (GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) | 2) << 16); break; case BASE_PALETTE_RAM: value = ((int32_t*) gbaMemory->p->video.palette)[(address & (SIZE_PALETTE_RAM - 1)) >> 2];