Savedata dialog: serialize ioThreadStatus (bump section to v3)

The s > 2 branch in PSPSaveDialog::DoState has been dead code since it
was written - the section version was never raised past 2, so
ioThreadStatus was reset to SAVEIO_NONE on every savestate load.
Loading a state that was saved while a savedata operation was in
flight then repeated the operation (or left the dialog waiting on a
completion that had already happened), instead of resuming from the
recorded status.

Restoring the value is safe: DoState joins the IO thread before
serializing, so the stored status is only ever SAVEIO_NONE or
SAVEIO_DONE, and the operation's effects are already part of the
serialized emulated RAM. Old (v2) states still load through the reset
path.
This commit is contained in:
Ren committed 2026-07-27 16:19:26 +02:00
1 parent a6e4d691ef
commit 459aefb48b
1 file changed
+7 -1
+7 -1
View File
@@ -1293,7 +1293,13 @@ void PSPSaveDialog::DoState(PointerWrap &p) {
}
PSPDialog::DoState(p);
auto s = p.Section("PSPSaveDialog", 1, 2);
// Version 3 activates the s > 2 branch below, so ioThreadStatus survives
// a savestate. Safe to restore: the IO thread was joined above, so the
// value is only ever SAVEIO_NONE or SAVEIO_DONE, and the operation's
// effects are already part of the serialized state. Without this, loading
// a state taken while a savedata operation was in flight would restart
// the operation instead of resuming from its recorded status.
auto s = p.Section("PSPSaveDialog", 1, 3);
if (!s) {
return;
}