GBA: Add DMA timer check to savestate loading

This commit is contained in:
Jeffrey Pfau 2015-10-01 22:16:22 -07:00
parent 9b66720955
commit d2804505cb
2 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@ Misc:
- 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:

View File

@ -107,6 +107,10 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
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;