diff --git a/gfx/py_state/py_state.c b/gfx/py_state/py_state.c index 68b4f4b239..f80175f66a 100644 --- a/gfx/py_state/py_state.c +++ b/gfx/py_state/py_state.c @@ -96,17 +96,17 @@ static PyObject *py_read_input(PyObject *self, PyObject *args) if (!driver.input_data) return PyBool_FromLong(0); - unsigned player; + unsigned user; unsigned key; - if (!PyArg_ParseTuple(args, "II", &player, &key)) + if (!PyArg_ParseTuple(args, "II", &user, &key)) return NULL; - if (player > MAX_PLAYERS || player < 1 || key >= RARCH_FIRST_META_KEY) + if (user > MAX_PLAYERS || user < 1 || key >= RARCH_FIRST_META_KEY) return NULL; int16_t res = driver.block_libretro_input ? 0 : driver.input->input_state(driver.input_data, - py_binds, player - 1, RETRO_DEVICE_JOYPAD, 0, key); + py_binds, user - 1, RETRO_DEVICE_JOYPAD, 0, key); return PyBool_FromLong(res); } @@ -116,17 +116,17 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args) if (!driver.input_data) return PyBool_FromLong(0); - unsigned player; + unsigned user; unsigned index; unsigned id; - if (!PyArg_ParseTuple(args, "III", &player, &index, &id)) + if (!PyArg_ParseTuple(args, "III", &user, &index, &id)) return NULL; - if (player > MAX_PLAYERS || player < 1 || index > 1 || id > 1) + if (user > MAX_PLAYERS || user < 1 || index > 1 || id > 1) return NULL; int16_t res = driver.input->input_state(driver.input_data, - py_binds, player - 1, RETRO_DEVICE_ANALOG, index, id); + py_binds, user - 1, RETRO_DEVICE_ANALOG, index, id); return PyFloat_FromDouble((double)res / 0x7fff); } diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 5b4b671f42..6d1dc430bf 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -59,7 +59,7 @@ struct menu_bind_state int64_t timeout_end; unsigned begin; unsigned last; - unsigned player; + unsigned user; struct menu_bind_state_port state[MAX_PLAYERS]; struct menu_bind_axis_state axis_state[MAX_PLAYERS]; bool skip; diff --git a/menu/menu_input_line_cb.c b/menu/menu_input_line_cb.c index 50ee83b008..0198ed734f 100644 --- a/menu/menu_input_line_cb.c +++ b/menu/menu_input_line_cb.c @@ -277,7 +277,7 @@ bool menu_poll_find_trigger(struct menu_bind_state *state, { /* Update the joypad mapping automatically. * More friendly that way. */ - g_settings.input.joypad_map[state->player] = i; + g_settings.input.joypad_map[state->user] = i; return true; } } diff --git a/netplay.c b/netplay.c index 3e83c85a20..4a80c6383d 100644 --- a/netplay.c +++ b/netplay.c @@ -80,7 +80,7 @@ struct netplay int fd; /* UDP connection for game state updates. */ int udp_fd; - /* Which port is governed by netplay (other player)? */ + /* Which port is governed by netplay (other user)? */ unsigned port; bool has_connection; @@ -1171,15 +1171,15 @@ static bool netplay_get_cmd(netplay_t *netplay) flip_frame = ntohl(flip_frame); if (flip_frame < netplay->flip_frame) { - RARCH_ERR("Host asked us to flip players in the past. Not possible ...\n"); + RARCH_ERR("Host asked us to flip users in the past. Not possible ...\n"); return netplay_cmd_nak(netplay); } netplay->flip ^= true; netplay->flip_frame = flip_frame; - RARCH_LOG("Netplay players are flipped.\n"); - msg_queue_push(g_extern.msg_queue, "Netplay players are flipped.", 1, 180); + RARCH_LOG("Netplay users are flipped.\n"); + msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180); return netplay_cmd_ack(netplay); } @@ -1190,7 +1190,7 @@ static bool netplay_get_cmd(netplay_t *netplay) } } -void netplay_flip_players(netplay_t *netplay) +void netplay_flip_users(netplay_t *netplay) { uint32_t flip_frame = netplay->frame_count + 2 * UDP_FRAME_PACKETS; uint32_t flip_frame_net = htonl(flip_frame); @@ -1198,20 +1198,20 @@ void netplay_flip_players(netplay_t *netplay) if (netplay->spectate) { - msg = "Cannot flip players in spectate mode."; + msg = "Cannot flip users in spectate mode."; goto error; } if (netplay->port == 0) { - msg = "Cannot flip players if you're not the host."; + msg = "Cannot flip users if you're not the host."; goto error; } /* Make sure both clients are definitely synced up. */ if (netplay->frame_count < (netplay->flip_frame + 2 * UDP_FRAME_PACKETS)) { - msg = "Cannot flip players yet. Wait a second or two before attempting flip."; + msg = "Cannot flip users yet. Wait a second or two before attempting flip."; goto error; } @@ -1219,8 +1219,8 @@ void netplay_flip_players(netplay_t *netplay) &flip_frame_net, sizeof(flip_frame_net)) && netplay_get_response(netplay)) { - RARCH_LOG("Netplay players are flipped.\n"); - msg_queue_push(g_extern.msg_queue, "Netplay players are flipped.", 1, 180); + RARCH_LOG("Netplay users are flipped.\n"); + msg_queue_push(g_extern.msg_queue, "Netplay users are flipped.", 1, 180); /* Queue up a flip well enough in the future. */ netplay->flip ^= true; @@ -1228,7 +1228,7 @@ void netplay_flip_players(netplay_t *netplay) } else { - msg = "Failed to flip players."; + msg = "Failed to flip users."; goto error; } diff --git a/netplay.h b/netplay.h index 8b7c253c44..b0c2d7a0df 100644 --- a/netplay.h +++ b/netplay.h @@ -46,7 +46,7 @@ typedef struct netplay netplay_t; bool netplay_init_network(void); /* Creates a new netplay handle. A NULL host means we're - * hosting (player 1). :) */ + * hosting (user 1). :) */ netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, const struct retro_callbacks *cb, bool spectate, @@ -54,8 +54,8 @@ netplay_t *netplay_new(const char *server, void netplay_free(netplay_t *handle); -/* On regular netplay, flip who controls player 1 and 2. */ -void netplay_flip_players(netplay_t *handle); +/* On regular netplay, flip who controls user 1 and 2. */ +void netplay_flip_users(netplay_t *handle); /* Call this before running retro_run(). */ void netplay_pre_frame(netplay_t *handle); diff --git a/retroarch.c b/retroarch.c index cd319ef287..2ceac10f9a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -499,12 +499,12 @@ static void print_help(void) puts("\t\tDo note that noload-save implies that save files will be deleted and overwritten."); #ifdef HAVE_NETPLAY - puts("\t-H/--host: Host netplay as player 1."); - puts("\t-C/--connect: Connect to netplay as player 2."); + puts("\t-H/--host: Host netplay as user 1."); + puts("\t-C/--connect: Connect to netplay as user 2."); puts("\t--port: Port used to netplay. Default is 55435."); puts("\t-F/--frames: Sync frames when using netplay."); puts("\t--spectate: Netplay will become spectating mode."); - puts("\t\tHost can live stream the game content to players that connect."); + puts("\t\tHost can live stream the game content to users that connect."); puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host."); #endif puts("\t--nick: Picks a username (for use with netplay). Not mandatory."); @@ -2649,7 +2649,7 @@ bool rarch_main_command(unsigned cmd) { netplay_t *netplay = (netplay_t*)driver.netplay_data; if (netplay) - netplay_flip_players(netplay); + netplay_flip_users(netplay); } #endif break; diff --git a/settings.c b/settings.c index 989a7cb3bd..2374d1be0c 100644 --- a/settings.c +++ b/settings.c @@ -1336,12 +1336,12 @@ static void parse_config_file(void) } -static void read_keybinds_keyboard(config_file_t *conf, unsigned player, +static void read_keybinds_keyboard(config_file_t *conf, unsigned user, unsigned idx, struct retro_keybind *bind) { if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) { - const char *prefix = input_config_get_prefix(player, + const char *prefix = input_config_get_prefix(user, input_config_bind_map[idx].meta); if (prefix) input_config_parse_key(conf, prefix, @@ -1349,12 +1349,12 @@ static void read_keybinds_keyboard(config_file_t *conf, unsigned player, } } -static void read_keybinds_button(config_file_t *conf, unsigned player, +static void read_keybinds_button(config_file_t *conf, unsigned user, unsigned idx, struct retro_keybind *bind) { if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) { - const char *prefix = input_config_get_prefix(player, + const char *prefix = input_config_get_prefix(user, input_config_bind_map[idx].meta); if (prefix) input_config_parse_joy_button(conf, prefix, @@ -1362,12 +1362,12 @@ static void read_keybinds_button(config_file_t *conf, unsigned player, } } -static void read_keybinds_axis(config_file_t *conf, unsigned player, +static void read_keybinds_axis(config_file_t *conf, unsigned user, unsigned idx, struct retro_keybind *bind) { if (input_config_bind_map[idx].valid && input_config_bind_map[idx].base) { - const char *prefix = input_config_get_prefix(player, + const char *prefix = input_config_get_prefix(user, input_config_bind_map[idx].meta); if (prefix) input_config_parse_joy_axis(conf, prefix, @@ -1375,20 +1375,20 @@ static void read_keybinds_axis(config_file_t *conf, unsigned player, } } -static void read_keybinds_player(config_file_t *conf, unsigned player) +static void read_keybinds_user(config_file_t *conf, unsigned user) { unsigned i; for (i = 0; input_config_bind_map[i].valid; i++) { struct retro_keybind *bind = (struct retro_keybind*) - &g_settings.input.binds[player][i]; + &g_settings.input.binds[user][i]; if (!bind->valid) continue; - read_keybinds_keyboard(conf, player, i, bind); - read_keybinds_button(conf, player, i, bind); - read_keybinds_axis(conf, player, i, bind); + read_keybinds_keyboard(conf, user, i, bind); + read_keybinds_button(conf, user, i, bind); + read_keybinds_axis(conf, user, i, bind); } } @@ -1396,7 +1396,7 @@ static void config_read_keybinds_conf(config_file_t *conf) { unsigned i; for (i = 0; i < MAX_PLAYERS; i++) - read_keybinds_player(conf, i); + read_keybinds_user(conf, i); } #if 0 @@ -1512,16 +1512,16 @@ static void save_keybind(config_file_t *conf, const char *prefix, save_keybind_axis(conf, prefix, base, bind); } -static void save_keybinds_player(config_file_t *conf, unsigned player) +static void save_keybinds_user(config_file_t *conf, unsigned user) { unsigned i = 0; for (i = 0; input_config_bind_map[i].valid; i++) { - const char *prefix = input_config_get_prefix(player, + const char *prefix = input_config_get_prefix(user, input_config_bind_map[i].meta); if (prefix) save_keybind(conf, prefix, input_config_bind_map[i].base, - &g_settings.input.binds[player][i]); + &g_settings.input.binds[user][i]); } } @@ -1791,7 +1791,7 @@ bool config_save_file(const char *path) } for (i = 0; i < MAX_PLAYERS; i++) - save_keybinds_player(conf, i); + save_keybinds_user(conf, i); config_set_bool(conf, "core_specific_config", g_settings.core_specific_config); diff --git a/settings_data.c b/settings_data.c index 525642c564..f5337cb269 100644 --- a/settings_data.c +++ b/settings_data.c @@ -1217,7 +1217,7 @@ static int setting_data_bind_action_ok(void *data, unsigned action) driver.menu->binds.begin = setting->bind_type; driver.menu->binds.last = setting->bind_type; driver.menu->binds.target = keybind; - driver.menu->binds.player = setting->index_offset; + driver.menu->binds.user = setting->index_offset; menu_list_push_stack( driver.menu->menu_list, "", @@ -2083,7 +2083,7 @@ int setting_data_get_description(const char *label, char *msg, "where (d) is slot number."); else if (!strcmp(label, "netplay_flip_players")) snprintf(msg, sizeof_msg, - " -- Netplay flip players."); + " -- Netplay flip users."); else if (!strcmp(label, "frame_advance")) snprintf(msg, sizeof_msg, " -- Frame advance when content is paused."); @@ -2174,7 +2174,7 @@ int setting_data_get_description(const char *label, char *msg, snprintf(msg, sizeof_msg, " -- Input Device. \n" " \n" - "Picks which gamepad to use for player N. \n" + "Picks which gamepad to use for user N. \n" "The name of the pad is available." ); else if (!strcmp(label, "input_bind_device_type")) @@ -4292,7 +4292,7 @@ static bool setting_data_append_list_input_options( { rarch_setting_group_info_t group_info; rarch_setting_group_info_t subgroup_info; - unsigned i, player; + unsigned i, user; START_GROUP(group_info, "Input Options"); START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info); @@ -4342,11 +4342,11 @@ static bool setting_data_append_list_input_options( general_write_handler, general_read_handler); - for (player = 0; player < MAX_PLAYERS; player ++) + for (user = 0; user < MAX_PLAYERS; 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 players than that. + * 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_PLAYERS][64]; @@ -4361,83 +4361,83 @@ static bool setting_data_append_list_input_options( static char label_bind_all[MAX_PLAYERS][64]; static char label_bind_defaults[MAX_PLAYERS][64]; - snprintf(key[player], sizeof(key[player]), - "input_player%d_joypad_index", player + 1); - snprintf(key_type[player], sizeof(key_type[player]), - "input_libretro_device_p%u", player + 1); - snprintf(key_analog[player], sizeof(key_analog[player]), - "input_player%u_analog_dpad_mode", player + 1); - snprintf(key_bind_all[player], sizeof(key_bind_all[player]), - "input_player%u_bind_all", player + 1); - snprintf(key_bind_defaults[player], sizeof(key_bind_defaults[player]), - "input_player%u_bind_defaults", player + 1); + snprintf(key[user], sizeof(key[user]), + "input_player%d_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_defaults[user], sizeof(key_bind_defaults[user]), + "input_player%u_bind_defaults", user + 1); - snprintf(label[player], sizeof(label[player]), - "User %d Device Index", player + 1); - snprintf(label_type[player], sizeof(label_type[player]), - "User %d Device Type", player + 1); - snprintf(label_analog[player], sizeof(label_analog[player]), - "User %d Analog To Digital Type", player + 1); - snprintf(label_bind_all[player], sizeof(label_bind_all[player]), - "User %d Bind All", player + 1); - snprintf(label_bind_defaults[player], sizeof(label_bind_defaults[player]), - "User %d Bind Default All", player + 1); + snprintf(label[user], sizeof(label[user]), + "User %d Device Index", user + 1); + snprintf(label_type[user], sizeof(label_type[user]), + "User %d Device Type", user + 1); + snprintf(label_analog[user], sizeof(label_analog[user]), + "User %d Analog To Digital Type", user + 1); + snprintf(label_bind_all[user], sizeof(label_bind_all[user]), + "User %d Bind All", user + 1); + snprintf(label_bind_defaults[user], sizeof(label_bind_defaults[user]), + "User %d Bind Default All", user + 1); CONFIG_UINT( - g_settings.input.libretro_device[player], - key_type[player], - label_type[player], - player, + g_settings.input.libretro_device[user], + key_type[user], + label_type[user], + user, group_info.name, subgroup_info.name, general_write_handler, general_read_handler); - (*list)[list_info->index - 1].index = player + 1; - (*list)[list_info->index - 1].index_offset = player; + (*list)[list_info->index - 1].index = user + 1; + (*list)[list_info->index - 1].index_offset = user; (*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_libretro_device_type; (*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_libretro_device_type; CONFIG_UINT( - g_settings.input.analog_dpad_mode[player], - key_analog[player], - label_analog[player], - player, + g_settings.input.analog_dpad_mode[user], + key_analog[user], + label_analog[user], + user, group_info.name, subgroup_info.name, general_write_handler, general_read_handler); - (*list)[list_info->index - 1].index = player + 1; - (*list)[list_info->index - 1].index_offset = player; + (*list)[list_info->index - 1].index = user + 1; + (*list)[list_info->index - 1].index_offset = user; (*list)[list_info->index - 1].action_toggle = &setting_data_uint_action_toggle_analog_dpad_mode; (*list)[list_info->index - 1].action_start = &setting_data_uint_action_start_analog_dpad_mode; CONFIG_ACTION( - key[player], - label[player], + key[user], + label[user], group_info.name, subgroup_info.name); - (*list)[list_info->index - 1].index = player + 1; - (*list)[list_info->index - 1].index_offset = player; + (*list)[list_info->index - 1].index = user + 1; + (*list)[list_info->index - 1].index_offset = user; (*list)[list_info->index - 1].action_start = &setting_data_action_start_bind_device; (*list)[list_info->index - 1].action_toggle = &setting_data_action_toggle_bind_device; (*list)[list_info->index - 1].get_string_representation = &get_string_representation_bind_device; CONFIG_ACTION( - key_bind_all[player], - label_bind_all[player], + key_bind_all[user], + label_bind_all[user], group_info.name, subgroup_info.name); - (*list)[list_info->index - 1].index = player + 1; - (*list)[list_info->index - 1].index_offset = player; + (*list)[list_info->index - 1].index = user + 1; + (*list)[list_info->index - 1].index_offset = user; (*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_all; CONFIG_ACTION( - key_bind_defaults[player], - label_bind_defaults[player], + key_bind_defaults[user], + label_bind_defaults[user], group_info.name, subgroup_info.name); - (*list)[list_info->index - 1].index = player + 1; - (*list)[list_info->index - 1].index_offset = player; + (*list)[list_info->index - 1].index = user + 1; + (*list)[list_info->index - 1].index_offset = user; (*list)[list_info->index - 1].action_ok = &setting_data_action_ok_bind_defaults; } @@ -4485,7 +4485,7 @@ static bool setting_data_append_list_input_options( END_SUB_GROUP(list, list_info); /* The second argument to config bind is 1 - * based for players and 0 only for meta keys. */ + * based for users and 0 only for meta keys. */ START_SUB_GROUP( list, list_info, @@ -4508,22 +4508,22 @@ static bool setting_data_append_list_input_options( } END_SUB_GROUP(list, list_info); - for (player = 0; player < MAX_PLAYERS; player ++) + for (user = 0; user < MAX_PLAYERS; 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 players than that. + * 2 is the length of '99'; we don't need more users than that. */ static char buffer[MAX_PLAYERS][7+2+1]; const struct retro_keybind* const defaults = - (player == 0) ? retro_keybinds_1 : retro_keybinds_rest; + (user == 0) ? retro_keybinds_1 : retro_keybinds_rest; - snprintf(buffer[player], sizeof(buffer[player]), "User %d", player + 1); + snprintf(buffer[user], sizeof(buffer[user]), "User %d", user + 1); START_SUB_GROUP( list, list_info, - buffer[player], + buffer[user], group_info.name, subgroup_info); @@ -4543,17 +4543,17 @@ static bool setting_data_append_list_input_options( && (g_extern.has_set_input_descriptors) && (i != RARCH_TURBO_ENABLE) ) - snprintf(label, sizeof(label), "%s %s", buffer[player], - g_extern.system.input_desc_btn[player][i] ? g_extern.system.input_desc_btn[player][i] : "N/A"); + snprintf(label, sizeof(label), "%s %s", buffer[user], + g_extern.system.input_desc_btn[user][i] ? g_extern.system.input_desc_btn[user][i] : "N/A"); else - snprintf(label, sizeof(label), "%s %s", buffer[player], keybind->desc); + snprintf(label, sizeof(label), "%s %s", buffer[user], keybind->desc); - snprintf(name, sizeof(name), "p%u_%s", player + 1, keybind->base); + snprintf(name, sizeof(name), "p%u_%s", user + 1, keybind->base); CONFIG_BIND( - g_settings.input.binds[player][i], - player + 1, - player, + g_settings.input.binds[user][i], + user + 1, + user, strdup(name), /* TODO: Find a way to fix these memleaks. */ strdup(label), &defaults[i],