mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(IOHIDManager) Another buildfix
This commit is contained in:
parent
b8f9e38b7e
commit
18dcda09d0
@ -188,6 +188,35 @@ static int16_t iohidmanager_hid_joypad_button(void *data,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t iohidmanager_hid_joypad_axis(void *data,
|
||||
unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
iohidmanager_hid_t *hid = (iohidmanager_hid_t*)data;
|
||||
int16_t val = 0;
|
||||
|
||||
if (AXIS_NEG_GET(joyaxis) < 11)
|
||||
{
|
||||
val += hid->axes[port][AXIS_NEG_GET(joyaxis)];
|
||||
val += pad_connection_get_axis(&hid->slots[port],
|
||||
port, AXIS_NEG_GET(joyaxis));
|
||||
|
||||
if (val >= 0)
|
||||
val = 0;
|
||||
}
|
||||
else if (AXIS_POS_GET(joyaxis) < 11)
|
||||
{
|
||||
val += hid->axes[port][AXIS_POS_GET(joyaxis)];
|
||||
val += pad_connection_get_axis(&hid->slots[port],
|
||||
port, AXIS_POS_GET(joyaxis));
|
||||
|
||||
if (val <= 0)
|
||||
val = 0;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
static int16_t iohidmanager_hid_joypad_state(
|
||||
void *data,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
@ -228,34 +257,6 @@ static bool iohidmanager_hid_joypad_rumble(void *data, unsigned pad,
|
||||
return pad_connection_rumble(&hid->slots[pad], pad, effect, strength);
|
||||
}
|
||||
|
||||
static int16_t iohidmanager_hid_joypad_axis(void *data,
|
||||
unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
iohidmanager_hid_t *hid = (iohidmanager_hid_t*)data;
|
||||
int16_t val = 0;
|
||||
|
||||
if (AXIS_NEG_GET(joyaxis) < 11)
|
||||
{
|
||||
val += hid->axes[port][AXIS_NEG_GET(joyaxis)];
|
||||
val += pad_connection_get_axis(&hid->slots[port],
|
||||
port, AXIS_NEG_GET(joyaxis));
|
||||
|
||||
if (val >= 0)
|
||||
val = 0;
|
||||
}
|
||||
else if (AXIS_POS_GET(joyaxis) < 11)
|
||||
{
|
||||
val += hid->axes[port][AXIS_POS_GET(joyaxis)];
|
||||
val += pad_connection_get_axis(&hid->slots[port],
|
||||
port, AXIS_POS_GET(joyaxis));
|
||||
|
||||
if (val <= 0)
|
||||
val = 0;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void iohidmanager_hid_device_send_control(void *data,
|
||||
uint8_t* data_buf, size_t size)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user