static bool wiiusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey) { uint64_t buttons = wiiusb_hid_joypad_get_buttons(data, port); if (joykey == NO_BTN) return false; /* Check hat. */ if (GET_HAT_DIR(joykey)) return false; /* Check the button. */ if ((port < MAX_USERS) && (joykey < 32)) return ((buttons & (1 << joykey)) != 0); return false; }
static bool wiiusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey) { input_bits_t buttons; wiiusb_hid_joypad_get_buttons(data, port, &buttons); /* Check hat. */ if (GET_HAT_DIR(joykey)) return false; /* Check the button. */ if ((port < MAX_USERS) && (joykey < 32)) return (BIT256_GET(buttons, joykey) != 0); return false; }