Browse Source

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.)
Zack Middleton 2 years ago
parent
commit
e512809246
2 changed files with 4 additions and 3 deletions
  1. 3 1
      src/core/ps2/SDL_ps2.c
  2. 1 2
      src/core/psp/SDL_psp.c

+ 3 - 1
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();
 

+ 1 - 2
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__ */