24#ifndef __DC_MAPLE_CONTROLLER_H
25#define __DC_MAPLE_CONTROLLER_H
106#define CONT_START (1<<3)
107#define CONT_DPAD_UP (1<<4)
108#define CONT_DPAD_DOWN (1<<5)
109#define CONT_DPAD_LEFT (1<<6)
110#define CONT_DPAD_RIGHT (1<<7)
113#define CONT_X (1<<10)
114#define CONT_D (1<<11)
115#define CONT_DPAD2_UP (1<<12)
116#define CONT_DPAD2_DOWN (1<<13)
117#define CONT_DPAD2_LEFT (1<<14)
118#define CONT_DPAD2_RIGHT (1<<15)
127#define CONT_RESET_BUTTONS (CONT_A | CONT_B | CONT_X | CONT_Y | CONT_START)
145typedef struct cont_state {
242#define CONT_CAPABILITY_C (1<<24)
243#define CONT_CAPABILITY_B (1<<25)
244#define CONT_CAPABILITY_A (1<<26)
245#define CONT_CAPABILITY_START (1<<27)
246#define CONT_CAPABILITY_DPAD_UP (1<<28)
247#define CONT_CAPABILITY_DPAD_DOWN (1<<29)
248#define CONT_CAPABILITY_DPAD_LEFT (1<<30)
249#define CONT_CAPABILITY_DPAD_RIGHT (1<<31)
250#define CONT_CAPABILITY_Z (1<<16)
251#define CONT_CAPABILITY_Y (1<<17)
252#define CONT_CAPABILITY_X (1<<18)
253#define CONT_CAPABILITY_D (1<<19)
254#define CONT_CAPABILITY_DPAD2_UP (1<<20)
255#define CONT_CAPABILITY_DPAD2_DOWN (1<<21)
256#define CONT_CAPABILITY_DPAD2_LEFT (1<<22)
257#define CONT_CAPABILITY_DPAD2_RIGHT (1<<23)
258#define CONT_CAPABILITY_RTRIG (1<<8)
259#define CONT_CAPABILITY_LTRIG (1<<9)
260#define CONT_CAPABILITY_ANALOG_X (1<<10)
261#define CONT_CAPABILITY_ANALOG_Y (1<<11)
262#define CONT_CAPABILITY_ANALOG2_X (1<<12)
263#define CONT_CAPABILITY_ANALOG2_Y (1<<13)
277#define CONT_CAPABILITIES_STANDARD_BUTTONS (CONT_CAPABILITY_A | \
278 CONT_CAPABILITY_B | \
279 CONT_CAPABILITY_X | \
280 CONT_CAPABILITY_Y | \
281 CONT_CAPABILITY_START)
284#define CONT_CAPABILITIES_DPAD (CONT_CAPABILITY_DPAD_UP | \
285 CONT_CAPABILITY_DPAD_DOWN | \
286 CONT_CAPABILITY_DPAD_LEFT | \
287 CONT_CAPABILITY_DPAD_RIGHT)
290#define CONT_CAPABILITIES_ANALOG (CONT_CAPABILITY_ANALOG_X | \
291 CONT_CAPABILITY_ANALOG_Y)
294#define CONT_CAPABILITIES_TRIGGERS (CONT_CAPABILITY_LTRIG | \
295 CONT_CAPABILITY_RTRIG)
298#define CONT_CAPABILITIES_EXTENDED_BUTTONS (CONT_CAPABILITY_C | \
302#define CONT_CAPABILITIES_SECONDARY_DPAD (CONT_CAPABILITY_DPAD2_UP | \
303 CONT_CAPABILITY_DPAD2_DOWN | \
304 CONT_CAPABILITY_DPAD2_LEFT | \
305 CONT_CAPABILITY_DPAD2_RIGHT)
308#define CONT_CAPABILITIES_SECONDARY_ANALOG (CONT_CAPABILITY_ANALOG2_X | \
309 CONT_CAPABILITY_ANALOG2_Y)
312#define CONT_CAPABILITIES_DUAL_DPAD (CONT_CAPABILITIES_DPAD | \
313 CONT_CAPABILITIES_SECONDARY_DPAD)
316#define CONT_CAPABILITIES_DUAL_ANALOG (CONT_CAPABILITIES_ANALOG | \
317 CONT_CAPABILITIES_SECONDARY_ANALOG)
401#define CONT_TYPE_STANDARD_CONTROLLER (CONT_CAPABILITIES_STANDARD_BUTTONS | \
402 CONT_CAPABILITIES_TRIGGERS | \
403 CONT_CAPABILITIES_DPAD | \
404 CONT_CAPABILITIES_ANALOG)
407#define CONT_TYPE_DUAL_ANALOG_CONTROLLER (CONT_CAPABILITIES_STANDARD_BUTTONS | \
408 CONT_CAPABILITIES_TRIGGERS | \
409 CONT_CAPABILITIES_DPAD | \
410 CONT_CAPABILITIES_DUAL_ANALOG)
413#define CONT_TYPE_ASCII_PAD (CONT_CAPABILITIES_STANDARD_BUTTONS | \
414 CONT_CAPABILITIES_EXTENDED_BUTTONS | \
415 CONT_CAPABILITIES_DPAD)
418#define CONT_TYPE_ARCADE_STICK (CONT_CAPABILITIES_STANDARD_BUTTONS | \
419 CONT_CAPABILITIES_EXTENDED_BUTTONS | \
420 CONT_CAPABILITIES_DPAD)
423#define CONT_TYPE_TWIN_STICK (CONT_CAPABILITIES_STANDARD_BUTTONS | \
424 CONT_CAPABILITIES_EXTENDED_BUTTONS | \
425 CONT_CAPABILITY_D | \
426 CONT_CAPABILITIES_DUAL_DPAD)
429#define CONT_TYPE_ASCII_MISSION_STICK (CONT_CAPABILITIES_STANDARD_BUTTONS | \
430 CONT_CAPABILITIES_DUAL_DPAD | \
431 CONT_CAPABILITIES_TRIGGERS | \
432 CONT_CAPABILITIES_ANALOG)
435#define CONT_TYPE_RACING_CONTROLLER (CONT_CAPABILITY_DPAD_UP | \
436 CONT_CAPABILITY_DPAD_DOWN | \
437 CONT_CAPABILITY_A | \
438 CONT_CAPABILITY_B | \
439 CONT_CAPABILITY_START | \
440 CONT_CAPABILITIES_TRIGGERS | \
441 CONT_CAPABILITY_ANALOG_X \
442 CONT_CAPABILITIES_SECONDARY_ANALOG)
445#define CONT_TYPE_MARACAS (CONT_CAPABILITY_A | \
446 CONT_CAPABILITY_B | \
447 CONT_CAPABILITY_D | \
448 CONT_CAPABILITY_START | \
449 CONT_CAPABILITIES_EXTENDED_BUTTONS | \
450 CONT_CAPABILITIES_DUAL_ANALOG)
453#define CONT_TYPE_DANCE_MAT (CONT_CAPABILITY_A | \
454 CONT_CAPABILITY_B | \
455 CONT_CAPABILITY_START | \
456 CONT_CAPABILITIES_DPAD)
459#define CONT_TYPE_FISHING_ROD (CONT_CAPABILITIES_STANDARD_BUTTONS | \
460 CONT_CAPABILITIES_DPAD | \
461 CONT_CAPABILITIES_TRIGGERS | \
462 CONT_CAPABILITIES_DUAL_ANALOG)
465#define CONT_TYPE_POP_N_MUSIC (CONT_CAPABILITIES_STANDARD_BUTTONS | \
466 CONT_CAPABILITY_C | \
467 CONT_CAPABILITIES_DPAD)
470#define CONT_TYPE_DENSHA_DE_GO (CONT_CAPABILITIES_STANDARD_BUTTONS | \
471 CONT_CAPABILITIES_EXTENDED_BUTTONS | \
472 CONT_CAPABILITY_D | \
473 CONT_CAPABILITIES_DPAD)
507void cont_shutdown(
void);
int cont_has_capabilities(const struct maple_device *cont, uint32_t capabilities)
Check for controller capabilities.
int cont_is_type(const struct maple_device *cont, uint32_t type)
Check for controller type.
Controller state structure.
Definition controller.h:145
int joy2y
Secondary joystick y-axis value.
Definition controller.h:177
uint32_t b
B button value.
Definition controller.h:153
uint32_t dpad_down
Main Dpad Down button value.
Definition controller.h:157
uint32_t z
Z button value.
Definition controller.h:160
uint32_t dpad2_down
Secondary Dpad Down button value.
Definition controller.h:165
uint32_t dpad2_up
Secondary Dpad Up button value.
Definition controller.h:164
int ltrig
Left trigger value (0-255).
Definition controller.h:172
uint32_t dpad2_left
Secondary Dpad Left button value.
Definition controller.h:166
uint32_t dpad2_right
Secondary Dpad Right button value.
Definition controller.h:167
uint32_t a
A button value.
Definition controller.h:154
uint32_t c
C button value.
Definition controller.h:152
uint32_t dpad_right
Main Dpad Right button value.
Definition controller.h:159
int joyx
Main joystick x-axis value (-128 - 127).
Definition controller.h:174
uint32_t buttons
bit-packed controller button states
Definition controller.h:150
int joy2x
Secondary joystick x-axis value.
Definition controller.h:176
uint32_t dpad_left
Main Dpad Left button value.
Definition controller.h:158
uint32_t y
Y button value.
Definition controller.h:161
int joyy
Main joystick y-axis value.
Definition controller.h:175
int rtrig
Right trigger value (0-255).
Definition controller.h:173
uint32_t x
X button value.
Definition controller.h:162
uint32_t d
D button value.
Definition controller.h:163
uint32_t start
Start button value.
Definition controller.h:155
uint32_t dpad_up
Main Dpad Up button value.
Definition controller.h:156