goweiwen / Allium

A custom launcher for the Miyoo Mini and Miyoo Mini Plus handheld devices
GNU General Public License v3.0
129 stars 13 forks source link

Feature Request: Reset game #28

Closed laesetuc closed 8 months ago

laesetuc commented 8 months ago

Hi, apologies for so many requests - but sometimes I've experienced where an auto-save state is corrupted, and then when you launch the game it tries to auto-load the save state and gets stuck.

Could you implement a "reset" function in the game selection screen. For example pressing the Select button currently lets you select "Launch with ", "Remove from Recents", and "Repopulate Database". Add one more function to launch the game from a fresh state, without auto-loading any previous save states.

Thanks!

laesetuc commented 8 months ago

Hi there, thank you for adding this! I just tested it out and it doesn't seem to work? It still launches games using the auto-save state. Expected behaviour is it should launch as a "fresh" state.

goweiwen commented 8 months ago

Do you have a core override that enables auto save state loading? I think this might be a problem as this feature currently makes a copy of the retroarch.cfg and disables auto-save state loading there before launching the game. As I don't have a way to detect what override config will be loaded until RetroArch loads, I might have to make changes in RetroArch to support this feature.

laesetuc commented 8 months ago

Ah I think I might have put that as a core override. So is the default behaviour of allium to not auto-load save states?

I notice with onion they achieve this appending config to the retroarch command on runtime.

Onion / static / build / .tmp_update / script / game_list_options.sh (line 318):

reset_game() { echo ":: reset_game $*" echo -e "savestate_auto_load = \"false\"\nconfig_save_on_exit = \"false\"\n" > $sysdir/reset.cfg echo "LD_PRELOAD=/mnt/SDCARD/miyoo/lib/libpadsp.so ./retroarch -v --appendconfig \"$sysdir/reset.cfg\" -L \"$corepath\" \"$rompath\"" > $sysdir/cmd_to_run.sh exit 0 }

goweiwen commented 8 months ago

The default behaviour of Allium is to auto-load save states for the cores that work with save states. You should be fine removing that from your override.

I have tried using the --appendconfig option as well, but it looks like it gets overriden by the core overrides when RetroArch boots. Might be something I did wrong, though, since it looks like it works on Onion.

laesetuc commented 8 months ago

Cool I'll remove the core override then! Thanks!

laesetuc commented 8 months ago

Hi I'm having trouble getting this to work.

When I look at my settings (using GBC Gambatte), I see:

If I set the Load Save State Automatically to Off in Retroarch, then it does not auto-load the save state when I start the game normally.

Can you please tell me what the settings should be set to? I'm on Allium 23.1

laesetuc commented 8 months ago

I've tested this again - have started with a fresh 23.2 install, and have also started with a blank /Saves/ folder, so everything is fresh except for my Roms and BIOS folder. I presume as well that any custom retroarch config and core overrides should now be removed and back to vanilla state.

I'm testing GBA games.

  1. Quitting a game creates auto-save
  2. Starting a game loads auto-save
  3. Reset from the in-game menu resets the game
  4. Reset from the game selection screen/main menu loads the auto-save and does not reset

Checking retroarch settings:

Is there anything you want me to test or check?