Add savestate buttons to home menu

This commit is contained in:
Eladash 2023-03-18 21:35:51 +02:00 committed by Megamouse
parent a6313fa46c
commit 79d09d02ed
10 changed files with 142 additions and 10 deletions

View file

@ -174,7 +174,7 @@ std::vector<std::pair<u16, u16>> read_used_savestate_versions()
return used_serial;
}
bool boot_last_savestate()
bool boot_last_savestate(bool testing)
{
if (!g_cfg.savestate.suspend_emu && !Emu.GetTitleID().empty() && (Emu.IsRunning() || Emu.GetStatus() == system_state::paused))
{
@ -203,7 +203,15 @@ bool boot_last_savestate()
}
}
if (fs::is_file(savestate_path))
const bool result = fs::is_file(savestate_path);
if (testing)
{
sys_log.trace("boot_last_savestate(true) returned %s.", result);
return result;
}
if (result)
{
sys_log.success("Booting the most recent savestate \'%s\' using the Reload shortcut.", savestate_path);
Emu.GracefulShutdown(false);