From 3a95a80333cad3afb26fb0e56f614cf28b3f5c0e Mon Sep 17 00:00:00 2001 From: Quinten Kock Date: Thu, 18 Jun 2020 01:46:27 +0200 Subject: [PATCH] Use #define constants, and more PROGMEM --- Board.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Board.h b/Board.h index dcc7e6c..05592de 100644 --- a/Board.h +++ b/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(); }