From b23a3ab831f91553d34a48f51370ed9525de07ac Mon Sep 17 00:00:00 2001 From: zlago Date: Tue, 24 Sep 2024 20:54:48 +0200 Subject: initial commit --- src/input.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/input.h (limited to 'src/input.h') 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) -- cgit 1.4.1-2-gfad0