diff --git a/Source/sys-clk/common/include/sysclk/clock_manager.h b/Source/sys-clk/common/include/sysclk/clock_manager.h index 917b3701..9660eabf 100644 --- a/Source/sys-clk/common/include/sysclk/clock_manager.h +++ b/Source/sys-clk/common/include/sysclk/clock_manager.h @@ -43,12 +43,17 @@ typedef struct uint32_t voltages[HocClkVoltage_EnumMax]; u16 speedos[HorizonOCSpeedo_EnumMax]; u16 iddq[HorizonOCSpeedo_EnumMax]; + + // Misc stuff GpuSchedulingMode gpuSchedulingMode; bool isSysDockInstalled; bool isSaltyNXInstalled; + bool isUsingRetroSuper; u8 maxDisplayFreq; u8 dramID; bool isDram8GB; + + // FPS / Resolution u8 fps; u16 resolutionHeight; } SysClkContext; diff --git a/Source/sys-clk/common/src/display_refresh_rate.cpp b/Source/sys-clk/common/src/display_refresh_rate.cpp index d20ba026..65936751 100644 --- a/Source/sys-clk/common/src/display_refresh_rate.cpp +++ b/Source/sys-clk/common/src/display_refresh_rate.cpp @@ -88,12 +88,29 @@ static const DockedTimings g_dockedTimings1080p[] = { // technically you can go to 476hz, but in practice, why would you? }; +// These timings *should* work but are untested static const HandheldTimings g_handheldTimingsRETRO[] = { - {72, 136, 72, 1, 660, 9, 78000}, - {72, 136, 72, 1, 443, 9, 77985}, - {72, 136, 72, 1, 270, 9, 78000}, - {72, 136, 72, 1, 128, 9, 77990}, - {72, 136, 72, 1, 10, 9, 78000} + {72, 136, 72, 1, 660, 9, 78000}, // 40Hz + {72, 136, 72, 1, 612, 9, 77982}, // 41Hz + {72, 136, 72, 1, 567, 9, 77994}, // 42Hz + {72, 136, 72, 1, 524, 9, 78002}, // 43Hz + {72, 136, 72, 1, 483, 9, 78012}, // 44Hz + {72, 136, 72, 1, 443, 9, 77985}, // 45Hz + {72, 136, 72, 1, 406, 9, 78016}, // 46Hz + {72, 136, 72, 1, 370, 9, 78020}, // 47Hz + {72, 136, 72, 1, 335, 9, 78000}, // 48Hz + {72, 136, 72, 1, 302, 9, 78008}, // 49Hz + {72, 136, 72, 1, 270, 9, 78000}, // 50Hz + {72, 136, 72, 1, 239, 9, 77979}, // 51Hz + {72, 136, 72, 1, 210, 9, 78000}, // 52Hz + {72, 136, 72, 1, 182, 9, 78016}, // 53Hz + {72, 136, 72, 1, 154, 9, 77976}, // 54Hz + {72, 136, 72, 1, 128, 9, 77990}, // 55Hz + {72, 136, 72, 1, 103, 9, 78008}, // 56Hz + {72, 136, 72, 1, 78, 9, 77976}, // 57Hz + {72, 136, 72, 1, 55, 9, 78010}, // 58Hz + {72, 136, 72, 1, 32, 9, 77998}, // 59Hz + {72, 136, 72, 1, 10, 9, 78000}, // 60Hz }; static const MinMaxRefreshRate g_handheldModeRefreshRate = {40, 80}; 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 a4810592..64ff2ed5 100644 --- a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp @@ -446,7 +446,7 @@ void MiscGui::listUI() }); gpuSubmenu->setValue(R_ARROW); this->listElement->addItem(gpuSubmenu); - + tsl::elm::ListItem* displaySubMenu = new tsl::elm::ListItem("Display Settings"); displaySubMenu->setClickListener([](u64 keys) { if (keys & HidNpadButton_A) { @@ -601,17 +601,23 @@ public: protected: void listUI() override { + BaseMenuGui::refresh(); // get latest context + if(!this->context) + return; + this->listElement->addItem(new tsl::elm::CategoryHeader("Display Settings")); addConfigToggle(HorizonOCConfigValue_OverwriteRefreshRate, nullptr); - tsl::elm::CustomDrawer* warningText = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) { - renderer->drawString("\uE150 Enabling unsafe display", false, x + 20, y + 30, 18, tsl::style::color::ColorText); - renderer->drawString("refresh rates may cause stress", false, x + 20, y + 50, 18, tsl::style::color::ColorText); - renderer->drawString("or damage to your display! ", false, x + 20, y + 70, 18, tsl::style::color::ColorText); - renderer->drawString("Proceed at your own risk!", false, x + 20, y + 90, 18, tsl::style::color::ColorText); - }); - warningText->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 110); - this->listElement->addItem(warningText); - addConfigToggle(HorizonOCConfigValue_EnableUnsafeDisplayFreqs, nullptr); + if(!this->context->isUsingRetroSuper) { + tsl::elm::CustomDrawer* warningText = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) { + renderer->drawString("\uE150 Enabling unsafe display", false, x + 20, y + 30, 18, tsl::style::color::ColorText); + renderer->drawString("refresh rates may cause stress", false, x + 20, y + 50, 18, tsl::style::color::ColorText); + renderer->drawString("or damage to your display! ", false, x + 20, y + 70, 18, tsl::style::color::ColorText); + renderer->drawString("Proceed at your own risk!", false, x + 20, y + 90, 18, tsl::style::color::ColorText); + }); + warningText->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 110); + this->listElement->addItem(warningText); + addConfigToggle(HorizonOCConfigValue_EnableUnsafeDisplayFreqs, nullptr); + } } }; diff --git a/Source/sys-clk/sysmodule/src/board.cpp b/Source/sys-clk/sysmodule/src/board.cpp index a32dff7d..433fff12 100644 --- a/Source/sys-clk/sysmodule/src/board.cpp +++ b/Source/sys-clk/sysmodule/src/board.cpp @@ -120,6 +120,7 @@ static const u32 gpuDvfsArray[] = { 590, 600, 610, 620, 630, 640, 650, 660, 670, u32 dvfsTable[6][32] = {}; u64 dvfsAddress; u32 ramVmin; +bool isRetro = false; const char* Board::GetModuleName(SysClkModule module, bool pretty) { @@ -282,7 +283,7 @@ void Board::Initialize() } struct stat st = {0}; - bool isRetro = stat("sdmc:/" FILE_CONFIG_DIR "/retro.flag", &st) == 0; + isRetro = (stat("sdmc:/" FILE_CONFIG_DIR "/retro.flag", &st) == 0); u64 clkVirtAddr, dsiVirtAddr, outsize; rc = svcQueryMemoryMapping(&clkVirtAddr, &outsize, 0x60006000, 0x1000); @@ -309,6 +310,10 @@ void Board::Initialize() } +bool Board::IsUsingRetroSuperDisplay() { + return isRetro; +} + void Board::fuseReadSpeedos() { u64 pid = 0; diff --git a/Source/sys-clk/sysmodule/src/board.h b/Source/sys-clk/sysmodule/src/board.h index 2a32c87b..c29e53ae 100644 --- a/Source/sys-clk/sysmodule/src/board.h +++ b/Source/sys-clk/sysmodule/src/board.h @@ -69,6 +69,7 @@ class Board static void SetCpuUvLevel(u32 levelLow, u32 levelHigh, u32 tbreakPoint); static u32 CalculateTbreak(u32 table); static bool IsHoag(); + static bool IsUsingRetroSuperDisplay(); protected: static void FetchHardwareInfos(); static PcvModule GetPcvModule(SysClkModule sysclkModule); diff --git a/Source/sys-clk/sysmodule/src/clock_manager.cpp b/Source/sys-clk/sysmodule/src/clock_manager.cpp index 22611b63..b53ff046 100644 --- a/Source/sys-clk/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk/sysmodule/src/clock_manager.cpp @@ -152,6 +152,7 @@ ClockManager::ClockManager() this->saltyNXIntegration->LoadSaltyNX(); } + this->context->isUsingRetroSuper = Board::IsUsingRetroSuperDisplay(); threadStart(&cpuGovernorTHREAD); threadStart(&gpuGovernorTHREAD); @@ -994,7 +995,7 @@ bool ClockManager::RefreshContext() if(targetHz && this->context->realFreqs[HorizonOCModule_Display] > targetHz && this->context->profile != SysClkProfile_Docked) this->context->realFreqs[HorizonOCModule_Display] = targetHz; // clean up display real freqs, should probably be moved to the real freqs loop? - + if(!Board::IsHoag()) Board::SetDisplayRefreshDockedState(this->context->profile == SysClkProfile_Docked); if(this->context->isSaltyNXInstalled) diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp index 1d8fbf35..620710df 100644 Binary files a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp and b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp differ diff --git a/dist/switch/.overlays/Horizon-OC-Monitor.ovl b/dist/switch/.overlays/Horizon-OC-Monitor.ovl index d6cd6cb3..dbb0ea1f 100644 Binary files a/dist/switch/.overlays/Horizon-OC-Monitor.ovl and b/dist/switch/.overlays/Horizon-OC-Monitor.ovl differ diff --git a/dist/switch/.overlays/horizon-oc-overlay.ovl b/dist/switch/.overlays/horizon-oc-overlay.ovl index 8ac20a17..2f114391 100644 Binary files a/dist/switch/.overlays/horizon-oc-overlay.ovl and b/dist/switch/.overlays/horizon-oc-overlay.ovl differ