flycast icon indicating copy to clipboard operation
flycast copied to clipboard

remove and re-insert VMU when loading a save state

Open checktext00 opened this issue 5 months ago • 6 comments

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).

checktext00 avatar Jul 15 '25 15:07 checktext00

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.

flyinghead avatar Jul 15 '25 16:07 flyinghead

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

checktext00 avatar Jul 16 '25 04:07 checktext00

There is also a bug:

  1. launch game with VMU inserted
  2. save state
  3. remove VMU in the flycast settings
  4. load saved state

Flycast standalone: VMU gets reinserted in the game, but the Flycast menu shows that there is no VMU RetroArch: app crash

checktext00 avatar Jul 30 '25 14:07 checktext00

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?

flyinghead avatar Jul 31 '25 09:07 flyinghead

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

checktext00 avatar Jul 31 '25 14:07 checktext00

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.

flyinghead avatar Jul 31 '25 15:07 flyinghead