- Sys-clk Fix: "Do not override" in overlay now works as intended

- Sys-clk Fix: Now you can completely disable ReverseNX profile syncing by removing "ReverseNX_sync.flag"
This commit is contained in:
KazushiM
2021-08-31 23:24:17 +08:00
parent 2724faf980
commit de9f7b7478
7 changed files with 48 additions and 25 deletions

View File

@@ -1,8 +1,6 @@
# Switch OC Suite
Overclocking suite for Switch **(Mariko Only)** running on Atmosphere CFW.
Support latest Horizon OS (12.1.0) and Atmosphere (0.20.0).
Overclocking suite for Switch **(Mariko Only)** running on Atmosphere CFW. Support Horizon OS 12.1.0.
@@ -38,7 +36,7 @@ Support latest Horizon OS (12.1.0) and Atmosphere (0.20.0).
- Choose RAM clock with care, or your eMMC filesystem will be **corrupted**.
- Once RAM overvolting is available on Mariko, we may gain more stability and reach higher clock.
- Mariko variants have much lower power consumption compared to Erista, therefore **GPU clock capping is lifted for Mariko**.
- For more info, see README.md in sys-clk-OC.
- For more info, see [README.md](https://github.com/KazushiMe/Switch-OC-Suite/tree/master/Source/sys-clk-OC) in sys-clk-OC.
- **Auto-Boost CPU for faster game loading**
- When a game launches or is in loading screen, sys-clk will boost CPU to 1963.5 MHz (w/o charger) and 2295.0 MHz (with charger) for 20 seconds or until the loading screen ends.
- Some games don't utilize `SetCpuBoostMode` at all, e.g. Overcooked 2, so Auto-Boost will be unavailable to these games.
@@ -46,8 +44,8 @@ Support latest Horizon OS (12.1.0) and Atmosphere (0.20.0).
- **Fan Control Optimization** at high load
- Higher tolerable temperature and smoother fan curve. Set `holdable_tskin` to 56˚C. Previously it's set to 48˚C, so by default the fan would go crazy (80~100%) easily with a slight degree of OC.
- **Modded sys-clk and ReverseNX**(-Tools and -RT), **no need to change clocks manually** after toggling modes in ReverseNX
- Add `/config/sys-clk/downclock_dock.flag` to use handheld(lower GPU) clocks in Docked mode when Handheld mode is set in ReverseNX.
- To **disable this feature**, simply use original version of ReverseNX rather than the one in the repo.
- Add `/config/sys-clk/downclock_dock.flag` to use handheld clocks in Docked mode when Handheld mode is set in ReverseNX.
- To **disable this feature**, use original version of ReverseNX and delete `/config/sys-clk/ReverseNX_sync.flag`.
- Disable background services, less heat and power consumption in standby mode
- **Remove** the "Disable Background service" part in `/atmosphere/config/system_settings.ini` if you **use Nintendo Online services**.
- Profile-aware clock override for all games
@@ -98,7 +96,7 @@ Support latest Horizon OS (12.1.0) and Atmosphere (0.20.0).
1. Make sure you are running targeted HOS (12.1.0), and have `prod.keys` *with latest master key (0b)* dumped by [Lockpick_RCM](https://github.com/shchmue/Lockpick_RCM).
2. Loader patches for Atmosphere: Grab from the web and apply. I won't provide them here. (Or build AMS with `ValidateAcidSignature()` stubbed.)
3. Place all the files in `SdOut` into SD card.
**See [Details](#details) sections for more info.**
**See [Details](#details) section for more info.**
- Be careful of `/atmosphere/config/system_settings.ini`, **you may want to edit it manually.**
- Remove all the files in previous OC Suite version before updating to avoid conflicts.
4. Dump your pcv module.

View File

View File

@@ -356,7 +356,7 @@ bool ClockManager::RefreshContext()
this->context->applicationId = applicationId;
hasChanged = true;
if (FileUtils::IsReverseNXEnabled() || recheckReverseNX)
if (FileUtils::IsReverseNXSyncEnabled() && (FileUtils::IsReverseNXToolExist() || recheckReverseNX))
{
// A new game starts or the real profile changes, then we need to check if ReverseNXTool patches are applied
isEnabledReverseNX = false;
@@ -379,7 +379,7 @@ bool ClockManager::RefreshContext()
}
}
if (!tickCheckReverseNXRT || recheckReverseNX)
if (FileUtils::IsReverseNXSyncEnabled() && (!tickCheckReverseNXRT || recheckReverseNX))
{
uint8_t flag = 0;
checkReverseNXRT(recheckReverseNX, &flag);

View File

@@ -84,6 +84,7 @@ bool Config::Refresh()
if (!this->loaded || this->mtime != this->CheckModificationTime())
{
this->Load();
Clocks::ResetToStock(); // Reset to stock since we can't detect if user set "Do not override" for specific module
return true;
}
return false;

View File

@@ -21,7 +21,8 @@ static bool g_log_enabled = false;
static bool g_boost_enabled = false;
static bool g_boost_start_enabled = false;
static bool g_downclock_dock_enabled = false;
static bool g_reversenx_enabled = false;
static bool g_reversenx_tool_exist = false;
static bool g_reversenx_sync_enabled = false;
static std::uint64_t g_last_flag_check = 0;
extern "C" void __libnx_init_time(void);
@@ -131,6 +132,12 @@ void FileUtils::RefreshFlags(bool force)
g_log_enabled = false;
}
g_last_flag_check = now;
}
void FileUtils::InitCheckFlags()
{
FILE *file;
// Only Enable Boost for Mariko
if (Clocks::isMariko)
{
@@ -162,7 +169,23 @@ void FileUtils::RefreshFlags(bool force)
g_downclock_dock_enabled = false;
}
g_last_flag_check = now;
file = fopen(FILE_REVERSENX_SYNC_FLAG_PATH, "r");
if (file)
{
g_reversenx_sync_enabled = true;
fclose(file);
} else {
g_reversenx_sync_enabled = false;
}
file = fopen(FILE_SALTYNX_PATH, "r");
if (file)
{
g_reversenx_tool_exist = true;
fclose(file);
} else {
g_reversenx_tool_exist = false;
}
}
bool FileUtils::IsBoostEnabled()
@@ -180,6 +203,16 @@ bool FileUtils::IsDownclockDockEnabled()
return g_downclock_dock_enabled;
}
bool FileUtils::IsReverseNXToolExist()
{
return g_reversenx_tool_exist;
}
bool FileUtils::IsReverseNXSyncEnabled()
{
return g_reversenx_sync_enabled;
}
void FileUtils::InitializeAsync()
{
Thread initThread = {0};
@@ -216,23 +249,11 @@ Result FileUtils::Initialize()
FileUtils::LogLine("=== " TARGET " " TARGET_VERSION " ===");
}
FILE *file = fopen(FILE_SALTYNX_PATH, "r");
if (file)
{
g_reversenx_enabled = true;
fclose(file);
} else {
g_reversenx_enabled = false;
}
FileUtils::InitCheckFlags();
return rc;
}
bool FileUtils::IsReverseNXEnabled()
{
return g_reversenx_enabled;
}
void FileUtils::Exit()
{
if (!g_has_initialized)

View File

@@ -26,6 +26,7 @@
#define FILE_BOOST_START_FLAG_PATH FILE_CONFIG_DIR "/boost_start.flag"
#define FILE_DOWNCLOCK_DOCK_FLAG_PATH FILE_CONFIG_DIR "/downclock_dock.flag"
#define FILE_SALTYNX_PATH "/atmosphere/contents/0000000000534C56/flags/boot2.flag" // Just check for SaltyNX boot flag
#define FILE_REVERSENX_SYNC_FLAG_PATH FILE_CONFIG_DIR "/ReverseNX_sync.flag"
#define FILE_REVERSENX_RT_CONF_PATH FILE_CONFIG_DIR "/ReverseNX-RT.conf"
class FileUtils
@@ -38,10 +39,12 @@ class FileUtils
static bool IsBoostEnabled();
static bool IsBoostStartEnabled();
static bool IsDownclockDockEnabled();
static bool IsReverseNXEnabled();
static bool IsReverseNXSyncEnabled();
static bool IsReverseNXToolExist();
static void InitializeAsync();
static void LogLine(const char *format, ...);
static void WriteContextToCsv(const SysClkContext* context);
protected:
static void RefreshFlags(bool force);
static void InitCheckFlags();
};