Savestates: Fix "Suspend Emulation Savestate Mode" setting

This commit is contained in:
Eladash 2022-07-11 12:24:09 +03:00 committed by Ivan
parent cdd6840826
commit 1f5cf776b2
2 changed files with 3 additions and 2 deletions

View file

@ -2270,6 +2270,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate)
if (m_state.exchange(system_state::stopped) == system_state::stopped)
{
// Ensure clean state
m_ar.reset();
argv.clear();
envp.clear();
data.clear();
@ -2563,7 +2564,6 @@ void Emulator::Kill(bool allow_autoexit, bool savestate)
}
// Boot arg cleanup (preserved in the case restarting)
m_ar.reset();
argv.clear();
envp.clear();
data.clear();
@ -2608,6 +2608,7 @@ game_boot_result Emulator::Restart(bool savestate)
if (g_cfg.savestate.suspend_emu)
{
m_ar.reset();
return game_boot_result::no_errors;
}
}

View file

@ -313,7 +313,7 @@ struct cfg_root : cfg::node
node_savestate(cfg::node* _this) : cfg::node(_this, "Savestate") {}
cfg::_bool start_paused{ this, "Start Paused" }; // Pause on first frame
cfg::_bool suspend_emu{ this, "Suspend Emulation Savestate Mode", false }; // Close emulation when saving, delete save after loading
cfg::_bool suspend_emu{ this, "Suspend Emulation Savestate Mode", true }; // Close emulation when saving, delete save after loading
cfg::_bool state_inspection_mode{ this, "Inspection Mode Savestates" }; // Save memory stored in executable files, thus allowing to view state without any files (for debugging)
cfg::_bool save_disc_game_data{ this, "Save Disc Game Data", false };
} savestate{this};