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
| port enum INPUT_PORT | Port to check (INPUT_PORT1 or INPUT_PORT2) |
Device type (INPUT_TYPE_JOYSTICK, INPUT_TYPE_MOUSE, etc.)
Direct access to mouse
| void Mouse_Read( |
| ) |
Gets current mouse information
| port u8 | Port to check (MOUSE_PORT_1 or MOUSE_PORT_2) |
| data Mouse_State* | Output mouse state |
| inline i8 Mouse_GetOffsetX( |
| ) |
Gets current mouse X offset
| data Mouse_State* | Current mouse state (from Mouse_Read) |
Mouse X offset
| inline i8 Mouse_GetOffsetY( |
| ) |
Gets current mouse Y offset
| data Mouse_State* | Current mouse state (from Mouse_Read) |
Mouse Y offset
| inline i8 Mouse_GetAdjustedOffsetX( |
| ) |
Gets current mouse X offset adjusted by speed
| data Mouse_State* | Current mouse state (from Mouse_Read) |
| spd u8 | Mouse speed (MOUSE_SPEED_LOWEST, MOUSE_SPEED_LOW, MOUSE_SPEED_MEDIUM, MOUSE_SPEED_HIGH, MOUSE_SPEED_HIGHEST) |
Mouse X offset
| inline i8 Mouse_GetAdjustedOffsetY( |
| ) |
Gets current mouse Y offset adjusted by speed
| data Mouse_State* | Current mouse state (from Mouse_Read) |
| spd u8 | Mouse speed (MOUSE_SPEED_LOWEST, MOUSE_SPEED_LOW, MOUSE_SPEED_MEDIUM, MOUSE_SPEED_HIGH, MOUSE_SPEED_HIGHEST) |
Mouse Y offset
| inline bool Mouse_IsButtonPress( |
| ) |
Check if mouse button is pressed
| data Mouse_State* | Current mouse state (from Mouse_Read) |
| btn u8 | Mouse button to check (MOUSE_BOUTON_LEFT, MOUSE_BOUTON_RIGHT) |
FALSE is not pressed
| inline bool Mouse_IsButtonClick( |
| ) |
Check if mouse button is clicked
| data Mouse_State* | Current mouse state (from Mouse_Read) |
| btn u8 | Mouse button to check (MOUSE_BOUTON_LEFT, MOUSE_BOUTON_RIGHT) |
FALSE is not clicked
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( |
| ) |
Set the buffer to store keyboard state
| new u8* | Buffer to store current frame keys state |
| old u8* | Buffer to store previous frame keys state |
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