add missing tools/pngdump to the repo
[gbajam22] / src / input.h
1 #ifndef INPUT_H_
2 #define INPUT_H_
3
4 #include <stdint.h>
5
6 enum {
7         BN_A            = 0x0001,
8         BN_B            = 0x0002,
9         BN_SELECT       = 0x0004,
10         BN_START        = 0x0008,
11         BN_RIGHT        = 0x0010,
12         BN_LEFT         = 0x0020,
13         BN_UP           = 0x0040,
14         BN_DOWN         = 0x0080,
15         BN_RT           = 0x0100,
16         BN_LT           = 0x0200
17 };
18
19 #ifdef BUILD_GBA
20 #define keyb_vblank()   (keystate = ~REG_KEYINPUT)
21 #endif
22
23 #define KEYPRESS(key)   ((keystate & (key)) && (keydelta & (key)))
24 #define KEYRELEASE(key) ((keystate & (key)) == 0 && (keydelta & (key)))
25
26 volatile uint16_t keystate, keydelta;
27
28 /*void key_repeat(int start, int rep, uint16_t mask);*/
29
30 void update_keyb(void);
31
32
33 #endif  /* INPUT_H_ */