Merge pull request #16965 from hrydgard/savestate-fixes

Reorder savestates to put memory before CoreTiming.
This commit is contained in:
Unknown W. Brackets authored and GitHub committed 2023-02-14 22:04:58 -08:00
commit 81ec0b03b8
2 files changed
+12 -4

No files matched your search

+9 -3
View File
@@ -335,7 +335,7 @@ namespace SaveState
void SaveStart::DoState(PointerWrap &p)
{
auto s = p.Section("SaveStart", 1, 2);
auto s = p.Section("SaveStart", 1, 3);
if (!s)
return;
@@ -357,8 +357,10 @@ namespace SaveState
saveDataGeneration = 0;
}
// Gotta do CoreTiming first since we'll restore into it.
CoreTiming::DoState(p);
// Gotta do CoreTiming before HLE, but from v3 we've moved it after the memory stuff.
if (s <= 2) {
CoreTiming::DoState(p);
}
// Memory is a bit tricky when jit is enabled, since there's emuhacks in it.
auto savedReplacements = SaveAndClearReplacements();
@@ -376,6 +378,10 @@ namespace SaveState
Memory::DoState(p);
}
if (s >= 3) {
CoreTiming::DoState(p);
}
// Don't bother restoring if reading, we'll deal with that in KernelModuleDoState.
// In theory, different functions might have been runtime loaded in the state.
if (p.mode != p.MODE_READ)