Regression in

9c73d3305d
- joykey needs to be uint64_t and then is later cast to uint16_t -
is apparently important for hotkeys
This commit is contained in:
twinaphex 2019-07-21 16:22:41 +02:00
parent 66b88b60f2
commit f4104f5c9a
22 changed files with 83 additions and 83 deletions

View File

@ -1361,7 +1361,7 @@ static void android_input_poll_memcpy(android_input_t *android)
static bool android_input_key_pressed(android_input_t *android, int key)
{
uint16_t joykey;
uint64_t joykey;
uint32_t joyaxis;
rarch_joypad_info_t joypad_info;
joypad_info.joy_idx = 0;
@ -1383,7 +1383,7 @@ static bool android_input_key_pressed(android_input_t *android, int key)
? input_config_binds[0][key].joyaxis
: joypad_info.auto_binds[key].joyaxis;
if (joykey != NO_BTN && android->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && android->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
return true;
else if (((float)abs(android->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
return true;
@ -1480,12 +1480,12 @@ static int16_t android_input_state(void *data,
{
bool res = false;
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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 (joykey != NO_BTN && android->joypad->button(
joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && android->joypad->button(
joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(android->joypad->axis(
joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
@ -1500,12 +1500,12 @@ static int16_t android_input_state(void *data,
{
bool res = false;
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && android->joypad->button(
joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && android->joypad->button(
joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(android->joypad->axis(
joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)

View File

@ -306,14 +306,14 @@ static int16_t cocoa_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = apple_key_state[rarch_keysym_lut[binds[port][i].key]];
if (!res)
{
if (joykey != NO_BTN && apple->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && apple->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(apple->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -321,7 +321,7 @@ static int16_t cocoa_input_state(void *data,
#ifdef HAVE_MFI
if (!res)
{
if (joykey != NO_BTN && apple->sec_joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && apple->sec_joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(apple->sec_joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -334,7 +334,7 @@ static int16_t cocoa_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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;
@ -342,8 +342,8 @@ static int16_t cocoa_input_state(void *data,
ret = apple_key_state[rarch_keysym_lut[binds[port][id].key]];
if (!ret)
{
if (joykey != NO_BTN && apple->joypad->button(
joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && apple->joypad->button(
joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(apple->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;
@ -351,7 +351,7 @@ static int16_t cocoa_input_state(void *data,
#ifdef HAVE_MFI
if (!ret)
{
if (joykey != NO_BTN && apple->sec_joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && apple->sec_joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(apple->sec_joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -65,14 +65,14 @@ static int16_t ctr_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN &&
ctr->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN &&
ctr->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(ctr->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -84,12 +84,12 @@ static int16_t ctr_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && ctr->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ctr->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(ctr->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -329,15 +329,15 @@ static bool dinput_is_pressed(struct dinput_input *di,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (dinput_mouse_button_pressed(di, port, binds[id].mbutton))
return true;
if (joykey != NO_BTN
&& di->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN
&& di->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
return true;
if (((float)abs(di->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
return true;

View File

@ -90,13 +90,13 @@ static int16_t dos_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && dos->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && dos->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(dos->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -109,12 +109,12 @@ static int16_t dos_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && dos->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && dos->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(dos->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -59,13 +59,13 @@ static int16_t gx_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && gx->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && gx->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(gx->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -77,12 +77,12 @@ static int16_t gx_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && gx->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && gx->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(gx->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -131,12 +131,12 @@ static int16_t linuxraw_input_state(void *data,
if (!res)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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 (joykey != NO_BTN && linuxraw->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && linuxraw->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(linuxraw->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -155,11 +155,11 @@ static int16_t linuxraw_input_state(void *data,
if (!ret)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && linuxraw->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && linuxraw->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(linuxraw->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -60,13 +60,13 @@ static int16_t ps2_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && ps2->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps2->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(ps2->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -78,12 +78,12 @@ static int16_t ps2_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && ps2->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps2->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(ps2->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -118,13 +118,13 @@ static int16_t ps3_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && ps3->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps3->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(ps3->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -136,12 +136,12 @@ static int16_t ps3_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && ps3->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps3->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(ps3->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -64,13 +64,13 @@ static int16_t ps4_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && ps4->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps4->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(ps4->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -82,12 +82,12 @@ static int16_t ps4_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && ps4->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && ps4->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(ps4->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -319,13 +319,13 @@ static int16_t psp_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && psp->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && psp->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(psp->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -337,12 +337,12 @@ static int16_t psp_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && psp->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && psp->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(psp->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -746,12 +746,12 @@ static bool qnx_is_pressed(qnx_input_t *qnx,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (joykey != NO_BTN && qnx->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && qnx->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;

View File

@ -487,7 +487,7 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
if (bind->valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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;
@ -495,7 +495,7 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
if (port == 0 && !!rwebinput_mouse_state(&rwebinput->mouse,
bind->mbutton, false))
return true;
if (joykey != NO_BTN && rwebinput->joypad->button(joypad_info.joy_idx, joykey))
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;

View File

@ -98,7 +98,7 @@ static int16_t sdl_joypad_device_state(sdl_input_t *sdl,
unsigned port, unsigned id, enum input_device_type *device)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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;
@ -109,7 +109,7 @@ static int16_t sdl_joypad_device_state(sdl_input_t *sdl,
return 1;
}
if (joykey != NO_BTN && sdl->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && sdl->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return 1;

View File

@ -388,12 +388,12 @@ static int16_t switch_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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 (joykey != NO_BTN && sw->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && sw->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret |= (1 << i);
else if (((float)abs(sw->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret |= (1 << 1);
@ -402,11 +402,11 @@ static int16_t switch_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && sw->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && sw->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(sw->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -945,14 +945,14 @@ static bool udev_is_pressed(udev_input_t *udev,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (udev_mouse_button_pressed(udev, port, bind->mbutton))
return true;
if (joykey != NO_BTN && udev->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && udev->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
return true;
if (((float)abs(udev->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
return true;

View File

@ -139,14 +139,14 @@ static bool uwp_pressed_joypad(uwp_input_t *uwp,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (uwp_mouse_state(port, bind->mbutton, false))
return true;
if (joykey != NO_BTN && uwp->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && uwp->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
return true;
if (((float)abs(uwp->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
return true;

View File

@ -301,11 +301,11 @@ static int16_t input_wl_state(void *data,
if (!res && binds[port])
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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 (joykey != NO_BTN && wl->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && wl->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(wl->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -321,11 +321,11 @@ static int16_t input_wl_state(void *data,
if (!ret && binds[port])
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && wl->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && wl->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(wl->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -144,13 +144,13 @@ static int16_t wiiu_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && wiiu->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && wiiu->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(wiiu->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -162,12 +162,12 @@ static int16_t wiiu_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && wiiu->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && wiiu->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(wiiu->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;

View File

@ -407,14 +407,14 @@ static bool winraw_is_pressed(winraw_input_t *wr,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (winraw_mouse_button_pressed(wr, port, bind->mbutton))
return true;
if (joykey != NO_BTN &&
wr->joypad->button(joypad_info.joy_idx, joykey))
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;

View File

@ -139,15 +139,15 @@ static bool x_is_pressed(x11_input_t *x11,
if (binds && binds[id].valid)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
const uint64_t joykey = (binds[id].joykey != NO_BTN)
? 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 (x_mouse_button_pressed(x11, port, bind->mbutton))
return true;
if (joykey != NO_BTN
&& x11->joypad->button(joypad_info.joy_idx, joykey))
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;

View File

@ -70,13 +70,13 @@ static int16_t xdk_input_state(void *data,
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][i].joykey != NO_BTN)
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;
bool res = false;
if (joykey != NO_BTN && xdk->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && xdk->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
res = true;
else if (((float)abs(xdk->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
res = true;
@ -88,12 +88,12 @@ static int16_t xdk_input_state(void *data,
else
{
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[port][id].joykey != NO_BTN)
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 (joykey != NO_BTN && xdk->joypad->button(joypad_info.joy_idx, joykey))
if ((uint16_t)joykey != NO_BTN && xdk->joypad->button(joypad_info.joy_idx, (uint16_t)joykey))
ret = 1;
else if (((float)abs(xdk->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
ret = 1;