all repos — mgba @ 40a0a0eb117f40fd3210f14fc9a188cb775e0988

mGBA Game Boy Advance Emulator

Fix reading 32-bit unaligned IO registers
Jeffrey Pfau jeffrey@endrift.com
Sun, 06 Oct 2013 12:28:48 -0700
commit

40a0a0eb117f40fd3210f14fc9a188cb775e0988

parent

45501658b5b9492996141149ade4ad29aa14ffd4

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

jump to
M src/gba/gba-memory.csrc/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];