2006-02-22 14:24:54 +00:00
|
|
|
|
|
|
|
#ifndef _GNUCHESS_H_
|
|
|
|
#define _GNUCHESS_H_
|
|
|
|
|
|
|
|
#define neutral 2
|
|
|
|
#define white 0
|
|
|
|
#define black 1
|
|
|
|
#define no_piece 0
|
|
|
|
#define pawn 1
|
|
|
|
#define knight 2
|
|
|
|
#define bishop 3
|
|
|
|
#define rook 4
|
|
|
|
#define queen 5
|
|
|
|
#define king 6
|
|
|
|
#define valueP 100
|
|
|
|
#define valueN 350
|
|
|
|
#define valueB 355
|
|
|
|
#define valueR 550
|
|
|
|
#define valueQ 1100
|
|
|
|
#define valueK 1200
|
|
|
|
|
2006-03-14 20:55:59 +00:00
|
|
|
/* ---- chess engine global types ---- */
|
|
|
|
struct GameRec {
|
|
|
|
unsigned short gmove;
|
|
|
|
short score,depth,time,piece,color;
|
|
|
|
long nodes;
|
|
|
|
};
|
|
|
|
struct TimeControlRec {
|
|
|
|
short moves[2];
|
|
|
|
long clock[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ---- chess engine global variables ---- */
|
|
|
|
extern short mate,opponent,computer,Sdepth;
|
2006-02-22 14:24:54 +00:00
|
|
|
extern short locn[8][8];
|
|
|
|
extern short board[64];
|
|
|
|
extern short color[64];
|
2006-04-15 11:27:47 +00:00
|
|
|
extern bool withbook;
|
2006-02-22 14:24:54 +00:00
|
|
|
extern long Level;
|
|
|
|
extern short TCflag,TCmoves,TCminutes;
|
2006-03-03 15:01:37 +00:00
|
|
|
extern short timeout;
|
2006-03-14 20:55:59 +00:00
|
|
|
extern short GameCnt,Game50,castld[2],kingmoved[2],OperatorTime;
|
|
|
|
extern struct TimeControlRec TimeControl;
|
|
|
|
extern struct GameRec GameList[240];
|
2006-02-22 14:24:54 +00:00
|
|
|
|
2006-02-23 21:16:51 +00:00
|
|
|
/* ---- RockBox integration ---- */
|
|
|
|
extern struct plugin_api* rb;
|
2006-02-22 14:24:54 +00:00
|
|
|
|
2006-02-23 21:16:51 +00:00
|
|
|
/* ---- The beginning of a GNUChess v2 APIfication ---- */
|
2006-02-22 14:24:54 +00:00
|
|
|
void SetTimeControl(void);
|
|
|
|
void GNUChess_Initialize(void);
|
2006-03-03 15:01:37 +00:00
|
|
|
int VerifyMove(char s[],short iop,unsigned short *mv);
|
2007-05-29 16:33:16 +00:00
|
|
|
int SelectMove ( short side, short iop , void (*callback)(void), char *move_buffer );
|
2006-03-14 20:55:59 +00:00
|
|
|
void InitializeStats ( void );
|
2007-08-03 21:59:41 +00:00
|
|
|
void ElapsedTime ( short iop );
|
2006-02-22 14:24:54 +00:00
|
|
|
|
|
|
|
#endif
|