unsigned int moveStack[500*MAXPLY];
int killers[MAXPLY][2];
int path[MAXPLY], deprec[MAXPLY];
+unsigned char checkHist[MAXMOVES+MAXPLY];
int repKey[512+20];
/*
stm = f->toPiece & COLOR;
f->bulk = promoGain[stm+30]; promoGain[stm+30] += handBulk[f->victim] - dropBulk[f->fromSqr];
location[f->toPiece] = f->toSqr;
+ checkHist[moveNr+ply+1] = f->checker;
return 1;
}
if(depth - reduction < LMR) reduction = depth - LMR; // never reduce to below 'LMR' ply
depth -= reduction;
} else reduction = originalReduction = 0;
-if(PATH)printf("%d:%d {%d,%d} max=%d eval=%d check=%02x,%d,%d\n",ply,depth,alpha,beta,maxDepth,curEval,f.checker,f.checkDir,f.checkDist);
+ checkHist[moveNr+ply+1] = f.checker;
// stand pat or null move
startAlpha = alpha; startScore = -INF;
if(depth <= 0) { // QS
{
int index;
// irreversibly adopt incrementally updated values from last move as new starting point
+ MoveStack m;
+ int checker;
undoInfo.pstEval = -undoInfo.newEval; // (like we initialize new Stackframe in daughter node)
undoInfo.hashKey = undoInfo.newKey;
undoInfo.rights |= spoiler[undoInfo.fromSqr] | spoiler[undoInfo.toSqr];
- undoInfo.checker = CK_NONE;
+ undoInfo.checker = CK_NONE; // make sure move will not be rejected
+ moveSP = 48;
+ checker = (MoveGen(stm ^ COLOR, &m, undoInfo.rights) ? CK_DOUBLE : CK_NONE); // test if we are in check by generating opponent moves
+ moveSP = 0; // and throw away those moves
MakeMove(&undoInfo, move);
+ checkHist[moveNr+1] = checker;
// store in game history hash table
index = (unsigned int)undoInfo.newKey >> 24 ^ stm << 2; // uses high byte of low (= hands-free) key
while(repKey[index] && (repKey[index] ^ (int)undoInfo.newKey) & 0x1FFFFF) index += 2; // find empty slot