LIBRETRO: add consecutive screen updates to auto perf tuner

This commit is contained in:
Giovanni Cascione 2023-04-02 18:44:04 +02:00
parent 7c8cc4df52
commit 4135efbb68
2 changed files with 20 additions and 6 deletions

View File

@ -35,11 +35,12 @@
// Performance switcher
#define PERF_SWITCH_FRAMESKIP_EVENTS REFRESH_RATE * 2
#define PERF_SWITCH_ON (1 << 0)
#define PERF_SWITCH_ENABLE_TIMING_INACCURACIES (1 << 1)
#define PERF_SWITCH_ENABLE_REDUCE_FRAMERATE (1 << 2)
#define PERF_SWITCH_ENABLE_AUTO_FRAMESKIP (1 << 3)
#define PERF_SWITCH_OVER (1 << 4)
#define PERF_SWITCH_ON (1 << 0)
#define PERF_SWITCH_ENABLE_TIMING_INACCURACIES (1 << 1)
#define PERF_SWITCH_ENABLE_REDUCE_FRAMERATE (1 << 2)
#define PERF_SWITCH_ENABLE_AUTO_FRAMESKIP (1 << 3)
#define PERF_SWITCH_DISABLE_CONSECUTIVE_SCREEN_UPDATES (1 << 4)
#define PERF_SWITCH_OVER (1 << 5)
// Reduce framerate
#define REDUCE_FRAMERATE_TAIL REFRESH_RATE / 2

View File

@ -154,6 +154,16 @@ static void increase_performance() {
retro_msg.duration = 3000;
retro_msg.msg = "";
if (!(performance_switch & PERF_SWITCH_DISABLE_CONSECUTIVE_SCREEN_UPDATES)) {
performance_switch |= PERF_SWITCH_DISABLE_CONSECUTIVE_SCREEN_UPDATES;
if (consecutive_screen_updates) {
retro_msg.msg = "Auto performance tuner: 'Show consecutive screen updates' disabled";
log_cb(RETRO_LOG_INFO, "Auto performance tuner: 'Show consecutive screen updates' disabled.\n");
environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &retro_msg);
return;
}
}
if (!(performance_switch & PERF_SWITCH_ENABLE_TIMING_INACCURACIES)) {
performance_switch |= PERF_SWITCH_ENABLE_TIMING_INACCURACIES;
if (!timing_inaccuracies_enabled) {
@ -336,7 +346,10 @@ bool timing_inaccuracies_is_enabled(){
}
bool consecutive_screen_updates_is_enabled(){
return consecutive_screen_updates;
if (performance_switch & PERF_SWITCH_ON)
return !(performance_switch & PERF_SWITCH_DISABLE_CONSECUTIVE_SCREEN_UPDATES);
else
return consecutive_screen_updates;
}
void parse_command_params(char *cmdline) {