Direct access to joystick
| u8 Joystick_Read( |
| ) __FASTCALL __PRESERVES(b, c, d, e, h, iyl, iyh) |
Gets current joystick information
| port u8 | JOY_PORT_1 or JOY_PORT_2 |
Joystick state (bit=0: pressed)
xxBARLDU
│││││└─ Up
││││└── Down
│││└─── Left
││└──── Right
│└───── Trigger A
└────── Trigger B
Updates both joystick stats at once and stores the result Only available when INPUT_JOY_UPDATE is TRUE
| inline u8 Joystick_GetDirection( |
| ) |
Gets current direction of the given joystick If INPUT_JOY_UPDATE is TRUE, this function uses data retrieved by Joystick_Update(). Otherwise, this function reads I/O data.
| port u8 | JOY_PORT_1 or JOY_PORT_2 |
One or two of those defines:
JOY_INPUT_DIR_NONE
JOY_INPUT_DIR_UP
JOY_INPUT_DIR_DOWN
JOY_INPUT_DIR_LEFT
JOY_INPUT_DIR_RIGHT
| inline u8 Joystick_GetDirectionChange( |
| ) |
Gets current direction of the given joystick if different from previous one Only available if INPUT_JOY_UPDATE is TRUE.
| port u8 | JOY_PORT_1 or JOY_PORT_2 |
One or two of those defines:
JOY_INPUT_DIR_NONE
JOY_INPUT_DIR_UP
JOY_INPUT_DIR_DOWN
JOY_INPUT_DIR_LEFT
JOY_INPUT_DIR_RIGHT
JOY_INPUT_DIR_UNCHANGED
| inline bool Joystick_IsButtonPressed( |
| ) |
Gets current trigger status of the given joystick If INPUT_JOY_UPDATE is TRUE, this function uses data retrieved by Joystick_Update(). Otherwise, this function read I/O data.
| port u8 | JOY_PORT_1 or JOY_PORT_2 |
| trigger u8 | JOY_INPUT_TRIGGER_A or JOY_INPUT_TRIGGER_B |
TRUE if given button is pressed
| inline bool Joystick_IsButtonPushed( |
| ) |
Gets current trigger status of the given joystick Only available if INPUT_JOY_UPDATE is TRUE.
| port u8 | JOY_PORT_1 or JOY_PORT_2 |
| trigger u8 | JOY_INPUT_TRIGGER_A or JOY_INPUT_TRIGGER_B |
TRUE if given button is pressed
General purpose port device detection
| u8 Input_Detect( |
| ) |
Detect device plugged in General purpose ports
Direct access to mouse
| void Mouse_Read( |
| ) |
| inline i8 Mouse_GetOffsetX( |
| ) |
| inline i8 Mouse_GetOffsetY( |
| ) |
| inline i8 Mouse_GetAdjustedOffsetX( |
| ) |
| inline i8 Mouse_GetAdjustedOffsetY( |
| ) |
| inline bool Mouse_IsButtonPress( |
| ) |
| inline bool Mouse_IsButtonClick( |
| ) |
Direct access to keyboard
Value encoded by combining a row number with a given physical key index in that row Can be KEY_1, KEY_SPACE, KEY_A, KEY_F1, etc.
| u8 Keyboard_Read( |
| ) __FASTCALL __PRESERVES(b, c, d, e, h, iyl, iyh) |
Reads keyboard matrix row
| row u8 | The row to read (0-10) |
8-bits value where each bit to 0 represents the pressed keys
| inline void Keyboard_SetBuffer( |
| ) |
Updates all keyboard rows at once Only available when INPUT_KB_UPDATE is TRUE
| bool Keyboard_IsKeyPressed( |
| ) |
When INPUT_KB_UPDATE is TRUE, this function uses data retrieved by Keyboard_Update() function Otherwise, the function reads the key's row before checking the key.
| key u8 | The key ID to check |
TRUE if key is pressed
| bool Keyboard_IsKeyPushed( |
| ) |
Checks if a given key was just pushed Only available when INPUT_KB_UPDATE is TRUE
| key u8 | The key ID to check |
TRUE if the key was pushed on this frame