Keep game window open when loading the last savestate

This commit is contained in:
Megamouse 2025-01-04 16:14:09 +01:00
parent cc7e7300ce
commit d5470d92ec
7 changed files with 17 additions and 4 deletions

View File

@ -114,6 +114,7 @@ namespace rsx
Emu.CallFromMainThread([]()
{
// Make sure we keep the game window opened
Emu.SetContinuousMode(true);
Emu.Restart(false);
});

View File

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

View File

@ -2912,10 +2912,13 @@ u64 get_sysutil_cb_manager_read_count();
void qt_events_aware_op(int repeat_duration_ms, std::function<bool()> wrapped_op);
void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savestate)
void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savestate, bool continuous_mode)
{
// Make sure we close the game window
Emu.SetContinuousMode(false);
if (!continuous_mode)
{
Emu.SetContinuousMode(false);
}
// Ensure no game has booted inbetween
const auto guard = Emu.MakeEmulationStateGuard();

View File

@ -419,7 +419,7 @@ public:
bool Pause(bool freeze_emulation = false, bool show_resume_message = true);
void Resume();
void GracefulShutdown(bool allow_autoexit = true, bool async_op = false, bool savestate = 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);
game_boot_result Restart(bool graceful = true);
bool Quit(bool force_quit);

View File

@ -322,7 +322,10 @@ bool boot_last_savestate(bool testing)
if (result)
{
sys_log.success("Booting the most recent savestate \'%s\' using the Reload shortcut.", savestate_path);
Emu.GracefulShutdown(false);
// Make sure we keep the game window opened
Emu.SetContinuousMode(true);
Emu.GracefulShutdown(false, false, false, true);
if (game_boot_result error = Emu.BootGame(savestate_path, "", true); error != game_boot_result::no_errors)
{

View File

@ -328,6 +328,8 @@ void gs_frame::handle_shortcut(gui::shortcuts::shortcut shortcut_key, const QKey
{
Emu.Restart();
};
// Make sure we keep the game window opened
Emu.SetContinuousMode(true);
}

View File

@ -2590,6 +2590,8 @@ void main_window::CreateConnects()
{
Emu.Restart();
};
// Make sure we keep the game window opened
Emu.SetContinuousMode(true);
}