Emu: simplify Emu::Stop some more

This commit is contained in:
Megamouse 2020-07-06 20:46:21 +02:00
parent 8d2ce2815c
commit 171e4fafed
2 changed files with 6 additions and 13 deletions

View file

@ -1731,9 +1731,6 @@ void Emulator::Stop(bool restart)
} }
}); });
const bool full_stop = !restart && !m_force_boot;
const bool do_exit = full_stop && g_cfg.misc.autoexit;
sys_log.notice("Stopping emulator..."); sys_log.notice("Stopping emulator...");
GetCallbacks().on_stop(); GetCallbacks().on_stop();
@ -1772,25 +1769,21 @@ void Emulator::Stop(bool restart)
klic.clear(); klic.clear();
hdd1.clear(); hdd1.clear();
m_force_boot = false;
// Always Enable display sleep, not only if it was prevented. // Always Enable display sleep, not only if it was prevented.
enable_display_sleep(); enable_display_sleep();
if (do_exit || full_stop) if (Quit(g_cfg.misc.autoexit.get()))
{ {
if (Quit(do_exit)) return;
{
return;
}
} }
m_force_boot = false;
Init(); Init();
} }
bool Emulator::Quit(bool force_quit) const bool Emulator::Quit(bool force_quit)
{ {
Emu.SetForceBoot(false); m_force_boot = false;
Emu.Stop(); Emu.Stop();
return GetCallbacks().exit(force_quit); return GetCallbacks().exit(force_quit);

View file

@ -202,7 +202,7 @@ public:
void Resume(); void Resume();
void Stop(bool restart = false); void Stop(bool restart = false);
void Restart() { Stop(true); } void Restart() { Stop(true); }
bool Quit(bool force_quit) const; bool Quit(bool force_quit);
bool IsRunning() const { return m_state == system_state::running; } bool IsRunning() const { return m_state == system_state::running; }
bool IsPaused() const { return m_state == system_state::paused; } bool IsPaused() const { return m_state == system_state::paused; }