Skip to content

Commit

Permalink
Remove menu_throttle_framerate option (#15850)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Oct 31, 2023
1 parent 3167529 commit 220caa5
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 71 deletions.
1 change: 0 additions & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions menu/cbs/menu_cbs_sublabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion menu/drivers/ozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion menu/drivers/xmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down
29 changes: 14 additions & 15 deletions menu/menu_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -6277,15 +6277,14 @@ 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
#ifdef HAVE_OVERLAY
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)
Expand Down Expand Up @@ -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);

Expand Down
16 changes: 0 additions & 16 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
24 changes: 8 additions & 16 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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. */
Expand Down
7 changes: 3 additions & 4 deletions runloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 220caa5

Please sign in to comment.