diff options
Diffstat (limited to 'src/input.h')
-rw-r--r-- | src/input.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/input.h b/src/input.h new file mode 100644 index 0000000..9830a49 --- /dev/null +++ b/src/input.h @@ -0,0 +1,21 @@ +#pragma once + +enum _inputs { + INPUT_UP, + INPUT_DOWN, + INPUT_LEFT, + INPUT_RIGHT, + + INPUT_A, + INPUT_S, + + INPUT_LENGTH // no. of checked inputs +}; + +#define input_up(a) (1 & a >> INPUT_UP) +#define input_down(a) (1 & a >> INPUT_DOWN) +#define input_left(a) (1 & a >> INPUT_LEFT) +#define input_right(a) (1 & a >> INPUT_RIGHT) + +#define input_a(a) (1 & a >> INPUT_A) +#define input_s(a) (1 & a >> INPUT_S) |