sysclk: make display change togglable and increase battery life in sleep mode
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "../format.h"
|
||||
#include "fatal_gui.h"
|
||||
|
||||
AppProfileGui::AppProfileGui(std::uint64_t applicationId, SysClkTitleProfileList* profileList)
|
||||
{
|
||||
this->applicationId = applicationId;
|
||||
@@ -272,7 +271,10 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
|
||||
this->addModuleListItem(profile, SysClkModule_CPU);
|
||||
this->addModuleListItem(profile, SysClkModule_GPU);
|
||||
this->addModuleListItem(profile, SysClkModule_MEM);
|
||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 40, 72, 5, " Hz", 1, 0);
|
||||
if(profile != SysClkProfile_Docked)
|
||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 40, 72, 1, " Hz", 1, 0);
|
||||
else
|
||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 5, " Hz", 1, 0);
|
||||
this->addModuleListItemToggle(profile, HorizonOCModule_Governor);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,10 @@ void BaseMenuGui::preDraw(tsl::gfx::Renderer* renderer) {
|
||||
renderer->drawString(displayStrings[20], false, dataPositions[0], y, SMALL_TEXT_SIZE, tempColors[HorizonOCThermalSensor_Battery]); // Battery
|
||||
renderer->drawString(displayStrings[22], false, dataPositions[1], y, SMALL_TEXT_SIZE, tempColors[HorizonOCThermalSensor_PMIC]); // PMIC
|
||||
|
||||
renderer->drawString(labels[13], false, positions[7], y, SMALL_TEXT_SIZE, tsl::sectionTextColor); // disp label
|
||||
|
||||
renderer->drawString(displayStrings[25], false, dataPositions[2], y, SMALL_TEXT_SIZE, tsl::infoTextColor); // disp freq
|
||||
|
||||
y+=20;
|
||||
|
||||
renderer->drawString(displayStrings[21], false, dataPositions[0], y, SMALL_TEXT_SIZE, tsl::infoTextColor); // Bat voltage
|
||||
@@ -163,9 +167,8 @@ void BaseMenuGui::preDraw(tsl::gfx::Renderer* renderer) {
|
||||
|
||||
renderer->drawString(displayStrings[24], false, dataPositions[1], y, SMALL_TEXT_SIZE, tsl::infoTextColor); // fan speed
|
||||
|
||||
renderer->drawString(labels[13], false, positions[7], y, SMALL_TEXT_SIZE, tsl::sectionTextColor); // fan label
|
||||
renderer->drawString(displayStrings[26], false, dataPositions[2], y, SMALL_TEXT_SIZE, tsl::infoTextColor); // disp volt
|
||||
|
||||
renderer->drawString(displayStrings[25], false, dataPositions[2], y, SMALL_TEXT_SIZE, tsl::infoTextColor); // fan speed
|
||||
|
||||
}
|
||||
|
||||
@@ -186,12 +189,14 @@ void BaseMenuGui::refresh()
|
||||
}
|
||||
|
||||
// === SYSCLK CONTEXT UPDATE ===
|
||||
const Result rc = sysclkIpcGetCurrentContext(this->context);
|
||||
Result rc = sysclkIpcGetCurrentContext(this->context);
|
||||
if (R_FAILED(rc)) [[unlikely]] {
|
||||
FatalGui::openWithResultCode("sysclkIpcGetCurrentContext", rc);
|
||||
return;
|
||||
}
|
||||
|
||||
sysclkIpcGetConfigValues(this->configList);
|
||||
// dockedHighestAllowedRefreshRate = this->context->maxDisplayFreq;
|
||||
|
||||
// === FORMAT ALL DISPLAY STRINGS (once per second) ===
|
||||
// App ID (hex conversion)
|
||||
sprintf(displayStrings[0], "%016lX", context->applicationId);
|
||||
@@ -274,6 +279,8 @@ void BaseMenuGui::refresh()
|
||||
|
||||
sprintf(displayStrings[25], "%u Hz", context->realFreqs[HorizonOCModule_Display]);
|
||||
|
||||
sprintf(displayStrings[26], "%u.%u mV", context->voltages[HocClkVoltage_Display] / 1000U, context->voltages[HocClkVoltage_Display] % 1000U);
|
||||
|
||||
}
|
||||
|
||||
tsl::elm::Element* BaseMenuGui::baseUI()
|
||||
|
||||
@@ -33,10 +33,12 @@
|
||||
class BaseMenuGui : public BaseGui
|
||||
{
|
||||
protected:
|
||||
SysClkContext* context;
|
||||
std::uint64_t lastContextUpdate;
|
||||
|
||||
public:
|
||||
// u8 dockedHighestAllowedRefreshRate = 60;
|
||||
SysClkContext* context;
|
||||
std::uint64_t lastContextUpdate;
|
||||
SysClkConfigValueList* configList;
|
||||
bool g_hardwareModelCached = false;
|
||||
bool g_isMariko = false;
|
||||
|
||||
|
||||
@@ -398,6 +398,8 @@ void MiscGui::listUI()
|
||||
chargerCurrents,
|
||||
false
|
||||
);
|
||||
addConfigToggle(HorizonOCConfigValue_OverwriteRefreshRate, nullptr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1076,7 +1078,7 @@ void MiscGui::refresh() {
|
||||
if (this->context && ++frameCounter >= 60) {
|
||||
frameCounter = 0;
|
||||
|
||||
sysclkIpcGetConfigValues(this->configList);
|
||||
// sysclkIpcGetConfigValues(this->configList);
|
||||
|
||||
updateConfigToggles();
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ protected:
|
||||
std::map<SysClkConfigValue, tsl::elm::ListItem*> configButtons;
|
||||
std::map<SysClkConfigValue, ValueRange> configRanges;
|
||||
std::map<SysClkConfigValue, std::vector<NamedValue>> configNamedValues;
|
||||
SysClkConfigValueList* configList;
|
||||
std::map<SysClkConfigValue, tsl::elm::ToggleListItem*> configToggles;
|
||||
std::map<SysClkConfigValue, std::tuple<tsl::elm::TrackBar*, tsl::elm::ListItem*, std::vector<uint64_t>>> configTrackbars;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user