mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 00:32:46 +00:00
Add 'Limit Maximum Run Speed' setting - set this to 'off' to
get the fastforward_ratio = -1 (no limit) setting again
This commit is contained in:
parent
d029362dd7
commit
aa961dba9e
@ -582,8 +582,11 @@ static const bool savestate_auto_load = false;
|
||||
/* Slowmotion ratio. */
|
||||
static const float slowmotion_ratio = 3.0;
|
||||
|
||||
/* Maximum fast forward ratio (Zero => no limit). */
|
||||
static const float fastforward_ratio = -1.0;
|
||||
/* Maximum fast forward ratio. */
|
||||
static const float fastforward_ratio = 1.0;
|
||||
|
||||
/* Throttle fast forward. */
|
||||
static const bool fastforward_ratio_throttle_enable = false;
|
||||
|
||||
/* Enable stdin/network command interface. */
|
||||
static const bool network_cmd_enable = false;
|
||||
|
@ -159,30 +159,6 @@ int menu_action_setting_fraction(
|
||||
setting->cmd_trigger.triggered = true;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(setting->name, "fastforward_ratio"))
|
||||
{
|
||||
bool clamp_value = false;
|
||||
if (action == MENU_ACTION_START)
|
||||
*setting->value.fraction = setting->default_value.fraction;
|
||||
else if (action == MENU_ACTION_LEFT)
|
||||
{
|
||||
*setting->value.fraction -= setting->step;
|
||||
|
||||
/* Avoid potential rounding errors when going from 1.1 to 1.0. */
|
||||
if (*setting->value.fraction < 0.95f)
|
||||
*setting->value.fraction = setting->default_value.fraction;
|
||||
else
|
||||
clamp_value = true;
|
||||
}
|
||||
else if (action == MENU_ACTION_RIGHT)
|
||||
{
|
||||
*setting->value.fraction += setting->step;
|
||||
clamp_value = true;
|
||||
}
|
||||
if (clamp_value)
|
||||
g_settings.fastforward_ratio =
|
||||
max(min(*setting->value.fraction, setting->max), 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (action)
|
||||
|
@ -382,6 +382,7 @@ struct settings
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
bool fastforward_ratio_throttle_enable;
|
||||
|
||||
bool pause_nonactive;
|
||||
unsigned autosave_interval;
|
||||
|
@ -3184,7 +3184,7 @@ void rarch_main_command(unsigned cmd)
|
||||
|
||||
static inline void do_limit_frame_time(void)
|
||||
{
|
||||
if (g_settings.fastforward_ratio >= 0.0f)
|
||||
if (g_settings.fastforward_ratio_throttle_enable)
|
||||
limit_frame_time();
|
||||
}
|
||||
|
||||
|
@ -622,8 +622,10 @@
|
||||
# The maximum rate at which content will be run when using fast forward. (E.g. 5.0 for 60 fps content => 300 fps cap).
|
||||
# RetroArch will go to sleep to ensure that the maximum rate will not be exceeded.
|
||||
# Do not rely on this cap to be perfectly accurate.
|
||||
# A ratio of zero equals no FPS cap.
|
||||
# fastforward_ratio = 0.0
|
||||
# fastforward_ratio = 1.0
|
||||
|
||||
# Setting this to false equals no FPS cap and will override the fastforward_ratio value.
|
||||
# fastforward_ratio_throttle_enable = false
|
||||
|
||||
# Enable stdin/network command interface.
|
||||
# network_cmd_enable = false
|
||||
|
@ -407,6 +407,7 @@ static void config_set_defaults(void)
|
||||
g_settings.rewind_granularity = rewind_granularity;
|
||||
g_settings.slowmotion_ratio = slowmotion_ratio;
|
||||
g_settings.fastforward_ratio = fastforward_ratio;
|
||||
g_settings.fastforward_ratio_throttle_enable = fastforward_ratio_throttle_enable;
|
||||
g_settings.pause_nonactive = pause_nonactive;
|
||||
g_settings.autosave_interval = autosave_interval;
|
||||
|
||||
@ -1086,6 +1087,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
g_settings.slowmotion_ratio = 1.0f;
|
||||
|
||||
CONFIG_GET_FLOAT(fastforward_ratio, "fastforward_ratio");
|
||||
CONFIG_GET_BOOL(fastforward_ratio_throttle_enable, "fastforward_ratio_throttle_enable");
|
||||
|
||||
CONFIG_GET_BOOL(pause_nonactive, "pause_nonactive");
|
||||
CONFIG_GET_INT(autosave_interval, "autosave_interval");
|
||||
@ -1667,6 +1669,7 @@ bool config_save_file(const char *path)
|
||||
g_settings.savestate_auto_load);
|
||||
|
||||
config_set_float(conf, "fastforward_ratio", g_settings.fastforward_ratio);
|
||||
config_set_bool(conf, "fastforward_ratio_throttle_enable", g_settings.fastforward_ratio_throttle_enable);
|
||||
config_set_float(conf, "slowmotion_ratio", g_settings.slowmotion_ratio);
|
||||
|
||||
config_set_bool(conf, "config_save_on_exit",
|
||||
|
@ -2330,7 +2330,8 @@ rarch_setting_t *setting_data_get_list(void)
|
||||
#endif
|
||||
CONFIG_BOOL(g_settings.video.disable_composition, "video_disable_composition", "Window Compositing Disable", disable_composition, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_CMD(RARCH_CMD_REINIT) WITH_FLAGS(SD_FLAG_CMD_APPLY_AUTO)
|
||||
CONFIG_BOOL(g_settings.pause_nonactive, "pause_nonactive", "Window Unfocus Pause", pause_nonactive, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
CONFIG_FLOAT(g_settings.fastforward_ratio, "fastforward_ratio", "Maximum Run Speed", fastforward_ratio, "%.1fx", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 10, 0.1, true, true)
|
||||
CONFIG_BOOL(g_settings.fastforward_ratio_throttle_enable, "fastforward_ratio_throttle_enable", "Limit Maximum Run Speed", fastforward_ratio_throttle_enable, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
CONFIG_FLOAT(g_settings.fastforward_ratio, "fastforward_ratio", "Maximum Run Speed", fastforward_ratio, "%.1fx", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(1, 10, 0.1, true, true)
|
||||
CONFIG_FLOAT(g_settings.slowmotion_ratio, "slowmotion_ratio", "Slow-Motion Ratio", slowmotion_ratio, "%.1fx", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(1, 10, 1.0, true, true)
|
||||
CONFIG_BOOL(g_settings.savestate_auto_index, "savestate_auto_index", "Save State Auto Index", savestate_auto_index, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
CONFIG_BOOL(g_settings.savestate_auto_save, "savestate_auto_save", "Auto Save State", savestate_auto_save, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
|
Loading…
x
Reference in New Issue
Block a user