added sys_modules folder and ability to load system modules (currently we try ngs2)
This commit is contained in:
parent
98316575fb
commit
882292f1ce
|
@ -36,6 +36,7 @@ static auto UserPaths = [] {
|
|||
create_path(PathType::ScreenshotsDir, user_dir / SCREENSHOTS_DIR);
|
||||
create_path(PathType::ShaderDir, user_dir / SHADER_DIR);
|
||||
create_path(PathType::SaveDataDir, user_dir / SAVEDATA_DIR);
|
||||
create_path(PathType::SysModuleDir, user_dir / SYSMODULES_DIR);
|
||||
|
||||
return paths;
|
||||
}();
|
||||
|
|
|
@ -14,6 +14,7 @@ enum class PathType {
|
|||
ScreenshotsDir, // Where screenshots are stored.
|
||||
ShaderDir, // Where shaders are stored.
|
||||
SaveDataDir, // Where guest save data is stored.
|
||||
SysModuleDir, // Where system modules are stored.
|
||||
};
|
||||
|
||||
constexpr auto PORTABLE_DIR = "user";
|
||||
|
@ -23,6 +24,7 @@ constexpr auto LOG_DIR = "log";
|
|||
constexpr auto SCREENSHOTS_DIR = "screenshots";
|
||||
constexpr auto SHADER_DIR = "shader";
|
||||
constexpr auto SAVEDATA_DIR = "savedata";
|
||||
constexpr auto SYSMODULES_DIR = "sys_modules";
|
||||
|
||||
// Filenames
|
||||
constexpr auto LOG_FILE = "shad_log.txt";
|
||||
|
|
|
@ -70,6 +70,14 @@ int main(int argc, char* argv[]) {
|
|||
Libraries::InitHLELibs(&linker->getHLESymbols());
|
||||
linker->LoadModule(path);
|
||||
|
||||
// check if we have system modules to load
|
||||
const auto& sys_module_path = Common::FS::GetUserPath(Common::FS::PathType::SysModuleDir);
|
||||
for (const auto& entry : std::filesystem::directory_iterator(sys_module_path)) {
|
||||
if (entry.path().filename() == "libSceNgs2.sprx") {
|
||||
LOG_INFO(Loader, "Loading {}", entry.path().string().c_str());
|
||||
linker->LoadModule(entry.path().string().c_str());
|
||||
}
|
||||
}
|
||||
// Check if there is a libc.prx in sce_module folder
|
||||
bool found = false;
|
||||
if (Config::isLleLibc()) {
|
||||
|
|
Loading…
Reference in New Issue