Loading font libs from title id folder (#1448)

This commit is contained in:
georgemoralis 2024-10-31 16:08:34 +02:00 committed by GitHub
parent 4da21a016e
commit cdae6a4ce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -229,7 +229,7 @@ void Emulator::Run(const std::filesystem::path& file) {
linker->LoadModule(eboot_path); linker->LoadModule(eboot_path);
// check if we have system modules to load // check if we have system modules to load
LoadSystemModules(eboot_path); LoadSystemModules(eboot_path, game_info.game_serial);
// Load all prx from game's sce_module folder // Load all prx from game's sce_module folder
std::filesystem::path sce_module_folder = file.parent_path() / "sce_module"; std::filesystem::path sce_module_folder = file.parent_path() / "sce_module";
@ -273,8 +273,8 @@ void Emulator::Run(const std::filesystem::path& file) {
std::exit(0); std::exit(0);
} }
void Emulator::LoadSystemModules(const std::filesystem::path& file) { void Emulator::LoadSystemModules(const std::filesystem::path& file, std::string game_serial) {
constexpr std::array<SysModules, 13> ModulesToLoad{ constexpr std::array<SysModules, 12> ModulesToLoad{
{{"libSceNgs2.sprx", &Libraries::Ngs2::RegisterlibSceNgs2}, {{"libSceNgs2.sprx", &Libraries::Ngs2::RegisterlibSceNgs2},
{"libSceFiber.sprx", &Libraries::Fiber::RegisterlibSceFiber}, {"libSceFiber.sprx", &Libraries::Fiber::RegisterlibSceFiber},
{"libSceUlt.sprx", nullptr}, {"libSceUlt.sprx", nullptr},
@ -284,7 +284,6 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file) {
{"libSceDiscMap.sprx", &Libraries::DiscMap::RegisterlibSceDiscMap}, {"libSceDiscMap.sprx", &Libraries::DiscMap::RegisterlibSceDiscMap},
{"libSceRtc.sprx", &Libraries::Rtc::RegisterlibSceRtc}, {"libSceRtc.sprx", &Libraries::Rtc::RegisterlibSceRtc},
{"libSceJpegEnc.sprx", nullptr}, {"libSceJpegEnc.sprx", nullptr},
{"libSceFont.sprx", nullptr},
{"libSceRazorCpu.sprx", nullptr}, {"libSceRazorCpu.sprx", nullptr},
{"libSceCesCs.sprx", nullptr}, {"libSceCesCs.sprx", nullptr},
{"libSceRudp.sprx", nullptr}}}; {"libSceRudp.sprx", nullptr}}};
@ -309,6 +308,10 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file) {
LOG_INFO(Loader, "No HLE available for {} module", module_name); LOG_INFO(Loader, "No HLE available for {} module", module_name);
} }
} }
for (const auto& entry : std::filesystem::directory_iterator(sys_module_path / game_serial)) {
LOG_INFO(Loader, "Loading {} from game serial file {}", entry.path().string(), game_serial);
linker->LoadModule(entry.path());
}
} }
#ifdef ENABLE_QT_GUI #ifdef ENABLE_QT_GUI

View file

@ -29,7 +29,7 @@ public:
void UpdatePlayTime(const std::string& serial); void UpdatePlayTime(const std::string& serial);
private: private:
void LoadSystemModules(const std::filesystem::path& file); void LoadSystemModules(const std::filesystem::path& file, std::string game_serial);
Core::MemoryManager* memory; Core::MemoryManager* memory;
Input::GameController* controller; Input::GameController* controller;