all repos — mgba @ dd91b689a2ca12c096b886204c9c7ef17435b64d

mGBA Game Boy Advance Emulator

GBA Hardware: Fix GPIO on big endian
Jeffrey Pfau jeffrey@endrift.com
Tue, 29 Dec 2015 00:03:42 -0500
commit

dd91b689a2ca12c096b886204c9c7ef17435b64d

parent

b20cda21e145e08912213ba1c35cf687b44724d1

2 files changed, 8 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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); } }