aboutsummaryrefslogtreecommitdiff
path: root/src/ppusim
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-03-10 13:12:02 +0100
committerlonkaars <loek@pipeframe.xyz>2023-03-10 13:12:02 +0100
commitbf8c5fdb43ae2446a502227a95f17167c3dcda33 (patch)
tree3b2611951db5d8cc033f8a97ef0aa27a38936ed4 /src/ppusim
parentc6563a099ce05d9291a0c27fdbab3ffd9efddc48 (diff)
add input emulation to test collision
Diffstat (limited to 'src/ppusim')
-rw-r--r--src/ppusim/input.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ppusim/input.c b/src/ppusim/input.c
new file mode 100644
index 0000000..bdb94ac
--- /dev/null
+++ b/src/ppusim/input.c
@@ -0,0 +1,16 @@
+#include <SDL2/SDL.h>
+
+#include "input.h"
+
+hh_s_gamepad g_hh_controller_p1 = { 0 };
+hh_s_gamepad g_hh_controller_p2 = { 0 };
+
+void hh_input_read() {
+ // SDL_PumpEvents();
+ const Uint8* kb = SDL_GetKeyboardState(NULL);
+ g_hh_controller_p1.dpad_up = kb[SDL_SCANCODE_W];
+ g_hh_controller_p1.dpad_down = kb[SDL_SCANCODE_S];
+ g_hh_controller_p1.dpad_left = kb[SDL_SCANCODE_A];
+ g_hh_controller_p1.dpad_right = kb[SDL_SCANCODE_D];
+}
+