Merge pull request #17783 from pstef/switch-performance-profiles

This commit is contained in:
LibretroAdmin 2025-04-08 18:44:20 -07:00 committed by GitHub
commit b5424e7448
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 34 deletions

View File

@ -76,6 +76,37 @@ static enum frontend_fork switch_fork_mode = FRONTEND_FORK_NONE;
bool platform_switch_has_focus = true;
#ifdef HAVE_LIBNX
char *SWITCH_CPU_PROFILES[] = {
"Maximum Performance",
"High Performance",
"Boost Performance",
"Stock Performance",
"Powersaving Mode 1",
"Powersaving Mode 2",
"Powersaving Mode 3",
NULL
};
char *SWITCH_CPU_SPEEDS[] = {
"1785 MHz",
"1581 MHz",
"1224 MHz",
"1020 MHz",
"918 MHz",
"816 MHz",
"714 MHz",
NULL
};
unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
1785000000,
1581000000,
1224000000,
1020000000,
918000000,
816000000,
714000000,
0
};
static bool psmInitialized = false;
static AppletHookCookie applet_hook_cookie;
@ -87,7 +118,7 @@ extern bool nxlink_connected;
void libnx_apply_overclock(void)
{
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)
/ sizeof(SWITCH_CPU_PROFILES[1]);
/ sizeof(SWITCH_CPU_PROFILES[1]) - 1;
settings_t *settings = config_get_ptr();
unsigned libnx_overclock = settings->uints.libnx_overclock;

View File

@ -12855,7 +12855,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
size_t _len;
unsigned i;
char text[128];
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
/* TODO/FIXME - localize */
runloop_msg_queue_push(
"Warning : extended overclocking can damage the Switch",
@ -12882,7 +12881,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
0, 0, NULL))
count++;
for (i = 0; i < profiles_count; i++)
for (i = 0; SWITCH_CPU_PROFILES[i]; i++)
{
char title[NAME_MAX_LENGTH];
size_t _len = strlcpy(title, SWITCH_CPU_PROFILES[i],

View File

@ -19,38 +19,10 @@
#if defined(HAVE_LIBNX)
static char *SWITCH_CPU_PROFILES[] = {
"Maximum Performance",
"High Performance",
"Boost Performance",
"Stock Performance",
"Powersaving Mode 1",
"Powersaving Mode 2",
"Powersaving Mode 3",
};
extern char *SWITCH_CPU_PROFILES[];
extern char *SWITCH_CPU_SPEEDS[];
extern unsigned SWITCH_CPU_SPEEDS_VALUES[];
#define SWITCH_DEFAULT_CPU_PROFILE 3 /* Stock Performance */
#define LIBNX_MAX_CPU_PROFILE 0 /* Max Performance */
static char *SWITCH_CPU_SPEEDS[] = {
"1785 MHz",
"1581 MHz",
"1224 MHz",
"1020 MHz",
"918 MHz",
"816 MHz",
"714 MHz"
};
static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
1785000000,
1581000000,
1224000000,
1020000000,
918000000,
816000000,
714000000
};
#endif