mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(PS3 Fixed two-player controls
This commit is contained in:
parent
eaaeda8c38
commit
b22f122c93
@ -38,6 +38,7 @@
|
|||||||
#define MAP(x) (x & 0xFF)
|
#define MAP(x) (x & 0xFF)
|
||||||
|
|
||||||
static uint64_t state[MAX_PADS];
|
static uint64_t state[MAX_PADS];
|
||||||
|
static unsigned pads_connected;
|
||||||
|
|
||||||
void cell_pad_input_deinit(void)
|
void cell_pad_input_deinit(void)
|
||||||
{
|
{
|
||||||
@ -95,6 +96,8 @@ static void ps3_input_poll(void *data)
|
|||||||
(void)data;
|
(void)data;
|
||||||
for (unsigned i = 0; i < MAX_PADS; i++)
|
for (unsigned i = 0; i < MAX_PADS; i++)
|
||||||
state[i] = cell_pad_input_poll_device(i);
|
state[i] = cell_pad_input_poll_device(i);
|
||||||
|
|
||||||
|
pads_connected = cell_pad_input_pads_connected();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t ps3_input_state(void *data, const struct snes_keybind **binds,
|
static int16_t ps3_input_state(void *data, const struct snes_keybind **binds,
|
||||||
@ -105,8 +108,12 @@ static int16_t ps3_input_state(void *data, const struct snes_keybind **binds,
|
|||||||
|
|
||||||
unsigned player = port;
|
unsigned player = port;
|
||||||
uint64_t button = binds[player][id].joykey;
|
uint64_t button = binds[player][id].joykey;
|
||||||
|
int16_t retval = CTRL_MASK(state[player], button);
|
||||||
|
|
||||||
return CTRL_MASK(state[player], button) ? 1 : 0;
|
if(player >= pads_connected || device != RETRO_DEVICE_JOYPAD)
|
||||||
|
retval = 0;
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user