libdragon
Loading...
Searching...
No Matches
Functions
controller.c File Reference

Controller Subsystem. More...

Functions

void controller_init (void)
 Initialize the controller subsystem.
 
void controller_read (struct controller_data *output)
 Read the controller button status for all controllers.
 
void controller_read_gc (struct controller_data *outdata, const uint8_t rumble[4])
 Read the controller button status for all controllers, GC version.
 
void controller_read_gc_origin (struct controller_origin_data *outdata)
 Read the controller origin status for all controllers, GC version.
 
void controller_scan (void)
 Fetch the current controller state.
 
struct controller_data get_keys_down (void)
 Get keys that were pressed since the last inspection.
 
struct controller_data get_keys_up (void)
 Get keys that were released since the last inspection.
 
struct controller_data get_keys_held (void)
 Get keys that were held since the last inspection.
 
struct controller_data get_keys_pressed (void)
 Get keys that are currently pressed, regardless of previous state.
 
int get_dpad_direction (int controller)
 Return the DPAD calculated direction.
 
void execute_raw_command (int controller, int command, int bytesout, int bytesin, unsigned char *out, unsigned char *in)
 Execute a raw PIF command.
 
int get_controllers_present (void)
 Return a bitmask representing which controllers are present.
 
int get_accessories_present (struct controller_data *out)
 Return a bitmask specifying which controllers have recognized accessories.
 
int read_mempak_address (int controller, uint16_t address, uint8_t *data)
 Read a chunk of data from a mempak.
 
int write_mempak_address (int controller, uint16_t address, uint8_t *data)
 Write a chunk of data to a mempak.
 
int identify_accessory (int controller)
 Identify the accessory connected to a controller.
 
void rumble_start (int controller)
 Turn rumble on for a particular controller.
 
void rumble_stop (int controller)
 Turn rumble off for a particular controller.
 

Detailed Description

Controller Subsystem.