mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 06:17:49 +00:00
Convert PST tables to relative values
This is a prerequisite to allow changing piece values at runtime, needed for tuning. Also use scores instead of separated midgame and endgame values. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+5
-1
@@ -1715,11 +1715,15 @@ void Position::init() {
|
||||
zobExclusion = rk.rand<Key>();
|
||||
|
||||
for (Piece p = WP; p <= WK; p++)
|
||||
{
|
||||
Score ps = make_score(piece_value_midgame(p), piece_value_endgame(p));
|
||||
|
||||
for (Square s = SQ_A1; s <= SQ_H8; s++)
|
||||
{
|
||||
pieceSquareTable[p][s] = make_score(MgPST[p][s], EgPST[p][s]);
|
||||
pieceSquareTable[p][s] = ps + PSQT[p][s];
|
||||
pieceSquareTable[p+8][flip(s)] = -pieceSquareTable[p][s];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user