diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index c7009ea4dc..e9bce9f451 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -786,12 +786,12 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool return game_boot_result::no_errors; } - // Check if path is inside the specified directory + // Check if path is inside the specified directory auto is_path_inside_path = [this](std::string_view path, std::string_view dir) { return (GetCallbacks().resolve_path(path) + '/').starts_with(GetCallbacks().resolve_path(dir) + '/'); }; - + // Detect boot location constexpr usz game_dir_size = 8; // size of PS3_GAME and PS3_GMXX const std::string hdd0_game = vfs::get("/dev_hdd0/game/"); @@ -1222,7 +1222,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool sys_log.notice("Elf path: %s", argv[0]); } - + if (!argv[0].starts_with("/dev_hdd0/game"sv) && m_cat == "HG"sv) { sys_log.error("Booting HG category outside of HDD0!"); diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 420f15efc9..3bafffb16a 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -388,6 +388,12 @@ namespace stx return single_ptr(*ptr, std::launder(arr)); } + template + static single_ptr> make_single_value(T&& value) + { + return make_single>(std::forward(value)); + } + #ifndef _MSC_VER #pragma GCC diagnostic pop #endif @@ -659,6 +665,12 @@ namespace stx return make_single(count); } + template + static shared_ptr> make_shared_value(T&& value) + { + return make_single_value(std::forward(value)); + } + // Atomic simplified shared pointer template class atomic_ptr @@ -1263,3 +1275,5 @@ using stx::single_ptr; using stx::shared_ptr; using stx::atomic_ptr; using stx::make_single; +using stx::make_single_value; +using stx::make_shared_value;