From 2454afd58f6f5b51c7bdead28042cff5dad8ec2a Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Thu, 19 Mar 2026 19:57:03 -0400 Subject: [PATCH] sysclk: fix resolution driver again --- .../sys-clk/sysmodule/src/clock_manager.cpp | 6 ++--- Source/sys-clk/sysmodule/src/integrations.cpp | 22 +++---------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/Source/sys-clk/sysmodule/src/clock_manager.cpp b/Source/sys-clk/sysmodule/src/clock_manager.cpp index 6378736a..1e1c98bb 100644 --- a/Source/sys-clk/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk/sysmodule/src/clock_manager.cpp @@ -623,15 +623,15 @@ void ClockManager::HandleGovernor(uint32_t targetHz) { isVRREnabled = newVrrGovernorState; if(newCpuGovernorState == false && lastCpuGovernorState == true) { - svcSleepThread(50'000'000); // thread syncing. probably a cleaner way to do this but hey, it works! + svcSleepThread(100'000'000); // thread syncing. probably a cleaner way to do this but hey, it works! Board::ResetToStockCpu(); } if(newGpuGovernorState == false && lastGpuGovernorState == true) { - svcSleepThread(50'000'000); + svcSleepThread(100'000'000); Board::ResetToStockGpu(); } if (newVrrGovernorState == false && lastVrrGovernorState == true) { - svcSleepThread(50'000'000); + svcSleepThread(100'000'000); Board::ResetToStockDisplay(); } if(newCpuGovernorState != lastCpuGovernorState || newGpuGovernorState != lastGpuGovernorState || newVrrGovernorState != lastVrrGovernorState) { diff --git a/Source/sys-clk/sysmodule/src/integrations.cpp b/Source/sys-clk/sysmodule/src/integrations.cpp index 2c19e954..64077895 100644 --- a/Source/sys-clk/sysmodule/src/integrations.cpp +++ b/Source/sys-clk/sysmodule/src/integrations.cpp @@ -110,19 +110,6 @@ u8 SaltyNXIntegration::GetFPS() { return NxFps ? NxFps->FPS : 254; } -struct resolutionCalls { // classes are bad :) - uint16_t width; - uint16_t height; - uint16_t calls; -}; - -resolutionCalls m_resolutionRenderCalls[8] = {0}; - -int compare (const void* elem1, const void* elem2) { - if ((((resolutionCalls*)(elem1))->calls) > (((resolutionCalls*)(elem2))->calls)) return -1; - else return 1; -} - u16 SaltyNXIntegration::GetResolutionHeight() { if (!SharedMemoryUsed) return 0; @@ -141,13 +128,10 @@ u16 SaltyNXIntegration::GetResolutionHeight() { searchSharedMemoryBlock(base); } if(NxFps) { - NxFps -> renderCalls[0].calls = 0xFFFF; + NxFps->renderCalls[0].calls = 0xFFFF; svcSleepThread(10*1000); - - memcpy(&m_resolutionRenderCalls, &(NxFps->renderCalls), sizeof(m_resolutionRenderCalls)); - qsort(m_resolutionRenderCalls, 8, sizeof(resolutionCalls), compare); - - return NxFps->viewportCalls[0].height; + + return NxFps->renderCalls[0].height == 0 ? NxFps->viewportCalls[0].height : NxFps->renderCalls[0].height; } return 0; } \ No newline at end of file