mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
move gamefolder to elfinfo
This commit is contained in:
parent
6fcefc95e7
commit
9b754ae117
@ -71,6 +71,7 @@ class ElfInfo {
|
|||||||
PSFAttributes psf_attributes{};
|
PSFAttributes psf_attributes{};
|
||||||
|
|
||||||
std::filesystem::path splash_path{};
|
std::filesystem::path splash_path{};
|
||||||
|
std::filesystem::path game_folder{};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static constexpr u32 FW_15 = 0x1500000;
|
static constexpr u32 FW_15 = 0x1500000;
|
||||||
@ -123,6 +124,10 @@ public:
|
|||||||
[[nodiscard]] const std::filesystem::path& GetSplashPath() const {
|
[[nodiscard]] const std::filesystem::path& GetSplashPath() const {
|
||||||
return splash_path;
|
return splash_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] const std::filesystem::path& GetGameFolder() const {
|
||||||
|
return game_folder;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
using namespace ImGui;
|
using namespace ImGui;
|
||||||
|
|
||||||
namespace Core::Devtools::Widget {
|
namespace Core::Devtools::Widget {
|
||||||
|
|
||||||
std::filesystem::path ModuleList::game_folder;
|
|
||||||
|
|
||||||
void ModuleList::Draw() {
|
void ModuleList::Draw() {
|
||||||
SetNextWindowSize({550.0f, 600.0f}, ImGuiCond_FirstUseEver);
|
SetNextWindowSize({550.0f, 600.0f}, ImGuiCond_FirstUseEver);
|
||||||
if (!Begin("Module List", &open)) {
|
if (!Begin("Module List", &open)) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "common/elf_info.h"
|
||||||
#include "common/path_util.h"
|
#include "common/path_util.h"
|
||||||
|
|
||||||
namespace Core::Devtools::Widget {
|
namespace Core::Devtools::Widget {
|
||||||
@ -21,12 +21,6 @@ public:
|
|||||||
void Draw();
|
void Draw();
|
||||||
bool open = false;
|
bool open = false;
|
||||||
|
|
||||||
static std::filesystem::path game_folder;
|
|
||||||
|
|
||||||
static void SetGameFolder(const std::filesystem::path& path) {
|
|
||||||
game_folder = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool IsSystemModule(const std::filesystem::path& path) {
|
static bool IsSystemModule(const std::filesystem::path& path) {
|
||||||
const auto sys_modules_path = Common::FS::GetUserPath(Common::FS::PathType::SysModuleDir);
|
const auto sys_modules_path = Common::FS::GetUserPath(Common::FS::PathType::SysModuleDir);
|
||||||
|
|
||||||
@ -40,7 +34,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool IsSystemModule(const std::string& name) {
|
static bool IsSystemModule(const std::string& name) {
|
||||||
const auto game_modules_path = game_folder / "sce_module";
|
const auto game_modules_path = Common::ElfInfo::Instance().GetGameFolder() / "sce_module";
|
||||||
const auto prx_path = game_modules_path / name;
|
const auto prx_path = game_modules_path / name;
|
||||||
|
|
||||||
if (!std::filesystem::exists(prx_path)) {
|
if (!std::filesystem::exists(prx_path)) {
|
||||||
|
@ -76,8 +76,6 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Devtools::Widget::ModuleList::SetGameFolder(game_folder);
|
|
||||||
|
|
||||||
// Applications expect to be run from /app0 so mount the file's parent path as app0.
|
// Applications expect to be run from /app0 so mount the file's parent path as app0.
|
||||||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||||
mnt->Mount(game_folder, "/app0", true);
|
mnt->Mount(game_folder, "/app0", true);
|
||||||
@ -191,6 +189,8 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
|
|||||||
game_info.splash_path = pic1_path;
|
game_info.splash_path = pic1_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
game_info.game_folder = game_folder;
|
||||||
|
|
||||||
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
|
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
|
||||||
std::string window_title = "";
|
std::string window_title = "";
|
||||||
if (Common::g_is_release) {
|
if (Common::g_is_release) {
|
||||||
|
Loading…
Reference in New Issue
Block a user