/* SPDX-License-Identifier: GPL-3.0-or-later */ #ifndef QUAD_INPUT_H #define QUAD_INPUT_H #include "rules.h" #define Q_LEFT 1 #define Q_RIGHT 2 #define Q_UP 4 #define Q_DOWN 8 #define Q_CCW 16 #define Q_CW 32 #define Q_HARD 64 #define Q_HOLD 128 #define Q_PAUSE 256 #define Q_CONFIRM 512 #define Q_BACK 1024 typedef struct { Q16 previous,repeat_ms,button_ms; signed char direction,axis_x,axis_y; Q8 guard,button_before,button_used,up_armed; Q8 stick_armed; /* bit 0: X has centered; bit 1: Y has centered */ } QInput; typedef struct { Q16 held,pressed; signed char move; Q8 repeats; } QActions; void q_input_reset(QInput *state); QActions q_input_step(QInput *state,Q16 keys,Q8 button,Q8 x,Q8 y,Q8 cx,Q8 cy,Q8 joystick,Q16 ms,Q8 playing,Q8 clockwise); #endif