(input hid) Change back to original code

This commit is contained in:
twinaphex 2020-07-28 12:42:33 +02:00
parent 59549d9f62
commit 89567dae5d
2 changed files with 6 additions and 8 deletions

View File

@ -330,10 +330,9 @@ static const char *ds3_get_name(void *data) { return "Sony DualShock 3"; }
static int16_t ds3_button(void *data, uint16_t joykey)
{
ds3_instance_t *pad = (ds3_instance_t *)data;
if (joykey < 31)
if (pad)
return (pad->buttons & (1 << joykey));
return 0;
if (!pad || joykey > 31)
return 0;
return pad->buttons & (1 << joykey);
}
pad_connection_interface_t ds3_pad_connection = {

View File

@ -328,10 +328,9 @@ static const char *wiiu_gca_get_name(void *data)
static int16_t wiiu_gca_button(void *data, uint16_t joykey)
{
gca_pad_t *pad = (gca_pad_t *)data;
if (joykey < 31)
if (pad)
return pad->buttons & (1 << joykey);
return 0;
if(!pad || joykey > 31)
return 0;
return pad->buttons & (1 << joykey);
}
pad_connection_interface_t wiiu_gca_pad_connection = {