Input latency configurability.

This commit is contained in:
Gregor Richards 2017-01-19 13:27:52 -05:00
parent 55157e934d
commit 4ff8982355
6 changed files with 72 additions and 1 deletions

View File

@ -581,6 +581,10 @@ MSG_HASH(MENU_ENUM_LABEL_NETPLAY_CHECK_FRAMES,
"netplay_check_frames")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_CLIENT_SWAP_INPUT,
"netplay_client_swap_input")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
"netplay_input_latency_frames_min")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
"netplay_input_latency_frames_range")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
"menu_netplay_disconnect")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_ENABLE,

View File

@ -1560,6 +1560,31 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
"no checks. This value is only used on the \n"
"netplay host. \n");
break;
case MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN:
snprintf(s, len,
"The number of frames of input latency for \n"
"netplay to use to hide network latency. \n"
" \n"
"When in netplay, this option delays local \n"
"input, so that the frame being run is \n"
"closer to the frames being received from \n"
"the network. This reduces jitter and makes \n"
"netplay less CPU-intensive, but at the \n"
"price of noticeable input lag. \n");
break;
case MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE:
snprintf(s, len,
"The range of frames of input latency that \n"
"may be used by netplay to hide network \n"
"latency. \n"
"\n"
"If set, netplay will adjust the number of \n"
"frames of input latency dynamically to \n"
"balance CPU time, input latency and \n"
"network latency. This reduces jitter and \n"
"makes netplay less CPU-intensive, but at \n"
"the price of unpredictable input lag. \n");
break;
case MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL:
snprintf(s, len,
"When hosting, attempt to listen for\n"

View File

@ -964,6 +964,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY,
"Netplay")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CHECK_FRAMES,
"Netplay Check Frames")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
"Input Latency Frames")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
"Input Latency Frames Range")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT,
"Netplay P2 Uses C1")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES,

View File

@ -4813,6 +4813,14 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_NETPLAY_CHECK_FRAMES,
PARSE_ONLY_INT, false) != -1)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
PARSE_ONLY_INT, false) != -1)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
PARSE_ONLY_INT, false) != -1)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL,
PARSE_ONLY_BOOL, false) != -1)

View File

@ -5672,7 +5672,35 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, -600, 600, 1, true, false);
menu_settings_list_current_add_range(list, list_info, -600, 600, 1, false, false);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_INT(
list, list_info,
(int *) &settings->netplay.input_latency_frames_min,
MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
MENU_ENUM_LABEL_VALUE_NETPLAY_INPUT_LATENCY_FRAMES_MIN,
0,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 15, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_INT(
list, list_info,
(int *) &settings->netplay.input_latency_frames_range,
MENU_ENUM_LABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
MENU_ENUM_LABEL_VALUE_NETPLAY_INPUT_LATENCY_FRAMES_RANGE,
0,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 15, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_BOOL(

View File

@ -1023,6 +1023,8 @@ enum msg_hash_enums
MENU_LABEL(NETPLAY_DELAY_FRAMES),
MENU_LABEL(NETPLAY_STATELESS_MODE),
MENU_LABEL(NETPLAY_CHECK_FRAMES),
MENU_LABEL(NETPLAY_INPUT_LATENCY_FRAMES_MIN),
MENU_LABEL(NETPLAY_INPUT_LATENCY_FRAMES_RANGE),
MENU_LABEL(NETPLAY_SPECTATOR_MODE_ENABLE),
MENU_LABEL(NETPLAY_TCP_UDP_PORT),
MENU_LABEL(NETPLAY_NAT_TRAVERSAL),