KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Controller state structure. More...
#include <controller.h>
Data Fields | ||
union { | ||
uint32_t buttons | ||
bit-packed controller button states More... | ||
struct { | ||
uint32_t c: 1 | ||
C button value. More... | ||
uint32_t b: 1 | ||
B button value. More... | ||
uint32_t a: 1 | ||
A button value. More... | ||
uint32_t start: 1 | ||
Start button value. More... | ||
uint32_t dpad_up: 1 | ||
Main Dpad Up button value. More... | ||
uint32_t dpad_down: 1 | ||
Main Dpad Down button value. More... | ||
uint32_t dpad_left: 1 | ||
Main Dpad Left button value. More... | ||
uint32_t dpad_right: 1 | ||
Main Dpad Right button value. More... | ||
uint32_t z: 1 | ||
Z button value. More... | ||
uint32_t y: 1 | ||
Y button value. More... | ||
uint32_t x: 1 | ||
X button value. More... | ||
uint32_t d: 1 | ||
D button value. More... | ||
uint32_t dpad2_up: 1 | ||
Secondary Dpad Up button value. More... | ||
uint32_t dpad2_down: 1 | ||
Secondary Dpad Down button value. More... | ||
uint32_t dpad2_left: 1 | ||
Secondary Dpad Left button value. More... | ||
uint32_t dpad2_right: 1 | ||
Secondary Dpad Right button value. More... | ||
uint32_t : 16 | ||
} | ||
}; | ||
int | ltrig | |
Left trigger value (0-255). | ||
int | rtrig | |
Right trigger value (0-255). | ||
int | joyx | |
Main joystick x-axis value (-128 - 127). | ||
int | joyy | |
Main joystick y-axis value. | ||
int | joy2x | |
Secondary joystick x-axis value. | ||
int | joy2y | |
Secondary joystick y-axis value. | ||
Controller state structure.
This structure contains information about the status of the controller device and can be fetched by casting the result of maple_dev_status() to this structure.
A 1 bit in the buttons' bitfield indicates that a button is pressed, and the joyx, joyy, joy2x, joy2 values are all 0 based (0 is centered).
union { ... } cont_state_t |
uint32_t cont_state_t::__pad0__ |
uint32_t cont_state_t::a |
A button value.
uint32_t cont_state_t::b |
B button value.
uint32_t cont_state_t::buttons |
bit-packed controller button states
uint32_t cont_state_t::c |
C button value.
uint32_t cont_state_t::d |
D button value.
uint32_t cont_state_t::dpad2_down |
Secondary Dpad Down button value.
uint32_t cont_state_t::dpad2_left |
Secondary Dpad Left button value.
uint32_t cont_state_t::dpad2_right |
Secondary Dpad Right button value.
uint32_t cont_state_t::dpad2_up |
Secondary Dpad Up button value.
uint32_t cont_state_t::dpad_down |
Main Dpad Down button value.
uint32_t cont_state_t::dpad_left |
Main Dpad Left button value.
uint32_t cont_state_t::dpad_right |
Main Dpad Right button value.
uint32_t cont_state_t::dpad_up |
Main Dpad Up button value.
int cont_state_t::joy2x |
Secondary joystick x-axis value.
int cont_state_t::joy2y |
Secondary joystick y-axis value.
int cont_state_t::joyx |
Main joystick x-axis value (-128 - 127).
int cont_state_t::joyy |
Main joystick y-axis value.
int cont_state_t::ltrig |
Left trigger value (0-255).
int cont_state_t::rtrig |
Right trigger value (0-255).
uint32_t cont_state_t::start |
Start button value.
uint32_t cont_state_t::x |
X button value.
uint32_t cont_state_t::y |
Y button value.
uint32_t cont_state_t::z |
Z button value.