additional compile fixes

This commit is contained in:
David Walters 2017-11-28 10:36:16 +00:00
parent c5bdc02d6f
commit f09477d46a
4 changed files with 42 additions and 33 deletions

View File

@ -186,13 +186,14 @@ static bool hidpad_ps4_check_dpad(struct ps4 *rpt, unsigned id)
static void hidpad_ps4_get_buttons(void *data, retro_bits_t* state)
{
uint64_t buttonstate = 0;
struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data;
struct ps4 *rpt = device ? (struct ps4*)&device->data : NULL;
if (!device || !rpt)
return;
RARCH_INPUT_STATE_CLEAR_PTR( state );
if ( rpt->btn.r3 ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 );
}

View File

@ -126,6 +126,8 @@ static void hidpad_wiiupro_get_buttons(void *data, retro_bits_t *state)
if (!device || !rpt)
return;
RARCH_INPUT_STATE_CLEAR_PTR( state );
if ( rpt->btn.r3 ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 );
}

View File

@ -50,13 +50,13 @@ int32_t cocoa_input_find_any_key(void)
}
static int cocoa_input_find_any_button_ret(cocoa_input_data_t *apple,
unsigned buttons, unsigned port)
retro_bits_t * state, unsigned port)
{
unsigned i;
if (buttons)
for (i = 0; i < 32; i++)
if (buttons & (1 << i))
if (state)
for (i = 0; i < 256; i++)
if (RARCH_INPUT_STATE_BIT_GET_PTR(state,i))
return i;
return -1;
}
@ -74,7 +74,11 @@ int32_t cocoa_input_find_any_button(uint32_t port)
apple->joypad->poll();
if (apple->joypad->get_buttons)
ret = cocoa_input_find_any_button_ret(apple, (unsigned)apple->joypad->get_buttons(port), port);
{
retro_bits_t state;
apple->joypad->get_buttons(port,&state);
ret = cocoa_input_find_any_button_ret(apple, &state, port);
}
}
if (ret != -1)
@ -86,8 +90,10 @@ int32_t cocoa_input_find_any_button(uint32_t port)
if (apple->sec_joypad->get_buttons)
{
retro_bits_t state;
apple->sec_joypad->poll();
ret = cocoa_input_find_any_button_ret(apple, (unsigned)apple->sec_joypad->get_buttons(port), port);
apple->sec_joypad->get_buttons(port,&state);
ret = cocoa_input_find_any_button_ret(apple, &state, port);
}
}

View File

@ -151,7 +151,7 @@ static bool iohidmanager_hid_joypad_button(void *data,
/* Check the button. */
if ((port < MAX_USERS) && (joykey < 32))
return (RARCH_INPUT_STATE_BIT_GET( buttons, joykey )) != 0)
return (RARCH_INPUT_STATE_BIT_GET( buttons, joykey ) != 0)
|| ((hid->buttons[port] & (1 << joykey)) != 0);
return false;