From 220caa514391caf01f689e2ccac956407fb8c0b7 Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:58:47 +0200 Subject: [PATCH] Remove menu_throttle_framerate option (#15850) --- configuration.c | 1 - configuration.h | 2 -- intl/msg_hash_lbl.h | 8 -------- menu/cbs/menu_cbs_sublabel.c | 4 ---- menu/drivers/ozone.c | 1 - menu/drivers/xmb.c | 1 - menu/menu_displaylist.c | 1 - menu/menu_driver.c | 29 ++++++++++++++--------------- menu/menu_setting.c | 16 ---------------- msg_hash.h | 3 +-- runloop.c | 24 ++++++++---------------- runloop.h | 7 +++---- 12 files changed, 26 insertions(+), 71 deletions(-) diff --git a/configuration.c b/configuration.c index 89d32b5bb103..89e9fe44f791 100644 --- a/configuration.c +++ b/configuration.c @@ -1863,7 +1863,6 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false); SETTING_BOOL("menu_disable_info_button", &settings->bools.menu_disable_info_button, true, false, false); SETTING_BOOL("menu_disable_search_button", &settings->bools.menu_disable_search_button, true, false, false); - SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false); SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, DEFAULT_VIDEO_SMOOTH, false); SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false); SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false); diff --git a/configuration.h b/configuration.h index efbdb2ac5f58..0a8613b5319e 100644 --- a/configuration.h +++ b/configuration.h @@ -706,13 +706,11 @@ typedef struct settings bool menu_core_enable; bool menu_show_sublabels; bool menu_dynamic_wallpaper_enable; - bool menu_throttle; bool menu_mouse_enable; bool menu_pointer_enable; bool menu_navigation_wraparound_enable; bool menu_navigation_browser_filter_supported_extensions_enable; bool menu_show_advanced_settings; - bool menu_throttle_framerate; bool menu_linear_filter; bool menu_horizontal_animation; bool menu_scroll_fast; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 7dec64a687f5..b0dedb079542 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -2303,10 +2303,6 @@ MSG_HASH( MENU_ENUM_LABEL_MENU_DRIVER_XMB, "xmb" ) -MSG_HASH( - MENU_ENUM_LABEL_MENU_ENUM_THROTTLE_FRAMERATE, - "menu_throttle_framerate" - ) MSG_HASH( MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS, "menu_file_browser_settings" @@ -4748,10 +4744,6 @@ MSG_HASH( MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS, "deferred_rpl_entry_actions" ) -MSG_HASH( - MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE, - "menu_throttle_framerate" - ) MSG_HASH( MENU_ENUM_LABEL_OVERLAY_SETTINGS, "overlay_settings" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 3340d1698143..6a534fbd7ae4 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -1009,7 +1009,6 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_disk_tray_eject, DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_disk_tray_insert, MENU_ENUM_SUBLABEL_DISK_TRAY_INSERT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_disk_index, MENU_ENUM_SUBLABEL_DISK_INDEX) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_disk_options, MENU_ENUM_SUBLABEL_DISK_OPTIONS) -DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_throttle_framerate, MENU_ENUM_SUBLABEL_MENU_ENUM_THROTTLE_FRAMERATE) #ifdef HAVE_XMB DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_layout, MENU_ENUM_SUBLABEL_XMB_LAYOUT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_icon_theme, MENU_ENUM_SUBLABEL_XMB_THEME) @@ -3151,9 +3150,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_switch_icons); #endif break; - case MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE: - BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_throttle_framerate); - break; case MENU_ENUM_LABEL_DISK_IMAGE_APPEND: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_disk_image_append); break; diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index a56e666a36da..4475516fe4e0 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -1980,7 +1980,6 @@ static uintptr_t ozone_entries_icon_get_texture( case MENU_ENUM_LABEL_LATENCY_SETTINGS: case MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY: case MENU_ENUM_LABEL_SETTINGS_SHOW_LATENCY: - case MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE: case MENU_ENUM_LABEL_VIDEO_FRAME_REST: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_LATENCY]; case MENU_ENUM_LABEL_SAVING_SETTINGS: diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index e6a9ee532f13..234f8c69d589 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -3182,7 +3182,6 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, case MENU_ENUM_LABEL_LATENCY_SETTINGS: case MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY: case MENU_ENUM_LABEL_SETTINGS_SHOW_LATENCY: - case MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE: case MENU_ENUM_LABEL_VIDEO_FRAME_REST: return xmb->textures.list[XMB_TEXTURE_LATENCY]; case MENU_ENUM_LABEL_SAVING_SETTINGS: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b9ea8ec18de6..95e572fdbeef 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -10917,7 +10917,6 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_FASTFORWARD_FRAMESKIP, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_SLOWMOTION_RATIO, PARSE_ONLY_FLOAT, true}, {MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE, PARSE_ONLY_BOOL, true}, - {MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_VIDEO_FRAME_REST, PARSE_ONLY_BOOL, true}, }; diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 1a666289e755..d816b65c5341 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -6266,7 +6266,7 @@ void menu_driver_toggle( runloop_state_t *runloop_st = runloop_state_get_ptr(); struct menu_state *menu_st = &menu_driver_state; bool runloop_shutdown_initiated = (runloop_st->flags & - RUNLOOP_FLAG_SHUTDOWN_INITIATED) ? true : false; + RUNLOOP_FLAG_SHUTDOWN_INITIATED) ? true : false; #ifdef HAVE_OVERLAY bool input_overlay_hide_in_menu = false; bool input_overlay_enable = false; @@ -6277,7 +6277,7 @@ void menu_driver_toggle( { #ifdef HAVE_NETWORKING pause_libretro = settings->bools.menu_pause_libretro && - netplay_driver_ctl(RARCH_NETPLAY_CTL_ALLOW_PAUSE, NULL); + netplay_driver_ctl(RARCH_NETPLAY_CTL_ALLOW_PAUSE, NULL); #else pause_libretro = settings->bools.menu_pause_libretro; #endif @@ -6285,7 +6285,6 @@ void menu_driver_toggle( input_overlay_hide_in_menu = settings->bools.input_overlay_hide_in_menu; input_overlay_enable = settings->bools.input_overlay_enable; #endif - video_adaptive_vsync = settings->bools.video_adaptive_vsync; } if (on) @@ -6329,18 +6328,18 @@ void menu_driver_toggle( IMEnableDim(); #endif - menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH; - - /* Menu should always run with vsync on and - * a video swap interval of 1 */ - if (current_video->set_nonblock_state) - current_video->set_nonblock_state( - video_driver_data, - false, - video_driver_test_all_flags(GFX_CTX_FLAGS_ADAPTIVE_VSYNC) && - video_adaptive_vsync, - 1 - ); + menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH; + + /* Always disable FF & SM when entering menu. */ + runloop_st->flags &= ~RUNLOOP_FLAG_FASTMOTION; + runloop_st->flags &= ~RUNLOOP_FLAG_SLOWMOTION; +#if defined(HAVE_GFX_WIDGETS) + video_state_get_ptr()->flags &= ~VIDEO_FLAG_WIDGETS_FAST_FORWARD; + video_state_get_ptr()->flags &= ~VIDEO_FLAG_WIDGETS_REWINDING; +#endif + input_state_get_ptr()->flags &= ~INP_FLAG_NONBLOCKING; + driver_set_nonblock_state(); + /* Stop all rumbling before entering the menu. */ command_event(CMD_EVENT_RUMBLE_STOP, NULL); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 0313d71ddccf..0b9cac7fef0f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -15636,22 +15636,6 @@ static bool setting_append_list( menu_settings_list_current_add_range(list, list_info, 0, 4, 1, true, true); #endif - CONFIG_BOOL( - list, list_info, - &settings->bools.menu_throttle_framerate, - MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE, - MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, - true, - MENU_ENUM_LABEL_VALUE_OFF, - MENU_ENUM_LABEL_VALUE_ON, - &group_info, - &subgroup_info, - parent_group, - general_write_handler, - general_read_handler, - SD_FLAG_ADVANCED - ); - END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); break; diff --git a/msg_hash.h b/msg_hash.h index fc81cb35b7c6..02a092fd3124 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1668,7 +1668,6 @@ enum msg_hash_enums MENU_LABEL(ADD_TO_FAVORITES_PLAYLIST), MENU_LABEL(SET_CORE_ASSOCIATION), MENU_LABEL(RESET_CORE_ASSOCIATION), - MENU_LABEL(MENU_THROTTLE_FRAMERATE), MENU_LABEL(NO_ACHIEVEMENTS_TO_DISPLAY), MENU_LABEL(NOT_LOGGED_IN), @@ -1739,7 +1738,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_CONNECT_NETPLAY_LAN, MENU_LABEL(MENU_ENUM_LINEAR_FILTER), - MENU_LABEL(MENU_ENUM_THROTTLE_FRAMERATE), + MENU_LABEL(MENU_ENUM_THROTTLE_FRAMERATE), /* deprecated */ MENU_LABEL(STATE_SLOT), MENU_ENUM_LABEL_PLAYLIST_SETTINGS_BEGIN, diff --git a/runloop.c b/runloop.c index 98976d2e0bec..e8e75ed0f5cf 100644 --- a/runloop.c +++ b/runloop.c @@ -6201,15 +6201,7 @@ static enum runloop_state_enum runloop_check_state( #ifdef HAVE_MENU /* Stop checking the rest of the hotkeys if menu is alive */ if (menu_st->flags & MENU_ST_FLAG_ALIVE) - { - float fastforward_ratio = runloop_get_fastforward_ratio(settings, - &runloop_st->fastmotion_override.current); - - if (!settings->bools.menu_throttle_framerate && !fastforward_ratio) - return RUNLOOP_STATE_MENU_ITERATE; - return RUNLOOP_STATE_END; - } #endif #ifdef HAVE_NETWORKING @@ -6954,13 +6946,14 @@ int runloop_iterate(void) netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL); #endif #endif - goto end; - case RUNLOOP_STATE_MENU_ITERATE: -#ifdef HAVE_NETWORKING - /* FIXME: This is an ugly way to tell Netplay this... */ - netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL); +#ifdef HAVE_MENU + /* Always run menu in 1x speed. */ + if (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE) + runloop_set_frame_limit(&video_st->av_info, 1.0f); + else + runloop_set_frame_limit(&video_st->av_info, settings->floats.fastforward_ratio); #endif - return 0; + goto end; case RUNLOOP_STATE_ITERATE: runloop_st->flags |= RUNLOOP_FLAG_CORE_RUNNING; break; @@ -7259,8 +7252,7 @@ int runloop_iterate(void) runloop_get_fastforward_ratio(settings, &runloop_st->fastmotion_override.current)); else - runloop_set_frame_limit(&video_st->av_info, - 1.0f); + runloop_set_frame_limit(&video_st->av_info, 1.0f); } /* if there's a fast forward limit, inject sleeps to keep from going too fast. */ diff --git a/runloop.h b/runloop.h index ddcb7464dcda..9a8db87ed06c 100644 --- a/runloop.h +++ b/runloop.h @@ -76,11 +76,10 @@ */ #define RUNLOOP_TIME_TO_EXIT(quit_key_pressed) ((runloop_state.flags & RUNLOOP_FLAG_SHUTDOWN_INITIATED) || quit_key_pressed || !is_alive BSV_MOVIE_IS_EOF() || ((runloop_state.max_frames != 0) && (frame_count >= runloop_state.max_frames)) || runloop_exec) -enum runloop_state_enum +enum runloop_state_enum { RUNLOOP_STATE_ITERATE = 0, RUNLOOP_STATE_POLLED_AND_SLEEP, - RUNLOOP_STATE_MENU_ITERATE, RUNLOOP_STATE_PAUSE, RUNLOOP_STATE_END, RUNLOOP_STATE_QUIT @@ -363,7 +362,7 @@ bool libretro_get_system_info( bool *load_no_content); void runloop_performance_counter_register( - struct retro_perf_counter *perf); + struct retro_perf_counter *perf); void runloop_runtime_log_deinit( runloop_state_t *runloop_st, @@ -452,7 +451,7 @@ void runloop_path_deinit_subsystem(void); * @return true on success, or false if symbols could not be loaded. **/ bool runloop_init_libretro_symbols( - void *data, + void *data, enum rarch_core_type type, struct retro_core_t *current_core, const char *lib_path,