X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=UCI2WB.c;h=78ab021dba1b243c2bb56779b87a22099ba8601b;hb=f3ac0c6de501ca2f972ae2047739619ba7010c2a;hp=71dfd4b5e920dfe73ead029b853fbb18e740d01e;hpb=f72070254816c26ab9e52862e6191b2a59029e4d;p=uci2wb.git diff --git a/UCI2WB.c b/UCI2WB.c index 71dfd4b..78ab021 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -1,6 +1,6 @@ /************************* UCI2WB by H.G.Muller ****************************/ -#define VERSION "1.8" +#define VERSION "1.9" #include #include @@ -32,7 +32,7 @@ char move[2000][10], checkOptions[8192], iniPos[256], hashOpt[20], pause, pondering, ponder, post, hasHash, c, sc='c', *suffix, *variants; int mps, tc, inc, sTime, depth, myTime, hisTime, stm, computer = NONE, memory, oldMem=0, cores, moveNr, lastDepth, lastScore, startTime, debug; -int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, on[500]; char currMove[20], moveMap[500][10]; // for analyze mode +int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, inex, on[500]; char currMove[20], moveMap[500][10]; // for analyze mode FILE *toE, *fromE; int pid; @@ -139,8 +139,6 @@ Move4GUI(char *m) m[4] = '=', m[5] = 0; } } - if(m[0] == 'e' && (m[5] == 'a' || m[5] == 'h')) // seirawan castling + gating at Rook - m[0] = m[5], m[2] = 'e'; // convert to RxK notation } void * @@ -191,7 +189,10 @@ Engine2GUI() if(p = strstr(line+5, "currmovenumber ")) { n = atoi(p+15); if(collect == 1 && n != 1) continue; // wait for move 1 - if(collect + (n == 1) > 2) { collect = 3; continue; } // done collecting + if(collect + (n == 1) > 2) { // done collecting + if(inex && collect == 2) printf("%d 0 0 0 OK to exclude\n", lastDepth); + collect = 3; continue; + } collect = 2; on[nr=n] = 1; sscanf(pv+9, "%s", moveMap[n]); continue; // store move } } @@ -265,12 +266,7 @@ Move4Engine(char *m) m[2] = 'a'+'0'+size - m[2]; m[3] = 'a'+'0'+size - m[3]; if(m[4] == '=') m[4] = 0; // no '=' in USI format! - else if(m[4] != '\n') m[4] = '+'; // cater to WB 4.4 bug :-( - } - if(m[4] && (m[1] == '1' || m[1] == '8')) { // seirawan gating - m[5] = m[0], m[6] = m[1], m[7] = '\0'; // copy from-square behind it, as gating square - if(m[2] == 'e' && (m[0] == 'a' || m[0] == 'h')) - m[2] = (m[0]+m[2]+1)>>1, m[0] = 'e'; // gating at Rook + else if(m[4]) m[4] = '+'; // cater to WB 4.4 bug :-( } } @@ -374,9 +370,9 @@ GUI2Engine() printf("stat01: %d %d %d %d 100 %s\n", statTime, statNodes, statDepth, 100-currNr, currMove); goto nomove; } - else if(!strcmp(command+2, "clude") && collect > 2) { + else if(!strcmp(command+2, "clude") && collect > 2) { // include or exclude int all = !strcmp(line+8, "all"), in = command[1] == 'n'; - line[strlen(line)-1] = sm = 0; // strip LF and clear sm flag + inex = 1; line[strlen(line)-1] = sm = 0; // strip LF and clear sm flag for(i=1; i