From f20c8493b3205f05f7caa38a83444d26c3f73ad3 Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Fri, 10 Nov 2023 02:36:19 +0200 Subject: [PATCH] Use video refresh rate for menu frame limiting (#15886) --- runloop.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runloop.c b/runloop.c index e4e325becb2d..79d57d8dc592 100644 --- a/runloop.c +++ b/runloop.c @@ -6947,9 +6947,14 @@ int runloop_iterate(void) #endif #endif #ifdef HAVE_MENU - /* Always run menu in 1x speed. */ + /* Always run menu in video refresh rate speed. */ if (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE) - runloop_set_frame_limit(&video_st->av_info, 1.0f); + { + float refresh_rate = video_driver_get_refresh_rate(); + + runloop_st->frame_limit_minimum_time = (retro_time_t) + roundf(1000000.0f / ((refresh_rate) ? refresh_rate : settings->floats.video_refresh_rate)); + } else runloop_set_frame_limit(&video_st->av_info, settings->floats.fastforward_ratio); #endif