X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=891621148b9204fbae16214195fe0bf273c47204;hb=1a2a13f6fb255d5f755c5ce937124eee5fba5667;hp=fa467736c64596e6d128ca8a39726f08d1533472;hpb=7a5a8ea11998209db6c9a3184633b3ad4ca9b7cf;p=xboard.git diff --git a/backend.c b/backend.c index fa46773..8916211 100644 --- a/backend.c +++ b/backend.c @@ -796,7 +796,11 @@ InitEngine(ChessProgramState *cps, int n) /* [HGM] debug */ cps->debug = FALSE; + cps->supportsNPS = UNKNOWN; + cps->memSize = FALSE; + cps->maxCores = FALSE; + cps->egtFormats[0] = NULLCHAR; /* [HGM] options */ cps->optionSettings = appData.engOptions[n]; @@ -5293,20 +5297,12 @@ fprintf(debugFP,"parsePV: %d %c%c%c%c yy='%s'\nPV = '%s'\n", valid, fromX+AAA, f endPV++; CopyBoard(boards[endPV], boards[endPV-1]); ApplyMove(fromX, fromY, toX, toY, promoChar, boards[endPV]); - moveList[endPV-1][0] = fromX + AAA; - moveList[endPV-1][1] = fromY + ONE; - moveList[endPV-1][2] = toX + AAA; - moveList[endPV-1][3] = toY + ONE; - moveList[endPV-1][4] = promoChar; - moveList[endPV-1][5] = NULLCHAR; + CoordsToComputerAlgebraic(fromY, fromX, toY, toX, promoChar, moveList[endPV - 1]); strncat(moveList[endPV-1], "\n", MOVE_LEN); - if(storeComments) - CoordsToAlgebraic(boards[endPV - 1], + CoordsToAlgebraic(boards[endPV - 1], PosFlags(endPV - 1), fromY, fromX, toY, toX, promoChar, parseList[endPV - 1]); - else - parseList[endPV-1][0] = NULLCHAR; } while(valid); currentMove = (atEnd || endPV == forwardMostMove) ? endPV : forwardMostMove + 1; if(currentMove == forwardMostMove) ClearPremoveHighlights(); else @@ -5317,7 +5313,7 @@ fprintf(debugFP,"parsePV: %d %c%c%c%c yy='%s'\nPV = '%s'\n", valid, fromX+AAA, f int MultiPV(ChessProgramState *cps) -{ // check if engine supports MultiPV, and if so, return the nmber of the option that sets it +{ // check if engine supports MultiPV, and if so, return the number of the option that sets it int i; for(i=0; inrOptions; i++) if(!strcmp(cps->option[i].name, "MultiPV") && cps->option[i].type == Spin) @@ -5343,14 +5339,14 @@ LoadMultiPV(int x, int y, char *buf, int index, int *start, int *end) buf[index] = 0; if(lineStart == 0 && gameMode == AnalyzeMode && (multi = MultiPV(&first)) >= 0) { int n = first.option[multi].value; - if(origIndex < 10) { if(n>1) n--; } else if(origIndex > index - 6) n++; + if(origIndex > 17 && origIndex < 24) { if(n>1) n--; } else if(origIndex > index - 6) n++; snprintf(buf2, MSG_SIZ, "option MultiPV=%d\n", n); if(first.option[multi].value != n) SendToProgram(buf2, &first); first.option[multi].value = n; *start = *end = 0; - return TRUE; + return FALSE; } - ParsePV(buf+startPV, FALSE, !shiftKey); + ParsePV(buf+startPV, FALSE, gameMode != AnalyzeMode); *start = startPV; *end = index-1; return TRUE; } @@ -5370,15 +5366,22 @@ UnLoadPV() int oldFMM = forwardMostMove; // N.B.: this was currentMove before PV was loaded! if(endPV < 0) return; endPV = -1; - if(shiftKey && gameMode == AnalyzeMode) { - if(pushed) storedGames--; // abandon shelved tail of original game + if(gameMode == AnalyzeMode && currentMove > forwardMostMove) { + Boolean saveAnimate = appData.animate; + if(pushed) { + if(shiftKey && storedGames < MAX_VARIATIONS-2) { // wants to start variation, and there is space + if(storedGames == 1) GreyRevert(FALSE); // we already pushed the tail, so just make it official + } else storedGames--; // abandon shelved tail of original game + } pushed = FALSE; forwardMostMove = currentMove; currentMove = oldFMM; + appData.animate = FALSE; ToNrEvent(forwardMostMove); + appData.animate = saveAnimate; } currentMove = forwardMostMove; - if(pushed) { PopInner(0); pushed = FALSE; } // restore shelved game contnuation + if(pushed) { PopInner(0); pushed = FALSE; } // restore shelved game continuation ClearPremoveHighlights(); DrawPosition(TRUE, boards[currentMove]); }