enable boost mode as early as possible during init, and exit boost as late as possible during exit.

This commit is contained in:
ITotalJustice
2025-06-09 12:32:43 +01:00
parent a33d8e1061
commit 6b77cbb0c0
9 changed files with 42 additions and 17 deletions

View File

@@ -192,6 +192,28 @@ public:
}
}
static void SetBoostMode(bool enable, bool force = false) {
static Mutex mutex{};
static int ref_count{};
mutexLock(&mutex);
ON_SCOPE_EXIT(mutexUnlock(&mutex));
if (enable) {
ref_count++;
appletSetCpuBoostMode(ApmCpuBoostMode_FastLoad);
} else {
if (ref_count) {
ref_count--;
}
}
if (!ref_count || force) {
ref_count = 0;
appletSetCpuBoostMode(ApmCpuBoostMode_Normal);
}
}
static auto GetAccountList() -> std::vector<AccountProfileBase> {
std::vector<AccountProfileBase> out;