Fix 8-bit I/O writes
Jeffrey Pfau jeffrey@endrift.com
Mon, 29 Jul 2013 01:30:06 -0700
1 files changed,
3 insertions(+),
3 deletions(-)
jump to
M
src/gba/gba-io.c
→
src/gba/gba-io.c
@@ -130,9 +130,9 @@ GBALog(GBA_LOG_STUB, "Stop unimplemented");
} return; } - value <<= 8 * (address & 1); - value |= (gba->memory.io[(address & (SIZE_IO - 1)) >> 1]) & ~(0xFF << (8 * (address & 1))); - GBAIOWrite(gba, address, value); + uint16_t value16 = value << (8 * (address & 1)); + value16 |= (gba->memory.io[(address & (SIZE_IO - 1)) >> 1]) & ~(0xFF << (8 * (address & 1))); + GBAIOWrite(gba, address & 0xFFFFFFFE, value16); } void GBAIOWrite32(struct GBA* gba, uint32_t address, uint32_t value) {