Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/boards/chess_makros.h
blob: f031315641721de238bf737d424fca62f62df165 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*
 * Copyright (C) 1999 Robert Wilhelm
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _MAKROS_H_
#define _MAKROS_H_

#include <glib.h>

#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */

/* Types */
typedef gushort Square;
typedef gchar   Piece;

/* Various empty defines */
#define NONE		0

/* Generated movelist */
#define AB_ZUGL		512	/*  Length of list generated moves	*/
#define AB_ZUG_S	256	/*  Beginning of generated capture moves*/

/* Colours */
#define WHITE		1	/*  White to Move			*/
#define BLACK		129	/*  Black to move			*/

/* Notation types */
#define	SAN		0	/*  Standard algebraic notation		*/
#define	COORD		1	/*  Coordinate notation			*/

/* Game results */
#define	GAME_NONE	0	/*  No game			        */
#define	GAME_PAUSED	1	/*  Game is paused			*/
#define	GAME_PROGRESS	2	/*  Game is in progress			*/
#define	GAME_ABORTED	3	/*  Game was aborted			*/
#define	GAME_WHITE	4	/*  White won the game			*/
#define	GAME_BLACK	5	/*  Black won the game			*/
#define	GAME_DRAW	6	/*  Draw			        */

/* Board window modes */
#define	COMPUTER_BLACK	1
#define	COMPUTER_WHITE	2
#define	AUTOPLAY	3
#define	ANALYSE		4
#define	HUMANS		5

#define  OL            9     /********************************************/
#define  OM           10     /*                                          */
#define  OR           11     /*            OL |  OM  | OR                */
#define  LI           -1     /*           ----+------+----               */
#define  RE            1     /*            LI | FELD | RE                */
#define  UL          -11     /*           ----+------+----               */
#define  UM          -10     /*            UL |  UM  | UR                */
#define  UR           -9     /********************************************/

/*************************************************************************/
/*                         Figuren      Pieces                           */
/*************************************************************************/
/*                                                                       */
/*      weiss   white  32 + x      x = 1  Bauer     Pawn                 */
/*      schwarz black  64 + x          2  Springer  Knight               */
/*      leer    empty  0               3  Laeufer   Bishop               */
/*      rand    border 16              4  Turm      Rook                 */
/*                                     5  Dame      Queen                */
/*                                     6  Koenig    King                 */
/*                                                                       */
/*************************************************************************/

#define WP		33	 /*  white pawn   */
#define WN		34	 /*  white knight */
#define WB		35	 /*  white bishop */
#define WR		36	 /*  white rook   */
#define WQ		37	 /*  white queen  */
#define WK		38	 /*  white king   */
#define BP		65	 /*  black pawn   */
#define BN		66	 /*  black knight */
#define BB		67	 /*  black bishop */
#define BR		68	 /*  black rook   */
#define BQ		69	 /*  black queen  */
#define BK		70	 /*  black king	  */
#define EMPTY     0              /*  empty	  */
#define BORDER    16             /*  border (illegal) */

#define WPIECE(c) ((c) & 32)   /* white piece? */
#define BPIECE(c) ((c) & 64)   /* black piece? */

/****************************************************************/
/*                      Squares                                 */
/****************************************************************/

#define A1 21
#define B1 22
#define C1 23
#define D1 24
#define E1 25
#define F1 26
#define G1 27
#define H1 28
#define A2 31
#define B2 32
#define C2 33
#define D2 34
#define E2 35
#define F2 36
#define G2 37
#define H2 38
#define A3 41
#define B3 42
#define C3 43
#define D3 44
#define E3 45
#define F3 46
#define G3 47
#define H3 48
#define A4 51
#define B4 52
#define C4 53
#define D4 54
#define E4 55
#define F4 56
#define G4 57
#define H4 58
#define A5 61
#define B5 62
#define C5 63
#define D5 64
#define E5 65
#define F5 66
#define G5 67
#define H5 68
#define A6 71
#define B6 72
#define C6 73
#define D6 74
#define E6 75
#define F6 76
#define G6 77
#define H6 78
#define A7 81
#define B7 82
#define C7 83
#define D7 84
#define E7 85
#define F7 86
#define G7 87
#define H7 88
#define A8 91
#define B8 92
#define C8 93
#define D8 94
#define E8 95
#define F8 96
#define G8 97
#define H8 98

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _MAKROS_H_ */