GBA Hardware: Fix GPIO on big endian
Jeffrey Pfau jeffrey@endrift.com
Tue, 29 Dec 2015 00:03:42 -0500
2 files changed,
8 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -18,6 +18,7 @@ - GBA BIOS: Fix misaligned CpuSet
- ARM7: Fix sign of unaligned LDRSH - GBA: Fix warnings when creating and loading savestates - GBA Memory: Fix DMAs triggering two cycles early + - GBA Hardware: Fix GPIO on big endian Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper
M
src/gba/hardware.c
→
src/gba/hardware.c
@@ -87,9 +87,11 @@ default:
GBALog(hw->p, GBA_LOG_WARN, "Invalid GPIO address"); } if (hw->readWrite) { - uint16_t old = hw->gpioBase[0]; + uint16_t old; + LOAD_16(old, 0, hw->gpioBase); old &= ~hw->direction; - hw->gpioBase[0] = old | hw->pinState; + old |= hw->pinState; + STORE_16(old, 0, hw->gpioBase); } else { hw->gpioBase[0] = 0; }@@ -129,10 +131,11 @@ }
void _outputPins(struct GBACartridgeHardware* hw, unsigned pins) { if (hw->readWrite) { - uint16_t old = hw->gpioBase[0]; + uint16_t old; + LOAD_16(old, 0, hw->gpioBase); old &= hw->direction; hw->pinState = old | (pins & ~hw->direction & 0xF); - hw->gpioBase[0] = hw->pinState; + STORE_16(hw->pinState, 0, hw->gpioBase); } }