move gamefolder to elfinfo

This commit is contained in:
Fire Cube 2025-05-24 12:24:24 +02:00
parent 6fcefc95e7
commit 9b754ae117
4 changed files with 9 additions and 13 deletions

View File

@ -71,6 +71,7 @@ class ElfInfo {
PSFAttributes psf_attributes{};
std::filesystem::path splash_path{};
std::filesystem::path game_folder{};
public:
static constexpr u32 FW_15 = 0x1500000;
@ -123,6 +124,10 @@ public:
[[nodiscard]] const std::filesystem::path& GetSplashPath() const {
return splash_path;
}
[[nodiscard]] const std::filesystem::path& GetGameFolder() const {
return game_folder;
}
};
} // namespace Common

View File

@ -12,9 +12,6 @@
using namespace ImGui;
namespace Core::Devtools::Widget {
std::filesystem::path ModuleList::game_folder;
void ModuleList::Draw() {
SetNextWindowSize({550.0f, 600.0f}, ImGuiCond_FirstUseEver);
if (!Begin("Module List", &open)) {

View File

@ -8,7 +8,7 @@
#include <mutex>
#include <string>
#include <vector>
#include "common/elf_info.h"
#include "common/path_util.h"
namespace Core::Devtools::Widget {
@ -21,12 +21,6 @@ public:
void Draw();
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) {
const auto sys_modules_path = Common::FS::GetUserPath(Common::FS::PathType::SysModuleDir);
@ -40,7 +34,7 @@ public:
}
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;
if (!std::filesystem::exists(prx_path)) {

View File

@ -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.
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
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.game_folder = game_folder;
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
std::string window_title = "";
if (Common::g_is_release) {