diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-26 22:39:28 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 6b48baaf6b67cc7364d5945eb6d9b25ea9683bd9 (patch) | |
| tree | b4b5a65c687a20f5f4075b2be100a1fffab06e59 /include/actions.h | |
| parent | d39e9f242d7e71a517adbe003e9b3a25b676a052 (diff) | |
Somehting along these lines, i'm tired
Diffstat (limited to 'include/actions.h')
| -rw-r--r-- | include/actions.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/actions.h b/include/actions.h index 661f11e..d331284 100644 --- a/include/actions.h +++ b/include/actions.h @@ -10,6 +10,15 @@ enum A_TYPE { A_PLACE, A_MOVE }; typedef uint32_t action_t; +#define TYPE_SHIFT 24 +#define LOC_SHIFT 16 +#define DATA0_SHIFT 8 + +#define GET_TYPE(a) (enum A_TYPE)((a)>>TYPE_SHIFT) +#define GET_LOC(a) (int8_t)(((a)>>LOC_SHIFT) & 0xFF) +#define GET_DATA0(a) (uint8_t)(((a)>>DATA0_SHIFT) & 0xFF) +#define GET_DATA1(a) (uint8_t)((a) & 0xFF) + typedef struct action_node_s { struct action_node_s *next; action_t action; @@ -20,6 +29,8 @@ typedef struct action_list_s { uint32_t length; } action_list_t; +extern int8_t move_deltas[4]; + void action_list_init(void); void action_list_free(action_list_t *list); action_list_t *action_list_generate(void); |
