Rename PTR_PTR_UNMAKE
This commit is contained in:
parent
3797e28c5b
commit
fa18fa6a98
19
Board.h
19
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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue