From: Yann Dirson Date: Mon, 17 Feb 2014 22:01:48 +0000 (+0100) Subject: Merge branch 'maint' into HEAD X-Git-Url: http://winboard.nl/cgi-bin?p=gnushogi.git;a=commitdiff_plain;h=7496586755298a8115a3988a8b52b32d41a4dcb7 Merge branch 'maint' into HEAD Conflicts: NEWS configure.ac gnushogi/cursesdsp.c --- 7496586755298a8115a3988a8b52b32d41a4dcb7 diff --cc NEWS index b32a839,f954ffc..05e43f8 --- a/NEWS +++ b/NEWS @@@ -1,14 -1,7 +1,14 @@@ GNU shogi news -------------- +Changes in version 1.5.0 (unreleased): + +* Build system switched from pure autoconf to automake +* Support for cross-compilation using standard "./configure --host=...", + including building windows binaries (both 32bit and 64bit) using + the gcc-mingw toolchain + - Changes in version 1.4.2 (unreleased): + Changes in version 1.4.2 (02/2014): * XShogi is no longer included in the GNU Shogi source, it is available as a separate source archive. diff --cc TODO index 054e46a,f630830..8a41e7b --- a/TODO +++ b/TODO @@@ -1,10 -1,15 +1,17 @@@ + Known bugs: + + - some positions show problem in the evaluation algorithm + - minishogi repetition rule, different from standard shogi, is + not implemented + - with no piece on board, computer generates invalid move + Target for v1.5: -- refactor dspwrappers into a driver-like structure -- integrate H.G.Muller's work on the xboard protocol on top of that +- integrate H.G.Muller's work on the xboard protocol on top of new driver-like + display handling - deprecate xshogi in favor of xboard +- use ~/.gnushogi for binary book and hash file + - make minishogi a run-time option rather than a compile-time one, using the "variant" mechanism of the xboard protocol diff --cc configure.ac index 60dac7a,ce334dc..bdfde4e --- a/configure.ac +++ b/configure.ac @@@ -5,8 -5,7 +5,8 @@@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) - AC_INIT([gnushogi],[1.4.1+],[https://savannah.gnu.org/bugs/?group=gnushogi]) + AC_INIT([gnushogi],[1.4.2+],[https://savannah.gnu.org/bugs/?group=gnushogi]) +AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([gnushogi/gnushogi.h]) AC_CONFIG_HEADER(config.h) diff --cc gnushogi/commondsp.c index 90a3ca0,33d1068..e5efc17 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@@ -1755,6 -1812,7 +1755,7 @@@ InputCommand(char *command flag.force = false; Sdepth = 0; ok = true; - UpdateDisplay(0, 0, 1, 0); ++ dsp->UpdateDisplay(0, 0, 1, 0); } else if (strcmp(s, "black") == 0) { diff --cc gnushogi/cursesdsp.c index bf37999,d2b336b..2ee21ae --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@@ -62,6 -62,9 +62,7 @@@ #define FLUSH_SCANW fflush(stdout), scanw -int mycnt1, mycnt2; - + #define MARGIN (5) #define TAB (58) #define VIR_C(s) ((flag.reverse) ? (NO_COLS - 1 - column(s)) : column(s)) @@@ -107,6 -109,14 +108,13 @@@ gotoXY(short x, short y static void + ClearMessage(void) + { + gotoXY(TAB, 6); + ClearEoln(); + } + - -void ++static void Curses_ShowCurrentMove(short pnt, short f, short t) { algbr(f, t, false); @@@ -452,10 -456,10 +460,10 @@@ static const short y0[2] = { 4 + 2 * (N * P* will put a pawn to the captured pieces. */ -void +static void Curses_EditBoard(void) { - short a, c, sq, i; + short a, c, sq, i, found; short r = 0; char s[80]; @@@ -502,40 -514,48 +518,48 @@@ for (i = NO_PIECES; i > no_piece; i--) { if ((s[0] == pxx[i]) || (s[0] == qxx[i])) + { + Captured[a][unpromoted[i]]++; + UpdateCatched(); + found = 1; break; + } } - - Captured[a][unpromoted[i]]++; - UpdateCatched(); - c = -1; + if (!found) - AlwaysShowMessage("Invalid piece type '%c'", s[0]); ++ dsp->AlwaysShowMessage("Invalid piece type '%c'", s[0]); + continue; } - else - { - c = COL_NAME(s[1]); - r = ROW_NAME(s[2]); + + c = COL_NUM(s[1]); + r = ROW_NUM(s[2]); + + if ((c < 0) || (c >= NO_COLS) || (r < 0) || (r >= NO_ROWS)) { - AlwaysShowMessage("Out-of-board '%c%c'", s[1], s[2]); ++ dsp->AlwaysShowMessage("Out-of-board '%c%c'", s[1], s[2]); + continue; } - if ((c >= 0) && (c < NO_COLS) && (r >= 0) && (r < NO_ROWS)) - { - sq = locn(r, c); + sq = locn(r, c); - for (i = NO_PIECES; i > no_piece; i--) + for (i = NO_PIECES; i > no_piece; i--) + { + if ((s[0] == pxx[i]) || (s[0] == qxx[i])) { - if ((s[0] == pxx[i]) || (s[0] == qxx[i])) - break; + color[sq] = a; + if (s[3] == '+') + board[sq] = promoted[i]; + else + board[sq] = unpromoted[i]; + + found = 1; + break; } + } - if (s[3] == '+') - i = promoted[i]; - else - i = unpromoted[i]; + if (!found) - AlwaysShowMessage("Invalid piece type '%c'", s[0]); ++ dsp->AlwaysShowMessage("Invalid piece type '%c'", s[0]); - board[sq] = i; - color[sq] = ((board[sq] == no_piece) ? neutral : a); - DrawPiece(sq); - } + DrawPiece(sq); } - while (s[0] != '.'); for (sq = 0; sq < NO_SQUARES; sq++) Mvboard[sq] = ((board[sq] != Stboard[sq]) ? 10 : 0);