apple_joypad_hid - cleanup apple_joypad_button somewhat

This commit is contained in:
Twinaphex 2014-10-05 03:12:32 +02:00
parent 784643fd8c
commit d1e26a6911

View File

@ -299,8 +299,9 @@ static bool apple_joypad_button(unsigned port, uint16_t joykey)
if (GET_HAT_DIR(joykey))
return false;
// Check the button
return (port < MAX_PLAYERS && joykey < 32) ?
(apple->buttons[port] & (1 << joykey)) != 0 : false;
if ((port < MAX_PLAYERS) && (joykey < 32))
return ((apple->buttons[port] & (1 << joykey)) != 0);
return false;
}
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)