Issue with RetroArch handling save files / save states for compressed games when launched via command line / external launcher
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Issue
If RetroArch is launched via command line or external launcher, save files / save states that were created in RetroArch when RetroArch is launched directly are not recognized if the game files are compressed (i.e. zip, 7z, etc.). Additionally, save files / states created while running RA launched via command line are recognized only when running via command line and not by RetroArch when launched directly.
Findings
This may be due to the way RA handles compressed folders. When RA is launched directly, it appears to unzip the contents of the game before launching the game and then rezipping them afterwards. When launched via command line, it behaves differently. Below is a direct example.
Example
You have a legal backup of Fire Emblem for Game Boy Advance (GBA) in a folder called
Fire Emblem (GBA).zipand inside that folder is a file calledFire Emblem (USA).gba. When launching RetroArch directly it will create save files with the stringFire Emblem (USA).srm(if save file compression is enabled in RA) andFire Emblem (USA).savbecause that is the file name of the.gbafile. If you launch the game through command line however, it will create save files with the stringFire Emblem (GBA).srmandFire Emblem (GBA).savbecause that is the file name of the.zipfolder that the.gbafile is inside of. The same thing occurs with save states using the extension.state.
Workaround
This can be resolved by simply naming the rom itself with the exact same file name as the zip folder it is saved in (i.e.
Fire Emblem (GBA).gbasaved inside a zip folder calledFire Emblem (GBA).zip) as the difference in naming is what causes the underlying issue. Else, you could simply unzip all of your roms, however you lose compression and thus increase the overall file size of your library.
Alternatively, there may be an argument that fixes this discrepancy, however after researching applicable command line arguments, this doesn't appear to be an option. I have just gone through and put all the names in parity with their respective compressed formats, but this is extremely time consuming and not at all ideal.
Steps to reproduce the bug
- Launch a compressed rom via RetroArch directly.
- Create a sav game (.sav/.srm) and/or a save state (.state).
- Exit RA and relaunch RA using command line.
- The saves and save states will be missing.
- While in the command line launched RA instance, create a save / save state.
- Relaunch RA directly, the saves created when launching RA via command line will not appear, but the originals you created will.
NOTE: To solve this, you MUST name the compressed folder and the files within with the same string (i.e. Game Name (GBA).zip containing Game Name (GBA).gba). If the name of the compressed folder and the rom inside do not match, then when run via command line, RA will create saves and save states with the name of the internal file and not the compressed folder, and vice versa for launching RA directly.
Bisect Results
See above.
Version/Commit
RetroArch: Version 1.15.0, however the same issue occurs with older versions and nightly builds.
Environment information
OS: Windows 10 / Windows 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using a compressed ROM with different archive and internal filenames, launching it first directly and then through the command-line or external-launcher entry point. Trace how each launch mode derives save-file and save-state names. Done means both launch paths recognize the same saves and states without requiring matching filenames or uncompressed ROMs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100