mirror of
https://github.com/libretro/RetroArch
synced 2025-03-14 01:19:01 +00:00
Use unsigned port.
This commit is contained in:
parent
e3a71a8c5b
commit
ba2e913908
2
driver.h
2
driver.h
@ -130,7 +130,7 @@ typedef struct input_driver
|
||||
{
|
||||
void *(*init)(void);
|
||||
void (*poll)(void *data);
|
||||
int16_t (*input_state)(void *data, const struct snes_keybind **snes_keybinds, bool port, unsigned device, unsigned index, unsigned id);
|
||||
int16_t (*input_state)(void *data, const struct snes_keybind **snes_keybinds, unsigned port, unsigned device, unsigned index, unsigned id);
|
||||
bool (*key_pressed)(void *data, int key);
|
||||
void (*free)(void *data);
|
||||
const char *ident;
|
||||
|
@ -58,15 +58,11 @@ static void input_ext_poll(void *data)
|
||||
ext->driver->poll(ext->handle);
|
||||
}
|
||||
|
||||
static int16_t input_ext_input_state(void *data, const struct snes_keybind **snes_keybinds, bool port, unsigned device, unsigned index, unsigned id)
|
||||
static int16_t input_ext_input_state(void *data, const struct snes_keybind **snes_keybinds, unsigned port, unsigned device, unsigned index, unsigned id)
|
||||
{
|
||||
input_ext_t *ext = (input_ext_t*)data;
|
||||
|
||||
unsigned player = 0;
|
||||
if (device == RETRO_DEVICE_JOYPAD_MULTITAP)
|
||||
player = (port == 1) ? 1 : index + 2;
|
||||
else
|
||||
player = port + 1;
|
||||
unsigned player = port + 1;
|
||||
|
||||
if (id < SSNES_BIND_LIST_END)
|
||||
{
|
||||
|
@ -323,15 +323,13 @@ static int16_t sdl_lightgun_device_state(sdl_input_t *sdl, unsigned id)
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t sdl_input_state(void *data_, const struct snes_keybind **binds, bool port, unsigned device, unsigned index, unsigned id)
|
||||
static int16_t sdl_input_state(void *data_, const struct snes_keybind **binds, unsigned port, unsigned device, unsigned index, unsigned id)
|
||||
{
|
||||
sdl_input_t *data = (sdl_input_t*)data_;
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
return sdl_joypad_device_state(data, binds, port, id);
|
||||
case RETRO_DEVICE_JOYPAD_MULTITAP:
|
||||
return sdl_joypad_device_state(data, binds, (port == 1) ? 1 + index : 0, id);
|
||||
case RETRO_DEVICE_MOUSE:
|
||||
return sdl_mouse_device_state(data, id);
|
||||
case RETRO_DEVICE_LIGHTGUN:
|
||||
|
@ -183,7 +183,7 @@ static bool x_bind_button_pressed(void *data, int key)
|
||||
input_sdl.key_pressed(x11->sdl, key);
|
||||
}
|
||||
|
||||
static int16_t x_input_state(void *data, const struct snes_keybind **binds, bool port, unsigned device, unsigned index, unsigned id)
|
||||
static int16_t x_input_state(void *data, const struct snes_keybind **binds, unsigned port, unsigned device, unsigned index, unsigned id)
|
||||
{
|
||||
x11_input_t *x11 = (x11_input_t*)data;
|
||||
|
||||
@ -193,10 +193,6 @@ static int16_t x_input_state(void *data, const struct snes_keybind **binds, bool
|
||||
return x_is_pressed(x11, binds[port], id) ||
|
||||
input_sdl.input_state(x11->sdl, binds, port, device, index, id);
|
||||
|
||||
case RETRO_DEVICE_JOYPAD_MULTITAP:
|
||||
return x_is_pressed(x11, binds[(port == 1) ? 1 + index : 0], id) ||
|
||||
input_sdl.input_state(x11->sdl, binds, port, device, index, id);
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user