From ff49b7db8a0bc5819eafe2498652d721afa388e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Sat, 10 Sep 2022 11:08:25 +0200 Subject: [PATCH] save sram when onPause is called --- .../swordfish/lemuroid/app/shared/game/BaseGameActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt b/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt index b70ee86d46..10d2deee22 100644 --- a/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt +++ b/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt @@ -789,6 +789,13 @@ abstract class BaseGameActivity : ImmersiveActivity() { } } + override fun onPause() { + GlobalScope.launch { + saveSRAM(game) + } + super.onPause() + } + private suspend fun autoSaveAndFinish() = withLoading { saveSRAM(game) saveAutoSave(game)