Implement Emulator::GracefulShutdown()

This commit is contained in:
Eladash 2022-02-05 12:49:29 +02:00 committed by GitHub
parent 6c5b8dc31c
commit e951c619c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 180 additions and 89 deletions

View file

@ -349,7 +349,7 @@ void _sys_process_exit(ppu_thread& ppu, s32 status, u32 arg2, u32 arg3)
Emu.CallAfter([]()
{
sys_process.success("Process finished");
Emu.Stop();
Emu.Kill();
});
// Wait for GUI thread
@ -415,8 +415,7 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr<sys_exit2_param> ar
, hdd1 = std::move(hdd1), klic = g_fxo->get<loaded_npdrm_keys>().last_key(), old_config = Emu.GetUsedConfig()]() mutable
{
sys_process.success("Process finished -> %s", argv[0]);
Emu.SetForceBoot(true);
Emu.Stop();
Emu.Kill(false);
Emu.argv = std::move(argv);
Emu.envp = std::move(envp);
Emu.data = std::move(data);
@ -435,7 +434,7 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr<sys_exit2_param> ar
if (res != game_boot_result::no_errors)
{
sys_process.fatal("Failed to boot from exitspawn! (path=\"%s\", error=%s)", path, res);
Emu.Stop();
Emu.Kill();
}
});