ldr: add auto ram vmin

This commit is contained in:
souldbminersmwc
2026-02-08 11:54:21 -05:00
parent 7d9c60cdfe
commit c0b458243c
9 changed files with 53 additions and 11 deletions

View File

@@ -22,6 +22,7 @@
/* Never edit these. */
#define AUTO 0
#define AUTO_RAM 0
#define ENABLED 1
#define DISABLED 0
#define DEACTIVATED_GPU_FREQ 2000

View File

@@ -51,6 +51,48 @@ namespace ams::ldr::oc::pcv::mariko {
}
/* Note: EOS (probably?) has a bug in this function that always results in high vmin, this is fixed here. */
static unsigned int ramBrackets[][22] =
{
{ 2133, 2200, 2266, 2300, 2366, 2400, 2433, 2466, 2533, 2566, 2600, 2633, 2700, 2733, 2766, 2833, 2866, 2900, 2933, 3033, 3066, 3100, },
{ 2300, 2366, 2433, 2466, 2533, 2566, 2633, 2700, 2733, 2800, 2833, 2900, 2933, 2966, 3033, 3066, 3100, 3133, 3166, 3200, 3233, 3266, },
{ 2433, 2466, 2533, 2600, 2666, 2733, 2766, 2800, 2833, 2866, 2933, 2966, 3033, 3066, 3100, 3133, 3166, 3200, 3233, 3300, 3333, 3366, },
{ 2500, 2533, 2600, 2633, 2666, 2733, 2800, 2866, 2900, 2966, 3033, 3100, 3166, 3200, 3233, 3266, 3300, 3333, 3366, 3400, 3400, 3400, }
};
unsigned int gpuDvfsArray[] = { 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800};
int GetSpeedoBracket (int speedo)
{
int speedoBracket = 3;
if ((speedo < 1754) && (speedoBracket = 2, speedo < 1690)) {
speedoBracket = !!(1625 < speedo);
}
return speedoBracket;
}
unsigned int GetGpuVoltage (unsigned int freq, int speedo)
{
long int lVar1;
int bracket = GetSpeedoBracket(speedo);
if (freq < 1601)
return 0;
lVar1 = 0;
do
{
if (freq <= ramBrackets[bracket][lVar1])//*(unsigned int *)((ulong)DAT_001491e0 * 0x58 + 1280960 + lVar1 * 4))
return gpuDvfsArray[lVar1];//*(undefined4 *)((long)(int)lVar1 * 4 + 1281312);
lVar1++;
} while (lVar1 != 22);
return 800;
}
u32 GetAutoVoltage() {
u32 voltage = GetGpuVminVoltage();
voltage = GetRamVminAdjustment(voltage);
@@ -85,7 +127,7 @@ namespace ams::ldr::oc::pcv::mariko {
/* C.marikoGpuVmin is zero, auto voltage is applied. */
/* Get vmin depending on speedo and ram clock. */
u32 autoVmin = GetAutoVoltage();
u32 autoVmin = C.marikoGpuVmin == 0 ? GetAutoVoltage() : GetGpuVoltage(C.marikoEmcMaxClock / 1000, C.gpuSpeedo);
PATCH_OFFSET(ptr, autoVmin);
R_SUCCEED();
}

View File

@@ -937,7 +937,7 @@ protected:
};
std::vector<NamedValue> mGpuVoltsVmin = {
NamedValue("Auto", 0),
NamedValue("Auto", 0), NamedValue("Auto (RAM)", 1),
NamedValue("480mV", 480), NamedValue("485mV", 485), NamedValue("490mV", 490),
NamedValue("495mV", 495), NamedValue("500mV", 500), NamedValue("505mV", 505),
NamedValue("510mV", 510), NamedValue("515mV", 515), NamedValue("520mV", 520),

View File

@@ -28,6 +28,7 @@
#include "process_management.h"
#include "file_utils.h"
#include "errors.h"
#define IS_QLAUNCH 0x20f
void ProcessManagement::Initialize()
{
@@ -47,7 +48,7 @@ void ProcessManagement::WaitForQLaunch()
do
{
rc = pmdmntGetProcessId(&pid, PROCESS_MANAGEMENT_QLAUNCH_TID);
svcSleepThread(500000000ULL);
svcSleepThread(50 * 1000000ULL); // 50ms
} while (R_FAILED(rc));
}
@@ -58,7 +59,7 @@ std::uint64_t ProcessManagement::GetCurrentApplicationId()
std::uint64_t tid = 0;
rc = pmdmntGetApplicationProcessId(&pid);
if (rc == 0x20f)
if (rc == IS_QLAUNCH)
{
return PROCESS_MANAGEMENT_QLAUNCH_TID;
}
@@ -67,7 +68,7 @@ std::uint64_t ProcessManagement::GetCurrentApplicationId()
rc = pminfoGetProgramId(&tid, pid);
if (rc == 0x20f)
if (rc == IS_QLAUNCH)
{
return PROCESS_MANAGEMENT_QLAUNCH_TID;
}

BIN
dist/HOC_AUTO_RAM_TEST.zip vendored Normal file

Binary file not shown.

10
dist/README.md vendored
View File

@@ -41,10 +41,8 @@ It enables advanced CPU, GPU, and RAM tuning with user-friendly configuration to
* Built-in configurator
* Compatible with most homebrew
> *Higher (potentially dangerous) frequencies are unlockable via configuration.*
> *Erista and Mariko units can usually push a bit further fully safely with a bit of undervolting, however this may not work on all units.*
> *The exact maximum overclock possible varies per console, although most consoles should be able to do this safely.*
> *You may refer to the Clock Table to see clocks in more detail*
> It is reccomended to read the [guide](https://rentry.co/howtoget60fps) before proceeding, as this can help you get a *significant* performance boost over the default settings, often times with less power draw and heat output
---
## Installation
@@ -98,8 +96,8 @@ Refer to COMPILATION.md
### CPU clocks
* 2601 → mariko absolute max, very dangerous
* 2499
* 2397
* 2295 → mariko safe max with UV (low speedo)
* 2397 → mariko safe max with UV (low speedo)
* 2295
* 2193
* 2091
* 1963 → mariko no UV max clock

Binary file not shown.

Binary file not shown.