diff options
author | zlago | 2024-09-24 20:54:48 +0200 |
---|---|---|
committer | zlago | 2024-09-24 20:54:48 +0200 |
commit | b23a3ab831f91553d34a48f51370ed9525de07ac (patch) | |
tree | bd4adf20ba92d17433f386c0b5347a8d8cc9045f /src/input.h |
initial commit
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) |