From b5876ede0e2db664f54b546cdf7aca1018eb9558 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Thu, 19 Mar 2026 16:50:21 -0400 Subject: [PATCH] sysclk: rework labels and warnings, bump version --- Source/sys-clk/overlay/Makefile | 2 +- .../overlay/src/ui/gui/app_profile_gui.cpp | 5 +- .../overlay/src/ui/gui/freq_choice_gui.cpp | 4 +- .../src/ui/gui/global_override_gui.cpp | 5 +- Source/sys-clk/overlay/src/ui/gui/labels.cpp | 74 ++++++++++++++++++- Source/sys-clk/overlay/src/ui/gui/labels.h | 10 ++- .../sys-clk/overlay/src/ui/gui/misc_gui.cpp | 21 ++++-- 7 files changed, 105 insertions(+), 16 deletions(-) diff --git a/Source/sys-clk/overlay/Makefile b/Source/sys-clk/overlay/Makefile index 90387362..b85a2943 100644 --- a/Source/sys-clk/overlay/Makefile +++ b/Source/sys-clk/overlay/Makefile @@ -39,7 +39,7 @@ include ${TOPDIR}/lib/libultrahand/ultrahand.mk # version control constants #--------------------------------------------------------------------------------- #TARGET_VERSION := $(shell git describe --dirty --always --tags) -APP_VERSION := 1.0.2 +APP_VERSION := 1.0.3 TARGET_VERSION := $(APP_VERSION) #--------------------------------------------------------------------------------- diff --git a/Source/sys-clk/overlay/src/ui/gui/app_profile_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/app_profile_gui.cpp index dfbd602d..0ee58361 100644 --- a/Source/sys-clk/overlay/src/ui/gui/app_profile_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/app_profile_gui.cpp @@ -54,9 +54,10 @@ void AppProfileGui::openFreqChoiceGui(tsl::elm::ListItem* listItem, SysClkProfil std::map labels = {}; if (module == SysClkModule_CPU) { - labels = IsMariko() ? cpu_freq_label_m : cpu_freq_label_e; + bool isUsingUv = IsMariko() ? configList.values[KipConfigValue_marikoCpuUVHigh] : configList.values[KipConfigValue_eristaCpuUV]; + labels = IsMariko() ? (isUsingUv ? cpu_freq_label_m_uv : cpu_freq_label_m) : (isUsingUv ? cpu_freq_label_e_uv : cpu_freq_label_e); } else if (module == SysClkModule_GPU) { - labels = IsMariko() ? gpu_freq_label_m : gpu_freq_label_e; + labels = IsMariko() ? *(marikoUV[configList.values[KipConfigValue_marikoGpuUV]]) : *(eristaUV[configList.values[KipConfigValue_eristaGpuUV]]); } tsl::changeTo(this->profileList->mhzMap[profile][module] * 1000000, hzList, hzCount, module, [this, listItem, profile, module](std::uint32_t hz) { this->profileList->mhzMap[profile][module] = hz / 1000000; diff --git a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp index 7311bd05..68fce9d8 100644 --- a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp @@ -154,7 +154,7 @@ void FreqChoiceGui::listUI() if (IsMariko()) { - unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2296 : 1964; + unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2398 : 1964; if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) { unsafe_gpu = 1076; } else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) { @@ -167,7 +167,7 @@ void FreqChoiceGui::listUI() } else { - unsafe_cpu = this->configList->values[KipConfigValue_eristaCpuUV] ? 1964 : 1786; + unsafe_cpu = this->configList->values[KipConfigValue_eristaCpuUV] ? 2092 : 1786; if(this->configList->values[KipConfigValue_eristaGpuUV] == 0) { unsafe_gpu = 922; } else { diff --git a/Source/sys-clk/overlay/src/ui/gui/global_override_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/global_override_gui.cpp index 24f89fb3..f694bb79 100644 --- a/Source/sys-clk/overlay/src/ui/gui/global_override_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/global_override_gui.cpp @@ -42,9 +42,10 @@ void GlobalOverrideGui::openFreqChoiceGui(SysClkModule module) std::map labels = {}; if (module == SysClkModule_CPU) { - labels = IsMariko() ? cpu_freq_label_m : cpu_freq_label_e; + bool isUsingUv = IsMariko() ? configList.values[KipConfigValue_marikoCpuUVHigh] : configList.values[KipConfigValue_eristaCpuUV]; + labels = IsMariko() ? (isUsingUv ? cpu_freq_label_m_uv : cpu_freq_label_m) : (isUsingUv ? cpu_freq_label_e_uv : cpu_freq_label_e); } else if (module == SysClkModule_GPU) { - labels = IsMariko() ? gpu_freq_label_m : gpu_freq_label_e; + labels = IsMariko() ? *(marikoUV[configList.values[KipConfigValue_marikoGpuUV]]) : *(eristaUV[configList.values[KipConfigValue_eristaGpuUV]]); } tsl::changeTo( this->context->overrideFreqs[module], hzList, hzCount, module, diff --git a/Source/sys-clk/overlay/src/ui/gui/labels.cpp b/Source/sys-clk/overlay/src/ui/gui/labels.cpp index a474817b..1d44d9f8 100644 --- a/Source/sys-clk/overlay/src/ui/gui/labels.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/labels.cpp @@ -29,14 +29,36 @@ std::map cpu_freq_label_m = { {2703000000, "Absolute Max"}, }; +std::map cpu_freq_label_m_uv = { + {612000000, "Sleep Mode"}, + {1020000000, "Stock"}, + {1224000000, "Dev OC"}, + {1785000000, "Boost Mode"}, + {2397000000, "Safe Max"}, + {2601000000, "Unsafe Max"}, + {2703000000, "Absolute Max"}, +}; + std::map cpu_freq_label_e = { {612000000, "Sleep Mode"}, {1020000000, "Stock"}, {1224000000, "Dev OC"}, - {1785000000, "Boost Mode & Safe Max"}, + {1785000000, "Safe Max"}, {2091000000, "Unsafe Max"}, {2397000000, "Absolute Max"}, }; + +std::map cpu_freq_label_e_uv = { + {612000000, "Sleep Mode"}, + {1020000000, "Stock"}, + {1224000000, "Dev OC"}, + {1785000000, "Boost Mode"}, + {2091000000, "Safe Max"}, + {2193000000, "Unsafe Max"}, + {2397000000, "Absolute Max"}, +}; + + std::map gpu_freq_label_e = { {76800000, "Boost Mode"}, {307200000, "Handheld"}, @@ -50,6 +72,18 @@ std::map gpu_freq_label_e = { {1075200000, "Absolute Max"}, }; +std::map gpu_freq_label_e_uv = { + {76800000, "Boost Mode"}, + {307200000, "Handheld"}, + {345600000, "Handheld"}, + {384000000, "Handheld"}, + {422400000, "Handheld"}, + {460800000, "Handheld Safe Max"}, + {768000000, "Docked"}, + {960000000, "Safe Max"}, + {1075200000, "Absolute Max"}, +}; + std::map gpu_freq_label_m = { {76800000, "Boost Mode"}, {307200000, "Handheld"}, @@ -60,5 +94,41 @@ std::map gpu_freq_label_m = { {1075200000, "Safe Max"}, {1305600000, "Unsafe Max"}, {1536000000, "Absolute Max"}, - }; + +std::map gpu_freq_label_m_slt = { + {76800000, "Boost Mode"}, + {307200000, "Handheld"}, + {384000000, "Handheld"}, + {460800000, "Handheld"}, + {614400000, "Handheld Safe Max"}, + {768000000, "Docked"}, + {1152200000, "Safe Max"}, + {1305600000, "Unsafe Max"}, + {1536000000, "Absolute Max"}, +}; + +std::map gpu_freq_label_m_hiopt = { + {76800000, "Boost Mode"}, + {307200000, "Handheld"}, + {384000000, "Handheld"}, + {460800000, "Handheld"}, + {614400000, "Handheld Safe Max"}, + {768000000, "Docked"}, + {1228800000, "Safe Max"}, + {1305600000, "Unsafe Max"}, + {1536000000, "Absolute Max"}, +}; + +std::map* marikoUV[3] { + &gpu_freq_label_m, + &gpu_freq_label_m_slt, + &gpu_freq_label_m_hiopt, +}; + + +std::map* eristaUV[3] { + &gpu_freq_label_e, + &gpu_freq_label_e_uv, + &gpu_freq_label_e_uv, +}; \ No newline at end of file diff --git a/Source/sys-clk/overlay/src/ui/gui/labels.h b/Source/sys-clk/overlay/src/ui/gui/labels.h index a157a44e..bbebef02 100644 --- a/Source/sys-clk/overlay/src/ui/gui/labels.h +++ b/Source/sys-clk/overlay/src/ui/gui/labels.h @@ -21,6 +21,14 @@ #include extern std::map cpu_freq_label_m; +extern std::map cpu_freq_label_m_uv; extern std::map cpu_freq_label_e; +extern std::map cpu_freq_label_e_uv; extern std::map gpu_freq_label_m; -extern std::map gpu_freq_label_e; \ No newline at end of file +extern std::map gpu_freq_label_m_slt; +extern std::map gpu_freq_label_m_hiopt; +extern std::map gpu_freq_label_e; +extern std::map gpu_freq_label_e_uv; + +extern std::map* marikoUV[3]; +extern std::map* eristaUV[3]; \ No newline at end of file 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 163b8b31..c18c1ab5 100644 --- a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp @@ -921,7 +921,17 @@ public: protected: void listUI() override { + Result rc = sysclkIpcGetConfigValues(this->configList); // populate config list early otherwise wont work + if (R_FAILED(rc)) [[unlikely]] { + FatalGui::openWithResultCode("sysclkIpcGetConfigValues", rc); + return; + } + ValueThresholds thresholdsDisabled(0, 0); + ValueThresholds mCpuClockThresholds(1963000, 2397000); + ValueThresholds mCpuClockThresholdsUV(2397000, 2499000); + ValueThresholds eCpuClockThresholds(1785000, 2091000); + ValueThresholds eCpuClockThresholdsUV(2091000, 2193000); this->listElement->addItem(new tsl::elm::CategoryHeader("CPU Settings")); if(IsMariko()) { @@ -935,13 +945,13 @@ protected: NamedValue("2601 MHz", 2601000), NamedValue("2703 MHz", 2703000), }; - ValueThresholds mCpuClockThresholds(1963000, 2397000); + addConfigButton( KipConfigValue_marikoCpuBoostClock, "CPU Boost Clock", ValueRange(0, 0, 1, "", 1), "CPU Boost Clock", - &mCpuClockThresholds, + this->configList->values[KipConfigValue_marikoCpuUVHigh] ? &mCpuClockThresholdsUV : &mCpuClockThresholds, {}, ClkOptions, false @@ -956,13 +966,12 @@ protected: NamedValue("2295 MHz", 2295000), NamedValue("2397 MHz", 2397000), }; - ValueThresholds eCpuClockThresholds(1785000, 2091000); addConfigButton( KipConfigValue_eristaCpuBoostClock, "CPU Boost Clock", ValueRange(0, 0, 1, "", 1), "CPU Boost Clock", - &eCpuClockThresholds, + this->configList->values[KipConfigValue_eristaCpuUV] ? &eCpuClockThresholdsUV : &eCpuClockThresholds, {}, ClkOptionsE, false @@ -1076,13 +1085,13 @@ protected: NamedValue("2601 MHz", 2601000), NamedValue("2703 MHz", 2703000), }; - ValueThresholds mCpuMaxClockThresholds(1963000, 2397000); + addConfigButton( KipConfigValue_marikoCpuMaxClock, "CPU Max Clock", ValueRange(0, 0, 1, "", 1), "CPU Max Clock", - &mCpuMaxClockThresholds, + this->configList->values[KipConfigValue_marikoCpuUVHigh] ? &mCpuClockThresholdsUV : &mCpuClockThresholds, {}, maxClkOptions, false