mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Rename MAX_PLAYERS to MAX_USERS
This commit is contained in:
parent
45cdb15de4
commit
7a456c6c3a
@ -32,7 +32,7 @@ static void apple_gamecontroller_poll(GCController *controller)
|
|||||||
{
|
{
|
||||||
uint32_t slot, pause;
|
uint32_t slot, pause;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
||||||
if (!apple || !controller || controller.playerIndex == MAX_PLAYERS)
|
if (!apple || !controller || controller.playerIndex == MAX_USERS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slot = (uint32_t)controller.playerIndex;
|
slot = (uint32_t)controller.playerIndex;
|
||||||
@ -114,7 +114,7 @@ static void apple_gamecontroller_connect(GCController *controller)
|
|||||||
{
|
{
|
||||||
int32_t slot = apple_joypad_connect_gcapi(slots);
|
int32_t slot = apple_joypad_connect_gcapi(slots);
|
||||||
|
|
||||||
controller.playerIndex = (slot >= 0 && slot < MAX_PLAYERS) ? slot : GCControllerPlayerIndexUnset;
|
controller.playerIndex = (slot >= 0 && slot < MAX_USERS) ? slot : GCControllerPlayerIndexUnset;
|
||||||
|
|
||||||
if (controller.playerIndex == GCControllerPlayerIndexUnset)
|
if (controller.playerIndex == GCControllerPlayerIndexUnset)
|
||||||
return;
|
return;
|
||||||
|
@ -50,7 +50,7 @@ struct pad_connection
|
|||||||
|
|
||||||
static bool inquiry_off;
|
static bool inquiry_off;
|
||||||
static bool inquiry_running;
|
static bool inquiry_running;
|
||||||
static struct pad_connection g_connections[MAX_PLAYERS];
|
static struct pad_connection g_connections[MAX_USERS];
|
||||||
|
|
||||||
static void btpad_connection_send_control(void *data,
|
static void btpad_connection_send_control(void *data,
|
||||||
uint8_t* data_buf, size_t size)
|
uint8_t* data_buf, size_t size)
|
||||||
@ -73,7 +73,7 @@ void btpad_set_inquiry_state(bool on)
|
|||||||
static struct pad_connection* btpad_find_empty_connection(void)
|
static struct pad_connection* btpad_find_empty_connection(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i != MAX_PLAYERS; i ++)
|
for (i = 0; i < MAX_USERS; i ++)
|
||||||
if (g_connections[i].state == BTPAD_EMPTY)
|
if (g_connections[i].state == BTPAD_EMPTY)
|
||||||
return &g_connections[i];
|
return &g_connections[i];
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ static struct pad_connection* btpad_find_connection_for(
|
|||||||
uint16_t handle, bd_addr_t address)
|
uint16_t handle, bd_addr_t address)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i ++)
|
for (i = 0; i < MAX_USERS; i ++)
|
||||||
{
|
{
|
||||||
if (!g_connections[i].handle && !g_connections[i].has_address)
|
if (!g_connections[i].handle && !g_connections[i].has_address)
|
||||||
continue;
|
continue;
|
||||||
@ -117,7 +117,7 @@ static void btpad_close_connection(struct pad_connection* connection)
|
|||||||
static void btpad_close_all_connections(void)
|
static void btpad_close_all_connections(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i ++)
|
for (i = 0; i < MAX_USERS; i ++)
|
||||||
btpad_close_connection(&g_connections[i]);
|
btpad_close_connection(&g_connections[i]);
|
||||||
/* TODO/FIXME - create platform-agnostic solution for this
|
/* TODO/FIXME - create platform-agnostic solution for this
|
||||||
* and figure out why/if this is needed. */
|
* and figure out why/if this is needed. */
|
||||||
@ -133,7 +133,7 @@ void btpad_packet_handler(uint8_t packet_type,
|
|||||||
switch (packet_type)
|
switch (packet_type)
|
||||||
{
|
{
|
||||||
case L2CAP_DATA_PACKET:
|
case L2CAP_DATA_PACKET:
|
||||||
for (i = 0; i < MAX_PLAYERS; i ++)
|
for (i = 0; i < MAX_USERS; i ++)
|
||||||
{
|
{
|
||||||
struct pad_connection* connection =
|
struct pad_connection* connection =
|
||||||
(struct pad_connection*)&g_connections[i];
|
(struct pad_connection*)&g_connections[i];
|
||||||
|
@ -645,7 +645,7 @@ static const bool input_descriptor_hide_unbound = false;
|
|||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
#include "intl/intl.h"
|
#include "intl/intl.h"
|
||||||
|
|
||||||
/* Player 1 */
|
/* User 1 */
|
||||||
static const struct retro_keybind retro_keybinds_1[] = {
|
static const struct retro_keybind retro_keybinds_1[] = {
|
||||||
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
||||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, RETRO_LBL_JOYPAD_B, RETROK_z, NO_BTN, 0, AXIS_NONE },
|
{ true, RETRO_DEVICE_ID_JOYPAD_B, RETRO_LBL_JOYPAD_B, RETROK_z, NO_BTN, 0, AXIS_NONE },
|
||||||
@ -708,7 +708,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
|||||||
{ true, RARCH_MENU_TOGGLE, RETRO_LBL_MENU_TOGGLE, RETROK_F1, NO_BTN, 0, AXIS_NONE },
|
{ true, RARCH_MENU_TOGGLE, RETRO_LBL_MENU_TOGGLE, RETROK_F1, NO_BTN, 0, AXIS_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Players 2 to MAX_PLAYERS */
|
/* Users 2 to MAX_USERS */
|
||||||
static const struct retro_keybind retro_keybinds_rest[] = {
|
static const struct retro_keybind retro_keybinds_rest[] = {
|
||||||
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
||||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, RETRO_LBL_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
{ true, RETRO_DEVICE_ID_JOYPAD_B, RETRO_LBL_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||||
|
@ -668,7 +668,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
{
|
{
|
||||||
retro_port = desc->port;
|
retro_port = desc->port;
|
||||||
retro_id = desc->id;
|
retro_id = desc->id;
|
||||||
if (desc->port >= MAX_PLAYERS)
|
if (desc->port >= MAX_USERS)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Ignore all others for now. */
|
/* Ignore all others for now. */
|
||||||
@ -725,7 +725,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
};
|
};
|
||||||
|
|
||||||
RARCH_LOG("Environ SET_INPUT_DESCRIPTORS:\n");
|
RARCH_LOG("Environ SET_INPUT_DESCRIPTORS:\n");
|
||||||
for (p = 0; p < MAX_PLAYERS; p++)
|
for (p = 0; p < MAX_USERS; p++)
|
||||||
{
|
{
|
||||||
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
|
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
|
||||||
{
|
{
|
||||||
|
26
general.h
26
general.h
@ -80,7 +80,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_PLAYERS 16
|
#define MAX_USERS 16
|
||||||
|
|
||||||
enum basic_event
|
enum basic_event
|
||||||
{
|
{
|
||||||
@ -360,22 +360,22 @@ struct settings
|
|||||||
char driver[32];
|
char driver[32];
|
||||||
char joypad_driver[32];
|
char joypad_driver[32];
|
||||||
char keyboard_layout[64];
|
char keyboard_layout[64];
|
||||||
struct retro_keybind binds[MAX_PLAYERS][RARCH_BIND_LIST_END];
|
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||||
|
|
||||||
unsigned max_users;
|
unsigned max_users;
|
||||||
|
|
||||||
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
||||||
* Does not override main binds. */
|
* Does not override main binds. */
|
||||||
struct retro_keybind autoconf_binds[MAX_PLAYERS][RARCH_BIND_LIST_END];
|
struct retro_keybind autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||||
bool autoconfigured[MAX_PLAYERS];
|
bool autoconfigured[MAX_USERS];
|
||||||
|
|
||||||
unsigned libretro_device[MAX_PLAYERS];
|
unsigned libretro_device[MAX_USERS];
|
||||||
unsigned analog_dpad_mode[MAX_PLAYERS];
|
unsigned analog_dpad_mode[MAX_USERS];
|
||||||
|
|
||||||
float axis_threshold;
|
float axis_threshold;
|
||||||
unsigned joypad_map[MAX_PLAYERS];
|
unsigned joypad_map[MAX_USERS];
|
||||||
unsigned device[MAX_PLAYERS];
|
unsigned device[MAX_USERS];
|
||||||
char device_names[MAX_PLAYERS][64];
|
char device_names[MAX_USERS][64];
|
||||||
bool autodetect_enable;
|
bool autodetect_enable;
|
||||||
bool netplay_client_swap_input;
|
bool netplay_client_swap_input;
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ struct global
|
|||||||
bool has_set_input_descriptors;
|
bool has_set_input_descriptors;
|
||||||
bool has_set_save_path;
|
bool has_set_save_path;
|
||||||
bool has_set_state_path;
|
bool has_set_state_path;
|
||||||
bool has_set_libretro_device[MAX_PLAYERS];
|
bool has_set_libretro_device[MAX_USERS];
|
||||||
bool has_set_libretro;
|
bool has_set_libretro;
|
||||||
bool has_set_libretro_directory;
|
bool has_set_libretro_directory;
|
||||||
bool has_set_verbosity;
|
bool has_set_verbosity;
|
||||||
@ -576,7 +576,7 @@ struct global
|
|||||||
bool force_nonblock;
|
bool force_nonblock;
|
||||||
bool no_content;
|
bool no_content;
|
||||||
|
|
||||||
const char *input_desc_btn[MAX_PLAYERS][RARCH_FIRST_META_KEY];
|
const char *input_desc_btn[MAX_USERS][RARCH_FIRST_META_KEY];
|
||||||
char valid_extensions[PATH_MAX];
|
char valid_extensions[PATH_MAX];
|
||||||
|
|
||||||
retro_keyboard_event_t key_event;
|
retro_keyboard_event_t key_event;
|
||||||
@ -698,8 +698,8 @@ struct global
|
|||||||
bool is_slowmotion;
|
bool is_slowmotion;
|
||||||
|
|
||||||
/* Turbo support. */
|
/* Turbo support. */
|
||||||
bool turbo_frame_enable[MAX_PLAYERS];
|
bool turbo_frame_enable[MAX_USERS];
|
||||||
uint16_t turbo_enable[MAX_PLAYERS];
|
uint16_t turbo_enable[MAX_USERS];
|
||||||
unsigned turbo_count;
|
unsigned turbo_count;
|
||||||
|
|
||||||
/* Autosave support. */
|
/* Autosave support. */
|
||||||
|
@ -79,7 +79,7 @@ static PyObject* py_read_vram(PyObject *self, PyObject *args)
|
|||||||
return PyLong_FromLong(data[addr]);
|
return PyLong_FromLong(data[addr]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct retro_keybind *py_binds[MAX_PLAYERS] = {
|
static const struct retro_keybind *py_binds[MAX_USERS] = {
|
||||||
g_settings.input.binds[0],
|
g_settings.input.binds[0],
|
||||||
g_settings.input.binds[1],
|
g_settings.input.binds[1],
|
||||||
g_settings.input.binds[2],
|
g_settings.input.binds[2],
|
||||||
@ -101,7 +101,7 @@ static PyObject *py_read_input(PyObject *self, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "II", &user, &key))
|
if (!PyArg_ParseTuple(args, "II", &user, &key))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (user > MAX_PLAYERS || user < 1 || key >= RARCH_FIRST_META_KEY)
|
if (user > MAX_USERS || user < 1 || key >= RARCH_FIRST_META_KEY)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int16_t res = driver.block_libretro_input ? 0 :
|
int16_t res = driver.block_libretro_input ? 0 :
|
||||||
@ -122,7 +122,7 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "III", &user, &index, &id))
|
if (!PyArg_ParseTuple(args, "III", &user, &index, &id))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (user > MAX_PLAYERS || user < 1 || index > 1 || id > 1)
|
if (user > MAX_USERS || user < 1 || index > 1 || id > 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int16_t res = driver.input->input_state(driver.input_data,
|
int16_t res = driver.input->input_state(driver.input_data,
|
||||||
@ -348,7 +348,7 @@ float py_state_get(py_state_t *handle, const char *id,
|
|||||||
unsigned frame_count)
|
unsigned frame_count)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
input_push_analog_dpad(g_settings.input.binds[i],
|
input_push_analog_dpad(g_settings.input.binds[i],
|
||||||
g_settings.input.analog_dpad_mode[i]);
|
g_settings.input.analog_dpad_mode[i]);
|
||||||
@ -358,7 +358,7 @@ float py_state_get(py_state_t *handle, const char *id,
|
|||||||
|
|
||||||
PyObject *ret = PyObject_CallMethod(handle->inst, (char*)id, (char*)"I", frame_count);
|
PyObject *ret = PyObject_CallMethod(handle->inst, (char*)id, (char*)"I", frame_count);
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
input_pop_analog_dpad(g_settings.input.binds[i]);
|
input_pop_analog_dpad(g_settings.input.binds[i]);
|
||||||
input_pop_analog_dpad(g_settings.input.autoconf_binds[i]);
|
input_pop_analog_dpad(g_settings.input.autoconf_binds[i]);
|
||||||
|
@ -264,7 +264,7 @@ static void update_input(state_tracker_t *tracker)
|
|||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
input_push_analog_dpad(g_settings.input.binds[i],
|
input_push_analog_dpad(g_settings.input.binds[i],
|
||||||
g_settings.input.analog_dpad_mode[i]);
|
g_settings.input.analog_dpad_mode[i]);
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
input_push_analog_dpad(g_settings.input.autoconf_binds[i],
|
input_push_analog_dpad(g_settings.input.autoconf_binds[i],
|
||||||
g_settings.input.analog_dpad_mode[i]);
|
g_settings.input.analog_dpad_mode[i]);
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ static void update_input(state_tracker_t *tracker)
|
|||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
input_pop_analog_dpad(g_settings.input.binds[i]);
|
input_pop_analog_dpad(g_settings.input.binds[i]);
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
input_pop_analog_dpad(g_settings.input.autoconf_binds[i]);
|
input_pop_analog_dpad(g_settings.input.autoconf_binds[i]);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
|
@ -25,7 +25,7 @@ static bool android_joypad_init(void)
|
|||||||
{
|
{
|
||||||
unsigned autoconf_pad;
|
unsigned autoconf_pad;
|
||||||
|
|
||||||
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
|
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.input.device_names[autoconf_pad],
|
strlcpy(g_settings.input.device_names[autoconf_pad],
|
||||||
android_joypad_name(autoconf_pad),
|
android_joypad_name(autoconf_pad),
|
||||||
@ -127,7 +127,7 @@ static void android_joypad_poll(void)
|
|||||||
static bool android_joypad_query_pad(unsigned pad)
|
static bool android_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
android_input_t *android = (android_input_t*)driver.input_data;
|
android_input_t *android = (android_input_t*)driver.input_data;
|
||||||
return (pad < MAX_PLAYERS && pad < android->pads_connected);
|
return (pad < MAX_USERS && pad < android->pads_connected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ typedef struct
|
|||||||
|
|
||||||
uint32_t key_state[MAX_KEYS];
|
uint32_t key_state[MAX_KEYS];
|
||||||
|
|
||||||
uint32_t buttons[MAX_PLAYERS];
|
uint32_t buttons[MAX_USERS];
|
||||||
int16_t axes[MAX_PLAYERS][4];
|
int16_t axes[MAX_USERS][4];
|
||||||
int8_t hats[NUM_HATS][2];
|
int8_t hats[NUM_HATS][2];
|
||||||
|
|
||||||
bool icade_enabled;
|
bool icade_enabled;
|
||||||
|
@ -123,7 +123,7 @@ static void remove_device(void* context, IOReturn result, void* sender)
|
|||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
||||||
struct pad_connection* connection = (struct pad_connection*)context;
|
struct pad_connection* connection = (struct pad_connection*)context;
|
||||||
|
|
||||||
if (connection && connection->slot < MAX_PLAYERS)
|
if (connection && connection->slot < MAX_USERS)
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512];
|
||||||
snprintf(msg, sizeof(msg), "Joypad #%u (%s) disconnected.",
|
snprintf(msg, sizeof(msg), "Joypad #%u (%s) disconnected.",
|
||||||
@ -162,7 +162,7 @@ static void add_device(void* context, IOReturn result,
|
|||||||
calloc(1, sizeof(*connection));
|
calloc(1, sizeof(*connection));
|
||||||
|
|
||||||
connection->device_handle = device;
|
connection->device_handle = device;
|
||||||
connection->slot = MAX_PLAYERS;
|
connection->slot = MAX_USERS;
|
||||||
|
|
||||||
IOHIDDeviceOpen(device, kIOHIDOptionsTypeNone);
|
IOHIDDeviceOpen(device, kIOHIDOptionsTypeNone);
|
||||||
|
|
||||||
@ -252,14 +252,14 @@ static bool apple_joypad_init(void)
|
|||||||
|
|
||||||
IOHIDManagerOpen(g_hid_manager, kIOHIDOptionsTypeNone);
|
IOHIDManagerOpen(g_hid_manager, kIOHIDOptionsTypeNone);
|
||||||
|
|
||||||
slots = (joypad_connection_t*)pad_connection_init(MAX_PLAYERS);
|
slots = (joypad_connection_t*)pad_connection_init(MAX_USERS);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool apple_joypad_query_pad(unsigned pad)
|
static bool apple_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS;
|
return pad < MAX_USERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void apple_joypad_hid_destroy(void)
|
static void apple_joypad_hid_destroy(void)
|
||||||
@ -294,7 +294,7 @@ static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check the button. */
|
/* Check the button. */
|
||||||
if ((port < MAX_PLAYERS) && (joykey < 32))
|
if ((port < MAX_USERS) && (joykey < 32))
|
||||||
return ((apple->buttons[port] & (1 << joykey)) != 0) ||
|
return ((apple->buttons[port] & (1 << joykey)) != 0) ||
|
||||||
((buttons & (1 << joykey)) != 0);
|
((buttons & (1 << joykey)) != 0);
|
||||||
return false;
|
return false;
|
||||||
@ -337,7 +337,7 @@ static bool apple_joypad_rumble(unsigned pad,
|
|||||||
static const char *apple_joypad_name(unsigned pad)
|
static const char *apple_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
/* TODO/FIXME - implement properly */
|
/* TODO/FIXME - implement properly */
|
||||||
if (pad >= MAX_PLAYERS)
|
if (pad >= MAX_USERS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -29,7 +29,7 @@ joypad_connection_t *slots;
|
|||||||
|
|
||||||
static bool apple_joypad_init(void)
|
static bool apple_joypad_init(void)
|
||||||
{
|
{
|
||||||
slots = (joypad_connection_t*)pad_connection_init(MAX_PLAYERS);
|
slots = (joypad_connection_t*)pad_connection_init(MAX_USERS);
|
||||||
|
|
||||||
if (!slots)
|
if (!slots)
|
||||||
return false;
|
return false;
|
||||||
@ -38,7 +38,7 @@ static bool apple_joypad_init(void)
|
|||||||
|
|
||||||
static bool apple_joypad_query_pad(unsigned pad)
|
static bool apple_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS;
|
return pad < MAX_USERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void apple_joypad_destroy(void)
|
static void apple_joypad_destroy(void)
|
||||||
@ -57,7 +57,7 @@ static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
|||||||
if (GET_HAT_DIR(joykey))
|
if (GET_HAT_DIR(joykey))
|
||||||
return false;
|
return false;
|
||||||
// Check the button
|
// Check the button
|
||||||
if ((port < MAX_PLAYERS) && (joykey < 32))
|
if ((port < MAX_USERS) && (joykey < 32))
|
||||||
return ((apple->buttons[port] & (1 << joykey)) != 0) ||
|
return ((apple->buttons[port] & (1 << joykey)) != 0) ||
|
||||||
((buttons & (1 << joykey)) != 0);
|
((buttons & (1 << joykey)) != 0);
|
||||||
return false;
|
return false;
|
||||||
|
@ -20,7 +20,7 @@ static int find_vacant_pad(joypad_connection_t *joyconn)
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
||||||
if (conn && !conn->used)
|
if (conn && !conn->used)
|
||||||
@ -91,7 +91,7 @@ int32_t apple_joypad_connect_gcapi(joypad_connection_t *joyconn)
|
|||||||
{
|
{
|
||||||
int pad = find_vacant_pad(joyconn);
|
int pad = find_vacant_pad(joyconn);
|
||||||
|
|
||||||
if (pad >= 0 && pad < MAX_PLAYERS)
|
if (pad >= 0 && pad < MAX_USERS)
|
||||||
{
|
{
|
||||||
joypad_connection_t *s = (joypad_connection_t*)&joyconn[pad];
|
joypad_connection_t *s = (joypad_connection_t*)&joyconn[pad];
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ void pad_connection_destroy(joypad_connection_t *joyconn)
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i ++)
|
for (i = 0; i < MAX_USERS; i ++)
|
||||||
{
|
{
|
||||||
joypad_connection_t *s = (joypad_connection_t*)&joyconn[i];
|
joypad_connection_t *s = (joypad_connection_t*)&joyconn[i];
|
||||||
pad_connection_pad_deinit(s, i);
|
pad_connection_pad_deinit(s, i);
|
||||||
|
@ -66,7 +66,7 @@ struct dinput_joypad
|
|||||||
};
|
};
|
||||||
|
|
||||||
static unsigned g_joypad_cnt;
|
static unsigned g_joypad_cnt;
|
||||||
static struct dinput_joypad g_pads[MAX_PLAYERS];
|
static struct dinput_joypad g_pads[MAX_USERS];
|
||||||
|
|
||||||
static void dinput_destroy_context(void)
|
static void dinput_destroy_context(void)
|
||||||
{
|
{
|
||||||
@ -610,13 +610,13 @@ input_driver_t input_dinput = {
|
|||||||
* -1 = not xbox pad, otherwise 0..3
|
* -1 = not xbox pad, otherwise 0..3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int g_xinput_pad_indexes[MAX_PLAYERS];
|
int g_xinput_pad_indexes[MAX_USERS];
|
||||||
bool g_xinput_block_pads;
|
bool g_xinput_block_pads;
|
||||||
|
|
||||||
static void dinput_joypad_destroy(void)
|
static void dinput_joypad_destroy(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
if (g_pads[i].joypad)
|
if (g_pads[i].joypad)
|
||||||
{
|
{
|
||||||
@ -734,7 +734,7 @@ static unsigned g_last_xinput_pad_idx;
|
|||||||
static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p)
|
static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p)
|
||||||
{
|
{
|
||||||
(void)p;
|
(void)p;
|
||||||
if (g_joypad_cnt == MAX_PLAYERS)
|
if (g_joypad_cnt == MAX_USERS)
|
||||||
return DIENUM_STOP;
|
return DIENUM_STOP;
|
||||||
|
|
||||||
LPDIRECTINPUTDEVICE8 *pad = &g_pads[g_joypad_cnt].joypad;
|
LPDIRECTINPUTDEVICE8 *pad = &g_pads[g_joypad_cnt].joypad;
|
||||||
@ -799,7 +799,7 @@ static bool dinput_joypad_init(void)
|
|||||||
|
|
||||||
g_last_xinput_pad_idx = 0;
|
g_last_xinput_pad_idx = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; ++i)
|
for (i = 0; i < MAX_USERS; ++i)
|
||||||
{
|
{
|
||||||
g_xinput_pad_indexes[i] = -1;
|
g_xinput_pad_indexes[i] = -1;
|
||||||
g_pads[i].joy_name = NULL;
|
g_pads[i].joy_name = NULL;
|
||||||
@ -923,7 +923,7 @@ static int16_t dinput_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
|||||||
static void dinput_joypad_poll(void)
|
static void dinput_joypad_poll(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
struct dinput_joypad *pad = &g_pads[i];
|
struct dinput_joypad *pad = &g_pads[i];
|
||||||
|
|
||||||
@ -955,12 +955,12 @@ static void dinput_joypad_poll(void)
|
|||||||
|
|
||||||
static bool dinput_joypad_query_pad(unsigned pad)
|
static bool dinput_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && g_pads[pad].joypad;
|
return pad < MAX_USERS && g_pads[pad].joypad;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *dinput_joypad_name(unsigned pad)
|
static const char *dinput_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
if (pad < MAX_PLAYERS)
|
if (pad < MAX_USERS)
|
||||||
return g_pads[pad].joy_name;
|
return g_pads[pad].joy_name;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -596,7 +596,7 @@ static void gx_joypad_poll(void)
|
|||||||
|
|
||||||
static bool gx_joypad_query_pad(unsigned pad)
|
static bool gx_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && pad_state[pad];
|
return pad < MAX_USERS && pad_state[pad];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gx_joypad_destroy(void)
|
static void gx_joypad_destroy(void)
|
||||||
|
@ -164,7 +164,7 @@ void input_config_autoconfigure_joypad(unsigned idx,
|
|||||||
const struct retro_keybind *input_get_auto_bind(unsigned port, unsigned id)
|
const struct retro_keybind *input_get_auto_bind(unsigned port, unsigned id)
|
||||||
{
|
{
|
||||||
unsigned joy_idx = g_settings.input.joypad_map[port];
|
unsigned joy_idx = g_settings.input.joypad_map[port];
|
||||||
if (joy_idx < MAX_PLAYERS)
|
if (joy_idx < MAX_USERS)
|
||||||
return &g_settings.input.autoconf_binds[joy_idx][id];
|
return &g_settings.input.autoconf_binds[joy_idx][id];
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -39,7 +39,7 @@ bool input_joypad_set_rumble(const rarch_joypad_driver_t *drv,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned joy_idx = g_settings.input.joypad_map[port];
|
unsigned joy_idx = g_settings.input.joypad_map[port];
|
||||||
if (joy_idx >= MAX_PLAYERS)
|
if (joy_idx >= MAX_USERS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return drv->set_rumble(joy_idx, effect, strength);
|
return drv->set_rumble(joy_idx, effect, strength);
|
||||||
@ -52,7 +52,7 @@ static bool input_joypad_is_pressed(
|
|||||||
unsigned key)
|
unsigned key)
|
||||||
{
|
{
|
||||||
unsigned joy_idx = g_settings.input.joypad_map[port];
|
unsigned joy_idx = g_settings.input.joypad_map[port];
|
||||||
if (joy_idx >= MAX_PLAYERS)
|
if (joy_idx >= MAX_USERS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Auto-binds are per joypad, not per user. */
|
/* Auto-binds are per joypad, not per user. */
|
||||||
@ -99,7 +99,7 @@ int16_t input_joypad_analog(const rarch_joypad_driver_t *drv,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unsigned joy_idx = g_settings.input.joypad_map[port];
|
unsigned joy_idx = g_settings.input.joypad_map[port];
|
||||||
if (joy_idx >= MAX_PLAYERS)
|
if (joy_idx >= MAX_USERS)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Auto-binds are per joypad, not per user. */
|
/* Auto-binds are per joypad, not per user. */
|
||||||
@ -206,7 +206,7 @@ bool input_translate_coord_viewport(int mouse_x, int mouse_y,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *bind_user_prefix[MAX_PLAYERS] = {
|
static const char *bind_user_prefix[MAX_USERS] = {
|
||||||
"input_player1",
|
"input_player1",
|
||||||
"input_player2",
|
"input_player2",
|
||||||
"input_player3",
|
"input_player3",
|
||||||
|
@ -39,7 +39,7 @@ struct linuxraw_joypad
|
|||||||
char *ident;
|
char *ident;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct linuxraw_joypad linuxraw_pads[MAX_PLAYERS];
|
static struct linuxraw_joypad linuxraw_pads[MAX_USERS];
|
||||||
static int g_notify;
|
static int g_notify;
|
||||||
static int g_epoll;
|
static int g_epoll;
|
||||||
static bool g_hotplug;
|
static bool g_hotplug;
|
||||||
@ -134,7 +134,7 @@ static void handle_plugged_pad(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
unsigned idx = strtoul(event->name + 2, NULL, 0);
|
unsigned idx = strtoul(event->name + 2, NULL, 0);
|
||||||
if (idx >= MAX_PLAYERS)
|
if (idx >= MAX_USERS)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (event->mask & IN_DELETE)
|
if (event->mask & IN_DELETE)
|
||||||
@ -181,10 +181,10 @@ static void handle_plugged_pad(void)
|
|||||||
static void linuxraw_joypad_poll(void)
|
static void linuxraw_joypad_poll(void)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
struct epoll_event events[MAX_PLAYERS + 1];
|
struct epoll_event events[MAX_USERS + 1];
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
ret = epoll_wait(g_epoll, events, MAX_PLAYERS + 1, 0);
|
ret = epoll_wait(g_epoll, events, MAX_USERS + 1, 0);
|
||||||
if (ret < 0 && errno == EINTR)
|
if (ret < 0 && errno == EINTR)
|
||||||
goto retry;
|
goto retry;
|
||||||
|
|
||||||
@ -206,11 +206,11 @@ static void linuxraw_joypad_setup_notify(void)
|
|||||||
static bool linuxraw_joypad_init(void)
|
static bool linuxraw_joypad_init(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
g_epoll = epoll_create(MAX_PLAYERS + 1);
|
g_epoll = epoll_create(MAX_USERS + 1);
|
||||||
if (g_epoll < 0)
|
if (g_epoll < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
struct linuxraw_joypad *pad = (struct linuxraw_joypad*)&linuxraw_pads[i];
|
struct linuxraw_joypad *pad = (struct linuxraw_joypad*)&linuxraw_pads[i];
|
||||||
pad->fd = -1;
|
pad->fd = -1;
|
||||||
@ -248,14 +248,14 @@ static bool linuxraw_joypad_init(void)
|
|||||||
static void linuxraw_joypad_destroy(void)
|
static void linuxraw_joypad_destroy(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
if (linuxraw_pads[i].fd >= 0)
|
if (linuxraw_pads[i].fd >= 0)
|
||||||
close(linuxraw_pads[i].fd);
|
close(linuxraw_pads[i].fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(linuxraw_pads, 0, sizeof(linuxraw_pads));
|
memset(linuxraw_pads, 0, sizeof(linuxraw_pads));
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
linuxraw_pads[i].fd = -1;
|
linuxraw_pads[i].fd = -1;
|
||||||
|
|
||||||
if (g_notify >= 0)
|
if (g_notify >= 0)
|
||||||
@ -305,12 +305,12 @@ static int16_t linuxraw_joypad_axis(unsigned port, uint32_t joyaxis)
|
|||||||
|
|
||||||
static bool linuxraw_joypad_query_pad(unsigned pad)
|
static bool linuxraw_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && linuxraw_pads[pad].fd >= 0;
|
return pad < MAX_USERS && linuxraw_pads[pad].fd >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *linuxraw_joypad_name(unsigned pad)
|
static const char *linuxraw_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
if (pad >= MAX_PLAYERS)
|
if (pad >= MAX_USERS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return *linuxraw_pads[pad].ident ? linuxraw_pads[pad].ident : NULL;
|
return *linuxraw_pads[pad].ident ? linuxraw_pads[pad].ident : NULL;
|
||||||
|
@ -41,7 +41,7 @@ struct parport_joypad
|
|||||||
char *ident;
|
char *ident;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct parport_joypad parport_pads[MAX_PLAYERS];
|
static struct parport_joypad parport_pads[MAX_USERS];
|
||||||
|
|
||||||
static void parport_poll_pad(struct parport_joypad *pad)
|
static void parport_poll_pad(struct parport_joypad *pad)
|
||||||
{
|
{
|
||||||
@ -200,7 +200,7 @@ static void parport_joypad_poll(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
if (parport_pads[i].fd >= 0)
|
if (parport_pads[i].fd >= 0)
|
||||||
parport_poll_pad(&parport_pads[i]);
|
parport_poll_pad(&parport_pads[i]);
|
||||||
@ -235,7 +235,7 @@ static bool parport_joypad_init(void)
|
|||||||
|
|
||||||
memset(buf, 0, PARPORT_NUM_BUTTONS * 3 + 1);
|
memset(buf, 0, PARPORT_NUM_BUTTONS * 3 + 1);
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
struct parport_joypad *pad = &parport_pads[i];
|
struct parport_joypad *pad = &parport_pads[i];
|
||||||
pad->fd = -1;
|
pad->fd = -1;
|
||||||
@ -307,7 +307,7 @@ static void parport_joypad_destroy(void)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
struct parport_joypad *pad;
|
struct parport_joypad *pad;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
pad = (struct parport_joypad*)&parport_pads[i];
|
pad = (struct parport_joypad*)&parport_pads[i];
|
||||||
if (pad->fd >= 0)
|
if (pad->fd >= 0)
|
||||||
@ -316,7 +316,7 @@ static void parport_joypad_destroy(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
memset(parport_pads, 0, sizeof(parport_pads));
|
memset(parport_pads, 0, sizeof(parport_pads));
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
parport_pads[i].fd = -1;
|
parport_pads[i].fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,12 +336,12 @@ static int16_t parport_joypad_axis(unsigned port, uint32_t joyaxis)
|
|||||||
|
|
||||||
static bool parport_joypad_query_pad(unsigned pad)
|
static bool parport_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && parport_pads[pad].fd >= 0;
|
return pad < MAX_USERS && parport_pads[pad].fd >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *parport_joypad_name(unsigned pad)
|
static const char *parport_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
if (pad >= MAX_PLAYERS)
|
if (pad >= MAX_USERS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return *parport_pads[pad].ident ? parport_pads[pad].ident : NULL;
|
return *parport_pads[pad].ident ? parport_pads[pad].ident : NULL;
|
||||||
|
@ -41,7 +41,7 @@ static bool ps3_joypad_init(void)
|
|||||||
|
|
||||||
cellPadInit(MAX_PADS);
|
cellPadInit(MAX_PADS);
|
||||||
|
|
||||||
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
|
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.input.device_names[autoconf_pad],
|
strlcpy(g_settings.input.device_names[autoconf_pad],
|
||||||
"SixAxis Controller",
|
"SixAxis Controller",
|
||||||
@ -209,7 +209,7 @@ static void ps3_joypad_poll(void)
|
|||||||
|
|
||||||
static bool ps3_joypad_query_pad(unsigned pad)
|
static bool ps3_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && pad_state[pad];
|
return pad < MAX_USERS && pad_state[pad];
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ps3_joypad_rumble(unsigned pad,
|
static bool ps3_joypad_rumble(unsigned pad,
|
||||||
|
@ -154,7 +154,7 @@ static void psp_joypad_poll(void)
|
|||||||
|
|
||||||
static bool psp_joypad_query_pad(unsigned pad)
|
static bool psp_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && pad_state;
|
return pad < MAX_USERS && pad_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ static bool qnx_joypad_init(void)
|
|||||||
{
|
{
|
||||||
unsigned autoconf_pad;
|
unsigned autoconf_pad;
|
||||||
|
|
||||||
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
|
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.input.device_names[autoconf_pad], "None",
|
strlcpy(g_settings.input.device_names[autoconf_pad], "None",
|
||||||
sizeof(g_settings.input.device_names[autoconf_pad]));
|
sizeof(g_settings.input.device_names[autoconf_pad]));
|
||||||
@ -105,7 +105,7 @@ static void qnx_joypad_poll(void)
|
|||||||
static bool qnx_joypad_query_pad(unsigned pad)
|
static bool qnx_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
qnx_input_t *qnx = (qnx_input_t*)driver.input_data;
|
qnx_input_t *qnx = (qnx_input_t*)driver.input_data;
|
||||||
return (qnx && pad < MAX_PLAYERS && qnx->pad_state[pad]);
|
return (qnx && pad < MAX_USERS && qnx->pad_state[pad]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const int g_subsystem = SDL_INIT_GAMECONTROLLER;
|
|||||||
const int g_subsystem = SDL_INIT_JOYSTICK;
|
const int g_subsystem = SDL_INIT_JOYSTICK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static sdl_joypad_t sdl_pads[MAX_PLAYERS];
|
static sdl_joypad_t sdl_pads[MAX_USERS];
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
static bool g_has_haptic;
|
static bool g_has_haptic;
|
||||||
#endif
|
#endif
|
||||||
@ -212,7 +212,7 @@ static void pad_disconnect(unsigned id)
|
|||||||
static void sdl_joypad_destroy(void)
|
static void sdl_joypad_destroy(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
pad_disconnect(i);
|
pad_disconnect(i);
|
||||||
|
|
||||||
SDL_QuitSubSystem(g_subsystem);
|
SDL_QuitSubSystem(g_subsystem);
|
||||||
@ -243,8 +243,8 @@ static bool sdl_joypad_init(void)
|
|||||||
memset(sdl_pads, 0, sizeof(sdl_pads));
|
memset(sdl_pads, 0, sizeof(sdl_pads));
|
||||||
|
|
||||||
unsigned num_sticks = SDL_NumJoysticks();
|
unsigned num_sticks = SDL_NumJoysticks();
|
||||||
if (num_sticks > MAX_PLAYERS)
|
if (num_sticks > MAX_USERS)
|
||||||
num_sticks = MAX_PLAYERS;
|
num_sticks = MAX_USERS;
|
||||||
|
|
||||||
for (i = 0; i < num_sticks; i++)
|
for (i = 0; i < num_sticks; i++)
|
||||||
pad_connect(i);
|
pad_connect(i);
|
||||||
@ -252,7 +252,7 @@ static bool sdl_joypad_init(void)
|
|||||||
#ifndef HAVE_SDL2
|
#ifndef HAVE_SDL2
|
||||||
/* quit if no joypad is detected. */
|
/* quit if no joypad is detected. */
|
||||||
num_sticks = 0;
|
num_sticks = 0;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
if (sdl_pads[i].joypad)
|
if (sdl_pads[i].joypad)
|
||||||
num_sticks++;
|
num_sticks++;
|
||||||
|
|
||||||
@ -413,12 +413,12 @@ static bool sdl_joypad_set_rumble(unsigned pad, enum retro_rumble_effect effect,
|
|||||||
|
|
||||||
static bool sdl_joypad_query_pad(unsigned pad)
|
static bool sdl_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && sdl_pads[pad].joypad;
|
return pad < MAX_USERS && sdl_pads[pad].joypad;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *sdl_joypad_name(unsigned pad)
|
static const char *sdl_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
if (pad >= MAX_PLAYERS)
|
if (pad >= MAX_USERS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return pad_name(pad);
|
return pad_name(pad);
|
||||||
|
@ -69,7 +69,7 @@ struct udev_joypad
|
|||||||
|
|
||||||
static struct udev *g_udev;
|
static struct udev *g_udev;
|
||||||
static struct udev_monitor *g_udev_mon;
|
static struct udev_monitor *g_udev_mon;
|
||||||
static struct udev_joypad udev_pads[MAX_PLAYERS];
|
static struct udev_joypad udev_pads[MAX_USERS];
|
||||||
|
|
||||||
static inline int16_t compute_axis(const struct input_absinfo *info, int value)
|
static inline int16_t compute_axis(const struct input_absinfo *info, int value)
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ static void udev_joypad_poll(void)
|
|||||||
while (hotplug_available())
|
while (hotplug_available())
|
||||||
handle_hotplug();
|
handle_hotplug();
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
udev_poll_pad(i);
|
udev_poll_pad(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ error:
|
|||||||
static int find_vacant_pad(void)
|
static int find_vacant_pad(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
if (udev_pads[i].fd < 0)
|
if (udev_pads[i].fd < 0)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
@ -415,7 +415,7 @@ static void check_device(struct udev_device *dev, const char *path, bool hotplug
|
|||||||
if (stat(path, &st) < 0)
|
if (stat(path, &st) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
if (st.st_rdev == udev_pads[i].device)
|
if (st.st_rdev == udev_pads[i].device)
|
||||||
{
|
{
|
||||||
@ -456,7 +456,7 @@ static void check_device(struct udev_device *dev, const char *path, bool hotplug
|
|||||||
static void remove_device(const char *path)
|
static void remove_device(const char *path)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
if (udev_pads[i].path && !strcmp(udev_pads[i].path, path))
|
if (udev_pads[i].path && !strcmp(udev_pads[i].path, path))
|
||||||
{
|
{
|
||||||
@ -475,7 +475,7 @@ static void remove_device(const char *path)
|
|||||||
static void udev_joypad_destroy(void)
|
static void udev_joypad_destroy(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
free_pad(i, false);
|
free_pad(i, false);
|
||||||
|
|
||||||
if (g_udev_mon)
|
if (g_udev_mon)
|
||||||
@ -489,7 +489,7 @@ static void udev_joypad_destroy(void)
|
|||||||
static bool udev_joypad_init(void)
|
static bool udev_joypad_init(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
udev_pads[i].fd = -1;
|
udev_pads[i].fd = -1;
|
||||||
udev_pads[i].ident = g_settings.input.device_names[i];
|
udev_pads[i].ident = g_settings.input.device_names[i];
|
||||||
@ -587,12 +587,12 @@ static int16_t udev_joypad_axis(unsigned port, uint32_t joyaxis)
|
|||||||
|
|
||||||
static bool udev_joypad_query_pad(unsigned pad)
|
static bool udev_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && udev_pads[pad].fd >= 0;
|
return pad < MAX_USERS && udev_pads[pad].fd >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *udev_joypad_name(unsigned pad)
|
static const char *udev_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
if (pad >= MAX_PLAYERS)
|
if (pad >= MAX_USERS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return *udev_pads[pad].ident ? udev_pads[pad].ident : NULL;
|
return *udev_pads[pad].ident ? udev_pads[pad].ident : NULL;
|
||||||
|
@ -90,7 +90,7 @@ typedef struct
|
|||||||
// hack is required here. dinput_joypad_init will fill this.
|
// hack is required here. dinput_joypad_init will fill this.
|
||||||
// For each pad index, the appropriate entry will be set to -1 if it is not
|
// For each pad index, the appropriate entry will be set to -1 if it is not
|
||||||
// a 360 pad, or the correct XInput user number (0..3 inclusive) if it is.
|
// a 360 pad, or the correct XInput user number (0..3 inclusive) if it is.
|
||||||
extern int g_xinput_pad_indexes[MAX_PLAYERS];
|
extern int g_xinput_pad_indexes[MAX_USERS];
|
||||||
extern bool g_xinput_block_pads;
|
extern bool g_xinput_block_pads;
|
||||||
|
|
||||||
// For xinput1_n.dll
|
// For xinput1_n.dll
|
||||||
@ -228,7 +228,7 @@ static bool winxinput_joypad_init(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
|
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
|
||||||
{
|
{
|
||||||
if (pad_index_to_xuser_index(autoconf_pad) > -1)
|
if (pad_index_to_xuser_index(autoconf_pad) > -1)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ static bool xdk_joypad_init(void)
|
|||||||
while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {}
|
while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (autoconf_pad = 0; autoconf_pad < MAX_PLAYERS; autoconf_pad++)
|
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.input.device_names[autoconf_pad],
|
strlcpy(g_settings.input.device_names[autoconf_pad],
|
||||||
"XInput Controller",
|
"XInput Controller",
|
||||||
@ -250,7 +250,7 @@ static void xdk_joypad_poll(void)
|
|||||||
|
|
||||||
static bool xdk_joypad_query_pad(unsigned pad)
|
static bool xdk_joypad_query_pad(unsigned pad)
|
||||||
{
|
{
|
||||||
return pad < MAX_PLAYERS && pad_state[pad];
|
return pad < MAX_USERS && pad_state[pad];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xdk_joypad_destroy(void)
|
static void xdk_joypad_destroy(void)
|
||||||
|
@ -282,7 +282,7 @@ static int16_t input_state(unsigned port, unsigned device,
|
|||||||
g_extern.bsv.movie_end = true;
|
g_extern.bsv.movie_end = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct retro_keybind *binds[MAX_PLAYERS] = {
|
static const struct retro_keybind *binds[MAX_USERS] = {
|
||||||
g_settings.input.binds[0],
|
g_settings.input.binds[0],
|
||||||
g_settings.input.binds[1],
|
g_settings.input.binds[1],
|
||||||
g_settings.input.binds[2],
|
g_settings.input.binds[2],
|
||||||
|
@ -161,7 +161,7 @@ static int menu_start_screen_iterate(unsigned action)
|
|||||||
|
|
||||||
static int mouse_iterate(unsigned action)
|
static int mouse_iterate(unsigned action)
|
||||||
{
|
{
|
||||||
const struct retro_keybind *binds[MAX_PLAYERS];
|
const struct retro_keybind *binds[MAX_USERS];
|
||||||
|
|
||||||
if (!driver.menu->mouse.enable)
|
if (!driver.menu->mouse.enable)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -32,8 +32,8 @@ extern "C" {
|
|||||||
#define MENU_MAX_AXES 32
|
#define MENU_MAX_AXES 32
|
||||||
#define MENU_MAX_HATS 4
|
#define MENU_MAX_HATS 4
|
||||||
|
|
||||||
#ifndef MAX_PLAYERS
|
#ifndef MAX_USERS
|
||||||
#define MAX_PLAYERS 16
|
#define MAX_USERS 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct menu_bind_state_port
|
struct menu_bind_state_port
|
||||||
@ -60,8 +60,8 @@ struct menu_bind_state
|
|||||||
unsigned begin;
|
unsigned begin;
|
||||||
unsigned last;
|
unsigned last;
|
||||||
unsigned user;
|
unsigned user;
|
||||||
struct menu_bind_state_port state[MAX_PLAYERS];
|
struct menu_bind_state_port state[MAX_USERS];
|
||||||
struct menu_bind_axis_state axis_state[MAX_PLAYERS];
|
struct menu_bind_axis_state axis_state[MAX_USERS];
|
||||||
bool skip;
|
bool skip;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
18
retroarch.c
18
retroarch.c
@ -485,9 +485,9 @@ static void print_help(void)
|
|||||||
puts("\t\tContent must be loaded in an order which depends on the particular subsystem used.");
|
puts("\t\tContent must be loaded in an order which depends on the particular subsystem used.");
|
||||||
puts("\t\tSee verbose log output to learn how a particular subsystem wants content to be loaded.");
|
puts("\t\tSee verbose log output to learn how a particular subsystem wants content to be loaded.");
|
||||||
|
|
||||||
printf("\t-N/--nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_PLAYERS);
|
printf("\t-N/--nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS);
|
||||||
printf("\t-A/--dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_PLAYERS);
|
printf("\t-A/--dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS);
|
||||||
printf("\t-d/--device: Connect a generic device into port of the device (1 to %d).\n", MAX_PLAYERS);
|
printf("\t-d/--device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS);
|
||||||
puts("\t\tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n");
|
puts("\t\tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n");
|
||||||
|
|
||||||
puts("\t-P/--bsvplay: Playback a BSV movie file.");
|
puts("\t-P/--bsvplay: Playback a BSV movie file.");
|
||||||
@ -774,7 +774,7 @@ static void parse_input(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
string_list_free(list);
|
string_list_free(list);
|
||||||
|
|
||||||
if (port < 1 || port > MAX_PLAYERS)
|
if (port < 1 || port > MAX_USERS)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Connect device to a valid port.\n");
|
RARCH_ERR("Connect device to a valid port.\n");
|
||||||
print_help();
|
print_help();
|
||||||
@ -787,7 +787,7 @@ static void parse_input(int argc, char *argv[])
|
|||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
port = strtol(optarg, NULL, 0);
|
port = strtol(optarg, NULL, 0);
|
||||||
if (port < 1 || port > MAX_PLAYERS)
|
if (port < 1 || port > MAX_USERS)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Connect dualanalog to a valid port.\n");
|
RARCH_ERR("Connect dualanalog to a valid port.\n");
|
||||||
print_help();
|
print_help();
|
||||||
@ -820,7 +820,7 @@ static void parse_input(int argc, char *argv[])
|
|||||||
|
|
||||||
case 'N':
|
case 'N':
|
||||||
port = strtol(optarg, NULL, 0);
|
port = strtol(optarg, NULL, 0);
|
||||||
if (port < 1 || port > MAX_PLAYERS)
|
if (port < 1 || port > MAX_USERS)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Disconnect device from a valid port.\n");
|
RARCH_ERR("Disconnect device from a valid port.\n");
|
||||||
print_help();
|
print_help();
|
||||||
@ -1046,7 +1046,7 @@ static void init_controllers(void)
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
unsigned device = g_settings.input.libretro_device[i];
|
unsigned device = g_settings.input.libretro_device[i];
|
||||||
const struct retro_controller_description *desc = NULL;
|
const struct retro_controller_description *desc = NULL;
|
||||||
@ -1798,7 +1798,7 @@ static void main_clear_state(bool inited)
|
|||||||
|
|
||||||
init_state();
|
init_state();
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
g_settings.input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
|
g_settings.input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2768,7 +2768,7 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
case RARCH_CMD_RUMBLE_STOP:
|
case RARCH_CMD_RUMBLE_STOP:
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
driver_set_rumble_state(i, RETRO_RUMBLE_STRONG, 0);
|
driver_set_rumble_state(i, RETRO_RUMBLE_STRONG, 0);
|
||||||
driver_set_rumble_state(i, RETRO_RUMBLE_WEAK, 0);
|
driver_set_rumble_state(i, RETRO_RUMBLE_WEAK, 0);
|
||||||
|
@ -569,7 +569,7 @@ static void check_block_hotkey(bool enable_hotkey)
|
|||||||
|
|
||||||
static inline retro_input_t input_keys_pressed(void)
|
static inline retro_input_t input_keys_pressed(void)
|
||||||
{
|
{
|
||||||
static const struct retro_keybind *binds[MAX_PLAYERS] = {
|
static const struct retro_keybind *binds[MAX_USERS] = {
|
||||||
g_settings.input.binds[0],
|
g_settings.input.binds[0],
|
||||||
g_settings.input.binds[1],
|
g_settings.input.binds[1],
|
||||||
g_settings.input.binds[2],
|
g_settings.input.binds[2],
|
||||||
|
18
settings.c
18
settings.c
@ -445,16 +445,16 @@ static void config_set_defaults(void)
|
|||||||
g_settings.input.autoconfig_descriptor_label_show = true;
|
g_settings.input.autoconfig_descriptor_label_show = true;
|
||||||
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
||||||
g_settings.input.input_descriptor_hide_unbound = input_descriptor_hide_unbound;
|
g_settings.input.input_descriptor_hide_unbound = input_descriptor_hide_unbound;
|
||||||
g_settings.input.max_users = MAX_PLAYERS;
|
g_settings.input.max_users = MAX_USERS;
|
||||||
|
|
||||||
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
||||||
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
||||||
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
||||||
for (i = 1; i < MAX_PLAYERS; i++)
|
for (i = 1; i < MAX_USERS; i++)
|
||||||
memcpy(g_settings.input.binds[i], retro_keybinds_rest,
|
memcpy(g_settings.input.binds[i], retro_keybinds_rest,
|
||||||
sizeof(retro_keybinds_rest));
|
sizeof(retro_keybinds_rest));
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||||
{
|
{
|
||||||
@ -466,7 +466,7 @@ static void config_set_defaults(void)
|
|||||||
sizeof(g_settings.input.autoconfigured));
|
sizeof(g_settings.input.autoconfigured));
|
||||||
|
|
||||||
/* Verify that binds are in proper order. */
|
/* Verify that binds are in proper order. */
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||||
if (g_settings.input.binds[i][j].valid)
|
if (g_settings.input.binds[i][j].valid)
|
||||||
rarch_assert(j == g_settings.input.binds[i][j].id);
|
rarch_assert(j == g_settings.input.binds[i][j].id);
|
||||||
@ -482,7 +482,7 @@ static void config_set_defaults(void)
|
|||||||
g_settings.input.autodetect_enable = input_autodetect_enable;
|
g_settings.input.autodetect_enable = input_autodetect_enable;
|
||||||
*g_settings.input.keyboard_layout = '\0';
|
*g_settings.input.keyboard_layout = '\0';
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
g_settings.input.joypad_map[i] = i;
|
g_settings.input.joypad_map[i] = i;
|
||||||
g_settings.input.analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
g_settings.input.analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
||||||
@ -1014,7 +1014,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
|||||||
CONFIG_GET_BOOL(input.autoconfig_descriptor_label_show,
|
CONFIG_GET_BOOL(input.autoconfig_descriptor_label_show,
|
||||||
"autoconfig_descriptor_label_show");
|
"autoconfig_descriptor_label_show");
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
|
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
|
||||||
@ -1409,7 +1409,7 @@ static void read_keybinds_user(config_file_t *conf, unsigned user)
|
|||||||
static void config_read_keybinds_conf(config_file_t *conf)
|
static void config_read_keybinds_conf(config_file_t *conf)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
read_keybinds_user(conf, i);
|
read_keybinds_user(conf, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1800,7 +1800,7 @@ bool config_save_file(const char *path)
|
|||||||
g_settings.input.joypad_driver);
|
g_settings.input.joypad_driver);
|
||||||
config_set_string(conf, "input_keyboard_layout",
|
config_set_string(conf, "input_keyboard_layout",
|
||||||
g_settings.input.keyboard_layout);
|
g_settings.input.keyboard_layout);
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char cfg[64];
|
char cfg[64];
|
||||||
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
||||||
@ -1813,7 +1813,7 @@ bool config_save_file(const char *path)
|
|||||||
config_set_int(conf, cfg, g_settings.input.analog_dpad_mode[i]);
|
config_set_int(conf, cfg, g_settings.input.analog_dpad_mode[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLAYERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
save_keybinds_user(conf, i);
|
save_keybinds_user(conf, i);
|
||||||
|
|
||||||
config_set_bool(conf, "core_specific_config",
|
config_set_bool(conf, "core_specific_config",
|
||||||
|
@ -4289,12 +4289,12 @@ static bool setting_data_append_list_input_options(
|
|||||||
g_settings.input.max_users,
|
g_settings.input.max_users,
|
||||||
"input_max_users",
|
"input_max_users",
|
||||||
"Max Users",
|
"Max Users",
|
||||||
MAX_PLAYERS,
|
MAX_USERS,
|
||||||
group_info.name,
|
group_info.name,
|
||||||
subgroup_info.name,
|
subgroup_info.name,
|
||||||
general_write_handler,
|
general_write_handler,
|
||||||
general_read_handler);
|
general_read_handler);
|
||||||
settings_list_current_add_range(list, list_info, 1, MAX_PLAYERS, 1, true, true);
|
settings_list_current_add_range(list, list_info, 1, MAX_USERS, 1, true, true);
|
||||||
|
|
||||||
CONFIG_BOOL(
|
CONFIG_BOOL(
|
||||||
g_settings.input.autodetect_enable,
|
g_settings.input.autodetect_enable,
|
||||||
@ -4372,17 +4372,17 @@ static bool setting_data_append_list_input_options(
|
|||||||
* 2 is the length of '99'; we don't need more users 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. */
|
/* FIXME/TODO - really need to clean up this mess in some way. */
|
||||||
static char key[MAX_PLAYERS][64];
|
static char key[MAX_USERS][64];
|
||||||
static char key_type[MAX_PLAYERS][64];
|
static char key_type[MAX_USERS][64];
|
||||||
static char key_analog[MAX_PLAYERS][64];
|
static char key_analog[MAX_USERS][64];
|
||||||
static char key_bind_all[MAX_PLAYERS][64];
|
static char key_bind_all[MAX_USERS][64];
|
||||||
static char key_bind_defaults[MAX_PLAYERS][64];
|
static char key_bind_defaults[MAX_USERS][64];
|
||||||
|
|
||||||
static char label[MAX_PLAYERS][64];
|
static char label[MAX_USERS][64];
|
||||||
static char label_type[MAX_PLAYERS][64];
|
static char label_type[MAX_USERS][64];
|
||||||
static char label_analog[MAX_PLAYERS][64];
|
static char label_analog[MAX_USERS][64];
|
||||||
static char label_bind_all[MAX_PLAYERS][64];
|
static char label_bind_all[MAX_USERS][64];
|
||||||
static char label_bind_defaults[MAX_PLAYERS][64];
|
static char label_bind_defaults[MAX_USERS][64];
|
||||||
|
|
||||||
snprintf(key[user], sizeof(key[user]),
|
snprintf(key[user], sizeof(key[user]),
|
||||||
"input_player%d_joypad_index", user + 1);
|
"input_player%d_joypad_index", user + 1);
|
||||||
@ -4537,7 +4537,7 @@ static bool setting_data_append_list_input_options(
|
|||||||
* Keep it up to date or you'll get some really obvious bugs.
|
* 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.
|
* 2 is the length of '99'; we don't need more users than that.
|
||||||
*/
|
*/
|
||||||
static char buffer[MAX_PLAYERS][7+2+1];
|
static char buffer[MAX_USERS][7+2+1];
|
||||||
const struct retro_keybind* const defaults =
|
const struct retro_keybind* const defaults =
|
||||||
(user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
(user == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
||||||
|
|
||||||
|
@ -409,10 +409,10 @@ static void parse_input(int argc, char *argv[])
|
|||||||
fprintf(stderr, "Player number must be at least 1.\n");
|
fprintf(stderr, "Player number must be at least 1.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
else if (g_player > MAX_PLAYERS)
|
else if (g_player > MAX_USERS)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Player number must be from 1 to %d.\n",
|
fprintf(stderr, "Player number must be from 1 to %d.\n",
|
||||||
MAX_PLAYERS);
|
MAX_USERS);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user