/* * *  database definitions * * */

#define CAPTURE 0x0008	/* capture bit */
#define PIECE   0x0007  /* piece field */
#define TO      0x03f0	/* to - square */
#define FROM    0xfc00  /* from square */

#define P_PAWN  0	/* promote pawn */
#define PAWN    1
#define KNIGHT  2
#define BISHOP  3
#define ROOK    4
#define QUEEN   5
#define KING    6
#define EP_PAWN 7	/* en-passant pawn */


#define N_OPEN  1	/* number of moves in opening position (either 1 or 20, depends on DTconv.c configuration) */

/* * *  the next defs are taken from /usr/chess/src/ch3/tsa/piece.h  * * */

#define EMPTY 0		/* 8 is also considered empty */
#define WPAWN 1
#define WKNIGHT 2
#define WBISHOP 3
#define WROOK 4
#define WQUEEN 5
#define WKING 6
#define BPAWN 9
#define BKNIGHT 10
#define BBISHOP 11
#define BROOK 12
#define BQUEEN 13
#define BKING 14
#define UNDEFINED 100
#define UNDEF 100


/* * *  this is from hardware.h  (sigh, but I don't want to include all of it!)  * * */

#define WSCastle	4
#define BSCastle	8
#define WLCastle	16
#define BLCastle	32


/* * * misc. exam-related stuff * * */

			/* display positions */

#define D_BPOS_X 10		    /* board */
#define D_BPOS_Y 2
#define D_EPOS_X 0		    /* error messages */
#define D_EPOS_Y 13
#define D_PPOS_X 0		    /* parameters */
#define D_PPOS_Y 15
#define D_SPOS_X 40		    /* scores */
#define D_SPOS_Y 7
#define D_FPOS_X 40		    /* fit results */
#define D_FPOS_Y 3

#define MAX_NPRM 128		/* max # of fit parameters */
#define MAX_PREGS 21		/* number of parameter registers */
#define MAX_GAMES 1000		/* max # of games (for seek vector) */
#define MAX_NMVS 128		/* max # of legal moves */
#define MAX_DEPTH 20		/* max depth of search trees */

				/* what to do about capture moves */
#define CAP_IGN	 0		    /* ignore: treat all positions alike */
#define CAP_SKIP 1		    /* skip: don't use any position that resulted from a capture move */
#define CAP_COM  2		    /* compensate: compensate the value by that of the captured piece */
#define CAP_CS   3		    /* compensate played moves, skip any other (probably the most sensible option) */
#define CAP_NOC  4		    /* skip any position that has capture moves */
