#define tile_occupied(brd, row, col)  (((unsigned char*)(((struct board*)brd)->tiles))[(row<<3)+col])

#define piece_in_tile(brd, row, col) tile_occupied(brd, row, col)

#define ptr_to_tile(brd, row, col) (((unsigned char*)(((struct board*)brd)->tiles))+(row<<3)+col)

unsigned char legal_moves(struct board *brd, struct coord pc_coords, struct coord *king_pos, struct coord *moves);
int move_in_list(struct coord *list, unsigned char count, struct coord *move);
void outofmemory(void);

void draw_board(struct board *brd, struct coord *legal_moves, unsigned char legal_move_count, struct coord *seltile,
                struct coord *selpiece);

struct bitmap *piece_bitmap(unsigned char piece);
