|
|
|
@ -2802,11 +2802,242 @@ static void overlay_enable_toggle_change_handler(void *data)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static bool setting_append_list_input_player_options(
|
|
|
|
|
rarch_setting_t **list,
|
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
|
const char *parent_group,
|
|
|
|
|
unsigned user)
|
|
|
|
|
{
|
|
|
|
|
/* This constants matches the string length.
|
|
|
|
|
* Keep it up to date or you'll get some really obvious bugs.
|
|
|
|
|
* 2 is the length of '99'; we don't need more users than that.
|
|
|
|
|
*/
|
|
|
|
|
static char buffer[MAX_USERS][13+2+1];
|
|
|
|
|
static char group_lbl[MAX_USERS][PATH_MAX_LENGTH];
|
|
|
|
|
unsigned i;
|
|
|
|
|
rarch_setting_group_info_t group_info = {0};
|
|
|
|
|
rarch_setting_group_info_t subgroup_info = {0};
|
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
|
const struct retro_keybind* const defaults =
|
|
|
|
|
(user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
|
|
|
|
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
|
|
|
|
|
|
|
|
|
snprintf(buffer[user], sizeof(buffer[user]),
|
|
|
|
|
"%s %u", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(group_lbl[user], sizeof(group_lbl[user]),
|
|
|
|
|
menu_hash_to_str(MENU_LABEL_VALUE_INPUT_USER_BINDS), user + 1);
|
|
|
|
|
|
|
|
|
|
START_GROUP(group_info, group_lbl[user], parent_group);
|
|
|
|
|
|
|
|
|
|
parent_group = menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS);
|
|
|
|
|
|
|
|
|
|
START_SUB_GROUP(
|
|
|
|
|
list,
|
|
|
|
|
list_info,
|
|
|
|
|
buffer[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info,
|
|
|
|
|
parent_group);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
/* These constants match the string lengths.
|
|
|
|
|
* Keep them up to date or you'll get some really obvious bugs.
|
|
|
|
|
* 2 is the length of '99'; we don't need more users than that.
|
|
|
|
|
*/
|
|
|
|
|
/* FIXME/TODO - really need to clean up this mess in some way. */
|
|
|
|
|
static char key[MAX_USERS][64];
|
|
|
|
|
static char key_type[MAX_USERS][64];
|
|
|
|
|
static char key_analog[MAX_USERS][64];
|
|
|
|
|
static char key_bind_all[MAX_USERS][64];
|
|
|
|
|
static char key_bind_all_save_autoconfig[MAX_USERS][64];
|
|
|
|
|
static char key_bind_defaults[MAX_USERS][64];
|
|
|
|
|
|
|
|
|
|
static char label[MAX_USERS][64];
|
|
|
|
|
static char label_type[MAX_USERS][64];
|
|
|
|
|
static char label_analog[MAX_USERS][64];
|
|
|
|
|
static char label_bind_all[MAX_USERS][64];
|
|
|
|
|
static char label_bind_all_save_autoconfig[MAX_USERS][64];
|
|
|
|
|
static char label_bind_defaults[MAX_USERS][64];
|
|
|
|
|
|
|
|
|
|
snprintf(key[user], sizeof(key[user]),
|
|
|
|
|
"input_player%u_joypad_index", user + 1);
|
|
|
|
|
snprintf(key_type[user], sizeof(key_type[user]),
|
|
|
|
|
"input_libretro_device_p%u", user + 1);
|
|
|
|
|
snprintf(key_analog[user], sizeof(key_analog[user]),
|
|
|
|
|
"input_player%u_analog_dpad_mode", user + 1);
|
|
|
|
|
snprintf(key_bind_all[user], sizeof(key_bind_all[user]),
|
|
|
|
|
"input_player%u_bind_all", user + 1);
|
|
|
|
|
snprintf(key_bind_all_save_autoconfig[user], sizeof(key_bind_all[user]),
|
|
|
|
|
"input_player%u_bind_all_save_autoconfig", user + 1);
|
|
|
|
|
snprintf(key_bind_defaults[user], sizeof(key_bind_defaults[user]),
|
|
|
|
|
"input_player%u_bind_defaults", user + 1);
|
|
|
|
|
|
|
|
|
|
snprintf(label[user], sizeof(label[user]),
|
|
|
|
|
"%s %u Device Index", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_type[user], sizeof(label_type[user]),
|
|
|
|
|
"%s %u Device Type", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_analog[user], sizeof(label_analog[user]),
|
|
|
|
|
"%s %u Analog To Digital Type", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_all[user], sizeof(label_bind_all[user]),
|
|
|
|
|
"%s %u Bind All", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_defaults[user], sizeof(label_bind_defaults[user]),
|
|
|
|
|
"%s %u Bind Default All", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_all_save_autoconfig[user], sizeof(label_bind_all_save_autoconfig[user]),
|
|
|
|
|
"%s %u Save Autoconfig", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
|
|
|
|
|
CONFIG_UINT(
|
|
|
|
|
settings->input.libretro_device[user],
|
|
|
|
|
key_type[user],
|
|
|
|
|
label_type[user],
|
|
|
|
|
user,
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group,
|
|
|
|
|
general_write_handler,
|
|
|
|
|
general_read_handler);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation =
|
|
|
|
|
&setting_get_string_representation_uint_libretro_device;
|
|
|
|
|
|
|
|
|
|
CONFIG_UINT(
|
|
|
|
|
settings->input.analog_dpad_mode[user],
|
|
|
|
|
key_analog[user],
|
|
|
|
|
label_analog[user],
|
|
|
|
|
user,
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group,
|
|
|
|
|
general_write_handler,
|
|
|
|
|
general_read_handler);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation =
|
|
|
|
|
&setting_get_string_representation_uint_analog_dpad_mode;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key[user],
|
|
|
|
|
label[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation = &get_string_representation_bind_device;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_all[user],
|
|
|
|
|
label_bind_all[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_all;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_defaults[user],
|
|
|
|
|
label_bind_defaults[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_defaults;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_all_save_autoconfig[user],
|
|
|
|
|
label_bind_all_save_autoconfig[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_all_save_autoconfig;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < RARCH_BIND_LIST_END; i ++)
|
|
|
|
|
{
|
|
|
|
|
char label[PATH_MAX_LENGTH];
|
|
|
|
|
char name[PATH_MAX_LENGTH];
|
|
|
|
|
bool do_add = true;
|
|
|
|
|
const struct input_bind_map* keybind =
|
|
|
|
|
(const struct input_bind_map*)&input_config_bind_map[i];
|
|
|
|
|
|
|
|
|
|
if (!keybind || keybind->meta)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
strlcpy(label, buffer[user], sizeof(label));
|
|
|
|
|
strlcat(label, " ", sizeof(label));
|
|
|
|
|
if (
|
|
|
|
|
settings->input.input_descriptor_label_show
|
|
|
|
|
&& (i < RARCH_FIRST_META_KEY)
|
|
|
|
|
&& (global->has_set.input_descriptors)
|
|
|
|
|
&& (i != RARCH_TURBO_ENABLE)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
if (system->input_desc_btn[user][i])
|
|
|
|
|
strlcat(label,
|
|
|
|
|
system->input_desc_btn[user][i],
|
|
|
|
|
sizeof(label));
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strlcat(label, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE),
|
|
|
|
|
sizeof(label));
|
|
|
|
|
|
|
|
|
|
if (settings->input.input_descriptor_hide_unbound)
|
|
|
|
|
do_add = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
strlcat(label, keybind->desc, sizeof(label));
|
|
|
|
|
|
|
|
|
|
snprintf(name, sizeof(name), "p%u_%s", user + 1, keybind->base);
|
|
|
|
|
|
|
|
|
|
if (do_add)
|
|
|
|
|
{
|
|
|
|
|
CONFIG_BIND(
|
|
|
|
|
settings->input.binds[user][i],
|
|
|
|
|
user + 1,
|
|
|
|
|
user,
|
|
|
|
|
strdup(name), /* TODO: Find a way to fix these memleaks. */
|
|
|
|
|
strdup(label),
|
|
|
|
|
&defaults[i],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].bind_type = i + MENU_SETTINGS_BIND_BEGIN;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
END_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool setting_append_list_main_menu_options(
|
|
|
|
|
rarch_setting_t **list,
|
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
|
const char *parent_group)
|
|
|
|
|
{
|
|
|
|
|
unsigned user;
|
|
|
|
|
rarch_setting_group_info_t group_info = {0};
|
|
|
|
|
rarch_setting_group_info_t subgroup_info = {0};
|
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
@ -2931,6 +3162,9 @@ static bool setting_append_list_main_menu_options(
|
|
|
|
|
menu_settings_list_current_add_cmd(list, list_info, EVENT_CMD_QUIT_RETROARCH);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
for (user = 0; user < MAX_USERS; user++)
|
|
|
|
|
setting_append_list_input_player_options(list, list_info, parent_group, user);
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
END_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
@ -4752,146 +4986,6 @@ static bool setting_append_list_input_options(
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
START_SUB_GROUP(
|
|
|
|
|
list,
|
|
|
|
|
list_info,
|
|
|
|
|
"Input Device Mapping",
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info,
|
|
|
|
|
parent_group);
|
|
|
|
|
|
|
|
|
|
for (user = 0; user < settings->input.max_users; user ++)
|
|
|
|
|
{
|
|
|
|
|
/* These constants match the string lengths.
|
|
|
|
|
* Keep them up to date or you'll get some really obvious bugs.
|
|
|
|
|
* 2 is the length of '99'; we don't need more users than that.
|
|
|
|
|
*/
|
|
|
|
|
/* FIXME/TODO - really need to clean up this mess in some way. */
|
|
|
|
|
static char key[MAX_USERS][64];
|
|
|
|
|
static char key_type[MAX_USERS][64];
|
|
|
|
|
static char key_analog[MAX_USERS][64];
|
|
|
|
|
static char key_bind_all[MAX_USERS][64];
|
|
|
|
|
static char key_bind_all_save_autoconfig[MAX_USERS][64];
|
|
|
|
|
static char key_bind_defaults[MAX_USERS][64];
|
|
|
|
|
|
|
|
|
|
static char label[MAX_USERS][64];
|
|
|
|
|
static char label_type[MAX_USERS][64];
|
|
|
|
|
static char label_analog[MAX_USERS][64];
|
|
|
|
|
static char label_bind_all[MAX_USERS][64];
|
|
|
|
|
static char label_bind_all_save_autoconfig[MAX_USERS][64];
|
|
|
|
|
static char label_bind_defaults[MAX_USERS][64];
|
|
|
|
|
|
|
|
|
|
snprintf(key[user], sizeof(key[user]),
|
|
|
|
|
"input_player%u_joypad_index", user + 1);
|
|
|
|
|
snprintf(key_type[user], sizeof(key_type[user]),
|
|
|
|
|
"input_libretro_device_p%u", user + 1);
|
|
|
|
|
snprintf(key_analog[user], sizeof(key_analog[user]),
|
|
|
|
|
"input_player%u_analog_dpad_mode", user + 1);
|
|
|
|
|
snprintf(key_bind_all[user], sizeof(key_bind_all[user]),
|
|
|
|
|
"input_player%u_bind_all", user + 1);
|
|
|
|
|
snprintf(key_bind_all_save_autoconfig[user], sizeof(key_bind_all[user]),
|
|
|
|
|
"input_player%u_bind_all_save_autoconfig", user + 1);
|
|
|
|
|
snprintf(key_bind_defaults[user], sizeof(key_bind_defaults[user]),
|
|
|
|
|
"input_player%u_bind_defaults", user + 1);
|
|
|
|
|
|
|
|
|
|
snprintf(label[user], sizeof(label[user]),
|
|
|
|
|
"%s %u Device Index", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_type[user], sizeof(label_type[user]),
|
|
|
|
|
"%s %u Device Type", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_analog[user], sizeof(label_analog[user]),
|
|
|
|
|
"%s %u Analog To Digital Type", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_all[user], sizeof(label_bind_all[user]),
|
|
|
|
|
"%s %u Bind All", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_defaults[user], sizeof(label_bind_defaults[user]),
|
|
|
|
|
"%s %u Bind Default All", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(label_bind_all_save_autoconfig[user], sizeof(label_bind_all_save_autoconfig[user]),
|
|
|
|
|
"%s %u Save Autoconfig", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
|
|
|
|
|
CONFIG_UINT(
|
|
|
|
|
settings->input.libretro_device[user],
|
|
|
|
|
key_type[user],
|
|
|
|
|
label_type[user],
|
|
|
|
|
user,
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group,
|
|
|
|
|
general_write_handler,
|
|
|
|
|
general_read_handler);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_libretro_device_type;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation =
|
|
|
|
|
&setting_get_string_representation_uint_libretro_device;
|
|
|
|
|
|
|
|
|
|
CONFIG_UINT(
|
|
|
|
|
settings->input.analog_dpad_mode[user],
|
|
|
|
|
key_analog[user],
|
|
|
|
|
label_analog[user],
|
|
|
|
|
user,
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group,
|
|
|
|
|
general_write_handler,
|
|
|
|
|
general_read_handler);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_analog_dpad_mode;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation =
|
|
|
|
|
&setting_get_string_representation_uint_analog_dpad_mode;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key[user],
|
|
|
|
|
label[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_start = &setting_action_start_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_left = &setting_action_left_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_right = &setting_action_right_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].action_select = &setting_action_right_bind_device;
|
|
|
|
|
(*list)[list_info->index - 1].get_string_representation = &get_string_representation_bind_device;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_all[user],
|
|
|
|
|
label_bind_all[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_all;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_defaults[user],
|
|
|
|
|
label_bind_defaults[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_defaults;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
key_bind_all_save_autoconfig[user],
|
|
|
|
|
label_bind_all_save_autoconfig[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_bind_all_save_autoconfig;
|
|
|
|
|
(*list)[list_info->index - 1].action_cancel = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
START_SUB_GROUP(
|
|
|
|
|
list,
|
|
|
|
@ -4939,6 +5033,29 @@ static bool setting_append_list_input_options(
|
|
|
|
|
menu_settings_list_current_add_range(list, list_info, 1, 0, 1, true, false);
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
START_SUB_GROUP(list, list_info, "Binds", group_info.name, subgroup_info, parent_group);
|
|
|
|
|
|
|
|
|
|
for (user = 0; user < MAX_USERS; user++)
|
|
|
|
|
{
|
|
|
|
|
static char binds_list[MAX_USERS][PATH_MAX_LENGTH];
|
|
|
|
|
static char binds_label[MAX_USERS][PATH_MAX_LENGTH];
|
|
|
|
|
|
|
|
|
|
snprintf(binds_list[user], sizeof(binds_list[user]), "%d_input_binds_list", user + 1);
|
|
|
|
|
snprintf(binds_label[user], sizeof(binds_label[user]), "Input User %d Binds", user + 1);
|
|
|
|
|
|
|
|
|
|
CONFIG_ACTION(
|
|
|
|
|
binds_list[user],
|
|
|
|
|
binds_label[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].index = user + 1;
|
|
|
|
|
(*list)[list_info->index - 1].index_offset = user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
END_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
@ -6539,103 +6656,6 @@ static bool setting_append_list_privacy_options(
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool setting_append_list_input_player_options(
|
|
|
|
|
rarch_setting_t **list,
|
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
|
const char *parent_group,
|
|
|
|
|
unsigned user)
|
|
|
|
|
{
|
|
|
|
|
/* This constants matches the string length.
|
|
|
|
|
* Keep it up to date or you'll get some really obvious bugs.
|
|
|
|
|
* 2 is the length of '99'; we don't need more users than that.
|
|
|
|
|
*/
|
|
|
|
|
static char buffer[MAX_USERS][13+2+1];
|
|
|
|
|
static char group_lbl[MAX_USERS][PATH_MAX_LENGTH];
|
|
|
|
|
unsigned i;
|
|
|
|
|
rarch_setting_group_info_t group_info = {0};
|
|
|
|
|
rarch_setting_group_info_t subgroup_info = {0};
|
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
|
const struct retro_keybind* const defaults =
|
|
|
|
|
(user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
|
|
|
|
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
|
|
|
|
|
|
|
|
|
snprintf(buffer[user], sizeof(buffer[user]),
|
|
|
|
|
"%s %u", menu_hash_to_str(MENU_VALUE_USER), user + 1);
|
|
|
|
|
snprintf(group_lbl[user], sizeof(group_lbl[user]),
|
|
|
|
|
menu_hash_to_str(MENU_LABEL_VALUE_INPUT_USER_BINDS), user + 1);
|
|
|
|
|
|
|
|
|
|
START_GROUP(group_info, group_lbl[user], parent_group);
|
|
|
|
|
|
|
|
|
|
parent_group = menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS);
|
|
|
|
|
|
|
|
|
|
START_SUB_GROUP(
|
|
|
|
|
list,
|
|
|
|
|
list_info,
|
|
|
|
|
buffer[user],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info,
|
|
|
|
|
parent_group);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < RARCH_BIND_LIST_END; i ++)
|
|
|
|
|
{
|
|
|
|
|
char label[PATH_MAX_LENGTH];
|
|
|
|
|
char name[PATH_MAX_LENGTH];
|
|
|
|
|
bool do_add = true;
|
|
|
|
|
const struct input_bind_map* keybind =
|
|
|
|
|
(const struct input_bind_map*)&input_config_bind_map[i];
|
|
|
|
|
|
|
|
|
|
if (!keybind || keybind->meta)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
strlcpy(label, buffer[user], sizeof(label));
|
|
|
|
|
strlcat(label, " ", sizeof(label));
|
|
|
|
|
if (
|
|
|
|
|
settings->input.input_descriptor_label_show
|
|
|
|
|
&& (i < RARCH_FIRST_META_KEY)
|
|
|
|
|
&& (global->has_set.input_descriptors)
|
|
|
|
|
&& (i != RARCH_TURBO_ENABLE)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
if (system->input_desc_btn[user][i])
|
|
|
|
|
strlcat(label,
|
|
|
|
|
system->input_desc_btn[user][i],
|
|
|
|
|
sizeof(label));
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strlcat(label, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE),
|
|
|
|
|
sizeof(label));
|
|
|
|
|
|
|
|
|
|
if (settings->input.input_descriptor_hide_unbound)
|
|
|
|
|
do_add = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
strlcat(label, keybind->desc, sizeof(label));
|
|
|
|
|
|
|
|
|
|
snprintf(name, sizeof(name), "p%u_%s", user + 1, keybind->base);
|
|
|
|
|
|
|
|
|
|
if (do_add)
|
|
|
|
|
{
|
|
|
|
|
CONFIG_BIND(
|
|
|
|
|
settings->input.binds[user][i],
|
|
|
|
|
user + 1,
|
|
|
|
|
user,
|
|
|
|
|
strdup(name), /* TODO: Find a way to fix these memleaks. */
|
|
|
|
|
strdup(label),
|
|
|
|
|
&defaults[i],
|
|
|
|
|
group_info.name,
|
|
|
|
|
subgroup_info.name,
|
|
|
|
|
parent_group);
|
|
|
|
|
(*list)[list_info->index - 1].bind_type = i + MENU_SETTINGS_BIND_BEGIN;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
END_SUB_GROUP(list, list_info, parent_group);
|
|
|
|
|
END_GROUP(list, list_info, parent_group);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool menu_setting_action_right(rarch_setting_t *setting, bool wraparound)
|
|
|
|
|
{
|
|
|
|
@ -6738,8 +6758,6 @@ rarch_setting_t *menu_setting_new(void)
|
|
|
|
|
if (!setting_append_list_input_options(&list, list_info, root))
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
for (user = 0; user < settings->input.max_users; user++)
|
|
|
|
|
setting_append_list_input_player_options(&list, list_info, root, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!setting_append_list_input_hotkey_options(&list, list_info, root))
|
|
|
|
|