static void ds3_get_buttons(void *data, input_bits_t *state) { ds3_instance_t *pad = (ds3_instance_t *)data; if(pad) { BITS_COPY16_PTR(state, pad->buttons); if(pad->buttons & 0x10000) BIT256_SET_PTR(state, RARCH_MENU_TOGGLE); } else { BIT256_CLEAR_ALL_PTR(state); } }
static void rwebpad_joypad_get_buttons(unsigned port_num, retro_bits_t *state) { EmscriptenGamepadEvent gamepad_state; EMSCRIPTEN_RESULT r; r = emscripten_get_gamepad_status(port_num, &gamepad_state); if (r == EMSCRIPTEN_RESULT_SUCCESS) { int i; for (i = 0; i < gamepad_state.numButtons; i++) { if (gamepad_state.digitalButton[i]) BIT256_SET_PTR(state, i); } } else BIT256_CLEAR_ALL_PTR(state); }
static void hidpad_wiiupro_get_buttons(void *data, input_bits_t *state) { struct hidpad_wiiupro_data *device = (struct hidpad_wiiupro_data*)data; struct wiiupro *rpt = device ? (struct wiiupro*)&device->data : NULL; if (!device || !rpt) return; BIT256_CLEAR_ALL_PTR(state); if (rpt->btn.r3) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R3); if (rpt->btn.l3) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L3); if (rpt->btn.plus) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_START); if ( rpt->btn.minus) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_SELECT); if ( rpt->btn.zr) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R2); if ( rpt->btn.zl) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L2); if ( rpt->btn.r) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R); if ( rpt->btn.l) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L); if ( rpt->btn.x) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_X); if ( rpt->btn.a) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_A); if ( rpt->btn.b) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_B); if ( rpt->btn.y) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_Y); if ( rpt->btn.left) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_LEFT); if ( rpt->btn.down) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_DOWN); if ( rpt->btn.right) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_RIGHT); if ( rpt->btn.up) BIT256_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_UP); if ( rpt->btn.home) BIT256_SET_PTR(state, RARCH_MENU_TOGGLE); }