From 6b48baaf6b67cc7364d5945eb6d9b25ea9683bd9 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Tue, 26 Jan 2021 22:39:28 -0500 Subject: Somehting along these lines, i'm tired --- include/actions.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/actions.h') 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); -- cgit v1.2.3