SDL: Fixup PS2/PSP SDL_RunApp()

From e512809246265828d4b33b5e21a362478e3db6ce Mon Sep 17 00:00:00 2001
From: Zack Middleton <[EMAIL REDACTED]>
Date: Sat, 17 Dec 2022 23:12:48 -0600
Subject: [PATCH] Fixup PS2/PSP SDL_RunApp()

Make PS2/PSP use the mainFunction argument for SDL_RunApp().

Make PSP SDL_RunApp() return the value from mainFunction().

Make PS2 SDL_RunApp() call SDL_SetMainReady() like all other
SDL_RunApp() functions. (It doesn't affect anything for PS2 as
SDL_MAIN_NEEDED isn't defined.)
---
 src/core/ps2/SDL_ps2.c | 4 +++-
 src/core/psp/SDL_psp.c | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/core/ps2/SDL_ps2.c b/src/core/ps2/SDL_ps2.c
index 7e9bcf8f1a50..878c54735460 100644
--- a/src/core/ps2/SDL_ps2.c
+++ b/src/core/ps2/SDL_ps2.c
@@ -96,7 +96,9 @@ SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
     getcwd(cwd, sizeof(cwd));
     waitUntilDeviceIsReady(cwd);
 
-    res = SDL_main(argc, argv);
+    SDL_SetMainReady();
+
+    res = mainFunction(argc, argv);
 
     deinit_drivers();
 
diff --git a/src/core/psp/SDL_psp.c b/src/core/psp/SDL_psp.c
index b9877af8ed83..d8a309416c9e 100644
--- a/src/core/psp/SDL_psp.c
+++ b/src/core/psp/SDL_psp.c
@@ -76,8 +76,7 @@ SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
 
     SDL_SetMainReady();
 
-    (void)SDL_main(argc, argv);
-    return 0;
+    return mainFunction(argc, argv);
 }
 
 #endif /* __PSP__ */