#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)

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

void draw_board(struct board *brd, struct coord *legal_moves, unsigned char legal_move_count, unsigned selrow, unsigned selcol);

struct bitmap *piece_bitmap(unsigned char piece);
