Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
Loading...
Searching...
No Matches
setup.h File Reference
#include "../defs.h"
Include dependency graph for setup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void initEvaluationMasks ()
 Initialize evaluation-related bitboard masks.
void InitFilesrankIndex120 ()
 Initialize file and rank lookup arrays.
void initZobristKeys ()
 Initialize Zobrist hash keys.
void initBitMasks ()
 Initialize bit masks for individual bitboard operations.
void initSquareIndexMaps ()
 Initialize lookup tables for 120->64 square indexing.
void initializeEngine ()
 Run all initialization routines.

Variables

int square120To64 [BRD_SQ_NUM]
 Lookup table to convert 120-based board index to 64-based.
int square64To120 [64]
 Lookup table to convert 64-based board index to 120-based.
U64 setBitMask [64]
 Bit masks for setting and clearing individual bits on a bitboard.
U64 clearBitMask [64]
U64 zobristPieceKeys [13][120]
 Zobrist hashing keys for each piece on each square.
U64 zobristSideKey
 Zobrist hashing key for side to move.
U64 zobristCastleKeys [16]
 Zobrist hashing keys for castling rights.
int fileIndex120 [BRD_SQ_NUM]
 File and rank lookup tables for each square (120-based).
int rankIndex120 [BRD_SQ_NUM]
U64 fileBitMask [8]
 Bitboard masks for each file and rank.
U64 rankBitMask [8]
U64 blackPassedPawnMask [64]
 Bitboard masks for pawn structure evaluation.
U64 whitePassedPawnMask [64]
U64 isolatedPawnMask [64]
S_OPTIONS engineOptions [1]
 Engine options structure.

Function Documentation

◆ initBitMasks()

void initBitMasks ( )

Initialize bit masks for individual bitboard operations.

Definition at line 128 of file setup.cpp.

References clearBitMask, and setBitMask.

Referenced by initializeEngine().

Here is the caller graph for this function:

◆ initEvaluationMasks()

void initEvaluationMasks ( )

Initialize evaluation-related bitboard masks.

Definition at line 40 of file setup.cpp.

References blackPassedPawnMask, FILE_A, FILE_H, fileBitMask, fileIndex120, isolatedPawnMask, RANK_1, RANK_8, rankBitMask, SQ120, and whitePassedPawnMask.

Referenced by initializeEngine().

Here is the caller graph for this function:

◆ InitFilesrankIndex120()

void InitFilesrankIndex120 ( )

Initialize file and rank lookup arrays.

Definition at line 98 of file setup.cpp.

References BRD_SQ_NUM, FILE_A, FILE_H, fileIndex120, FR2SQ, OFFBOARD, RANK_1, RANK_8, and rankIndex120.

Referenced by initializeEngine().

Here is the caller graph for this function:

◆ initializeEngine()

void initializeEngine ( )
extern

Run all initialization routines.

Definition at line 156 of file setup.cpp.

References initBitMasks(), initEvaluationMasks(), InitFilesrankIndex120(), InitMvvLva(), initSquareIndexMaps(), and initZobristKeys().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initSquareIndexMaps()

void initSquareIndexMaps ( )

Initialize lookup tables for 120->64 square indexing.

Definition at line 139 of file setup.cpp.

References ASSERT, BRD_SQ_NUM, FILE_A, FILE_H, FR2SQ, RANK_1, RANK_8, SqOnBoard(), square120To64, and square64To120.

Referenced by initializeEngine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initZobristKeys()

void initZobristKeys ( )

Initialize Zobrist hash keys.

Definition at line 115 of file setup.cpp.

References RAND_64, zobristCastleKeys, zobristPieceKeys, and zobristSideKey.

Referenced by initializeEngine().

Here is the caller graph for this function:

Variable Documentation

◆ blackPassedPawnMask

U64 blackPassedPawnMask[64]
extern

Bitboard masks for pawn structure evaluation.

Definition at line 32 of file setup.cpp.

Referenced by initEvaluationMasks().

◆ clearBitMask

U64 clearBitMask[64]
extern

Definition at line 20 of file setup.cpp.

Referenced by initBitMasks().

◆ engineOptions

S_OPTIONS engineOptions[1]
extern

Engine options structure.

Definition at line 36 of file setup.cpp.

◆ fileBitMask

U64 fileBitMask[8]
extern

Bitboard masks for each file and rank.

Definition at line 29 of file setup.cpp.

Referenced by initEvaluationMasks().

◆ fileIndex120

int fileIndex120[BRD_SQ_NUM]
extern

File and rank lookup tables for each square (120-based).

Definition at line 26 of file setup.cpp.

Referenced by initEvaluationMasks(), InitFilesrankIndex120(), moveToString(), SqOnBoard(), and squareToString().

◆ isolatedPawnMask

U64 isolatedPawnMask[64]
extern

Definition at line 34 of file setup.cpp.

Referenced by initEvaluationMasks().

◆ rankBitMask

U64 rankBitMask[8]
extern

Definition at line 30 of file setup.cpp.

Referenced by initEvaluationMasks().

◆ rankIndex120

◆ setBitMask

U64 setBitMask[64]
extern

Bit masks for setting and clearing individual bits on a bitboard.

Definition at line 19 of file setup.cpp.

Referenced by initBitMasks().

◆ square120To64

int square120To64[BRD_SQ_NUM]
extern

Lookup table to convert 120-based board index to 64-based.

Definition at line 16 of file setup.cpp.

Referenced by initSquareIndexMaps().

◆ square64To120

int square64To120[64]
extern

Lookup table to convert 64-based board index to 120-based.

Definition at line 17 of file setup.cpp.

Referenced by initSquareIndexMaps().

◆ whitePassedPawnMask

U64 whitePassedPawnMask[64]
extern

Definition at line 33 of file setup.cpp.

Referenced by initEvaluationMasks().

◆ zobristCastleKeys

U64 zobristCastleKeys[16]
extern

Zobrist hashing keys for castling rights.

Definition at line 24 of file setup.cpp.

Referenced by generatePositionKeys(), and initZobristKeys().

◆ zobristPieceKeys

U64 zobristPieceKeys[13][120]
extern

Zobrist hashing keys for each piece on each square.

Definition at line 22 of file setup.cpp.

Referenced by generatePositionKeys(), and initZobristKeys().

◆ zobristSideKey

U64 zobristSideKey
extern

Zobrist hashing key for side to move.

Definition at line 23 of file setup.cpp.

Referenced by generatePositionKeys(), and initZobristKeys().