summary refs log tree commit diff
path: root/src/input.h
diff options
context:
space:
mode:
authorzlago2024-09-24 20:54:48 +0200
committerzlago2024-09-24 20:54:48 +0200
commitb23a3ab831f91553d34a48f51370ed9525de07ac (patch)
treebd4adf20ba92d17433f386c0b5347a8d8cc9045f /src/input.h
initial commit
Diffstat (limited to 'src/input.h')
-rw-r--r--src/input.h21
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)