sys_game: Made the LV2 Watchdog restarts the game forcefully

This commit is contained in:
brian218 2022-12-14 01:39:04 +08:00 committed by Ivan
parent 7e35679ec2
commit d78e2dad29
3 changed files with 7 additions and 4 deletions

View File

@ -69,7 +69,7 @@ struct watchdog_t
Emu.CallFromMainThread([]()
{
Emu.Restart();
Emu.Restart(false);
});
return;

View File

@ -2823,13 +2823,16 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
return to_ar;
}
game_boot_result Emulator::Restart()
game_boot_result Emulator::Restart(bool graceful)
{
if (!IsStopped())
{
auto save_args = std::make_tuple(argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_mode);
GracefulShutdown(false, false);
if (graceful)
GracefulShutdown(false, false);
else
Kill(false);
std::tie(argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_mode) = std::move(save_args);
}

View File

@ -307,7 +307,7 @@ public:
void Resume();
void GracefulShutdown(bool allow_autoexit = true, bool async_op = false, bool savestate = false);
std::shared_ptr<utils::serial> Kill(bool allow_autoexit = true, bool savestate = false);
game_boot_result Restart();
game_boot_result Restart(bool graceful = true);
bool Quit(bool force_quit);
static void CleanUp();