sysclk: fix typo and add way to change kip editing path

This commit is contained in:
souldbminersmwc
2025-12-14 10:24:39 -05:00
parent bb7f0c8f5f
commit d76cd2e8f9
4 changed files with 47 additions and 16 deletions

View File

@@ -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:

View File

@@ -275,7 +275,7 @@ void MiscGui::listUI()
{1785000000, "Boost Mode"},
{1963000000, "Safe Max"},
{2397000000, "Unsafe Max"},
{2805000000, "Aboslute Max"},
{2805000000, "Absolute Max"},
};
std::map<uint32_t, std::string> 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<uint32_t, std::string> 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<uint32_t, std::string> 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<uint32_t, std::string> emc_freq_label_e = {
@@ -340,6 +340,21 @@ void MiscGui::listUI()
addConfigToggle(HocClkConfigValue_KipEditing, nullptr);
std::vector<NamedValue> 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<NamedValue> autoAdjOptions = {
@@ -609,6 +624,8 @@ void MiscGui::listUI()
false
);
std::vector<NamedValue> marikoTableConf = {
NamedValue("Auto", 0),
NamedValue("Default", 1),

View File

@@ -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)) {

View File

@@ -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())
{