summaryrefslogtreecommitdiff
path: root/src/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/board.c')
-rwxr-xr-xsrc/board.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/board.c b/src/board.c
index 0c5f4df..0b195be 100755
--- a/src/board.c
+++ b/src/board.c
@@ -169,6 +169,7 @@ Return value:
"Extra pieces on board that are not accounted for",
"Fifty move counter is too high",
"bbPieces bitboard doesn't match piece list",
+ "bbPawns bitboard doesn't match pawn list",
};
ULONG u, v;
COOR c;
@@ -177,6 +178,7 @@ Return value:
ULONG uNonPawnMaterial[2] = {0, 0};
ULONG uNonPawnCount[2][7];
BITBOARD bbPieces[2][8];
+ BITBOARD bbPawns[2];
ULONG uSigmaNonPawnCount[2] = {0, 0};
ULONG uWhiteSqBishopCount[2] = {0, 0};
UINT64 u64Computed;
@@ -186,6 +188,7 @@ Return value:
memset(uNonPawnCount, 0, sizeof(uNonPawnCount));
memset(bbPieces, 0, sizeof(bbPieces));
+ memset(bbPawns, 0, sizeof(bbPawns));
u64Computed = ComputeSig(pos);
if (pos->u64NonPawnSig != u64Computed)
{
@@ -268,6 +271,7 @@ Return value:
}
uPawnMaterial[u] += VALUE_PAWN;
uPawnCount[u]++;
+ bbPawns[u] |= COOR_TO_BB(c);
}
}
@@ -364,6 +368,12 @@ Return value:
}
}
+ if (pos->bbPawns[u] != bbPawns[u])
+ {
+ uReason = 22;
+ goto end;
+ }
+
//
// Note: the 0th spot in the array is the sum of all non pawns
//