sysclk: fix logic errors

This commit is contained in:
souldbminersmwc
2026-03-21 10:51:03 -04:00
parent 1a42ad1a67
commit 610bf9ad82
5 changed files with 19 additions and 8 deletions

View File

@@ -27,6 +27,7 @@ tsl::elm::ListItem* IddqItem = NULL;
tsl::elm::ListItem* DramModule = NULL;
tsl::elm::ListItem* sysdockStatusItem = NULL;
tsl::elm::ListItem* saltyNXStatusItem = NULL;
tsl::elm::ListItem* RETROStatusItem = NULL;
ImageElement* CatImage = NULL;
HideableCategoryHeader* CatHeader = NULL;
@@ -67,6 +68,12 @@ void AboutGui::listUI()
saltyNXStatusItem =
new tsl::elm::ListItem("SaltyNX status:");
this->listElement->addItem(saltyNXStatusItem);
if(IsHoag()) {
RETROStatusItem =
new tsl::elm::ListItem("RR Display status:");
this->listElement->addItem(RETROStatusItem);
}
this->listElement->addItem(
new tsl::elm::CategoryHeader("Credits")
@@ -284,4 +291,6 @@ void AboutGui::refresh()
DramModule->setValue(formatRamModule());
sysdockStatusItem->setValue(this->context->isSysDockInstalled ? "Installed" : "Not Installed");
saltyNXStatusItem->setValue(this->context->isSaltyNXInstalled ? "Installed" : "Not Installed");
if(IsHoag())
RETROStatusItem->setValue(this->context->isUsingRetroSuper ? "Installed" : "Not Installed");
}

View File

@@ -26,7 +26,7 @@
class AboutGui : public BaseMenuGui
{
protected:
char strings[32][32]; // Pre-formatted strings
char strings[32][32];
public:
AboutGui();

View File

@@ -296,7 +296,7 @@ public:
static constexpr struct { const char* label; int shift; } kAll[] = {
{"CPU", 0}, {"GPU", 8}, {"VRR", 16}
};
int count = configList.values[HorizonOCConfigValue_OverwriteRefreshRate] ? 2 : 3;
int count = configList.values[HorizonOCConfigValue_OverwriteRefreshRate] ? 3 : 2;
for (int i = 0; i < count; i++) {
u8 cur = (this->profileList->mhzMap[this->profile][HorizonOCModule_Governor] >> kAll[i].shift) & 0xFF;
@@ -416,8 +416,7 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
NamedValue("115 Hz", 115),
NamedValue("120 Hz", 120)
};
if(configList.values[HorizonOCConfigValue_OverwriteRefreshRate])
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 1, " Hz", 1, 0, ValueThresholds(), dockedFreqsStandard);
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 1, " Hz", 1, 0, ValueThresholds(), dockedFreqsStandard);
}
}
}

View File

@@ -299,12 +299,17 @@ public:
GovernorOverrideSubMenuGui(u32 initialPacked) : packed(initialPacked) {}
void listUI() override {
Result rc = sysclkIpcGetConfigValues(&configList); // idk why this is needed, probably some refreshing issue
if (R_FAILED(rc)) [[unlikely]] {
FatalGui::openWithResultCode("sysclkIpcGetConfigValues", rc);
return;
}
this->listElement->addItem(new tsl::elm::CategoryHeader("Governor"));
static constexpr struct { const char* label; int shift; } kAll[] = {
{"CPU", 0}, {"GPU", 8}, {"VRR", 16}
};
int count = configList.values[HorizonOCConfigValue_OverwriteRefreshRate] ? 2 : 3;
int count = configList.values[HorizonOCConfigValue_OverwriteRefreshRate] ? 3 : 2;
for (int i = 0; i < count; i++) {
u8 cur = (this->packed >> kAll[i].shift) & 0xFF;

View File

@@ -776,11 +776,9 @@ void ClockManager::SetClocks(bool isBoost) {
if(noDisp && module == HorizonOCModule_Display)
continue;
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate) && !noDisp) {
if(targetHz)
Board::SetHz(HorizonOCModule_Display, targetHz);
else
Board::ResetToStockDisplay();
}
// Skip GPU and CPU if governors handle them