diff --git a/configuration.h b/configuration.h index e9aeedf17d..9587c9250c 100644 --- a/configuration.h +++ b/configuration.h @@ -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]; diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 4113ed4570..132292415c 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -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" + ) diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 876ab7be56..c19d47e875 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -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" + ) diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index c12e8f5562..5be8b2a3c7 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -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" + ) diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 8a98713d73..70645638d1 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -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" + ) diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 21982658f2..dbe94933ea 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -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" + ) diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index f0309a2b23..19d6cf5839 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -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" + ) diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index f070b737dd..ce408a6a9d 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -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" + ) diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index f11e822530..5911f8c854 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -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" + ) diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index a4bd01113b..f03253da9f 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -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" + ) diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index bd5e94c9d6..0e4dcb59f7 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -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" + ) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index f5eaf894e0..c191f38f36 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -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, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 7e5e4a3a28..123ac8fa67 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -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" + ) diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index c7666db3b4..cbdcae33b8 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -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" + ) diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index f39fa8e5cf..549607f257 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -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" + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index d43afc0ca5..bd656e31ac 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -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" + ) diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index ae068b3fd1..f637ced219 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -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" + ) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index a036c7ddf4..72a62c7dff 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -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" + ) diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 8e9923f913..5e9ec23d87 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -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" + ) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 5a37ce16be..32b1b394f7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -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, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 0cde556605..c57fd5fd49 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -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], diff --git a/msg_hash.h b/msg_hash.h index b9095515b2..fb852b2ac4 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -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,