mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-15 02:28:56 +02:00
swap handling
This commit is contained in:
parent
43c7b288a8
commit
a034d7a8c2
4 changed files with 43 additions and 3 deletions
|
|
@ -51,6 +51,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef __OPENORBIS__
|
||||
#include <orbis/SystemService.h>
|
||||
# define STUB_WEAK(name) extern "C" void name() { printf("called " #name); asm volatile("ud2"); }
|
||||
STUB_WEAK(__cxa_thread_atexit)
|
||||
STUB_WEAK(__assert)
|
||||
|
|
@ -441,10 +442,20 @@ int main(int argc, char** argv) {
|
|||
[](VideoCore::LoadCallbackStage, size_t value, size_t total) {});
|
||||
}
|
||||
|
||||
system.RegisterExitCallback([&] {
|
||||
auto const exit_fn = [&] {
|
||||
#ifdef __OPENORBIS__
|
||||
sceSystemServiceLoadExec("EXIT", nullptr);
|
||||
#else
|
||||
// Just exit right away.
|
||||
exit(0);
|
||||
});
|
||||
#endif
|
||||
};
|
||||
system.RegisterExitCallback(exit_fn);
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StartGamemode();
|
||||
#endif
|
||||
|
||||
void(system.Run());
|
||||
if (system.DebuggerEnabled()) {
|
||||
system.InitializeDebugger();
|
||||
|
|
@ -456,6 +467,7 @@ int main(int argc, char** argv) {
|
|||
void(system.Pause());
|
||||
system.ShutdownMainProcess();
|
||||
detached_tasks.WaitForAllTasks();
|
||||
exit_fn();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue