SaveStates: Fix restart after saving

This commit is contained in:
Elad 2026-03-27 21:39:33 +03:00
parent a4523651c7
commit 976cd1ce66
5 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@ namespace rsx
{ {
if (!suspend_mode) if (!suspend_mode)
{ {
Emu.after_kill_callback = []() { Emu.Restart(); }; Emu.after_kill_callback = []() { Emu.Restart(true, false); };
// Make sure we keep the game window opened // Make sure we keep the game window opened
Emu.SetContinuousMode(true); Emu.SetContinuousMode(true);

View File

@ -3996,7 +3996,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
})); }));
} }
game_boot_result Emulator::Restart(bool graceful) game_boot_result Emulator::Restart(bool graceful, bool reset_path)
{ {
if (m_state == system_state::stopping) if (m_state == system_state::stopping)
{ {
@ -4004,7 +4004,7 @@ game_boot_result Emulator::Restart(bool graceful)
return game_boot_result::still_running; return game_boot_result::still_running;
} }
Emu.after_kill_callback = [this] Emu.after_kill_callback = [this, reset_path]
{ {
// Reset boot path in case of ISO // Reset boot path in case of ISO
if (m_path.starts_with(iso_device::virtual_device_name)) if (m_path.starts_with(iso_device::virtual_device_name))
@ -4016,7 +4016,7 @@ game_boot_result Emulator::Restart(bool graceful)
} }
// If continuous mode changed the path, restart from the original executable // If continuous mode changed the path, restart from the original executable
if (!m_path_original.empty() && m_path_original != m_path) if (reset_path && !m_path_original.empty() && m_path_original != m_path)
{ {
sys_log.notice("Restart: Resetting boot path from '%s' to original '%s'", m_path, m_path_original); sys_log.notice("Restart: Resetting boot path from '%s' to original '%s'", m_path, m_path_original);
m_path = m_path_original; m_path = m_path_original;

View File

@ -442,7 +442,7 @@ public:
void Resume(); void Resume();
void GracefulShutdown(bool allow_autoexit = true, bool async_op = false, bool savestate = false, bool continuous_mode = false); void GracefulShutdown(bool allow_autoexit = true, bool async_op = false, bool savestate = false, bool continuous_mode = false);
void Kill(bool allow_autoexit = true, bool savestate = false, savestate_stage* stage = nullptr); void Kill(bool allow_autoexit = true, bool savestate = false, savestate_stage* stage = nullptr);
game_boot_result Restart(bool graceful = true); game_boot_result Restart(bool graceful = true, bool reset_path = true);
bool Quit(bool force_quit); bool Quit(bool force_quit);
static void CleanUp(); static void CleanUp();

View File

@ -362,7 +362,7 @@ void gs_frame::handle_shortcut(gui::shortcuts::shortcut shortcut_key, const QKey
{ {
Emu.after_kill_callback = []() Emu.after_kill_callback = []()
{ {
Emu.Restart(); Emu.Restart(true, false);
}; };
// Make sure we keep the game window opened // Make sure we keep the game window opened

View File

@ -2538,7 +2538,7 @@ void main_window::CreateConnects()
{ {
Emu.after_kill_callback = []() Emu.after_kill_callback = []()
{ {
Emu.Restart(); Emu.Restart(true, false);
}; };
// Make sure we keep the game window opened // Make sure we keep the game window opened