From 89942ed92ab8d2b5df64dbf48f618a3d394fb433 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 1 Feb 2021 23:34:48 +0100 Subject: [PATCH] optimize add_only boot process No need for hardcore stuff while adding games to the list --- rpcs3/Emu/System.cpp | 23 +++++++++++++++-------- rpcs3/Emu/System.h | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 5d5c4bb23c..ed65663971 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -121,7 +121,7 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -void Emulator::Init() +void Emulator::Init(bool add_only) { jit_runtime::initialize(); @@ -243,6 +243,16 @@ void Emulator::Init() make_path_verbose(dev_hdd1 + "caches/"); } + make_path_verbose(fs::get_cache_dir() + "shaderlog/"); + make_path_verbose(fs::get_cache_dir() + "spu_progs/"); + make_path_verbose(fs::get_config_dir() + "captures/"); + + if (add_only) + { + // We don't need to initialize the rest if we only add games + return; + } + // Log user if (m_usr.empty()) { @@ -312,9 +322,9 @@ void Emulator::Init() } } - make_path_verbose(fs::get_cache_dir() + "shaderlog/"); - make_path_verbose(fs::get_config_dir() + "captures/"); - make_path_verbose(fs::get_cache_dir() + "spu_progs/"); + // Limit cache size + if (g_cfg.vfs.limit_cache_size) + LimitCacheSize(); // Initialize patch engine g_fxo->init()->append_global_patches(); @@ -666,9 +676,6 @@ void Emulator::LimitCacheSize() game_boot_result Emulator::BootGame(const std::string& path, const std::string& title_id, bool direct, bool add_only, bool force_global_config) { - if (g_cfg.vfs.limit_cache_size) - LimitCacheSize(); - if (!fs::exists(path)) { return game_boot_result::invalid_file_or_folder; @@ -905,7 +912,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool } { - Init(); + Init(add_only); // Load game list (maps ABCD12345 IDs to /dev_bdvd/ locations) YAML::Node games; diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 0788bbe144..f18a79f4fa 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -122,7 +122,7 @@ public: m_state = system_state::running; } - void Init(); + void Init(bool add_only = false); std::vector argv; std::vector envp;