Add hotkey for toggling sync to exact content framerate (#13725)

* Add hotkey for toggling sync to exact content framerate

* CHANGES.md: add sync to exact content framerate toggle hotkey
This commit is contained in:
Nikos Chantziaras 2022-03-10 18:21:08 +02:00 committed by GitHub
parent 53bd6908e1
commit b094c58081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 67 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Future
- IOS/IOS13+: Support a toolbar that allows toggling of onscreen keyboard and touch mouse
- LOCALIZATION: Add Czech language support
- HOTKEYS: Added hotkey for toggling sync to exact content framerate
# 1.10.1
- ANDROID: Add `HAVE_LANGEXTRA` back to makefile

View File

@ -74,6 +74,7 @@ enum event_command
CMD_EVENT_RESET,
CMD_EVENT_SET_PER_GAME_RESOLUTION,
CMD_EVENT_SET_FRAME_LIMIT,
CMD_EVENT_VRR_RUNLOOP_TOGGLE,
/* Loads core. */
CMD_EVENT_LOAD_CORE,
CMD_EVENT_LOAD_CORE_PERSIST,
@ -442,6 +443,7 @@ static const struct cmd_map map[] = {
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
{ "SLOWMOTION", RARCH_SLOWMOTION_KEY },
{ "SLOWMOTION_HOLD", RARCH_SLOWMOTION_HOLD_KEY },
{ "VRR_RUNLOOP_TOGGLE", RARCH_VRR_RUNLOOP_TOGGLE },
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },

View File

@ -304,6 +304,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_SLOWMOTION_HOLD_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE, RETROK_UNKNOWN,
RARCH_VRR_RUNLOOP_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -886,6 +893,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_SLOWMOTION_HOLD_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE, RETROK_UNKNOWN,
RARCH_VRR_RUNLOOP_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -1468,6 +1482,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_SLOWMOTION_HOLD_KEY, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE, RETROK_UNKNOWN,
RARCH_VRR_RUNLOOP_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,

View File

@ -308,6 +308,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY),
DECLARE_META_BIND(1, toggle_slowmotion, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY),
DECLARE_META_BIND(2, hold_slowmotion, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY),
DECLARE_META_BIND(2, toggle_vrr_runloop, RARCH_VRR_RUNLOOP_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE),
DECLARE_META_BIND(1, load_state, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY),
DECLARE_META_BIND(1, save_state, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY),
DECLARE_META_BIND(2, toggle_fullscreen, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY),

View File

@ -78,6 +78,7 @@ enum
RARCH_FAST_FORWARD_HOLD_KEY,
RARCH_SLOWMOTION_KEY,
RARCH_SLOWMOTION_HOLD_KEY,
RARCH_VRR_RUNLOOP_TOGGLE,
RARCH_LOAD_STATE_KEY,
RARCH_SAVE_STATE_KEY,
RARCH_FULLSCREEN_TOGGLE_KEY,

View File

@ -67,6 +67,10 @@ int msg_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
snprintf(s, len,
"Hold for slowmotion.");
break;
case RARCH_VRR_RUNLOOP_TOGGLE:
snprintf(s, len,
"Toggle exact content framerate sync.");
break;
case RARCH_PAUSE_TOGGLE:
snprintf(s, len,
"Toggle between paused and non-paused state.");

View File

@ -2556,6 +2556,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_SLOWMOTION_HOLD_KEY,
"Enables slow-motion when held. Content runs at normal speed when key is released."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE,
"Sync to Exact Content Framerate (Toggle)"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_VRR_RUNLOOP_TOGGLE,
"Toggles sync to exact content framerate on/off."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY,
"Load State"
@ -12640,6 +12648,14 @@ MSG_HASH(
MSG_FAILED_TO_ENTER_GAMEMODE_LINUX,
"Failed to enter GameMode - ensure GameMode daemon is installed/running"
)
MSG_HASH(
MSG_VRR_RUNLOOP_ENABLED,
"Sync to exact content framerate enabled."
)
MSG_HASH(
MSG_VRR_RUNLOOP_DISABLED,
"Sync to exact content framerate disabled."
)
/* Lakka */

