From 1e8e8a11305b782c527d4c2c635205c4f073eb22 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 20 Sep 2014 10:25:59 +0200 Subject: [PATCH] Support printing of piece command specified in ini file Lines behind the game definition starting with # (after an empty such line) are sent to the GUI with a 'piece' prefix. This allows Fairy-Max to implement the new XBoard protocol for communicating piece moves to the GUI, so the latter can do legality testing and better SAN generation. --- data/fmax.ini | 2 ++ fairymax.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/data/fmax.ini b/data/fmax.ini index 7cae580..ea064e8 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -140,6 +140,8 @@ Line 1: Board size (files x ranks). Ranks must currently still be 8. Line 2: initial setup of white pieces on back rank Line 3: initial setup of black pieces on back rank Line 4-18: Description of piece types that can occur in the variant +This can be followed by some optional info to be sent to GUI when it +selects the variant, e.g. to tell it how some non-standard pieces move. There can be upto 15 piece types per variant, numbered 1 to 15. Numbers 1 and 2 are considered Pawns for white and black, respectively, diff --git a/fairymax.c b/fairymax.c index f20bb1f..f476379 100644 --- a/fairymax.c +++ b/fairymax.c @@ -525,7 +525,6 @@ void LoadGame(char *name) c=0; if(i>15 || j>255) break; } - fclose(f); sh = w[7] < 250 ? 3 : 0; if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN if(ptc == 2) printf("setup (%s) ", pieceToChar); @@ -538,6 +537,8 @@ void LoadGame(char *name) if(makruk) printf("8/"); for(i=0; i