const Score WeightKingOppSafetyInternal = make_score(259, 0);
// Mobility and outposts bonus modified by Joona Kiiski
- //
- // Visually better to define tables constants
+
typedef Value V;
#define S(mg, eg) make_score(mg, eg)
// Pointers table to access mobility tables through piece type
const Score* MobilityBonus[8] = { 0, 0, KnightMobilityBonus, BishopMobilityBonus,
- RookMobilityBonus, QueenMobilityBonus, 0, 0 };
+ RookMobilityBonus, QueenMobilityBonus, 0, 0 };
// Outpost bonuses for knights and bishops, indexed by square (from white's
// point of view).
// ThreatBonus[][] contains bonus according to which piece type
// attacks which one.
- #define Z make_score(0, 0)
+ #define Z S(0, 0)
const Score ThreatBonus[8][8] = {
{ Z, Z, Z, Z, Z, Z, Z, Z }, // not used
// in init_safety().
Value SafetyTable[100];
- // Pawn and material hash tables, indexed by the current thread id
- PawnInfoTable* PawnTable[8] = {0, 0, 0, 0, 0, 0, 0, 0};
- MaterialInfoTable* MaterialTable[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+ // Pawn and material hash tables, indexed by the current thread id.
+ // Note that they will be initialized at 0 being global variables.
+ MaterialInfoTable* MaterialTable[THREAD_MAX];
+ PawnInfoTable* PawnTable[THREAD_MAX];
// Sizes of pawn and material hash tables
const int PawnTableSize = 16384;
// Probe the pawn hash table
ei.pi = PawnTable[threadID]->get_pawn_info(pos);
- ei.value += apply_weight(ei.pi->value(), WeightPawnStructure);
+ ei.value += apply_weight(ei.pi->pawns_value(), WeightPawnStructure);
// Initialize king attack bitboards and king attack zones for both sides
ei.attackedBy[WHITE][KING] = pos.attacks_from<KING>(pos.king_square(WHITE));