From fa18fa6a9818ce5d3b61eaf70afdc23dc2b0db30 Mon Sep 17 00:00:00 2001 From: Quinten Kock Date: Mon, 15 Jun 2020 20:27:51 +0200 Subject: [PATCH] Rename PTR_PTR_UNMAKE --- Board.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Board.h b/Board.h index 6f461f1..805a6e6 100644 --- a/Board.h +++ b/Board.h @@ -42,7 +42,7 @@ class Board { }; const byte PTR_SIDE_AND_CASTLERIGHT = 0x08; //byte (1=side, 2,4=white castle, 8,16=black) - const byte PTR_PTR_REVMOV = 0x09; //byte (points to index) + const byte PTR_PTR_UNMAKE = 0x09; //byte (points to index) const byte 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_ZOBRIST = 0x0C; // 4 bytes @@ -51,31 +51,32 @@ class Board { // 0x0F const byte PTR_ENPASSANT = 0x18; + const byte PTR_REVMOV = 0x19; - const byte PTR_UNMAKE_START = 0x1A; + const byte PTR_UNMAKE_START = 0x28; const byte PTR_UNMAKE_LAST = 0x7F; inline byte get_unmake() __attribute__((always_inline)) { - return field[PTR_PTR_REVMOV]; + return field[PTR_PTR_UNMAKE]; } byte next_unmake() { - field[PTR_PTR_REVMOV]++; + field[PTR_PTR_UNMAKE]++; if(get_unmake() > PTR_UNMAKE_LAST) { - field[PTR_PTR_REVMOV] = PTR_UNMAKE_START; + field[PTR_PTR_UNMAKE] = PTR_UNMAKE_START; return PTR_UNMAKE_START; } if(!(get_unmake() & 0x8)) { - field[PTR_PTR_REVMOV] += 0x8; + field[PTR_PTR_UNMAKE] += 0x8; } return get_unmake(); } byte prev_unmake() { - field[PTR_PTR_REVMOV]--; + field[PTR_PTR_UNMAKE]--; if(get_unmake() < PTR_UNMAKE_START) { - field[PTR_PTR_REVMOV] = PTR_UNMAKE_LAST; + field[PTR_PTR_UNMAKE] = PTR_UNMAKE_LAST; return PTR_UNMAKE_LAST; } if(!(get_unmake() & 0x8)) { - field[PTR_PTR_REVMOV] -= 0x8; + field[PTR_PTR_UNMAKE] -= 0x8; } return get_unmake(); }