diff options
Diffstat (limited to 'backends/platform/psp/psp_main.cpp')
| -rw-r--r-- | backends/platform/psp/psp_main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index e568184990..dba9a8fc2b 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -39,10 +39,12 @@ #include <base/main.h> #include <base/plugins.h> #include "backends/platform/psp/powerman.h" +#include "backends/platform/psp/thread.h" #include "backends/plugins/psp/psp-provider.h" #include "backends/platform/psp/psppixelformat.h" #include "backends/platform/psp/osys_psp.h" +#include "backends/platform/psp/tests.h" /* for unit/speed tests */ #include "backends/platform/psp/trace.h" #ifdef ENABLE_PROFILING @@ -109,12 +111,13 @@ int exit_callback(void) { } /* Function for handling suspend/resume */ -void power_callback(int , int powerinfo) { +int power_callback(int , int powerinfo, void *) { if (powerinfo & PSP_POWER_CB_POWER_SWITCH || powerinfo & PSP_POWER_CB_SUSPENDING) { PowerMan.suspend(); } else if (powerinfo & PSP_POWER_CB_RESUME_COMPLETE) { PowerMan.resume(); } + return 0; } /* Callback thread */ @@ -140,7 +143,7 @@ int CallbackThread(SceSize /*size*/, void *arg) { /* Sets up the callback thread and returns its thread id */ int SetupCallbacks(void) { - int thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0); + int thid = sceKernelCreateThread("power_thread", CallbackThread, PRIORITY_POWER_THREAD, STACK_POWER_THREAD, THREAD_ATTR_USER, 0); if (thid >= 0) { sceKernelStartThread(thid, 0, 0); } @@ -167,6 +170,13 @@ int main(void) { PluginManager::instance().addPluginProvider(new PSPPluginProvider()); #endif +/* unit/speed tests */ +#if defined (PSP_ENABLE_UNIT_TESTS) || defined (PSP_ENABLE_SPEED_TESTS) + PSP_INFO_PRINT("running tests\n"); + psp_tests(); + sceKernelSleepThread(); // that's it. That's all we're doing +#endif + int res = scummvm_main(argc, argv); g_system->quit(); // TODO: Consider removing / replacing this! |
