mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
search sce_module folder and fall back to libc HLE if not found
This commit is contained in:
parent
cfd68f18cc
commit
88b790d846
11
src/main.cpp
11
src/main.cpp
@ -18,6 +18,7 @@
|
||||
#include "emulator.h"
|
||||
#include <core/hle/libraries/libkernel/thread_management.h>
|
||||
#include "core/file_sys/fs.h"
|
||||
#include <core/hle/libraries/libc/libc.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc == 1) {
|
||||
@ -42,16 +43,24 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
auto linker = Common::Singleton<Core::Linker>::Instance();
|
||||
Core::Libraries::InitHLELibs(&linker->getHLESymbols());
|
||||
linker->LoadModule(path);
|
||||
//check if there is a libc.prx in sce_module folder
|
||||
bool found = false;
|
||||
if (Config::isLleLibc()) {
|
||||
std::filesystem::path sce_module_folder = std::string(p.parent_path().string() + "\\sce_module");
|
||||
if (std::filesystem::exists(sce_module_folder)) {
|
||||
for (const auto& entry : std::filesystem::directory_iterator(sce_module_folder)) {
|
||||
if (entry.path().filename() == "libc.prx") {
|
||||
//found = true;
|
||||
printf("%s\n", entry.path().string().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)//load HLE libc
|
||||
{
|
||||
Core::Libraries::LibC::libcSymbolsRegister(&linker->getHLESymbols());
|
||||
}
|
||||
linker->LoadModule(path);
|
||||
std::jthread mainthread([linker](std::stop_token stop_token, void*) { linker->Execute(); }, nullptr);
|
||||
Discord::RPC discordRPC;
|
||||
discordRPC.init();
|
||||
|
Loading…
Reference in New Issue
Block a user