mirror of https://github.com/mgba-emu/mgba.git
GBA: Check for cycle count being too high
This commit is contained in:
parent
d8ab8d8999
commit
42b011a68b
1
CHANGES
1
CHANGES
|
@ -27,6 +27,7 @@ Misc:
|
|||
- Qt: Dropping multiplayer windows works more cleanly now
|
||||
- GBA BIOS: Implement RegisterRamReset for SIO registers
|
||||
- GBA: Additional savestate sanity checks
|
||||
- GBA: Check for cycle count being too high
|
||||
|
||||
0.3.0: (2015-08-16)
|
||||
Features:
|
||||
|
|
|
@ -87,6 +87,10 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
|
|||
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: CPU cycles are negative");
|
||||
error = true;
|
||||
}
|
||||
if (state->cpu.cycles >= (int32_t) GBA_ARM7TDMI_FREQUENCY) {
|
||||
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: CPU cycles are too high");
|
||||
error = true;
|
||||
}
|
||||
if (state->cpu.nextEvent < 0) {
|
||||
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: Next event is negative");
|
||||
error = true;
|
||||
|
|
Loading…
Reference in New Issue