Skip to content

Commit

Permalink
Fix #9879 and fix firmware confirmation dialog when auto-start is dis…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
elad335 committed Mar 31, 2021
1 parent 2212a13 commit f74a1ba
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions rpcs3/Emu/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,40 +1686,49 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
return game_boot_result::invalid_file_or_folder;
}

ensure(IsReady());

if (m_force_boot || g_cfg.misc.autostart)
if (ppu_exec == elf_error::ok && !fs::is_file(g_cfg.vfs.get_dev_flash() + "sys/external/liblv2.sprx"))
{
if (ppu_exec == elf_error::ok)
const auto libs = g_cfg.core.libraries_control.get_set();

extern const std::map<std::string_view, int> g_prx_list;

// Check if there are any firmware SPRX which may be LLEd during emulation
// Don't prompt GUI confirmation if there aren't any
if (std::any_of(g_prx_list.begin(), g_prx_list.end(), [&libs](auto& lib)
{
if (!fs::is_file(g_cfg.vfs.get_dev_flash() + "sys/external/liblv2.sprx"))
{
const auto libs = g_cfg.core.libraries_control.get_set();
return libs.count(std::string(lib.first) + ":lle") || (!lib.second && !libs.count(std::string(lib.first) + ":hle"));
}))
{
SetForceBoot(true);
Stop();

extern const std::map<std::string_view, int> g_prx_list;
CallAfter([this]()
{
GetCallbacks().on_missing_fw();
});

// Check if there are any firmware SPRX which may be LLEd during emulation
// Don't prompt GUI confirmation if there aren't any
if (std::any_of(g_prx_list.begin(), g_prx_list.end(), [&libs](auto& lib)
{
return libs.count(std::string(lib.first) + ":lle") || (!lib.second && !libs.count(std::string(lib.first) + ":hle"));
}))
{
Stop();
return game_boot_result::firmware_missing;
}
}

CallAfter([this]()
{
GetCallbacks().on_missing_fw();
});
const bool autostart = (std::exchange(m_force_boot, false) || g_cfg.misc.autostart);

return game_boot_result::firmware_missing;
}
}
if (!autostart)
{
return game_boot_result::no_errors;
}

if (IsReady())
{
if (ppu_exec == elf_error::ok)
{
Run(true);
}

m_force_boot = false;
}
else
{
ensure(m_state.compare_and_swap_test(system_state::paused, system_state::ready));
GetCallbacks().on_ready();
}

return game_boot_result::no_errors;
Expand Down

0 comments on commit f74a1ba

Please sign in to comment.