Skip to content

Commit 9f29249

Browse files
committed
Move input_assign_ports_on_button_press up the menu
1 parent dd42d13 commit 9f29249

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

config.def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@
16261626

16271627
/* Map user to core port on first button press. First person
16281628
* to press a button is player 1, second is player 2, etc. */
1629-
#define DEFAULT_INPUT_REMAP_PORTS_ON_BUTTON_PRESS false
1629+
#define DEFAULT_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS false
16301630

16311631
/* Enables accelerometer/gyroscope/illuminance
16321632
* sensor input, if supported */

configuration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,9 +2176,9 @@ static struct config_bool_setting *populate_settings_bool(
21762176
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, DEFAULT_INPUT_AUTODETECT_ENABLE, false);
21772177
SETTING_BOOL("input_turbo_enable", &settings->bools.input_turbo_enable, true, DEFAULT_TURBO_ENABLE, false);
21782178
SETTING_BOOL("input_turbo_allow_dpad", &settings->bools.input_turbo_allow_dpad, true, DEFAULT_TURBO_ALLOW_DPAD, false);
2179+
SETTING_BOOL("input_assign_ports_on_button_press", &settings->bools.input_assign_ports_on_button_press, true, DEFAULT_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS, false);
21792180
SETTING_BOOL("input_auto_mouse_grab", &settings->bools.input_auto_mouse_grab, true, DEFAULT_INPUT_AUTO_MOUSE_GRAB, false);
21802181
SETTING_BOOL("input_remap_binds_enable", &settings->bools.input_remap_binds_enable, true, true, false);
2181-
SETTING_BOOL("input_assign_ports_on_button_press", &settings->bools.input_assign_ports_on_button_press, true, DEFAULT_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS, false);
21822182
SETTING_BOOL("input_remap_sort_by_controller_enable", &settings->bools.input_remap_sort_by_controller_enable, true, false, false);
21832183
SETTING_BOOL("input_hotkey_device_merge", &settings->bools.input_hotkey_device_merge, true, DEFAULT_INPUT_HOTKEY_DEVICE_MERGE, false);
21842184
SETTING_BOOL("input_hotkey_follows_player1", &settings->bools.input_hotkey_follows_player1, true, DEFAULT_INPUT_HOTKEY_FOLLOWS_PLAYER1, false);

configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,9 @@ typedef struct settings
700700
#endif
701701

702702
/* Input */
703+
bool input_assign_ports_on_button_press;
703704
bool input_remap_binds_enable;
704705
bool input_remap_sort_by_controller_enable;
705-
bool input_remap_ports_on_button_press;
706706
bool input_autodetect_enable;
707707
bool input_sensors_enable;
708708
bool input_overlay_enable;

input/input_driver.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6126,8 +6126,8 @@ void input_driver_poll(void)
61266126
*sec_joypad = NULL;
61276127
#endif
61286128
bool input_remap_binds_enable = settings->bools.input_remap_binds_enable;
6129-
bool input_remap_ports_on_button_press
6130-
= settings->bools.input_remap_ports_on_button_press;
6129+
bool input_assign_ports_on_button_press
6130+
= settings->bools.input_assign_ports_on_button_press;
61316131
float input_axis_threshold = settings->floats.input_axis_threshold;
61326132
uint8_t max_users = (uint8_t)settings->uints.input_max_users;
61336133

@@ -6142,8 +6142,8 @@ void input_driver_poll(void)
61426142
}
61436143

61446144
#ifdef HAVE_MENU
6145-
input_remap_ports_on_button_press =
6146-
input_remap_ports_on_button_press
6145+
input_assign_ports_on_button_press =
6146+
input_assign_ports_on_button_press
61476147
&& !(menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE);
61486148
#endif
61496149

@@ -6155,7 +6155,7 @@ void input_driver_poll(void)
61556155
&& input_st->current_driver->poll)
61566156
input_st->current_driver->poll(input_st->current_data);
61576157

