better input, button for quality selection
[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 #define KEYPRESS(key)   ((keystate & (key)) && (keydelta & (key)))
20 #define KEYRELEASE(key) ((keystate & (key)) == 0 && (keydelta & (key)))
21
22 volatile uint16_t keystate, keydelta;
23
24 /*void key_repeat(int start, int rep, uint16_t mask);*/
25
26 void update_keyb(void);
27
28
29 #endif  /* INPUT_H_ */