Replaces the temporary fix that did the hidden modes' IO inside Update.
The IO thread read and wrote the dialog's request, display state and save
list, all shared with the emulator thread, which kept using them to draw the
dialog and reload the request from the game.
Now the IO thread works on its own copy of the request, its own SavedataParam
and directory names resolved up front, and shares nothing else with the
emulator thread but the (locked) file system, MemoryStick_FreeSpace's cached
use and sceChnnlsv's scratch buffer and kirk state, the last two now under
locks too. It still reads and writes the game's buffers directly, like a PSP's
utility threads and sceIoReadAsync do, so a savestate waits for it before it
saves or loads memory. Save
bookkeeping, the save indicator and display changes happen on the emulator
thread when the results are taken, and only the request fields the IO changed
are copied back, so a game's own edits in the meantime survive.
Hidden modes take the results at the next Update (or, with Host IO timing,
the first Update that finds them done). The visible dialogs keep drawing and
take them once the IO is done; save and load used to stall the emulator
thread for the whole operation. Savestates keep results that haven't been
taken yet.
When the results land in PSP memory doesn't matter to games, so
utility/savedata/filelist now only prints them once the utility has finished.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
In fact, it may even be wrong to show the new data icon in this case...
Also fixes crashes when save title is 128 characters long.
Should improve #9632.
This is probably more based on IO (maybe even loading and unloading
the module for the dialog or something?) but time should approximate it.
May improve games not expecting the status to switch right away.
Some savedata modes make changes that aren't flushed to memory right away.
Although, maybe/probably they shouldn't...
Fixes#2440, fixes#2439 (which is a duplicate.)
LittleBigPlanet uses these. It seems happier with these working,
although it goes on to call MAKEDATA.
Also seems to make some other games happier.
GETSIZE not heavily tested yet.