libretro / libretro-uae

PUAE libretro
GNU General Public License v2.0
111 stars 60 forks source link

Saves not In folders ? #562

Closed zzedmore closed 1 year ago

zzedmore commented 1 year ago

I have the option 'Sort saves/states in folders by content directory' on. In the 'saves' directory I have the following Amiga files that aren't in it's content directory folder -

Puae_libretro.hdf .nvr TEMP directory WHDLoad directory WHDSaves directory

All other systems are saving their files to the correct content directory.

Note - 'states' ARE saving to the correct content folder but not 'saves'.

sonninnos commented 1 year ago

Weird. The core seems to be using the API save directory like it should be used, but something is definitely wrong when that option is enabled.

Also the frontend assigns the path in the wrong order, as in [content_path]/[core] when it should absolutely be the other way around when both sorts are enabled. But even so only those directories are created, and the savefile will be on the root of saves..

Tried simply with a CD32 game which creates [content].nvr file on boot.

sonninnos commented 1 year ago

Hmm, this appears to be a frontend issue since RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY won't get the content dir path appended to it, meaning that every core that does not do saving via the API (which is designed for SRAM stuff only) should suffer from the same thing.

States go via the API always so they are not affected.

Though how in the heck does the other save sorting per core name work then.. Wait what, it does not work either for those saves anymore, even though they have clearly worked before..

Phew, frontend is not totally to blame, but rather my hack in the core that takes only the first time the path is requested, and indeed at that moment the appended sort dir is not included yet.. As in frontend runs retro_set_environment() multiple times. First at launch (path is wrong), then retro_init() is run (path is correct), and after that retro_set_environment() is run 4 more times. HNNNNNG.

I've been setting a custom path via --appendconfig in my non-test setup, and that is correct from the start, which is why I didn't notice it.

Indeed this was borked when I added the dynamic cartridge option, and I reused the same code from VICE for the paths, so VICE must suffer from the same thing. It does even less saving and thus goes easier unnoticed.

sonninnos commented 1 year ago

Ok, I think I got it working now without breaking anything else.

Tasosgemah commented 8 months ago

Ok, I think I got it working now without breaking anything else.

Seems like this is broken again. No matter what the option for the save location is, PUAE will always put the saves (including two WHDLoad subfolders) in the root saves folder, cluttering it. Though it will create a PUAE sub-folder if the option is such, but it won't save any files in it. The core also ignores any custom save location set in the PUAE.cfg.

sonninnos commented 8 months ago

Still works here, and there hasn't been any related changes. I have savefile_directory = ":\saves\amiga" set with --appendconfig.

Core is not responsible for creating core-sorted subfolders.