Fix Emulator::IsPaused()

This commit is contained in:
Eladash 2021-03-02 16:56:23 +02:00 committed by Ivan
parent 66df38957b
commit aad5283786
5 changed files with 32 additions and 45 deletions

View file

@ -1651,7 +1651,9 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
return game_boot_result::invalid_file_or_folder;
}
if ((m_force_boot || g_cfg.misc.autostart) && IsReady())
ensure(IsReady());
if (m_force_boot || g_cfg.misc.autostart)
{
if (ppu_exec == elf_error::ok)
{
@ -1684,38 +1686,14 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
m_force_boot = false;
}
else if (IsPaused())
{
m_state = system_state::ready;
GetCallbacks().on_ready();
}
return game_boot_result::no_errors;
}
}
void Emulator::Run(bool start_playtime)
{
if (!IsReady())
{
// Reload with prior configuration.
Load(m_title_id, false, m_force_global_config);
if (!IsReady())
{
return;
}
}
if (IsRunning())
{
Stop();
}
if (IsPaused())
{
Resume();
return;
}
ensure(IsReady());
GetCallbacks().on_run(start_playtime);