add resolution
This commit is contained in:
@@ -621,7 +621,7 @@ void ClockManager::HandleGovernor(uint32_t targetHz) {
|
||||
isCpuGovernorEnabled = newCpuGovernorState;
|
||||
isGpuGovernorEnabled = newGpuGovernorState;
|
||||
isVRREnabled = newVrrGovernorState;
|
||||
|
||||
|
||||
if(newCpuGovernorState == false && lastCpuGovernorState == true) {
|
||||
svcSleepThread(50'000'000); // thread syncing. probably a cleaner way to do this but hey, it works!
|
||||
Board::ResetToStockCpu();
|
||||
@@ -1010,6 +1010,11 @@ bool ClockManager::RefreshContext()
|
||||
else
|
||||
this->context->fps = 254; // N/A
|
||||
|
||||
if(this->context->isSaltyNXInstalled)
|
||||
this->context->resolutionHeight = saltyNXIntegration->GetResolutionHeight();
|
||||
else
|
||||
this->context->resolutionHeight = 0; // N/A
|
||||
|
||||
return hasChanged;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ void SaltyNXIntegration::searchSharedMemoryBlock(uintptr_t base) {
|
||||
}
|
||||
|
||||
u64 prevTid = 0;
|
||||
|
||||
u8 SaltyNXIntegration::GetFPS() {
|
||||
if (!SharedMemoryUsed)
|
||||
return 254;
|
||||
@@ -107,4 +108,29 @@ u8 SaltyNXIntegration::GetFPS() {
|
||||
}
|
||||
|
||||
return NxFps ? NxFps->FPS : 254;
|
||||
}
|
||||
|
||||
u16 SaltyNXIntegration::GetResolutionHeight() {
|
||||
if (!SharedMemoryUsed)
|
||||
return 0;
|
||||
|
||||
u64 tid = ProcessManagement::GetCurrentApplicationId();
|
||||
if (tid == 0)
|
||||
return 0;
|
||||
|
||||
if (prevTid != tid) {
|
||||
NxFps = 0;
|
||||
prevTid = tid;
|
||||
}
|
||||
|
||||
if (!NxFps) {
|
||||
uintptr_t base = (uintptr_t)shmemGetAddr(&_sharedmemory);
|
||||
searchSharedMemoryBlock(base);
|
||||
}
|
||||
if(NxFps) {
|
||||
NxFps -> renderCalls[0].calls = 0xFFFF;
|
||||
svcSleepThread(10*1000);
|
||||
return NxFps->viewportCalls[0].height;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -90,4 +90,5 @@ public:
|
||||
void LoadSharedMemory();
|
||||
void searchSharedMemoryBlock(uintptr_t base);
|
||||
u8 GetFPS();
|
||||
u16 GetResolutionHeight();
|
||||
};
|
||||
Reference in New Issue
Block a user