mirror of https://github.com/mgba-emu/mgba.git
GB Serialize: Prevent loading savestates that aren't about to load an instruction
This commit is contained in:
parent
13a68a0dac
commit
7b86d5cec7
|
@ -112,6 +112,10 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) {
|
|||
mLOG(GB_STATE, WARN, "Savestate is corrupted: CPU cycles are negative");
|
||||
error = true;
|
||||
}
|
||||
if (state->cpu.executionState != LR35902_CORE_FETCH) {
|
||||
mLOG(GB_STATE, WARN, "Savestate is corrupted: Execution state is not FETCH");
|
||||
error = true;
|
||||
}
|
||||
if (check >= (int32_t) DMG_LR35902_FREQUENCY) {
|
||||
mLOG(GB_STATE, WARN, "Savestate is corrupted: CPU cycles are too high");
|
||||
error = true;
|
||||
|
|
Loading…
Reference in New Issue