Swordfish90 / Lemuroid

All in one emulator on Android!
GNU General Public License v3.0
2.61k stars 164 forks source link

Sort Savegames by system in internal storage #690

Open newhinton opened 1 year ago

newhinton commented 1 year ago

This will create a folder for each system in internal memory. Other emulator-applications usually seperate savegames by their system name. When the internal storage is now synced to external ones, they are not "compatible" with those applications. (I mainly refer to how retropie handles this).

The changes work like this:

  1. Core loads savegame.
  2. Savegame-file is detected as usual.
  3. SavegameManager checks if a system/savename.srm-file exists
  4. returns that if it is not empty
  5. return legacy-save if it is empty.

Saving:

  1. Save like usual, except use system/savename.srm-scheme
  2. check if file has been written, and if legacy file exists.
  3. If legacy file exists, delete it

This is really only useful with #632

Edit:

Since i am deleting savegames, this PR should be tested extensively. I can also remove the deletion and just keep the internal storage "cluttered", it shouldn't matter that much storage-wise.

newhinton commented 1 year ago

@s0mt0chukwu Necessary? Probably not.

However: Most other emulator-packages (like RetroPie) do use such a sorted folderstructure.

This PR standalone is probably pointless and useless since all the savegames are inaccessible on internal storage. But my own build combines this with all of my other PR's, especially #632, which makes this a really nice addition since i have sorted savegames synced to the cloud-provider of my choice. Without this PR it is an unsorted mess.

newhinton commented 1 year ago

@s0mt0chukwu Necessary? Probably not.

However: Most other emulator-packages (like RetroPie) do use such a sorted folderstructure.

This PR is probably pointless and useless if used standalone, since all the savegames are inaccessible on internal storage. But my own build combines this with all of my other PR's, especially #632, which makes this a really nice addition since i have sorted savegames synced to the cloud-provider of my choice. Without this PR it is an unsorted mess.