GBA: Add DMA timer check to savestate loading
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Oct 2015 22:16:22 -0700
2 files changed,
5 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -32,6 +32,7 @@ - Qt: Prevent savestate window from opening while in multiplayer
- Qt: Disable menu items in multiplayer that don't make sense to have enabled - Qt: Dropping multiplayer windows works more cleanly now - GBA BIOS: Implement RegisterRamReset for SIO registers + - GBA: Additional savestate sanity checks 0.3.0: (2015-08-16) Features:
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -107,6 +107,10 @@ if (state->timers[0].nextEvent < 0 || state->timers[1].nextEvent < 0 || state->timers[2].nextEvent < 0 || state->timers[3].nextEvent < 0) {
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: timer nextEvent is negative"); error = true; } + if (state->dma[0].nextEvent < 0 || state->dma[1].nextEvent < 0 || state->dma[2].nextEvent < 0 || state->dma[3].nextEvent < 0) { + GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: DMA nextEvent is negative"); + error = true; + } if (state->audio.eventDiff < 0) { GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio eventDiff is negative"); error = true;