Use #define constants, and more PROGMEM

This commit is contained in:
Quinten Kock 2020-06-18 01:46:27 +02:00
parent 61296d8a9a
commit 3a95a80333
1 changed files with 9 additions and 9 deletions

18
Board.h
View File

@ -27,21 +27,21 @@ void board_init() {
} }
// 0x88-fill definitions // 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 // 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) // 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 // 0x0D
// 0x0E // 0x0E
// 0x0F // 0x0F
static const byte PTR_ENPASSANT = 0x18; #define PTR_ENPASSANT 0x18
static const byte PTR_REVMOV = 0x19; #define PTR_REVMOV 0x19
// free space // free space
static const byte PTR_UNMOVE_START = 0x28; #define PTR_UNMOVE_START 0x28
static const byte PTR_UNMOVE_LAST = 0x7F; #define PTR_UNMOVE_LAST 0x7F
byte PTR_UNMOVE = PTR_UNMOVE_START; byte PTR_UNMOVE = PTR_UNMOVE_START;
struct Unmove { struct Unmove {
@ -108,9 +108,9 @@ void print() {
for(char i = 7; i >= 0; i--) { for(char i = 7; i >= 0; i--) {
for(byte j = 0; j < 16; j++) { for(byte j = 0; j < 16; j++) {
if(j == 8) if(j == 8)
Serial.print("| "); Serial.print(F("| "));
Serial.print(field[i*16 + j], HEX); Serial.print(field[i*16 + j], HEX);
Serial.print(" "); Serial.print(F(" "));
} }
Serial.println(); Serial.println();
} }