X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Finput.h;h=55a7f2726eeb66966daf9c540c25eab5852af4ab;hb=97f8eca559ee318131a11436b12f06b61b8629ad;hp=3ed22a0af0d922f7aa9645ecafd33ff677be3a63;hpb=f57fab6afe62f2a476ef4afa1842c81722816451;p=gbajam22 diff --git a/src/input.h b/src/input.h index 3ed22a0..55a7f27 100644 --- a/src/input.h +++ b/src/input.h @@ -16,9 +16,18 @@ enum { BN_LT = 0x0200 }; -#define BN_DPAD (BN_RIGHT | BN_LEFT | BN_UP | BN_DOWN) +#ifdef BUILD_GBA +#define keyb_vblank() (keystate = ~REG_KEYINPUT) +#endif + +#define KEYPRESS(key) ((keystate & (key)) && (keydelta & (key))) +#define KEYRELEASE(key) ((keystate & (key)) == 0 && (keydelta & (key))) + +volatile uint16_t keystate, keydelta; + +/*void key_repeat(int start, int rep, uint16_t mask);*/ + +void update_keyb(void); -void select_input(uint16_t bmask); -uint16_t get_input(void); #endif /* INPUT_H_ */