From d76cd2e8f960e7d445e6152f3bec112aec1b1d46 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Sun, 14 Dec 2025 10:24:39 -0500 Subject: [PATCH] sysclk: fix typo and add way to change kip editing path --- Source/sys-clk/common/include/sysclk/config.h | 5 ++++ .../sys-clk/overlay/src/ui/gui/misc_gui.cpp | 27 +++++++++++++++---- .../sys-clk/sysmodule/src/clock_manager.cpp | 15 ++++++++--- Source/sys-clk/sysmodule/src/main.cpp | 16 +++++------ 4 files changed, 47 insertions(+), 16 deletions(-) diff --git a/Source/sys-clk/common/include/sysclk/config.h b/Source/sys-clk/common/include/sysclk/config.h index a8770cc1..aabdcb3c 100644 --- a/Source/sys-clk/common/include/sysclk/config.h +++ b/Source/sys-clk/common/include/sysclk/config.h @@ -61,6 +61,7 @@ typedef enum { HocClkConfigValue_EnforceBoardLimit, HocClkConfigValue_KipEditing, + HocClkConfigValue_KipFileName, KipConfigValue_custRev, KipConfigValue_mtcConf, @@ -227,6 +228,9 @@ static inline const char* sysclkFormatConfigValue(SysClkConfigValue val, bool pr case HocClkConfigValue_KipEditing: return pretty ? "Enable KIP Editing" : "kip_editing"; + case HocClkConfigValue_KipFileName: + return pretty ? "KIP File Name" : "kip_file_name"; + // KIP config values case KipConfigValue_custRev: return pretty ? "Custom Revision" : "kip_cust_rev"; @@ -448,6 +452,7 @@ static inline uint64_t sysclkValidConfigValue(SysClkConfigValue val, uint64_t in case HocClkConfigValue_HandheldTDP: case HocClkConfigValue_EnforceBoardLimit: case HocClkConfigValue_KipEditing: + case HocClkConfigValue_KipFileName: return (input & 0x1) == input; case KipConfigValue_custRev: diff --git a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp index 3638af9f..7f7c32df 100644 --- a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp @@ -275,7 +275,7 @@ void MiscGui::listUI() {1785000000, "Boost Mode"}, {1963000000, "Safe Max"}, {2397000000, "Unsafe Max"}, - {2805000000, "Aboslute Max"}, + {2805000000, "Absolute Max"}, }; std::map cpu_freq_label_e = { @@ -284,7 +284,7 @@ void MiscGui::listUI() {1224000000, "Dev OC"}, {1785000000, "Boost Mode & Safe Max"}, {2091000000, "Unsafe Max"}, - {2295000000, "Aboslute Max"}, + {2295000000, "Absolute Max"}, }; std::map gpu_freq_label_e = { @@ -295,7 +295,7 @@ void MiscGui::listUI() {768000000, "Docked"}, {844000000, "Safe Max"}, {998400000, "Unsafe Max"}, - {1075200000, "Aboslute Max"}, + {1075200000, "Absolute Max"}, }; std::map gpu_freq_label_m = { @@ -305,9 +305,9 @@ void MiscGui::listUI() {460800000, "Handheld"}, {614400000, "Handheld Safe Max"}, {768000000, "Docked"}, - {1152200000, "Safe Max"}, + {1075200000, "Safe Max"}, {1305600000, "Unsafe Max"}, - {1536000000, "Aboslute Max"}, + {1536000000, "Absolute Max"}, }; std::map emc_freq_label_e = { @@ -340,6 +340,21 @@ void MiscGui::listUI() addConfigToggle(HocClkConfigValue_KipEditing, nullptr); + std::vector kipNameLabels = { + NamedValue("hoc.kip", 0), + NamedValue("loader.kip", 1) + }; + + addConfigButton( + HocClkConfigValue_KipFileName, + "KIP File Name", + ValueRange(0, 6, 1, "", 0), + "KIP File Name", + &thresholdsDisabled, + {}, + kipNameLabels, + false + ); this->listElement->addItem(new tsl::elm::CategoryHeader("KIP Settings")); std::vector autoAdjOptions = { @@ -609,6 +624,8 @@ void MiscGui::listUI() false ); + + std::vector marikoTableConf = { NamedValue("Auto", 0), NamedValue("Default", 1), diff --git a/Source/sys-clk/sysmodule/src/clock_manager.cpp b/Source/sys-clk/sysmodule/src/clock_manager.cpp index 2ae99c3b..ce456d7f 100644 --- a/Source/sys-clk/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk/sysmodule/src/clock_manager.cpp @@ -79,7 +79,7 @@ ClockManager::ClockManager() this->lastCsvWriteNs = 0; this->rnxSync = new ReverseNXSync; - + if(this->config->GetConfigValue(HocClkConfigValue_KipEditing)) this->GetKipData(); } @@ -523,7 +523,12 @@ void ClockManager::SetRNXRTMode(ReverseNXMode mode) void ClockManager::SetKipData() { std::scoped_lock lock{this->contextMutex}; - const char* kip = "sdmc:/atmosphere/kips/hoc.kip"; + const char* kip; + if(this->config->GetConfigValue(HocClkConfigValue_KipFileName)) + kip = "sdmc:/atmosphere/kips/hoc.kip"; + else + kip = "sdmc:/atmosphere/kips/loader.kip"; + CustomizeTable table; if (!cust_read_and_cache(kip, &table)) { @@ -593,8 +598,12 @@ void ClockManager::SetKipData() { void ClockManager::GetKipData() { std::scoped_lock lock{this->contextMutex}; + const char* kip; + if(this->config->GetConfigValue(HocClkConfigValue_KipFileName)) + kip = "sdmc:/atmosphere/kips/hoc.kip"; + else + kip = "sdmc:/atmosphere/kips/loader.kip"; - const char* kip = "sdmc:/atmosphere/kips/hoc.kip"; CustomizeTable table; if (!cust_read_and_cache(kip, &table)) { diff --git a/Source/sys-clk/sysmodule/src/main.cpp b/Source/sys-clk/sysmodule/src/main.cpp index bfb96661..12f4f069 100644 --- a/Source/sys-clk/sysmodule/src/main.cpp +++ b/Source/sys-clk/sysmodule/src/main.cpp @@ -83,9 +83,9 @@ extern "C" setsysExit(); } - rc = fanInitialize(); - if (R_FAILED(rc)) - diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen)); + // rc = fanInitialize(); + // if (R_FAILED(rc)) + // diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen)); rc = i2cInitialize(); if (R_FAILED(rc)) @@ -95,7 +95,7 @@ extern "C" void __appExit(void) { CloseFanControllerThread(); - fanExit(); + // fanExit(); i2cExit(); fsExit(); fsdevUnmountAll(); @@ -126,10 +126,10 @@ int main(int argc, char** argv) clockMgr->SetRunning(true); clockMgr->GetConfig()->SetEnabled(true); ipcSrv->SetRunning(true); - TemperaturePoint *table; - ReadConfigFile(&table); - InitFanController(table); - StartFanControllerThread(); + // TemperaturePoint *table; + // ReadConfigFile(&table); + // InitFanController(table); + // StartFanControllerThread(); while (clockMgr->Running()) {