distribution/packages/games/emulators/PPSSPPSDL/patches/001-exit-to-jelos.patch
2023-02-22 06:56:08 -05:00

55 lines
1.7 KiB
Diff

MRFIXIT: Add the option to exit the emulator completely from the pause screen
Fewtarius: Update for 351ELEC
--- a/UI/PauseScreen.h
+++ b/UI/PauseScreen.h
@@ -40,6 +40,7 @@
private:
UI::EventReturn OnGameSettings(UI::EventParams &e);
UI::EventReturn OnExitToMenu(UI::EventParams &e);
+ UI::EventReturn OnExitToBatocera(UI::EventParams &e);
UI::EventReturn OnReportFeedback(UI::EventParams &e);
UI::EventReturn OnRewind(UI::EventParams &e);
--- a/UI/PauseScreen.cpp
+++ b/UI/PauseScreen.cpp
@@ -386,6 +386,8 @@
rightColumnItems->Add(new Choice(mm->T("Exit")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
} else {
rightColumnItems->Add(new Choice(pa->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
+ rightColumnItems->Add(new Spacer(25.0));
+ rightColumnItems->Add(new Choice(pa->T("Exit to JELOS")))->OnClick.Handle(this, &GamePauseScreen::OnExitToBatocera);
}
}
@@ -437,6 +439,31 @@
return UI::EVENT_DONE;
}
+UI::EventReturn GamePauseScreen::OnExitToBatocera(UI::EventParams &e) {
+ if (g_Config.bPauseMenuExitsEmulator) {
+ System_SendMessage("finish", "");
+ } else {
+ TriggerFinish(DR_OK);
+ }
+
+ System_SendMessage("event", "exitprogram");
+
+ // Request the framework to exit cleanly.
+ System_SendMessage("finish", "");
+
+ // However, let's make sure the config was saved, since it may not have been.
+ g_Config.Save("MainScreen::OnExit");
+
+#ifdef __ANDROID__
+#ifdef ANDROID_NDK_PROFILER
+ moncleanup();
+#endif
+#endif
+
+ UpdateUIState(UISTATE_EXIT);
+ return UI::EVENT_DONE;
+}
+
UI::EventReturn GamePauseScreen::OnReportFeedback(UI::EventParams &e) {
screenManager()->push(new ReportScreen(gamePath_));
return UI::EVENT_DONE;