6158-
if (input_remap_ports_on_button_press)
6158+
if (input_assign_ports_on_button_press)
61596159
{
61606160
for (i = 0; i < max_users; i++)
61616161
{
@@ -6189,7 +6189,7 @@ void input_driver_poll(void)
61896189

61906190
/* If user 0 is not mapped yet, use the port they would be mapped
61916191
* to on overlay button press to get the input_analog_dpad_mode. */
6192-
if (!first_user_is_mapped && input_remap_ports_on_button_press)
6192+
if (!first_user_is_mapped && input_assign_ports_on_button_press)
61936193
mapped_port = get_first_free_core_port(settings);
61946194

61956195
switch (input_analog_dpad_mode)
@@ -6220,7 +6220,7 @@ void input_driver_poll(void)
62206220
input_analog_dpad_mode,
62216221
settings->floats.input_axis_threshold);
62226222

6223-
if (!first_user_is_mapped && input_remap_ports_on_button_press)
6223+
if (!first_user_is_mapped && input_assign_ports_on_button_press)
62246224
{
62256225
if (input_st->overlay_ptr->overlay_state.buttons.data[0])
62266226
map_user_to_first_free_core_port(0, settings);
@@ -6875,17 +6875,17 @@ void input_remapping_set_remap_ports_defaults(void)
68756875
{
68766876
unsigned i;
68776877
settings_t *settings = config_get_ptr();
6878-
bool remap_on_button_press = settings->bools.input_remap_ports_on_button_press;
6878+
bool assign_ports_on_button_press = settings->bools.input_assign_ports_on_button_press;
68796879

68806880
for (i = 0; i < MAX_USERS; i++)
68816881
{
68826882
configuration_set_uint(settings,
68836883
settings->uints.input_remap_ports[i],
6884-
remap_on_button_press ? MAX_USERS : i);
6884+
assign_ports_on_button_press ? MAX_USERS : i);
68856885

68866886
configuration_set_uint(settings,
68876887
settings->uints.input_libretro_device[i],
6888-
remap_on_button_press ? RETRO_DEVICE_NONE : RETRO_DEVICE_JOYPAD);
6888+
assign_ports_on_button_press ? RETRO_DEVICE_NONE : RETRO_DEVICE_JOYPAD);
68896889
}
68906890

68916891
/* Need to call 'input_remapping_update_port_map()'

intl/msg_hash_lbl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,10 @@ MSG_HASH(
21622162
MENU_ENUM_LABEL_INPUT_PREFER_FRONT_TOUCH,
21632163
"input_prefer_front_touch"
21642164
)
2165+
MSG_HASH(
2166+
MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
2167+
"input_assign_ports_on_button_press"
2168+
)
21652169
MSG_HASH(
21662170
MENU_ENUM_LABEL_INPUT_REMAPPING_DIRECTORY,
21672171
"input_remapping_directory"
@@ -2170,10 +2174,6 @@ MSG_HASH(
21702174
MENU_ENUM_LABEL_INPUT_REMAP_BINDS_ENABLE,
21712175
"input_remap_binds_enable"
21722176
)
2173-
MSG_HASH(
2174-
MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
2175-
"input_assign_ports_on_button_press"
2176-
)
21772177
MSG_HASH(
21782178
MENU_ENUM_LABEL_INPUT_REMAP_SORT_BY_CONTROLLER_ENABLE,
21792179
"input_remap_sort_by_controller_enable"

intl/msg_hash_us.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,11 +3339,11 @@ MSG_HASH(
33393339
)
33403340
MSG_HASH(
33413341
MENU_ENUM_LABEL_VALUE_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
3342-
"Remap Ports on Button Press"
3342+
"Assign Ports on Button Press"
33433343
)
33443344
MSG_HASH(
33453345
MENU_ENUM_SUBLABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
3346-
"First user to press a button becomes player 1, second becomes player 2, etc."
3346+
"Core input ports are mapped sequentially when input is received from a physical input device. The first person to press a button becomes player 1, the second becomes player 2, etc."
33473347
)
33483348
MSG_HASH(
33493349
MENU_ENUM_LABEL_VALUE_INPUT_REMAP_SORT_BY_CONTROLLER_ENABLE,

menu/cbs/menu_cbs_sublabel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_autosave_interval, MENU_
824824
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_replay_max_keep, MENU_ENUM_SUBLABEL_REPLAY_MAX_KEEP)
825825
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_replay_checkpoint_interval, MENU_ENUM_SUBLABEL_REPLAY_CHECKPOINT_INTERVAL)
826826
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_replay_checkpoint_deserialize, MENU_ENUM_SUBLABEL_REPLAY_CHECKPOINT_DESERIALIZE)
827+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_assign_ports_on_button_press, MENU_ENUM_SUBLABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS)
827828
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_remap_binds_enable, MENU_ENUM_SUBLABEL_INPUT_REMAP_BINDS_ENABLE)
828-
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_remap_ports_on_button_press, MENU_ENUM_SUBLABEL_INPUT_REMAP_PORTS_ON_BUTTON_PRESS)
829829
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_remap_sort_by_controller_enable, MENU_ENUM_SUBLABEL_INPUT_REMAP_SORT_BY_CONTROLLER_ENABLE)
830830
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_autodetect_enable, MENU_ENUM_SUBLABEL_INPUT_AUTODETECT_ENABLE)
831831
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
@@ -4140,6 +4140,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
41404140
case MENU_ENUM_LABEL_INPUT_SENSORS_ENABLE:
41414141
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_sensors_enable);
41424142
break;
4143+
case MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS:
4144+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_assign_ports_on_button_press);
4145+
break;
41434146
case MENU_ENUM_LABEL_INPUT_AUTO_MOUSE_GRAB:
41444147
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_auto_mouse_grab);
41454148
break;
@@ -4149,9 +4152,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
41494152
case MENU_ENUM_LABEL_INPUT_REMAP_BINDS_ENABLE:
41504153
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_remap_binds_enable);
41514154
break;
4152-
case MENU_ENUM_LABEL_INPUT_REMAP_PORTS_ON_BUTTON_PRESS:
4153-
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_remap_ports_on_button_press);
4154-
break;
41554155
case MENU_ENUM_LABEL_INPUT_REMAP_SORT_BY_CONTROLLER_ENABLE:
41564156
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_remap_sort_by_controller_enable);
41574157
break;

menu/menu_displaylist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8270,6 +8270,7 @@ unsigned menu_displaylist_build_list(
82708270
{MENU_ENUM_LABEL_INPUT_MENU_SETTINGS, PARSE_ACTION, true},
82718271
{MENU_ENUM_LABEL_INPUT_HAPTIC_FEEDBACK_SETTINGS, PARSE_ACTION, true},
82728272
{MENU_ENUM_LABEL_INPUT_MAX_USERS, PARSE_ONLY_UINT, true},
8273+
{MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS, PARSE_ONLY_BOOL, true},
82738274
{MENU_ENUM_LABEL_INPUT_AUTO_MOUSE_GRAB, PARSE_ONLY_BOOL, true},
82748275
{MENU_ENUM_LABEL_INPUT_AUTO_GAME_FOCUS, PARSE_ONLY_UINT, true},
82758276
{MENU_ENUM_LABEL_PAUSE_ON_DISCONNECT, PARSE_ONLY_BOOL, true},
@@ -8278,7 +8279,6 @@ unsigned menu_displaylist_build_list(
82788279
{MENU_ENUM_LABEL_INPUT_BIND_HOLD, PARSE_ONLY_UINT, true},
82798280
{MENU_ENUM_LABEL_INPUT_AUTODETECT_ENABLE, PARSE_ONLY_BOOL, true},
82808281
{MENU_ENUM_LABEL_INPUT_REMAP_BINDS_ENABLE, PARSE_ONLY_BOOL, true},
8281-
{MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS, PARSE_ONLY_BOOL, true},
82828282
{MENU_ENUM_LABEL_INPUT_REMAP_SORT_BY_CONTROLLER_ENABLE, PARSE_ONLY_BOOL, true},
82838283
{MENU_ENUM_LABEL_INPUT_ICADE_ENABLE, PARSE_ONLY_BOOL, true},
82848284
{MENU_ENUM_LABEL_INPUT_SMALL_KEYBOARD_ENABLE, PARSE_ONLY_BOOL, true},

menu/menu_setting.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15617,10 +15617,10 @@ static bool setting_append_list(
1561715617

1561815618
CONFIG_BOOL(
1561915619
list, list_info,
15620-
&settings->bools.input_remap_binds_enable,
15621-
MENU_ENUM_LABEL_INPUT_REMAP_BINDS_ENABLE,
15622-
MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE,
15623-
true,
15620+
&settings->bools.input_assign_ports_on_button_press,
15621+
MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
15622+
MENU_ENUM_LABEL_VALUE_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
15623+
DEFAULT_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
1562415624
MENU_ENUM_LABEL_VALUE_OFF,
1562515625
MENU_ENUM_LABEL_VALUE_ON,
1562615626
&group_info,
@@ -15630,13 +15630,13 @@ static bool setting_append_list(
1563015630
general_read_handler,
1563115631
SD_FLAG_ADVANCED
1563215632
);
15633-
15633+
1563415634
CONFIG_BOOL(
1563515635
list, list_info,
15636-
&settings->bools.input_assign_ports_on_button_press,
15637-
MENU_ENUM_LABEL_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
15638-
MENU_ENUM_LABEL_VALUE_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
15639-
DEFAULT_INPUT_ASSIGN_PORTS_ON_BUTTON_PRESS,
15636+
&settings->bools.input_remap_binds_enable,
15637+
MENU_ENUM_LABEL_INPUT_REMAP_BINDS_ENABLE,
15638+
MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE,
15639+
true,
1564015640
MENU_ENUM_LABEL_VALUE_OFF,
1564115641
MENU_ENUM_LABEL_VALUE_ON,
1564215642
&group_info,

0 commit comments

Comments
 (0)