Reorder savestates to put memory before CoreTiming.

Also, don't clear the JIT for rounding after saving, only after loading.
This commit is contained in:
Henrik Rydgård 2023-02-14 16:43:22 +01:00
parent 5ce43215b9
commit 718cb9ee4a
2 changed files with 12 additions and 4 deletions

View file

@ -135,7 +135,9 @@ void Jit::DoState(PointerWrap &p) {
Do(p, js.startDefaultPrefix); Do(p, js.startDefaultPrefix);
if (s >= 2) { if (s >= 2) {
Do(p, js.hasSetRounding); Do(p, js.hasSetRounding);
js.lastSetRounding = 0; if (p.mode == PointerWrap::MODE_READ) {
js.lastSetRounding = 0;
}
} else { } else {
js.hasSetRounding = 1; js.hasSetRounding = 1;
} }

View file

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