X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=UCI2WB.c;h=15b35de852f992da1de41cbdeb4c3fbe8add7eee;hb=9dc81a4e9cd733c1ac04515325534749a39d8959;hp=33546037baccf0772288def903ca25598b0996f6;hpb=9106cb55be2eee65075e4cd9954d371c82ecd8e0;p=uci2wb.git diff --git a/UCI2WB.c b/UCI2WB.c index 3354603..15b35de 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -35,6 +35,7 @@ int mps, tc, inc, sTime, depth, myTime, hisTime, stm, computer = NONE, memory, o int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, inex, on[500]; char currMove[20], moveMap[500][10], /* for analyze mode */ canPonder[20], threadOpt[20]; char board[100]; // XQ board for UCCI +char *nameWord = "name ", *valueWord = "value ", *wTime = "w", *bTime = "b", *wInc = "winc", *bInc = "binc", newGame; // keywords that differ in UCCI int unit = 1; FILE *toE, *fromE, *fromF; @@ -131,11 +132,12 @@ StartSearch(char *ponder) int x = (ponder[0] != 0); // during ponder stm is the opponent int black = (stm == BLACK ^ x ^ sc == 's'); // set if our color is what the engine calls black int nr = moveNr + x; // we ponder for one move ahead! - fprintf(toE, "\ngo%s btime %d wtime %d", ponder, black ? myTime : hisTime, !black ? myTime : hisTime); - DPRINT( "\n# go%s btime %d wtime %d", ponder, black ? myTime : hisTime, !black ? myTime : hisTime); + if(sc == 'x') black = 1; // in UCCI 'black' refers to us and 'white' to opponent + fprintf(toE, "\ngo%s %stime %d %stime %d", ponder, bTime, black ? myTime : hisTime, wTime, !black ? myTime : hisTime); + DPRINT( "\n# go%s %stime %d %stime %d", ponder, bTime, black ? myTime : hisTime, wTime, !black ? myTime : hisTime); if(sTime > 0) { fprintf(toE, " movetime %d", sTime); DPRINT(" movetime %d", sTime); } else if(mps) { fprintf(toE, " movestogo %d", mps*(nr/(2*mps)+1)-nr/2); DPRINT(" movestogo %d", mps*(nr/(2*mps)+1)-nr/2); } - if(inc && !suffix) { fprintf(toE, " winc %d binc %d", inc, inc); DPRINT(" winc %d binc %d", inc, inc); } + if(inc && !suffix) { fprintf(toE, " %s %d %s %d", wInc, inc, bInc, inc); DPRINT(" %s %d %s %d", wInc, inc, bInc, inc); } if(depth > 0) { fprintf(toE, " depth %d", depth); DPRINT(" depth %d", depth); } if(suffix) { fprintf(toE, suffix, inc); DPRINT(suffix, inc); } fprintf(toE, "\n"); DPRINT("\n"); @@ -153,10 +155,16 @@ StopPonder(int pondering) void LoadPos(int moveNr) { - int j; - fprintf(toE, "%s moves", iniPos); - DPRINT( "# %s moves", iniPos); - for(j=0; j 2) dir = argv[2]; if(argc > 3) suffix = argv[3]; + if(sc == 'x') nameWord = valueWord = bTime = "", wTime = "opp", bInc = "increment", wInc = "oppincrement", unit = 1000; // switch to UCCI keywords + // spawn engine proc if(StartEngine(argv[1], dir) != NO_ERROR) { perror(argv[1]), exit(-1); }