View File

@ -366,6 +366,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_fast_forward_key, ME
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_fast_forward_hold_key, MENU_ENUM_SUBLABEL_INPUT_META_FAST_FORWARD_HOLD_KEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_slowmotion_key, MENU_ENUM_SUBLABEL_INPUT_META_SLOWMOTION_KEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_slowmotion_hold_key, MENU_ENUM_SUBLABEL_INPUT_META_SLOWMOTION_HOLD_KEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_vrr_runloop_toggle, MENU_ENUM_SUBLABEL_INPUT_META_VRR_RUNLOOP_TOGGLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_load_state_key, MENU_ENUM_SUBLABEL_INPUT_META_LOAD_STATE_KEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_save_state_key, MENU_ENUM_SUBLABEL_INPUT_META_SAVE_STATE_KEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_fullscreen_toggle_key, MENU_ENUM_SUBLABEL_INPUT_META_FULLSCREEN_TOGGLE_KEY)
@ -1935,6 +1936,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case RARCH_SLOWMOTION_HOLD_KEY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_slowmotion_hold_key);
return 0;
case RARCH_VRR_RUNLOOP_TOGGLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_vrr_runloop_toggle);
return 0;
case RARCH_LOAD_STATE_KEY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_load_state_key);
return 0;

View File

@ -511,6 +511,8 @@ enum msg_hash_enums
MSG_FOUND_ENTRY_STATE_IN,
MSG_FAILED_TO_ENTER_GAMEMODE,
MSG_FAILED_TO_ENTER_GAMEMODE_LINUX,
MSG_VRR_RUNLOOP_ENABLED,
MSG_VRR_RUNLOOP_DISABLED,
MSG_IOS_TOUCH_MOUSE_ENABLED,
MSG_IOS_TOUCH_MOUSE_DISABLED,
@ -872,6 +874,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE,
MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,
@ -932,6 +935,7 @@ enum msg_hash_enums
MENU_ENUM_SUBLABEL_INPUT_META_FAST_FORWARD_HOLD_KEY,
MENU_ENUM_SUBLABEL_INPUT_META_SLOWMOTION_KEY,
MENU_ENUM_SUBLABEL_INPUT_META_SLOWMOTION_HOLD_KEY,
MENU_ENUM_SUBLABEL_INPUT_META_VRR_RUNLOOP_TOGGLE,
MENU_ENUM_SUBLABEL_INPUT_META_LOAD_STATE_KEY,
MENU_ENUM_SUBLABEL_INPUT_META_SAVE_STATE_KEY,
MENU_ENUM_SUBLABEL_INPUT_META_FULLSCREEN_TOGGLE_KEY,

View File

@ -3414,6 +3414,14 @@ bool command_event(enum event_command cmd, void *data)
settings->uints.input_max_users);
}
break;
case CMD_EVENT_VRR_RUNLOOP_TOGGLE:
settings->bools.vrr_runloop_enable = !(settings->bools.vrr_runloop_enable);
runloop_msg_queue_push(
msg_hash_to_str(
settings->bools.vrr_runloop_enable ? MSG_VRR_RUNLOOP_ENABLED
: MSG_VRR_RUNLOOP_DISABLED),
1, 100, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
break;
case CMD_EVENT_NONE:
return false;
}

View File

@ -610,6 +610,9 @@
# Hold for slowmotion.
# input_slowmotion = e
# Toggles sync to exact content framerate.
# input_toggle_vrr_runloop =
# Enable other hotkeys.
# If this hotkey is bound to either keyboard, joybutton or joyaxis,
# all other hotkeys will be disabled unless this hotkey is also held at the same time.

View File

@ -7249,6 +7249,8 @@ static enum runloop_state_enum runloop_check_state(
}
}
HOTKEY_CHECK(RARCH_VRR_RUNLOOP_TOGGLE, CMD_EVENT_VRR_RUNLOOP_TOGGLE, true, NULL);
/* Check movie record toggle */
HOTKEY_CHECK(RARCH_BSV_RECORD_TOGGLE, CMD_EVENT_BSV_RECORDING_TOGGLE, true, NULL);