diff options
Diffstat (limited to 'arm9/source/devices/input.h')
-rw-r--r-- | arm9/source/devices/input.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/arm9/source/devices/input.h b/arm9/source/devices/input.h index 4f91ed5..6df947b 100644 --- a/arm9/source/devices/input.h +++ b/arm9/source/devices/input.h @@ -1,21 +1,26 @@ -#include <nds.h> -#include "../types/circbuf.h" - #ifndef INPUT_H_ #define INPUT_H_ + #include "../bang.h" + #include "../types/circbuf.h" + + + // Bedrock input device. typedef struct { - bool pointer; // pointer active - bool keyboard; // keyboard active - CircBuf keybuffer; // queued keypresses - u16 x,y; // pointer position - u8 navigation; // navigation state - u8 gamepad; // gamepad state - bool wake; // wake flag + bool pointer; // Pointer active + bool keyboard; // Keyboard active + u16 x, y; // Pointer position + u16 x_read, y_read; // Read caches for pointer position + CircBuf keybuffer; // Queued keypresses + u8 gamepad; // Gamepad state + bool wake; // Wake flag } InputDevice; - void inp_receive_byte(InputDevice *inp, u8 byte); - void inp_read_gamepad(InputDevice *inp); - void inp_read_navigation(InputDevice *inp); - void inp_read_touch(InputDevice *inp); + // Methods. + void input_reset(InputDevice *input); + void input_read_x(InputDevice *input); + void input_read_y(InputDevice *input); + void input_receive_key(InputDevice *input, u8 byte); + void input_update_gamepad(InputDevice *input); + void input_update_touch(InputDevice *input); #endif |