diff --git a/src/Util/config.cpp b/src/Util/config.cpp index 7c5a4fa7c..63babaecd 100644 --- a/src/Util/config.cpp +++ b/src/Util/config.cpp @@ -11,10 +11,12 @@ bool isNeo = false; u32 screenWidth = 1280; u32 screenHeight = 720; u32 logLevel = 0; // TRACE = 0 , DEBUG = 1 , INFO = 2 , WARN = 3 , ERROR = 4 , CRITICAL = 5, OFF = 6 +bool isLibc = true; bool isNeoMode() { return isNeo; } u32 getScreenWidth() { return screenWidth; } u32 getScreenHeight() { return screenHeight; } +bool isLleLibc() { return isLibc; } u32 getLogLevel() { return logLevel; } void load(const std::filesystem::path& path) { @@ -52,7 +54,15 @@ void load(const std::filesystem::path& path) { screenHeight = toml::find_or(general, "screenHeight", false); } } - int k = 0; + + if (data.contains("LLE")) { + auto generalResult = toml::expect(data.at("LLE")); + if (generalResult.is_ok()) { + auto general = generalResult.unwrap(); + + isLibc = toml::find_or(general, "libc", true); + } + } } void save(const std::filesystem::path& path) { toml::basic_value data; @@ -76,6 +86,7 @@ void save(const std::filesystem::path& path) { data["General"]["logLevel"] = logLevel; data["GPU"]["screenWidth"] = screenWidth; data["GPU"]["screenHeight"] = screenHeight; + data["LLE"]["libc"] = isLibc; std::ofstream file(path, std::ios::out); file << data; diff --git a/src/Util/config.h b/src/Util/config.h index 1397a6439..62670bd3d 100644 --- a/src/Util/config.h +++ b/src/Util/config.h @@ -12,4 +12,6 @@ u32 getLogLevel(); u32 getScreenWidth(); u32 getScreenHeight(); +bool isLleLibc(); + }; // namespace Config diff --git a/src/core/hle/libraries/libs.cpp b/src/core/hle/libraries/libs.cpp index 815a7c547..a81b64949 100644 --- a/src/core/hle/libraries/libs.cpp +++ b/src/core/hle/libraries/libs.cpp @@ -6,6 +6,7 @@ #include "core/hle/libraries/libpad/pad.h" #include "core/hle/libraries/libsystemservice/system_service.h" #include "core/hle/libraries/libc/libc.h" +#include "Util/config.h" namespace Core::Libraries { @@ -16,7 +17,9 @@ void InitHLELibs(Loader::SymbolsResolver* sym) { LibUserService::userServiceSymbolsRegister(sym); LibPad::padSymbolsRegister(sym); LibSystemService::systemServiceSymbolsRegister(sym); - LibC::libcSymbolsRegister(sym); + if (!Config::isLleLibc()) { + LibC::libcSymbolsRegister(sym); + } } } // namespace Core::Libraries