remove and re-insert VMU when loading a save state
Is your feature request related to a problem? Please describe. When loading a save state, the internal state of the VMU from the save state is used instead of the on-disk saved version of the VMU. That means save data can be lost if you save a game to VMU, load an earlier save state, and then save to VMU again.
Describe the solution you'd like remove and re-insert VMU when loading a save state that has a different internal VMU state than the on-disk VMU
Additional context DuckStation and PCSX2 do this for their memory cards (the option is on by default and can be switched off).
This isn't something that can be done instantly and without the game noticing. This could probably lead to game crashes in some cases. Also many games will display a message about input devices having changed and will pause for a couple of seconds. For these reasons I don't plan on implementing such a feature.
I tested it with Resident Evil: Code: Veronica and it just pauses the game for half a second (setting slot A1 from VMU > none > VMU) This could be implemented as a configurable setting and off by default, with an on-screen notification from Flycast saying something like: save state loaded, VMUs re-inserted
There is also a bug:
- launch game with VMU inserted
- save state
- remove VMU in the flycast settings
- load saved state
Flycast standalone: VMU gets reinserted in the game, but the Flycast menu shows that there is no VMU RetroArch: app crash
I haven't been able to reproduce the crash with retroarch. I've tried several games, removing the VMU A1 only, or all VMUs, but I don't get any crash. Using RA 1.21.0 and flycast core version 5743502. Can you provide a reproducible scenario?
I tried to reproduce it now with the same commit version and could not, it may have been a one-off crash.
Now in the RA Flycast core, the VMU gets reinserted in the game, while the VMU screen doesn't show up, and the RA menu shows the controller slot as None.
The difference is that with Flycast standalone, the VMU screen did show up
A libretro core has no control over which settings are selected in its core options. So reflecting the current controller configuration is impossible. Displaying VMUs should be possible however.
For standalone I have some prototype code that shows the current config after loading a state but I still need to work on it.