GBA Hardware: Fix crash if a savestate lies about game hardware
Vicki Pfau vi@endrift.com
Mon, 24 Apr 2017 13:34:57 -0700
3 files changed,
6 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -46,6 +46,7 @@ - GBA Video: Don't update background scanline params in mode 0 (fixes mgba.io/i/377)
- Qt: Ensure CLI backend is attached when submitting commands (fixes mgba.io/i/662) - Core: Fix crash with rewind if savestates shrink - Test: Fix crash when loading invalid file + - GBA Hardware: Fix crash if a savestate lies about game hardware Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M
src/gba/gba.c
→
src/gba/gba.c
@@ -76,6 +76,8 @@
gba->sio.p = gba; GBASIOInit(&gba->sio); + GBAHardwareInit(&gba->memory.hw, NULL); + gba->springIRQ = 0; gba->keySource = 0; gba->rotationSource = 0;
M
src/gba/hardware.c
→
src/gba/hardware.c
@@ -77,6 +77,9 @@ }
} void GBAHardwareGPIOWrite(struct GBACartridgeHardware* hw, uint32_t address, uint16_t value) { + if (!hw->gpioBase) { + return; + } switch (address) { case GPIO_REG_DATA: hw->pinState &= ~hw->direction;