GBDK libraries documentation | ||
---|---|---|
Prev | Chapter 5. Libraries | Next |
/* Joypad bits */ #define J_START 0x80U #define J_SELECT 0x40U #define J_B 0x20U #define J_A 0x10U #define J_DOWN 0x08U #define J_UP 0x04U #define J_LEFT 0x02U #define J_RIGHT 0x01U UBYTE joypad(void); UBYTE waitpad(UBYTE mask); void waitpadup(void);
The joypad() function reads the current status of the joypad. It does not block the current thread of control. The joypad status returned by the function uses one bit for each button, according to the definitions given above.
The waitpad() function waits for any button from a given mask to be pushed. The waitpadup() function waits for all buttons to be released.
mask: set of buttons to wait for.
The joypad() and \waitpadup() functions return the joypad status.
Prev | Home | Next |
Graphics/Tile functions | Up | Hardware registers - hardware.h |