Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetroArch does not auto save on exit #16080

Closed
danielbyon opened this issue Jan 6, 2024 · 4 comments
Closed

RetroArch does not auto save on exit #16080

danielbyon opened this issue Jan 6, 2024 · 4 comments

Comments

@danielbyon
Copy link
Contributor

danielbyon commented Jan 6, 2024

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

I'm unable to get auto save on mGBA (and Gambatte, snes9x) when exiting content on my Android Odin 2 Pro.

  • Saving -> Auto Save State and Auto Load State turned on
  • Hardcore achievements is turned OFF
  • My saves and save states directories are customized to separate folders on my SD card (but I have also tried using the default internal storage location as well)

Expected behavior

  1. I quit Retroarch by either the quit hotkey, Quick Menu -> Close Content (with the quit RetroArch when content closes option turned on), or Main Menu -> Quit RetroArch
  2. RA should save state to the auto slot (Pokemon Emerald.state.auto)

When starting the same content, same core, the auto save state should be loaded

Actual behavior

The auto save state slot is never written (confirmed by using the File Explorer app to navigate to my save state folder), and therefore the save state is not loaded when I start the game again.

Manual save/load state DOES work, just the auto one does not.

Steps to reproduce the bug

  1. Enable Saving -> Auto Save State and Auto Load State
  2. Start a game
  3. Exit the game (auto save state should be written)
  4. Start the same game again (I use Daijisho launcher, but launcher shouldn't matter)
  5. Observe that auto save state was not loaded

Bisect Results

retroarch__2024_01_05__20_17_47.log

I've attached a log (only redacted my RetroAchievements username), and there's a line towards the bottom:
Auto save state to "/storage/6575-071D/Games/_savestates/mGBA/Pokemon Emerald.state.auto" failed. This line traces to this part of the code in command.c:

RARCH_LOG("%s \"%s\" %s.\n",

I see that there was a PR that went in last week to change save state behavior (to address Netplay freezes/crashes), I'm wondering if that's what broke this?

I'm pretty sure this was working for me a few weeks ago, and looking at the file history for task_save.c shows two PRs within the last week (first changes since end of October)

Version/Commit

  • RetroArch: 1.16.0/a3e9525 (nightly build from 1/5/24)

Environment information

  • OS: Android 13, Odin firmware 1.0.0.208
  • Compiler: n/a, nightly build auto-updated via Obtainium
@danielbyon danielbyon changed the title RetroArch on Android does not auto save on exit RetroArch does not auto save on exit Jan 6, 2024
@danielbyon
Copy link
Contributor Author

Tested this on macOS nightly, I installed the 12/29/23 build, configured auto save/load and confirmed it works with Pokemon Emerald on mGBA. Then I installed the 12/30/23 build, and it does not work anymore.

I updated the issue title and removed the "Android" part, since this isn't just an Android issue

@bslenul
Copy link
Contributor

bslenul commented Jan 6, 2024

I can reproduce on Windows 10 as well, it only saves if the file already exists. Looks like it's a recent regression due to #16061

edit: No idea if it helps, but in my case it returns false here:

RetroArch/tasks/task_save.c

Lines 1335 to 1336 in 19a3688

if (serial_size == 0 || !path_is_valid(path))
return false;

because path_is_valid() returns false after this returns 0:

if (file_info == INVALID_FILE_ATTRIBUTES)
return 0;

@danielbyon
Copy link
Contributor Author

Got a fix #16084

@danielbyon
Copy link
Contributor Author

Confirmed fixed in the 1/8/24 nightly! Thanks for getting this merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants