Use #define constants, and more PROGMEM
This commit is contained in:
parent
61296d8a9a
commit
3a95a80333
18
Board.h
18
Board.h
|
|
@ -27,21 +27,21 @@ void board_init() {
|
|||
}
|
||||
|
||||
// 0x88-fill definitions
|
||||
static const byte PTR_SIDE_AND_CASTLERIGHT = 0x08; //byte (1=side, 2,4=white castle, 8,16=black)
|
||||
#define PTR_SIDE_AND_CASTLERIGHT 0x08 //byte (1=side, 2,4=white castle, 8,16=black)
|
||||
// CAN FILL 0x09
|
||||
static const byte PTR_W_KING = 0x0A; // byte (points to index or maybe 64-arr index)
|
||||
#define PTR_W_KING 0x0A // byte (points to index or maybe 64-arr index)
|
||||
// const byte PTR_B_KING = 0x0B; (PTR_W_KING | COLOR or PTR_W_KING + COLOR)
|
||||
static const byte PTR_ZOBRIST = 0x0C; // 4 bytes
|
||||
#define PTR_ZOBRIST 0x0C // 4 bytes
|
||||
// 0x0D
|
||||
// 0x0E
|
||||
// 0x0F
|
||||
|
||||
static const byte PTR_ENPASSANT = 0x18;
|
||||
static const byte PTR_REVMOV = 0x19;
|
||||
#define PTR_ENPASSANT 0x18
|
||||
#define PTR_REVMOV 0x19
|
||||
// free space
|
||||
|
||||
static const byte PTR_UNMOVE_START = 0x28;
|
||||
static const byte PTR_UNMOVE_LAST = 0x7F;
|
||||
#define PTR_UNMOVE_START 0x28
|
||||
#define PTR_UNMOVE_LAST 0x7F
|
||||
byte PTR_UNMOVE = PTR_UNMOVE_START;
|
||||
|
||||
struct Unmove {
|
||||
|
|
@ -108,9 +108,9 @@ void print() {
|
|||
for(char i = 7; i >= 0; i--) {
|
||||
for(byte j = 0; j < 16; j++) {
|
||||
if(j == 8)
|
||||
Serial.print("| ");
|
||||
Serial.print(F("| "));
|
||||
Serial.print(field[i*16 + j], HEX);
|
||||
Serial.print(" ");
|
||||
Serial.print(F(" "));
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue