all repos — mgba @ 3f122dcf14d2f0df4e747be2e24c9460a69f7334

mGBA Game Boy Advance Emulator

Fix 8-bit I/O writes
Jeffrey Pfau jeffrey@endrift.com
Mon, 29 Jul 2013 01:30:06 -0700
commit

3f122dcf14d2f0df4e747be2e24c9460a69f7334

parent

15aa862d7046a71d82e84c8bd8c750f6b630b46d

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

jump to
M src/gba/gba-io.csrc/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) {