Undo bad change, prevents console from booting, fix later

This commit is contained in:
Lightos1
2025-12-03 17:15:19 +01:00
parent e61ef8ccb2
commit b3cb87b236

View File

@@ -55,21 +55,28 @@ namespace ams::ldr::oc::pcv::mariko {
} }
Result CpuVoltRange(u32 *ptr) { Result CpuVoltRange(u32 *ptr) {
if(!C.marikoCpuHighVmin && !C.marikoCpuLowVmin) u32 min_volt_got = *(ptr - 1);
R_SKIP(); for (const auto &mv : CpuMinVolts) {
PATCH_OFFSET((ptr - 5), C.marikoCpuHighVmin); // hf vmin if (min_volt_got != mv)
PATCH_OFFSET((ptr - 1), C.marikoCpuLowVmin); // lf vmin continue;
R_SUCCEED();
}
Result CpuVmax(u32 *ptr) {
if (!C.marikoCpuMaxVolt) if (!C.marikoCpuMaxVolt)
R_SKIP(); R_SKIP();
PATCH_OFFSET(ptr, C.marikoCpuMaxVolt); PATCH_OFFSET(ptr, C.marikoCpuMaxVolt);
// Patch vmin for slt
if (C.marikoCpuUV) {
if (*(ptr - 5) == 620) {
PATCH_OFFSET((ptr - 5), C.marikoCpuLowVmin); // hf vmin
}
if (*(ptr - 1) == 620) {
PATCH_OFFSET((ptr - 1), C.marikoCpuHighVmin); // lf vmin
}
}
R_SUCCEED(); R_SUCCEED();
} }
R_THROW(ldr::ResultInvalidCpuMinVolt());
}
Result CpuVoltDfll(u32 *ptr) { Result CpuVoltDfll(u32 *ptr) {
cvb_cpu_dfll_data *entry = reinterpret_cast<cvb_cpu_dfll_data *>(ptr); cvb_cpu_dfll_data *entry = reinterpret_cast<cvb_cpu_dfll_data *>(ptr);
@@ -839,8 +846,7 @@ namespace ams::ldr::oc::pcv::mariko {
PatcherEntry<u32> patches[] = { PatcherEntry<u32> patches[] = {
{"CPU Freq Vdd", &CpuFreqVdd, 1, nullptr, CpuClkOSLimit}, {"CPU Freq Vdd", &CpuFreqVdd, 1, nullptr, CpuClkOSLimit},
{"CPU Freq Table", CpuFreqCvbTable<true>, 1, nullptr, CpuCvbDefaultMaxFreq}, {"CPU Freq Table", CpuFreqCvbTable<true>, 1, nullptr, CpuCvbDefaultMaxFreq},
{"CPU Volt Range", &CpuVoltRange, 1, nullptr, CpuVminOfficial}, {"CPU Volt Range", &CpuVoltRange, 13, nullptr, CpuVminOfficial},
{"CPU Volt Limit", &CpuVmax, 13, nullptr, CpuVoltOfficial},
{"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0x0000FFCF}, {"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0x0000FFCF},
{"GPU Freq Table", GpuFreqCvbTable<true>, 1, nullptr, GpuCvbDefaultMaxFreq}, {"GPU Freq Table", GpuFreqCvbTable<true>, 1, nullptr, GpuCvbDefaultMaxFreq},
{"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn}, {"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn},