mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
CTR buildfix + cleanups
This commit is contained in:
parent
f12ac35438
commit
dee0c5dbca
@ -1418,8 +1418,8 @@ bool android_run_events(void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool android_is_pressed(
|
||||
android_input_t *android,
|
||||
static int16_t android_is_pressed(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -1430,17 +1430,14 @@ static bool android_is_pressed(
|
||||
? binds[id].joykey : joypad_info->auto_binds[id].joykey;
|
||||
const uint32_t joyaxis = (binds[id].joyaxis != AXIS_NONE)
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN
|
||||
&& android->joypad->button(
|
||||
&& joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
|
||||
if (((float)abs(android->joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t android_input_state(void *data,
|
||||
@ -1462,7 +1459,7 @@ static int16_t android_input_state(void *data,
|
||||
if (
|
||||
android_keyboard_port_input_pressed(binds[port], i)
|
||||
|| android_is_pressed(
|
||||
android, joypad_info, binds[port],
|
||||
android->joypad, joypad_info, binds[port],
|
||||
port, i)
|
||||
)
|
||||
ret |= (1 << i);
|
||||
@ -1474,7 +1471,7 @@ static int16_t android_input_state(void *data,
|
||||
if (
|
||||
android_keyboard_port_input_pressed(binds[port], id)
|
||||
|| android_is_pressed(
|
||||
android, joypad_info, binds[port],
|
||||
android->joypad, joypad_info, binds[port],
|
||||
port, id))
|
||||
return 1;
|
||||
}
|
||||
|
@ -290,7 +290,9 @@ static int16_t cocoa_pointer_state(cocoa_input_data_t *apple,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool cocoa_is_pressed(cocoa_input_data_t *apple,
|
||||
static int16_t cocoa_is_pressed(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -300,21 +302,21 @@ static bool cocoa_is_pressed(cocoa_input_data_t *apple,
|
||||
? binds[id].joykey : joypad_info->auto_binds[id].joykey;
|
||||
const uint32_t joyaxis = (binds[id].joyaxis != AXIS_NONE)
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
if ((uint16_t)joykey != NO_BTN && apple->joypad->button(
|
||||
if ((uint16_t)joykey != NO_BTN && joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(apple->joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
return 1;
|
||||
#ifdef HAVE_MFI
|
||||
if ((uint16_t)joykey != NO_BTN && apple->sec_joypad->button(
|
||||
if ((uint16_t)joykey != NO_BTN && sec_joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(apple->sec_joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(sec_joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
return 1;
|
||||
#endif
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t cocoa_input_state(void *data,
|
||||
@ -335,7 +337,9 @@ static int16_t cocoa_input_state(void *data,
|
||||
{
|
||||
if (apple_key_state[rarch_keysym_lut[binds[i].key]])
|
||||
return 1;
|
||||
if (cocoa_is_pressed(apple, joypad_info, binds[port], port, i))
|
||||
if (cocoa_is_pressed(
|
||||
apple->joypad, apple->sec_joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
return ret;
|
||||
@ -345,7 +349,9 @@ static int16_t cocoa_input_state(void *data,
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
if (apple_key_state[rarch_keysym_lut[binds[id].key]])
|
||||
return 1;
|
||||
return cocoa_is_pressed(apple, joypad_info, binds[port], port, id);
|
||||
return cocoa_is_pressed(
|
||||
apple->joypad, apple->sec_joypad,
|
||||
joypad_info, binds[port], port, id);
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
|
@ -43,6 +43,28 @@ static void ctr_input_poll(void *data)
|
||||
ctr->joypad->poll();
|
||||
}
|
||||
|
||||
static int16_t ctr_is_pressed(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
{
|
||||
const struct retro_keybind *bind = &binds[id];
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[port][id].joykey != NO_BTN)
|
||||
? binds[port][id].joykey : joypad_info->auto_binds[id].joykey;
|
||||
const uint32_t joyaxis = (binds[port][id].joyaxis != AXIS_NONE)
|
||||
? binds[port][id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
if ((uint16_t)joykey != NO_BTN &&
|
||||
joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t ctr_input_state(void *data,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
@ -63,41 +85,22 @@ static int16_t ctr_input_state(void *data,
|
||||
int16_t ret = 0;
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[port][i].joykey != NO_BTN)
|
||||
? binds[port][i].joykey : joypad_info->auto_binds[i].joykey;
|
||||
const uint32_t joyaxis = (binds[port][i].joyaxis != AXIS_NONE)
|
||||
? binds[port][i].joyaxis : joypad_info->auto_binds[i].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN &&
|
||||
ctr->joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
}
|
||||
if (((float)abs(ctr->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
}
|
||||
if (binds[port][i].valid)
|
||||
if (ctr_is_pressed(
|
||||
ctr->joypad, joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[port][id].joykey != NO_BTN)
|
||||
? binds[port][id].joykey : joypad_info->auto_binds[id].joykey;
|
||||
const uint32_t joyaxis = (binds[port][id].joyaxis != AXIS_NONE)
|
||||
? binds[port][id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN && ctr->joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return 1;
|
||||
if (((float)abs(ctr->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
{
|
||||
if (binds[port][id].valid)
|
||||
return ctr_is_pressed(
|
||||
ctr->joypad, joypad_info, binds[port], port, id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
|
@ -536,8 +536,9 @@ static int16_t dinput_pointer_state(struct dinput_input *di,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool dinput_is_pressed(
|
||||
static int16_t dinput_is_pressed(
|
||||
struct dinput_input *di,
|
||||
const input_device_driver_t *joypad,
|
||||
settings_t *settings,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
@ -553,18 +554,15 @@ static bool dinput_is_pressed(
|
||||
if (settings->uints.input_mouse_index[port] == 0)
|
||||
if (dinput_mouse_button_pressed(
|
||||
di, port, binds[id].mbutton))
|
||||
return true;
|
||||
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN
|
||||
&& di->joypad->button(
|
||||
&& joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
|
||||
if (((float)abs(di->joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t dinput_input_state(void *data,
|
||||
@ -594,7 +592,8 @@ static int16_t dinput_input_state(void *data,
|
||||
{
|
||||
if (binds[port][i].valid)
|
||||
if (dinput_is_pressed(
|
||||
di, settings, joypad_info, binds[port], port, i))
|
||||
di, di->joypad,
|
||||
settings, joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -607,7 +606,7 @@ static int16_t dinput_input_state(void *data,
|
||||
ret |= (1 << i);
|
||||
else if (binds[port][i].valid)
|
||||
if (dinput_is_pressed(
|
||||
di, settings, joypad_info,
|
||||
di, di->joypad, settings, joypad_info,
|
||||
binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
@ -626,7 +625,8 @@ static int16_t dinput_input_state(void *data,
|
||||
}
|
||||
if (binds[port][id].valid)
|
||||
return dinput_is_pressed(
|
||||
di, settings, joypad_info, binds[port], port, id);
|
||||
di, di->joypad,
|
||||
settings, joypad_info, binds[port], port, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -735,7 +735,8 @@ static int16_t dinput_input_state(void *data,
|
||||
return 1;
|
||||
}
|
||||
if (binds[port][new_id].valid)
|
||||
return dinput_is_pressed(di, settings, joypad_info,
|
||||
return dinput_is_pressed(di, di->joypad,
|
||||
settings, joypad_info,
|
||||
binds[port], port, new_id);
|
||||
}
|
||||
break;
|
||||
|
@ -743,21 +743,20 @@ static bool qnx_keyboard_pressed(qnx_input_t *qnx, unsigned id)
|
||||
return id < RETROK_LAST && BIT_GET(qnx->keyboard_state, bit);
|
||||
}
|
||||
|
||||
static bool qnx_is_pressed(qnx_input_t *qnx,
|
||||
static int16_t qnx_is_pressed(
|
||||
qnx_input_t *qnx,
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
{
|
||||
const struct retro_keybind *bind = &binds[id];
|
||||
int key = bind->key;
|
||||
|
||||
if (id >= RARCH_BIND_LIST_END)
|
||||
return false;
|
||||
|
||||
return 0;
|
||||
if (qnx_keyboard_pressed(qnx, key))
|
||||
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_qnx.keyboard_mapping_blocked)
|
||||
return true;
|
||||
|
||||
return 1;
|
||||
if (binds && binds[id].valid)
|
||||
{
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
@ -766,14 +765,14 @@ static bool qnx_is_pressed(qnx_input_t *qnx,
|
||||
const uint32_t joyaxis = (binds[id].joyaxis != AXIS_NONE)
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN && qnx->joypad->button(
|
||||
if ((uint16_t)joykey != NO_BTN && joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(qnx->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t qnx_pointer_input_state(qnx_input_t *qnx,
|
||||
@ -825,7 +824,8 @@ static int16_t qnx_input_state(void *data,
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
if (qnx_is_pressed(
|
||||
qnx, joypad_info, binds[port], port, i))
|
||||
qnx, qnx->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
@ -835,7 +835,8 @@ static int16_t qnx_input_state(void *data,
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
if (qnx_is_pressed(qnx, joypad_info, binds[port], port, id))
|
||||
if (qnx_is_pressed(qnx, qnx->joypad,
|
||||
joypad_info, binds[port], port, id))
|
||||
return 1;
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
|
@ -467,10 +467,12 @@ static int16_t rwebinput_mouse_state(rwebinput_mouse_state_t *mouse,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
static int16_t rwebinput_is_pressed(
|
||||
rwebinput_input_t *rwebinput,
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
{
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
{
|
||||
@ -479,7 +481,7 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
|
||||
|
||||
if ((key < RETROK_LAST) && rwebinput_key_pressed(rwebinput, key))
|
||||
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_rwebinput.keyboard_mapping_blocked)
|
||||
return true;
|
||||
return 1;
|
||||
|
||||
if (bind->valid)
|
||||
{
|
||||
@ -491,15 +493,15 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
|
||||
|
||||
if (port == 0 && !!rwebinput_mouse_state(&rwebinput->mouse,
|
||||
bind->mbutton, false))
|
||||
return true;
|
||||
if ((uint16_t)joykey != NO_BTN && rwebinput->joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(rwebinput->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN && joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t rwebinput_analog_pressed(rwebinput_input_t *rwebinput,
|
||||
@ -512,9 +514,11 @@ static int16_t rwebinput_analog_pressed(rwebinput_input_t *rwebinput,
|
||||
|
||||
input_conv_analog_id_to_bind_id(idx, id, id_minus, id_plus);
|
||||
|
||||
if (rwebinput_is_pressed(rwebinput, joypad_info, binds, idx, id_minus))
|
||||
if (rwebinput_is_pressed(rwebinput,
|
||||
rwebinput->joypad, joypad_info, binds, idx, id_minus))
|
||||
pressed_minus = -0x7fff;
|
||||
if (rwebinput_is_pressed(rwebinput, joypad_info, binds, idx, id_plus))
|
||||
if (rwebinput_is_pressed(rwebinput,
|
||||
rwebinput->joypad, joypad_info, binds, idx, id_plus))
|
||||
pressed_plus = 0x7fff;
|
||||
|
||||
return pressed_plus + pressed_minus;
|
||||
@ -537,7 +541,8 @@ static int16_t rwebinput_input_state(void *data,
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
if (rwebinput_is_pressed(
|
||||
rwebinput, joypad_info, binds[port], port, i))
|
||||
rwebinput, rwebinput->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
@ -549,8 +554,9 @@ static int16_t rwebinput_input_state(void *data,
|
||||
else
|
||||
{
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
if (rwebinput_is_pressed(rwebinput, joypad_info, binds[port],
|
||||
port, id))
|
||||
if (rwebinput_is_pressed(rwebinput, rwebinput->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, id))
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@ -89,7 +89,8 @@ static int16_t sdl_analog_pressed(sdl_input_t *sdl, const struct retro_keybind *
|
||||
return pressed_plus + pressed_minus;
|
||||
}
|
||||
|
||||
static bool sdl_is_pressed(sdl_input_t *sdl,
|
||||
static int16_t sdl_is_pressed(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -101,17 +102,14 @@ static bool sdl_is_pressed(sdl_input_t *sdl,
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if ((binds[id].key < RETROK_LAST) && sdl_key_pressed(binds[id].key))
|
||||
return true;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN && sdl->joypad->button(
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN && joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
|
||||
if (((float)abs(sdl->joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t sdl_mouse_device_state(sdl_input_t *sdl, unsigned id)
|
||||
@ -231,7 +229,7 @@ static int16_t sdl_input_state(void *data,
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
if (sdl_is_pressed(
|
||||
sdl, joypad_info, binds[port], port, i))
|
||||
sdl->joypad, joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
@ -240,7 +238,7 @@ static int16_t sdl_input_state(void *data,
|
||||
else
|
||||
{
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
if (sdl_is_pressed(sdl,
|
||||
if (sdl_is_pressed(sdl->joypad,
|
||||
joypad_info, binds[port], port, id))
|
||||
return 1;
|
||||
}
|
||||
|
@ -932,7 +932,9 @@ static bool udev_mouse_button_pressed(
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool udev_is_pressed(udev_input_t *udev,
|
||||
static int16_t udev_is_pressed(
|
||||
udev_input_t *udev,
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -941,7 +943,7 @@ static bool udev_is_pressed(udev_input_t *udev,
|
||||
|
||||
if ( (bind->key < RETROK_LAST) && udev_keyboard_pressed(udev, bind->key) )
|
||||
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_udev.keyboard_mapping_blocked)
|
||||
return true;
|
||||
return 1;
|
||||
|
||||
if (binds && binds[id].valid)
|
||||
{
|
||||
@ -952,16 +954,16 @@ static bool udev_is_pressed(udev_input_t *udev,
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if (udev_mouse_button_pressed(udev, port, bind->mbutton))
|
||||
return true;
|
||||
if ((uint16_t)joykey != NO_BTN && udev->joypad->button(
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN && joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(udev->joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t udev_analog_pressed(const struct retro_keybind *binds,
|
||||
@ -1024,7 +1026,8 @@ static int16_t udev_input_state(void *data,
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
if (udev_is_pressed(
|
||||
udev, joypad_info, binds[port], port, i))
|
||||
udev, udev->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
@ -1033,7 +1036,8 @@ static int16_t udev_input_state(void *data,
|
||||
else
|
||||
{
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
return udev_is_pressed(udev, joypad_info, binds[port], port, id);
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info, binds[port], port, id);
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
@ -1072,37 +1076,48 @@ static int16_t udev_input_state(void *data,
|
||||
|
||||
/*buttons*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_TRIGGER);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_RELOAD);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_AUX_A);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_AUX_B);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_AUX_C);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_START);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_SELECT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_DPAD_UP);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
|
||||
/*deprecated*/
|
||||
@ -1117,7 +1132,8 @@ static int16_t udev_input_state(void *data,
|
||||
return (mouse) ? udev_mouse_get_y(mouse) : 0;
|
||||
}
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_PAUSE:
|
||||
return udev_is_pressed(udev, joypad_info,
|
||||
return udev_is_pressed(udev, udev->joypad,
|
||||
joypad_info,
|
||||
binds[port], port, RARCH_LIGHTGUN_START);
|
||||
}
|
||||
break;
|
||||
|
@ -314,8 +314,10 @@ static bool winraw_mouse_button_pressed(
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool winraw_is_pressed(winraw_input_t *wr,
|
||||
static int16_t winraw_is_pressed(
|
||||
winraw_input_t *wr,
|
||||
winraw_mouse_t *mouse,
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -328,14 +330,14 @@ static bool winraw_is_pressed(winraw_input_t *wr,
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
if (mouse && winraw_mouse_button_pressed(wr,
|
||||
mouse, port, bind->mbutton))
|
||||
return true;
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN &&
|
||||
wr->joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(wr->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void winraw_init_mouse_xy_mapping(void)
|
||||
@ -659,7 +661,8 @@ static int16_t winraw_input_state(void *d,
|
||||
{
|
||||
if (binds[port][i].valid)
|
||||
if (winraw_is_pressed(
|
||||
wr, mouse, joypad_info, binds[port], port, i))
|
||||
wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -672,7 +675,8 @@ static int16_t winraw_input_state(void *d,
|
||||
ret |= (1 << i);
|
||||
else if (binds[port][i].valid)
|
||||
if (winraw_is_pressed(
|
||||
wr, mouse, joypad_info, binds[port], port, i))
|
||||
wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -690,7 +694,8 @@ static int16_t winraw_input_state(void *d,
|
||||
return 1;
|
||||
if (binds[port][id].valid)
|
||||
return winraw_is_pressed(
|
||||
wr, mouse ,joypad_info, binds[port], port, id);
|
||||
wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -727,7 +732,7 @@ static int16_t winraw_input_state(void *d,
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_TRIGGER].valid)
|
||||
return winraw_is_pressed(
|
||||
wr, mouse, joypad_info, binds[port],
|
||||
wr, mouse, wr->joypad, joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_TRIGGER);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
@ -738,7 +743,7 @@ static int16_t winraw_input_state(void *d,
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_RELOAD].valid)
|
||||
return winraw_is_pressed(
|
||||
wr, mouse, joypad_info, binds[port],
|
||||
wr, mouse, wr->joypad, joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_RELOAD);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
@ -748,7 +753,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_AUX_A].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_A].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_A);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_A);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -757,7 +763,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_AUX_B].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_B].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_B);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_B);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -766,7 +773,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_AUX_C].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_C].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_C);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_AUX_C);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -775,7 +783,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_START].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_START].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_START);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_START);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -784,7 +793,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_SELECT].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_SELECT].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_SELECT);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_SELECT);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -793,7 +803,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_DPAD_UP].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_UP].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_UP);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_UP);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -802,7 +813,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_DPAD_DOWN].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_DOWN].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -811,7 +823,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_DPAD_LEFT].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_LEFT].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
@ -820,7 +833,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_DPAD_RIGHT].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_RIGHT].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
break;
|
||||
|
||||
/*deprecated*/
|
||||
@ -836,7 +850,8 @@ static int16_t winraw_input_state(void *d,
|
||||
[RARCH_LIGHTGUN_START].key))
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_START].valid)
|
||||
return winraw_is_pressed(wr, mouse, joypad_info, binds[port], port, RARCH_LIGHTGUN_START);
|
||||
return winraw_is_pressed(wr, mouse, wr->joypad,
|
||||
joypad_info, binds[port], port, RARCH_LIGHTGUN_START);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -114,7 +114,9 @@ static bool x_mouse_button_pressed(
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool x_is_pressed(x11_input_t *x11,
|
||||
static int16_t x_is_pressed(
|
||||
x11_input_t *x11,
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
@ -126,14 +128,14 @@ static bool x_is_pressed(x11_input_t *x11,
|
||||
const uint32_t joyaxis = (binds[id].joyaxis != AXIS_NONE)
|
||||
? binds[id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
if (x_mouse_button_pressed(x11, port, bind->mbutton))
|
||||
return true;
|
||||
return 1;
|
||||
if ((uint16_t)joykey != NO_BTN
|
||||
&& x11->joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(x11->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
&& joypad->button(joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return 1;
|
||||
if (((float)abs(joypad->axis(joypad_info->joy_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t x_pressed_analog(x11_input_t *x11,
|
||||
@ -318,7 +320,8 @@ static int16_t x_input_state(void *data,
|
||||
{
|
||||
if (binds[port][i].valid)
|
||||
if (x_is_pressed(
|
||||
x11, joypad_info, binds[port], port, i))
|
||||
x11, x11->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -331,7 +334,8 @@ static int16_t x_input_state(void *data,
|
||||
return true;
|
||||
if (binds[port][i].valid)
|
||||
if (x_is_pressed(
|
||||
x11, joypad_info, binds[port], port, i))
|
||||
x11, x11->joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -348,7 +352,8 @@ static int16_t x_input_state(void *data,
|
||||
|| !input_x.keyboard_mapping_blocked)
|
||||
return 1;
|
||||
if (binds[port][id].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port], port, id);
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port], port, id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -391,7 +396,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_TRIGGER].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_TRIGGER].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_TRIGGER);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
@ -401,7 +407,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_RELOAD].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_RELOAD].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_RELOAD);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
@ -411,7 +418,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_AUX_A].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_A].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_AUX_A);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
@ -421,7 +429,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_AUX_B].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_B].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_AUX_B);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
@ -431,7 +440,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_AUX_C].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_AUX_C].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_AUX_C);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
@ -441,7 +451,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_START].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_START].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_START);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
@ -451,7 +462,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_SELECT].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_SELECT].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_SELECT);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
@ -461,7 +473,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_DPAD_UP].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_UP].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_DPAD_UP);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
@ -471,7 +484,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_DPAD_DOWN].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_DOWN].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
@ -481,7 +495,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_DPAD_LEFT].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_LEFT].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
break;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
@ -491,7 +506,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_DPAD_RIGHT].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_DPAD_RIGHT].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
break;
|
||||
/*deprecated*/
|
||||
@ -506,7 +522,8 @@ static int16_t x_input_state(void *data,
|
||||
[RARCH_LIGHTGUN_START].key) )
|
||||
return 1;
|
||||
if (binds[port][RARCH_LIGHTGUN_START].valid)
|
||||
return x_is_pressed(x11, joypad_info, binds[port],
|
||||
return x_is_pressed(x11, x11->joypad,
|
||||
joypad_info, binds[port],
|
||||
port, RARCH_LIGHTGUN_START);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user