diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 69f97ed22b..485af84d32 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -281,9 +281,17 @@ std::string Emulator::GetLibDir() return fmt::replace_all(g_cfg.vfs.dev_flash, "$(EmulatorDir)", emu_dir) + "sys/external/"; } +void Emulator::SetForceBoot(bool force_boot) +{ + m_force_boot = force_boot; +} + void Emulator::Load(bool add_only) { - Stop(); + if (!IsStopped()) + { + Stop(); + } try { @@ -616,9 +624,10 @@ void Emulator::Load(bool add_only) return; } - if (g_cfg.misc.autostart && IsReady()) + if ((m_force_boot || g_cfg.misc.autostart) && IsReady()) { Run(); + m_force_boot = false; } else if (IsPaused()) { diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index ddc7271236..dbec6ce2df 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -182,6 +182,8 @@ class Emulator final std::string m_title_id; std::string m_title; + bool m_force_boot = false; + public: Emulator() = default; @@ -247,6 +249,8 @@ public: static std::string GetHddDir(); static std::string GetLibDir(); + void SetForceBoot(bool force_boot); + void Load(bool add_only = false); void Run(); bool Pause(); diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index 4e48472da4..5a8e4fda9e 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -74,8 +74,8 @@ int main(int argc, char** argv) QTimer::singleShot(2, [path = sstr(QFileInfo(args.at(0)).canonicalFilePath()), argv = std::move(argv)]() mutable { Emu.argv = std::move(argv); + Emu.SetForceBoot(true); Emu.BootGame(path, true); - Emu.Run(); }); }