summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/gnuchess.h
blob: 3bca031ef76ba01a47fa1427f8ffc0f9e9d997d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

#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

/* ---- 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;
extern short locn[8][8];
extern short board[64];
extern short color[64];
extern bool withbook;
extern long Level;
extern short TCflag,TCmoves,TCminutes;
extern short timeout;
extern short GameCnt,Game50,castld[2],kingmoved[2],OperatorTime;
extern struct TimeControlRec TimeControl;
extern struct GameRec GameList[240];

/* ---- RockBox integration ---- */
extern struct plugin_api* rb;

/* ---- The beginning of a GNUChess v2 APIfication ---- */
void SetTimeControl(void);
void GNUChess_Initialize(void);
int  VerifyMove(char s[],short iop,unsigned short *mv);
int  SelectMove ( short side, short iop , void (*callback)(void) );
void InitializeStats ( void );

#endif