sysclk: fix display rate bug on lite
This commit is contained in:
@@ -446,8 +446,8 @@ volatile CustomizeTable C = {
|
|||||||
{ 998400, { }, { 1065665,-16075, -497,-179, 3213, 9 } },
|
{ 998400, { }, { 1065665,-16075, -497,-179, 3213, 9 } },
|
||||||
{ 1075200, { }, { 1132576,-16093, -648, 0, 1077, 40 } },
|
{ 1075200, { }, { 1132576,-16093, -648, 0, 1077, 40 } },
|
||||||
{ 1152000, { }, { 1180029,-14534, -830, 0, 1469, 110 } },
|
{ 1152000, { }, { 1180029,-14534, -830, 0, 1469, 110 } },
|
||||||
{ 1228800, { }, { 1248293,-16383, -859, 0, 3722, 313 } },
|
// { 1228800, { }, { 1248293,-16383, -859, 0, 3722, 313 } },
|
||||||
{ 1267200, { }, { 1286399,-17475, -867, 0, 3681, 559 } },
|
// { 1267200, { }, { 1286399,-17475, -867, 0, 3681, 559 } },
|
||||||
},
|
},
|
||||||
|
|
||||||
.marikoGpuDvfsTableSLT = {
|
.marikoGpuDvfsTableSLT = {
|
||||||
@@ -467,7 +467,7 @@ volatile CustomizeTable C = {
|
|||||||
{ 1075200, { }, { 1132576, -16093, -648, 0, 1077, 40 } },
|
{ 1075200, { }, { 1132576, -16093, -648, 0, 1077, 40 } },
|
||||||
{ 1152000, { }, { 1180029, -14534, -830, 0, 1469, 110 } },
|
{ 1152000, { }, { 1180029, -14534, -830, 0, 1469, 110 } },
|
||||||
{ 1228800, { }, { 1238293, -16383, -859, 0, 3722, 313 } },
|
{ 1228800, { }, { 1238293, -16383, -859, 0, 3722, 313 } },
|
||||||
{ 1267200, { }, { 1276399, -17475, -867, 0, 3681, 559 } },
|
// { 1267200, { }, { 1276399, -17475, -867, 0, 3681, 559 } },
|
||||||
},
|
},
|
||||||
|
|
||||||
.marikoGpuDvfsTableHiOPT = {
|
.marikoGpuDvfsTableHiOPT = {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// display_refresh_rate.h
|
|
||||||
#ifndef DISPLAY_REFRESH_RATE_H
|
#ifndef DISPLAY_REFRESH_RATE_H
|
||||||
#define DISPLAY_REFRESH_RATE_H
|
#define DISPLAY_REFRESH_RATE_H
|
||||||
|
|
||||||
@@ -109,9 +108,6 @@ typedef struct {
|
|||||||
bool displaySyncDockedOutOfFocus60;
|
bool displaySyncDockedOutOfFocus60;
|
||||||
} DisplayRefreshConfig;
|
} DisplayRefreshConfig;
|
||||||
|
|
||||||
// Callback types for hardware access (compatible with libnx Result types)
|
|
||||||
|
|
||||||
// Public API functions
|
|
||||||
bool DisplayRefresh_Initialize(const DisplayRefreshConfig* config);
|
bool DisplayRefresh_Initialize(const DisplayRefreshConfig* config);
|
||||||
bool DisplayRefresh_SetRate(uint32_t new_refreshRate);
|
bool DisplayRefresh_SetRate(uint32_t new_refreshRate);
|
||||||
bool DisplayRefresh_GetRate(uint32_t* out_refreshRate, bool internal);
|
bool DisplayRefresh_GetRate(uint32_t* out_refreshRate, bool internal);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// display_refresh_rate.c
|
|
||||||
#include "display_refresh_rate.h"
|
#include "display_refresh_rate.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -111,7 +110,6 @@ static void _changeOledElvssSettings(const uint32_t* offsets, const uint32_t* va
|
|||||||
svcSleepThread(20000000);
|
svcSleepThread(20000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public API Implementation
|
|
||||||
|
|
||||||
bool DisplayRefresh_Initialize(const DisplayRefreshConfig* config) {
|
bool DisplayRefresh_Initialize(const DisplayRefreshConfig* config) {
|
||||||
if (!config) return false;
|
if (!config) return false;
|
||||||
@@ -571,7 +569,7 @@ bool DisplayRefresh_SetRate(uint32_t new_refreshRate) {
|
|||||||
uint32_t fd = 0;
|
uint32_t fd = 0;
|
||||||
|
|
||||||
if (g_config.isLite && g_config.isPossiblySpoofedRetro) {
|
if (g_config.isLite && g_config.isPossiblySpoofedRetro) {
|
||||||
g_config.isRetroSUPER = false; // Would check flag file here in original
|
g_config.isRetroSUPER = false; // Would check flag file here in original, but i dont care lol
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_config.isRetroSUPER && !g_config.isDocked) {
|
if (g_config.isRetroSUPER && !g_config.isDocked) {
|
||||||
|
|||||||
@@ -271,10 +271,12 @@ void AppProfileGui::addProfileUI(SysClkProfile profile)
|
|||||||
this->addModuleListItem(profile, SysClkModule_CPU);
|
this->addModuleListItem(profile, SysClkModule_CPU);
|
||||||
this->addModuleListItem(profile, SysClkModule_GPU);
|
this->addModuleListItem(profile, SysClkModule_GPU);
|
||||||
this->addModuleListItem(profile, SysClkModule_MEM);
|
this->addModuleListItem(profile, SysClkModule_MEM);
|
||||||
if(profile != SysClkProfile_Docked)
|
if(!IsHoag()) {
|
||||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 40, 72, 1, " Hz", 1, 0);
|
if(profile != SysClkProfile_Docked)
|
||||||
else
|
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 40, 72, 1, " Hz", 1, 0);
|
||||||
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 5, " Hz", 1, 0);
|
else
|
||||||
|
this->addModuleListItemValue(profile, HorizonOCModule_Display, "Display", 50, 120, 5, " Hz", 1, 0);
|
||||||
|
}
|
||||||
this->addModuleListItemToggle(profile, HorizonOCModule_Governor);
|
this->addModuleListItemToggle(profile, HorizonOCModule_Governor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ BaseMenuGui::BaseMenuGui() : tempColors{ tsl::Color(0), tsl::Color(0), tsl::Colo
|
|||||||
|
|
||||||
|
|
||||||
// Pre-cache hardware model during initialization
|
// Pre-cache hardware model during initialization
|
||||||
|
IsAula();
|
||||||
IsMariko();
|
IsMariko();
|
||||||
|
IsHoag();
|
||||||
|
|
||||||
// Initialize display strings
|
// Initialize display strings
|
||||||
memset(displayStrings, 0, sizeof(displayStrings));
|
memset(displayStrings, 0, sizeof(displayStrings));
|
||||||
|
|||||||
@@ -41,17 +41,39 @@ class BaseMenuGui : public BaseGui
|
|||||||
SysClkConfigValueList* configList;
|
SysClkConfigValueList* configList;
|
||||||
bool g_hardwareModelCached = false;
|
bool g_hardwareModelCached = false;
|
||||||
bool g_isMariko = false;
|
bool g_isMariko = false;
|
||||||
|
bool g_isAula = false;
|
||||||
bool IsMariko() {
|
bool g_isHoag = false;
|
||||||
|
SetSysProductModel HWmodel;
|
||||||
|
|
||||||
|
bool IsAula() {
|
||||||
if (!g_hardwareModelCached) {
|
if (!g_hardwareModelCached) {
|
||||||
SetSysProductModel model = SetSysProductModel_Invalid;
|
SetSysProductModel HWmodel = SetSysProductModel_Invalid;
|
||||||
setsysGetProductModel(&model);
|
setsysGetProductModel(&HWmodel);
|
||||||
g_isMariko = (model == SetSysProductModel_Iowa ||
|
|
||||||
model == SetSysProductModel_Hoag ||
|
|
||||||
model == SetSysProductModel_Calcio ||
|
|
||||||
model == SetSysProductModel_Aula);
|
|
||||||
g_hardwareModelCached = true;
|
g_hardwareModelCached = true;
|
||||||
}
|
}
|
||||||
|
g_isAula = (HWmodel == SetSysProductModel_Aula);
|
||||||
|
return g_isAula;
|
||||||
|
}
|
||||||
|
bool IsHoag() {
|
||||||
|
if (!g_hardwareModelCached) {
|
||||||
|
SetSysProductModel HWmodel = SetSysProductModel_Invalid;
|
||||||
|
setsysGetProductModel(&HWmodel);
|
||||||
|
g_hardwareModelCached = true;
|
||||||
|
}
|
||||||
|
g_isHoag = (HWmodel == SetSysProductModel_Hoag);
|
||||||
|
return g_isHoag;
|
||||||
|
}
|
||||||
|
bool IsMariko() {
|
||||||
|
if (!g_hardwareModelCached) {
|
||||||
|
SetSysProductModel HWmodel = SetSysProductModel_Invalid;
|
||||||
|
setsysGetProductModel(&HWmodel);
|
||||||
|
g_hardwareModelCached = true;
|
||||||
|
}
|
||||||
|
g_isMariko = (HWmodel == SetSysProductModel_Iowa ||
|
||||||
|
HWmodel == SetSysProductModel_Hoag ||
|
||||||
|
HWmodel == SetSysProductModel_Calcio ||
|
||||||
|
HWmodel == SetSysProductModel_Aula);
|
||||||
|
|
||||||
return g_isMariko;
|
return g_isMariko;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,7 +255,8 @@ void GlobalOverrideGui::listUI()
|
|||||||
this->addModuleListItem(SysClkModule_CPU);
|
this->addModuleListItem(SysClkModule_CPU);
|
||||||
this->addModuleListItem(SysClkModule_GPU);
|
this->addModuleListItem(SysClkModule_GPU);
|
||||||
this->addModuleListItem(SysClkModule_MEM);
|
this->addModuleListItem(SysClkModule_MEM);
|
||||||
this->addModuleListItemValue(HorizonOCModule_Display, "Display", 40, 72, 1, " Hz", 1, 0);
|
if(!IsHoag())
|
||||||
|
this->addModuleListItemValue(HorizonOCModule_Display, "Display", 40, 72, 1, " Hz", 1, 0);
|
||||||
this->addModuleToggleItem(HorizonOCModule_Governor);
|
this->addModuleToggleItem(HorizonOCModule_Governor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Note: Hoag crashes on display refresh rate init while in sleep mode
|
||||||
|
|
||||||
#include <nxExt.h>
|
#include <nxExt.h>
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
@@ -254,16 +255,17 @@ void Board::Initialize()
|
|||||||
if (hosversionAtLeast(6,0,0) && R_SUCCEEDED(pwmInitialize())) {
|
if (hosversionAtLeast(6,0,0) && R_SUCCEEDED(pwmInitialize())) {
|
||||||
pwmCheck = pwmOpenSession2(&g_ICon, 0x3D000001);
|
pwmCheck = pwmOpenSession2(&g_ICon, 0x3D000001);
|
||||||
}
|
}
|
||||||
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite) {
|
||||||
|
u64 clkVirtAddr, dsiVirtAddr, outsize;
|
||||||
|
rc = svcQueryMemoryMapping(&clkVirtAddr, &outsize, 0x60006000, 0x1000);
|
||||||
|
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (clk)");
|
||||||
|
rc = svcQueryMemoryMapping(&dsiVirtAddr, &outsize, 0x54300000, 0x40000);
|
||||||
|
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (dsi)");
|
||||||
|
|
||||||
u64 clkVirtAddr, dsiVirtAddr, outsize;
|
DisplayRefreshConfig cfg = {.clkVirtAddr = clkVirtAddr, .dsiVirtAddr = dsiVirtAddr};
|
||||||
rc = svcQueryMemoryMapping(&clkVirtAddr, &outsize, 0x60006000, 0x1000);
|
|
||||||
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (clk)");
|
|
||||||
rc = svcQueryMemoryMapping(&dsiVirtAddr, &outsize, 0x54300000, 0x40000);
|
|
||||||
ASSERT_RESULT_OK(rc, "svcQueryMemoryMapping (dsi)");
|
|
||||||
|
|
||||||
DisplayRefreshConfig cfg = {.clkVirtAddr = clkVirtAddr, .dsiVirtAddr = dsiVirtAddr};
|
DisplayRefresh_Initialize(&cfg);
|
||||||
|
}
|
||||||
DisplayRefresh_Initialize(&cfg);
|
|
||||||
FetchHardwareInfos();
|
FetchHardwareInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,6 +368,8 @@ void Board::Exit()
|
|||||||
rgltrExit();
|
rgltrExit();
|
||||||
batteryInfoExit();
|
batteryInfoExit();
|
||||||
pmdmntExit();
|
pmdmntExit();
|
||||||
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite)
|
||||||
|
DisplayRefresh_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
SysClkProfile Board::GetProfile()
|
SysClkProfile Board::GetProfile()
|
||||||
@@ -400,7 +404,7 @@ void Board::SetHz(SysClkModule module, std::uint32_t hz)
|
|||||||
{
|
{
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
|
|
||||||
if(module == HorizonOCModule_Display) {
|
if(module == HorizonOCModule_Display && Board::GetConsoleType() != HorizonOCConsoleType_Lite) {
|
||||||
DisplayRefresh_SetRate(hz);
|
DisplayRefresh_SetRate(hz);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -430,7 +434,10 @@ std::uint32_t Board::GetHz(SysClkModule module)
|
|||||||
std::uint32_t hz = 0;
|
std::uint32_t hz = 0;
|
||||||
|
|
||||||
if(module == HorizonOCModule_Display) {
|
if(module == HorizonOCModule_Display) {
|
||||||
DisplayRefresh_GetRate(&hz, false);
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite)
|
||||||
|
DisplayRefresh_GetRate(&hz, false);
|
||||||
|
else
|
||||||
|
hz = 60;
|
||||||
return hz;
|
return hz;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,7 +474,10 @@ std::uint32_t Board::GetRealHz(SysClkModule module)
|
|||||||
case SysClkModule_MEM:
|
case SysClkModule_MEM:
|
||||||
return t210ClkMemFreq();
|
return t210ClkMemFreq();
|
||||||
case HorizonOCModule_Display:
|
case HorizonOCModule_Display:
|
||||||
DisplayRefresh_GetRate(&hz, false);
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite)
|
||||||
|
DisplayRefresh_GetRate(&hz, false);
|
||||||
|
else
|
||||||
|
hz = 60;
|
||||||
return hz;
|
return hz;
|
||||||
default:
|
default:
|
||||||
ASSERT_ENUM_VALID(SysClkModule, module);
|
ASSERT_ENUM_VALID(SysClkModule, module);
|
||||||
@@ -662,11 +672,15 @@ void Board::ResetToStockGpu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Board::ResetToStockDisplay() {
|
void Board::ResetToStockDisplay() {
|
||||||
DisplayRefresh_SetRate(60);
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite)
|
||||||
|
DisplayRefresh_SetRate(60);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 Board::GetHighestDockedDisplayRate() {
|
u8 Board::GetHighestDockedDisplayRate() {
|
||||||
return DisplayRefresh_GetDockedHighestAllowed();
|
if(Board::GetConsoleType() != HorizonOCConsoleType_Lite)
|
||||||
|
return DisplayRefresh_GetDockedHighestAllowed();
|
||||||
|
else
|
||||||
|
return 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::uint32_t Board::GetTemperatureMilli(SysClkThermalSensor sensor)
|
std::uint32_t Board::GetTemperatureMilli(SysClkThermalSensor sensor)
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ void ClockManager::Tick()
|
|||||||
isGovernorEnabled = newGovernorState;
|
isGovernorEnabled = newGovernorState;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate)) {
|
if(module == HorizonOCModule_Display && this->config->GetConfigValue(HorizonOCConfigValue_OverwriteRefreshRate) && Board::GetConsoleType() != HorizonOCConsoleType_Lite) {
|
||||||
if(targetHz)
|
if(targetHz)
|
||||||
Board::SetHz(HorizonOCModule_Display, targetHz);
|
Board::SetHz(HorizonOCModule_Display, targetHz);
|
||||||
else
|
else
|
||||||
@@ -670,7 +670,7 @@ bool ClockManager::RefreshContext()
|
|||||||
FileUtils::WriteContextToCsv(this->context);
|
FileUtils::WriteContextToCsv(this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->context->profile == SysClkProfile_Docked)
|
if(this->context->profile == SysClkProfile_Docked && !Board::GetConsoleType() == HorizonOCConsoleType_Lite)
|
||||||
this->context->maxDisplayFreq = Board::GetHighestDockedDisplayRate();
|
this->context->maxDisplayFreq = Board::GetHighestDockedDisplayRate();
|
||||||
else
|
else
|
||||||
this->context->maxDisplayFreq = 60;
|
this->context->maxDisplayFreq = 60;
|
||||||
|
|||||||
2
dist/README.md
vendored
2
dist/README.md
vendored
@@ -57,7 +57,7 @@ It enables advanced CPU, GPU, and RAM tuning with user-friendly configuration to
|
|||||||
|
|
||||||
```
|
```
|
||||||
kip1=atmosphere/kips/hoc.kip
|
kip1=atmosphere/kips/hoc.kip
|
||||||
secmon=secmon_patch_ams_x_xx_x.bin
|
secmon=exosphere.bin
|
||||||
```
|
```
|
||||||
|
|
||||||
*(No changes needed if using fusee.)*
|
*(No changes needed if using fusee.)*
|
||||||
|
|||||||
Reference in New Issue
Block a user