mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Add split joycon setting
This commit is contained in:
parent
cb21aa91cc
commit
a3f98a21f8
@ -415,6 +415,7 @@ typedef struct settings
|
||||
|
||||
unsigned input_overlay_show_physical_inputs_port;
|
||||
|
||||
unsigned input_split_joycon[MAX_USERS];
|
||||
unsigned input_joypad_map[MAX_USERS];
|
||||
unsigned input_device[MAX_USERS];
|
||||
unsigned input_mouse_index[MAX_USERS];
|
||||
|
@ -3655,3 +3655,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3439,3 +3439,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3431,3 +3431,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"串流模式")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"串流名稱")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3541,3 +3541,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3306,3 +3306,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -7590,3 +7590,7 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Título del Stream"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3465,3 +3465,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3525,3 +3525,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3928,3 +3928,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3426,3 +3426,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -209,6 +209,8 @@ MSG_HASH(MENU_ENUM_LABEL_CORE_INFO_ENTRY,
|
||||
"core_info_entry")
|
||||
MSG_HASH(MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS,
|
||||
"core_input_remapping_options")
|
||||
MSG_HASH(MENU_ENUM_LABEL_INPUT_SPLIT_JOYCON,
|
||||
"input_split_joycon")
|
||||
MSG_HASH(MENU_ENUM_LABEL_CORE_LIST,
|
||||
"load_core")
|
||||
MSG_HASH(MENU_ENUM_LABEL_CORE_OPTIONS,
|
||||
|
@ -3300,3 +3300,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3728,3 +3728,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -7544,3 +7544,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3392,3 +3392,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3595,3 +3595,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -7614,3 +7614,7 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3463,3 +3463,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_MODE,
|
||||
"Streaming Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_STREAMING_TITLE,
|
||||
"Title of Stream")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON,
|
||||
"Split Joy-Con"
|
||||
)
|
||||
|
@ -3279,6 +3279,7 @@ static int menu_displaylist_parse_options_remappings(
|
||||
{
|
||||
char key_type[PATH_MAX_LENGTH];
|
||||
char key_analog[PATH_MAX_LENGTH];
|
||||
char key_split_joycon[PATH_MAX_LENGTH];
|
||||
unsigned val = p + 1;
|
||||
|
||||
key_type[0] = key_analog[0] = '\0';
|
||||
@ -3287,11 +3288,18 @@ static int menu_displaylist_parse_options_remappings(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_LIBRETRO_DEVICE), val);
|
||||
snprintf(key_analog, sizeof(key_analog),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE), val);
|
||||
snprintf(key_split_joycon, sizeof(key_analog),
|
||||
"%s_%u",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_SPLIT_JOYCON), val);
|
||||
|
||||
menu_displaylist_parse_settings(menu, info,
|
||||
key_type, PARSE_ONLY_UINT, true);
|
||||
menu_displaylist_parse_settings(menu, info,
|
||||
key_analog, PARSE_ONLY_UINT, true);
|
||||
#ifdef HAVE_LIBNX
|
||||
menu_displaylist_parse_settings(menu, info,
|
||||
key_split_joycon, PARSE_ONLY_UINT, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
menu_entries_append_enum(info->list,
|
||||
|
@ -2440,6 +2440,19 @@ setting_get_string_representation_st_float_video_refresh_rate_auto(
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);
|
||||
}
|
||||
|
||||
static void get_string_representation_split_joycon(rarch_setting_t *setting, char *s,
|
||||
size_t len)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned index_offset = setting->index_offset;
|
||||
unsigned map = settings->uints.input_split_joycon[index_offset];
|
||||
|
||||
if (map == 0)
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
|
||||
else
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON), len);
|
||||
}
|
||||
|
||||
static void get_string_representation_bind_device(rarch_setting_t *setting, char *s,
|
||||
size_t len)
|
||||
{
|
||||
@ -3014,6 +3027,8 @@ static bool setting_append_list_input_player_options(
|
||||
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 split_joycon[MAX_USERS][64];
|
||||
static char split_joycon_lbl[MAX_USERS][64];
|
||||
static char key_bind_defaults[MAX_USERS][64];
|
||||
static char mouse_index[MAX_USERS][64];
|
||||
|
||||
@ -3037,6 +3052,10 @@ static bool setting_append_list_input_player_options(
|
||||
snprintf(key_analog[user], sizeof(key_analog[user]),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE),
|
||||
user + 1);
|
||||
snprintf(split_joycon[user], sizeof(split_joycon[user]),
|
||||
"%s_%u",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_SPLIT_JOYCON),
|
||||
user + 1);
|
||||
fill_pathname_join_delim(key_bind_all[user], tmp_string, "bind_all", '_',
|
||||
sizeof(key_bind_all[user]));
|
||||
fill_pathname_join_delim(key_bind_all_save_autoconfig[user],
|
||||
@ -3048,6 +3067,9 @@ static bool setting_append_list_input_player_options(
|
||||
fill_pathname_join_delim(mouse_index[user], tmp_string, "mouse_index", '_',
|
||||
sizeof(mouse_index[user]));
|
||||
|
||||
snprintf(split_joycon_lbl[user], sizeof(label[user]),
|
||||
"%s %u", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_SPLIT_JOYCON), user + 1);
|
||||
|
||||
snprintf(label[user], sizeof(label[user]),
|
||||
"%s %u %s", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER), user + 1,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_DEVICE_INDEX));
|
||||
@ -3116,6 +3138,29 @@ static bool setting_append_list_input_player_options(
|
||||
menu_settings_list_current_add_enum_idx(list, list_info,
|
||||
(enum msg_hash_enums)(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE + user));
|
||||
|
||||
CONFIG_UINT_ALT(
|
||||
list, list_info,
|
||||
&settings->uints.input_split_joycon[user],
|
||||
split_joycon[user],
|
||||
split_joycon_lbl[user],
|
||||
user,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].index = user + 1;
|
||||
(*list)[list_info->index - 1].index_offset = user;
|
||||
#if 0
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*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;
|
||||
#endif
|
||||
(*list)[list_info->index - 1].get_string_representation = &get_string_representation_split_joycon;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0, true, true);
|
||||
|
||||
CONFIG_ACTION_ALT(
|
||||
list, list_info,
|
||||
key[user],
|
||||
|
@ -545,6 +545,7 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_INPUT_SETTINGS_BEGIN,
|
||||
|
||||
MENU_LABEL(INPUT_HOTKEY_BINDS),
|
||||
MENU_LABEL(INPUT_SPLIT_JOYCON),
|
||||
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BINDS_BEGIN,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user