From: H.G. Muller Date: Tue, 21 Jan 2014 19:47:12 +0000 (+0100) Subject: XBoard: deal with semantic differences in "post" between xboard and xshogi protocols X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7e806d3c2cba049e315b13e64cadfa309c734ba5;p=gnushogi.git XBoard: deal with semantic differences in "post" between xboard and xshogi protocols YD: split original patch into a series --- diff --git a/gnushogi/book.c b/gnushogi/book.c index 79f9b4c..547f3fd 100644 --- a/gnushogi/book.c +++ b/gnushogi/book.c @@ -334,10 +334,12 @@ RESET(void) { short l; - flag.illegal = flag.mate = flag.post = flag.quit + flag.illegal = flag.mate = flag.quit = flag.reverse = flag.bothsides = flag.onemove = flag.force = false; + flag.post &= xboard; /* [HGM] xboard: do not clear in XBoard mode */ + flag.material = flag.coords = flag.hash = flag.easy = flag.beep = flag.rcptr = true; diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 7361e76..a883051 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -1615,7 +1615,11 @@ InputCommand(char *command) } else if (strcmp(s, "post") == 0) { - flag.post = !flag.post; + flag.post = (xboard ? 1 : !flag.post); + } + else if (strcmp(s, "nopost") == 0) + { + flag.post = 0; } else if (strcmp(s, "alg") == 0) { diff --git a/gnushogi/init.c b/gnushogi/init.c index 679b382..1c034d0 100644 --- a/gnushogi/init.c +++ b/gnushogi/init.c @@ -485,9 +485,10 @@ NewGame(void) compptr = oppptr = 0; stage = 0; stage2 = -1; /* the game is not yet started */ - flag.illegal = flag.mate = flag.post = flag.quit + flag.illegal = flag.mate = flag.quit = flag.reverse = flag.bothsides = flag.onemove = flag.force = false; + flag.post &= xboard; /* xboard: do not alter post status on 'new' */ flag.material = flag.coords = flag.hash = flag.easy = flag.beep = flag.rcptr = true; diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index 1a1035b..14e623f 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -190,7 +190,7 @@ Raw_ShowResponseTime(void) static void Raw_ShowResults(short score, unsigned short *bstline, char ch) { - if (flag.post && !XSHOGI) + if (flag.post && (xboard || !XSHOGI)) { ElapsedTime(2); printf("%2d%c %6d %4ld %8ld ",