diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-26 22:39:28 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2021-01-26 22:40:34 -0500 |
| commit | 3b986bddd381c6f5aca0fcc38ba03eb1ca6ec510 (patch) | |
| tree | b4b5a65c687a20f5f4075b2be100a1fffab06e59 /include/actions.h | |
| parent | dc058ddf94f03ef8c7df896446ec708ca5d532fa (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); |
