Swordfish90 / Lemuroid

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

Autosave not working when closing Lemuroid abruptly #842

Open mircey opened 7 months ago

mircey commented 7 months ago

Describe the bug Lemuroid does not autosave MelonDS state when exiting the app. When there are no saved states yet, the game will just reboot entirely. If there is a previously manually saved state however, it will load it instead.

To Reproduce

  1. Play New Super Mario Bros DS and make any progress
  2. Exit out of Lemuroid
  3. Open Lemuroid
  4. New Super Mario Bros DS is not running anymore! #814
  5. Start New Super Mario Bros DS
  6. The last manually saved state was loaded, or the game got rebooted if there is none, completely reversing any progress that has been made since last saving.

Expected behavior When Lemuroid is closed, it should, as autosave is enabled in settings, autosave the games state and resume when picked up any time later.

Smartphone:

mircey commented 7 months ago

https://github.com/Swordfish90/Lemuroid/assets/82475806/06d80a38-182b-4630-bb31-ea98a097329d

mircey commented 7 months ago

814 is describing a related issue for 3ds emulation

mircey commented 7 months ago

I think Lemuroids autosave should, just like Retroarchs, autosave the current emulators state whenever Lemuroid is minimized/closed/whatever, so that one can seamlessly continue where one has left off last time.

Note that autosaving when exiting from a running game to the Lemuroid main menu using the back button works flawlessly, it is just when exiting Lemuroid abruptly that the autosave does not work at all.

mircey commented 7 months ago

25 is this exact issue. Autosave on exiting Lemuroid has first been brought up in 2019, I would say this an essential feature!! Are there any plans to add this anytime soon?

HFPasfho commented 7 months ago

@hitsu4yrkl since 4 years have already passed since this bug report you better make it a habit to save your game frequently because it doesn't look like this feature will ever be implemented

mircey commented 7 months ago

hm, you are probably right. guess I'll try fixing this myself then!!

mdemoss commented 5 months ago

I see autosave happening only for exit from menu and for back button:

https://github.com/Swordfish90/Lemuroid/blob/e070950173b40e52636b879d473503318c62d1fd/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt#L924

https://github.com/Swordfish90/Lemuroid/blob/e070950173b40e52636b879d473503318c62d1fd/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt#L749

Maybe it's appropriate for a save to happen in onPause or onStop.

https://github.com/Swordfish90/Lemuroid/blob/e070950173b40e52636b879d473503318c62d1fd/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/mobile/feature/game/GameActivity.kt#L462

mdemoss commented 5 months ago

Oddly, if the pause menu is open when hitting home, the active game will not exit.