diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index 6febf32b..0eb25e4e 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -216,9 +216,8 @@ namespace ams::ldr::oc::pcv { constexpr u32 GpuClkPllLimit = 921'600'000; constexpr u32 GpuVminOfficial = 810; - static const u32 gpuVoltDvfsPattern[] = { 1150, 1000, 100, 1000, 10, }; - static const u32 gpuVoltDvfsOffsets[] = { 1, 2, 3, 4, 5, }; - static_assert(sizeof(gpuVoltDvfsPattern) == sizeof(gpuVoltDvfsOffsets), "Invalid gpuVoltDvfsPattern"); + static const u32 gpuVoltDvfsPattern[] = { 810, 1150, 1000, 100, 1000, 10, }; + static_assert(sizeof(gpuVoltDvfsPattern) == (sizeof(u32) * 6), "Invalid gpuVoltDvfsPattern"); static const u32 gpuVoltThermalPattern[] = { 950, 1132, 0, 810, 1132, 15000, 810, 1132, 30000, 810, 1132, 50000, 810, 1132, 70000, 810, 1132, 105000 }; static_assert(sizeof(gpuVoltThermalPattern) == 0x48, "invalid gpuVoltageThermalPattern size"); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp index 8a8d2cef..b8cdc28a 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp @@ -103,14 +103,15 @@ namespace ams::ldr::oc::pcv::erista { } Result GpuVoltDVFS(u32 *ptr) { - if (MatchesPattern(ptr, gpuVoltDvfsPattern, gpuVoltDvfsOffsets)) { - if (C.eristaGpuVmin) { - PATCH_OFFSET(ptr, C.eristaGpuVmin); - } - R_SUCCEED(); - } + u32 result = std::memcmp(ptr, gpuVoltDvfsPattern, sizeof(gpuVoltDvfsPattern)); - R_THROW(ldr::ResultInvalidGpuDvfs()); + if (result) + R_THROW(ldr::ResultInvalidGpuDvfs()); + + if (C.eristaGpuVmin) + PATCH_OFFSET(ptr, C.eristaGpuVmin); + + R_SUCCEED(); } Result GpuVoltThermals(u32 *ptr) { @@ -730,19 +731,16 @@ namespace ams::ldr::oc::pcv::erista { } void Patch(uintptr_t mapped_nso, size_t nso_size) { - u32 CpuCvbDefaultMaxFreq = static_cast(GetDvfsTableLastEntry(CpuCvbTableDefault)->freq); - u32 GpuCvbDefaultMaxFreq = static_cast(GetDvfsTableLastEntry(GpuCvbTableDefault)->freq); - PatcherEntry patches[] = { - {"CPU Freq Table", CpuFreqCvbTable, 1, nullptr, CpuCvbDefaultMaxFreq}, + {"CPU Freq Table", CpuFreqCvbTable, 1, nullptr, static_cast(GetDvfsTableLastEntry(CpuCvbTableDefault)->freq)}, {"CPU Volt DVFS", &CpuVoltDvfs, 1, nullptr, 825}, {"CPU Volt Thermals", &CpuVoltThermals, 1, nullptr, 825}, {"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0xFFD0EAFF}, {"GPU Volt DVFS", &GpuVoltDVFS, 1, nullptr, 810}, {"GPU Volt Thermals", &GpuVoltThermals, 1, nullptr, 810}, - {"GPU Freq Table", GpuFreqCvbTable, 1, nullptr, GpuCvbDefaultMaxFreq}, + {"GPU Freq Table", GpuFreqCvbTable, 1, nullptr, static_cast(GetDvfsTableLastEntry(GpuCvbTableDefault)->freq)}, {"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn}, - {"GPU Freq PLL", &GpuFreqPllLimit, 1, nullptr, GpuClkPllLimit}, + {"GPU Freq PLL", &GpuFreqPllLimit, 1, nullptr, GpuClkPllLimit}, // NOT ISSUE {"MEM Freq Mtc", &MemFreqMtcTable, 0, nullptr, EmcClkOSLimit}, {"MEM Freq Max", &MemFreqMax, 0, nullptr, EmcClkOSLimit}, {"MEM Freq PLLM", &MemFreqPllmLimit, 2, nullptr, EmcClkPllmLimit}, diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp index 63b9d906..2925aeaf 100644 Binary files a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp and b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp differ diff --git a/dist/atmosphere/kips/hoc.kip b/dist/atmosphere/kips/hoc.kip index c02e3798..335f1ed2 100644 Binary files a/dist/atmosphere/kips/hoc.kip and b/dist/atmosphere/kips/hoc.kip differ diff --git a/dist/switch/.overlays/horizon-oc-overlay.ovl b/dist/switch/.overlays/horizon-oc-overlay.ovl index 8f8e36a6..54b2b141 100644 Binary files a/dist/switch/.overlays/horizon-oc-overlay.ovl and b/dist/switch/.overlays/horizon-oc-overlay.ovl differ