diff --git a/Source/sys-clk/common/include/memmem.h b/Source/sys-clk/common/include/memmem.h index 0c04ae4e..a9ff28d8 100644 --- a/Source/sys-clk/common/include/memmem.h +++ b/Source/sys-clk/common/include/memmem.h @@ -1,3 +1,27 @@ +/* + MIT License + + Copyright (c) 2024 Roy Merkel + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + #ifndef MEMMEM_IMPL_H #define MEMMEM_IMPL_H diff --git a/Source/sys-clk/common/src/memmem.c b/Source/sys-clk/common/src/memmem.c index 4530609b..53cf0b8a 100644 --- a/Source/sys-clk/common/src/memmem.c +++ b/Source/sys-clk/common/src/memmem.c @@ -1,3 +1,27 @@ +/* + MIT License + + Copyright (c) 2024 Roy Merkel + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + #include "memmem.h" void *memmem_impl(void *haystack, size_t haystacklen, const void *needle, size_t needlelen) diff --git a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp index cd769383..67a57ad0 100644 --- a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp @@ -155,7 +155,7 @@ void FreqChoiceGui::listUI() if (IsMariko()) { - unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2296 : 1963; + unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2296 : 1964; if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) { unsafe_gpu = 1076; } else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) { diff --git a/Source/sys-clk/sysmodule/src/clock_manager.cpp b/Source/sys-clk/sysmodule/src/clock_manager.cpp index 81dc7ef7..bcdaab03 100644 --- a/Source/sys-clk/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk/sysmodule/src/clock_manager.cpp @@ -578,7 +578,6 @@ void ClockManager::Tick() if(module == SysClkModule_MEM && Board::GetSocType() == SysClkSocType_Mariko && targetHz < oldHz && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) { Board::PcvHijackDvfs(0); - // I2c_BuckConverter_SetMvOut(&I2c_Mariko_GPU, 0); targetHz = this->context->overrideFreqs[SysClkModule_GPU]; if (!targetHz) @@ -691,6 +690,21 @@ bool ClockManager::RefreshContext() if (Board::GetSocType() == SysClkSocType_Mariko && this->config->GetConfigValue(HorizonOCConfigValue_DVFSMode) == DVFSMode_Hijack) { Board::PcvHijackDvfs(0); + + u32 targetHz = this->context->overrideFreqs[SysClkModule_GPU]; + if (!targetHz) + { + targetHz = this->config->GetAutoClockHz(this->context->applicationId, SysClkModule_GPU, this->context->profile, false); + if(!targetHz) + targetHz = this->config->GetAutoClockHz(GLOBAL_PROFILE_ID, SysClkModule_GPU, this->context->profile, false); + } + if(targetHz) { + Board::SetHz(SysClkModule_GPU, ~0); + Board::SetHz(SysClkModule_GPU, targetHz); + } else { + Board::SetHz(SysClkModule_GPU, ~0); + Board::ResetToStockGpu(); + } } break;