xboard.git
8 years agoAllow promotion on two-leg move
H.G.Muller [Tue, 9 Feb 2016 09:59:31 +0000]
Allow promotion on two-leg move

After a second-leg of a SAN move the parser now checks for apromotion
suffix, and if any is found this is used by ParseOneMove / LoadGameOneMove
to set the promoChar. In converting to SAN for the parseList the promoChar
is now appended to the second leg, rather than the first, and the Edit Book
window will also show it. The promochar is written behind the kill square
in the moveList, and when sending the move there to the engine it is
appended to the second move of the multi-move pair.

8 years agoFix type-in of hit-and-run captures
H.G.Muller [Tue, 9 Feb 2016 09:25:40 +0000]
Fix type-in of hit-and-run captures

Processing of the move in ParseOneMove (which basically duplicates
the code of LoadGameOneMove) was not yet adapted to ignore ';' as a
promotion character when it is internally used to append 'kill squares'
where locust capture should take place..

8 years agoAllow setting of piece nicknames from pieceToChar string
H.G.Muller [Tue, 9 Feb 2016 08:53:44 +0000]
Allow setting of piece nicknames from pieceToChar string

A piece IDs in the pieceToChar string can now be suffixed by "=L",
with L an arbitrary single letter, to define a nickname for the piece.
Such a nickname would make it possible to specify a complex ID like +I'
as promotion choice, and by indicating this in the pieceToChar string
the engine can configure that through the 'setup' command. This facility
is needed to force promotion after capture of a contageous piece in
variants with Shogi promotion, such as Maka Dai Dai Shogi.

8 years agoSlight speedup of parsing promotion suffix
H.G.Muller [Tue, 9 Feb 2016 08:31:11 +0000]
Slight speedup of parsing promotion suffix

8 years agoFix printing of 'x' in position diagram
H.G.Muller [Mon, 8 Feb 2016 12:21:20 +0000]
Fix printing of 'x' in position diagram

The times where 'x' was used as PieceToChar result for an empty square
are long behind us; 'x' now is a valid piece ID.

8 years agoImprove variant recognition for enabling buttons (XB)
H.G.Muller [Sun, 7 Feb 2016 21:48:34 +0000]
Improve variant recognition for enabling buttons (XB)

Buttons for variants were enabled when the name of the variant they
selected was a sub-string of waht the engine could play, so that
Grand Chess (variant grand) would be enabled by Fairy-Max' grande-acedrex.
Now we test if the matched sub-string of the engine's variants feature
is immediately followed by a comma (or at the end).

8 years agoFix using VariantMen PGN tag for both colors
H.G.Muller [Sat, 6 Feb 2016 17:18:29 +0000]
Fix using VariantMen PGN tag for both colors

Black pieces were not recognized as the same as white pieces.

8 years agoAlways assume FEN in variant-fairy PGN game is initial position
H.G.Muller [Sat, 6 Feb 2016 15:19:52 +0000]
Always assume FEN in variant-fairy PGN game is initial position

As variant fairy is a catch-all without a defined initial position,
the FEN tag n a PGN game for this variant must be considered an initial
position. So we copy over the FEN position to the initial one in this
case. Otherwise castling would always be thought illegal in fairy games
loaded from PGN.

8 years agoProcess VariantMen PGN tag
H.G.Muller [Sat, 6 Feb 2016 14:12:19 +0000]
Process VariantMen PGN tag

On loading a PGN game the VariantMen tag is now parsed, and the
move definitions are assigned to the mentioned pieces.
This only works when the pieceToCharTable is defined in advance!

8 years agoLet VarianMen PGN tag work with dressed letters
H.G.Muller [Sat, 6 Feb 2016 12:46:43 +0000]
Let VarianMen PGN tag work with dressed letters

The internal 'character' codes > 127 are now printed as letter + suffix.

8 years agoRemove debug printf
H.G.Muller [Sat, 6 Feb 2016 09:25:27 +0000]
Remove debug printf

8 years agoFix spurious promotion partners
H.G.Muller [Sat, 6 Feb 2016 09:21:21 +0000]
Fix spurious promotion partners

When defining a new promotion pairing through ^L the default partners
of L and +L must be made partnerless, or they would still promote to +L
or demote to L.

8 years agoFix printing of piece ID in illegal SAN moves
H.G.Muller [Fri, 5 Feb 2016 10:26:51 +0000]
Fix printing of piece ID in illegal SAN moves

Illegal SAN moves did not add ' or ! suffixes to the piece ID,
and printed shogi-promoted pieces as a '+' without ID.

8 years agoFix clipping of GTK menu-bar labels for broad boards
H.G.Muller [Fri, 5 Feb 2016 09:06:09 +0000]
Fix clipping of GTK menu-bar labels for broad boards

The number of characters kept in the menu-bar labels was dependent on
square size, but did not take into account the number of files of the
board. So when there were more than 8 files, the label texts were often
clipped while there was in fact plenty of room to display them fully.
Now the adjustment of square size based on number of board files is done
after the other window parameters have been picked based on the window
width calculated as 8*squareSize. Only the default line gap is then
adapted to the actual square size (consistent with what is done during
user sizing of the board later).

8 years agoChange the piece order again
H.G.Muller [Thu, 4 Feb 2016 18:43:14 +0000]
Change the piece order again

The internal piece encoding is now altered such that the uninteresting
ones (promoted Shogi pieces and symmetry partners) are all at the end,
just before King. These now start with the PromoBishop. A slash in the
pieceToChar string skips to this new 'promoted series', so that strings
can be made 'future proof' (for when new pieces are added before it).
The promoted Chu pieces all get new book keys by this, but as it is
unlikely that they occurin opening lines, this was considered acceptable.
The +L, +T in Chu are now represented by Pegasus and Gnu rather than
Knight and Chancellor, but the latter two are defined as fall-backs to
remain compatible with old Chu themes.
The +N, +L, +S replacements in Shogi are now also taken from amongst the
regular pieces, rather than extra images stored beyond King.

8 years agoAdapt Chu-Shogi pieceToCharTable to new piece order
H.G.Muller [Wed, 3 Feb 2016 09:24:17 +0000]
Adapt Chu-Shogi pieceToCharTable to new piece order

8 years agoFix demoting in Edit Position mode
H.G.Muller [Wed, 3 Feb 2016 08:34:42 +0000]
Fix demoting in Edit Position mode

A click on an already selected demotable piece will now cause demotion,
rather than disappearance of that piece, similar to how clicks on a
selected promotable piece will promote it.

8 years agoClear highlights after moving piece in Edit Position
H.G.Muller [Wed, 3 Feb 2016 08:23:15 +0000]
Clear highlights after moving piece in Edit Position

When moving a piece during Edit position the from-square remained
highlighted, but the to square was not highlighted, which would
create the erroneous impression that the (now-empty) from-square
was selected (and ready to obliterate a piece on the next click).
Now this highlight is cleared. This was preferred over also highlighting
the to-square, because this is not really a move in a game.

8 years agoFix aborted detour under-promotion XB
H.G.Muller [Tue, 2 Feb 2016 18:18:13 +0000]
Fix aborted detour under-promotion XB

When a dragged Pawn was released before the promotion piece was fixed,
this would fake a release on the from-square. But the repair of animation
damage would take place on the to-square derived from the actual mouse
coordinates. When this was different from the from-square, the animation
damage (consisting of removalof the piece) would thus not be repaired
by redrawing that square, as normally (when the to-square is different)
it should remain empty. Now we mark the from-square as damaged when the
detour under-promotion changes the dragged piece.

8 years agoFix default piece in Shogi promotions
H.G.Muller [Tue, 2 Feb 2016 16:34:53 +0000]
Fix default piece in Shogi promotions

In Shogi the default should be promotion, but it was using Queen like
the other variants. As the +/= issue was decided based on comparing this
default promotion piece with the moved piece, the Lance (which internally
is represented by Queen) would by default defer. Now the up-click of
a drag-drop move (which would bypass sweep selection) sets the default
choice to the promoted partner if the pieceToCharTable specifies one.

8 years agoFix sweep promotions to Tokin
H.G.Muller [Tue, 2 Feb 2016 16:31:41 +0000]
Fix sweep promotions to Tokin

Sweep promotions of multiple pieces to Tokin were not working, because
once the promoted version was shown it would always demote to Pawn.
Now the toggle always demotes to the selected piece.

8 years agoFix setting default piece from 'choice' command
H.G.Muller [Tue, 2 Feb 2016 12:10:24 +0000]
Fix setting default piece from 'choice' command

PieceToCharwas used instead of CharToPiece. In addition it is important
to deduce the color from currentMoe rather than forwardMostMove, as
one could be entering a move in the middle of a game (e.g. when editing
or starting a variation).

8 years agoFix two compiler warnings
H.G.Muller [Tue, 2 Feb 2016 11:09:17 +0000]
Fix two compiler warnings

8 years agoAllow pieces with dressed-letter ID as promotion choice
H.G.Muller [Tue, 2 Feb 2016 08:27:34 +0000]
Allow pieces with dressed-letter ID as promotion choice

Testing for the occurrence of a piece in the promotion set specified
through the 'choice' command now takes dressing of the piece IDs into
account.

8 years agoFix castling rights
H.G.Muller [Mon, 1 Feb 2016 20:51:04 +0000]
Fix castling rights

The expansion of the number of piece types to > 64 had broken the
accounting of castling rights, because the code for NoRights is also
a piece code (as it is stored in the board), and had gotten a value
so high that it could no longer be stored as signed char. This is
solved by declaring the initialRights array as unsigned char instead.

8 years agoImplement engine-requested settings-popup WB
H.G.Muller [Mon, 1 Feb 2016 19:45:14 +0000]
Implement engine-requested settings-popup WB

8 years agoAllow O1 as Betza castling descriptor
H.G.Muller [Mon, 1 Feb 2016 16:32:05 +0000]
Allow O1 as Betza castling descriptor

The notation On is now also recognized as castling for n=1, but this
uses the same system as non-royal castling ('guarding'), which is
performed as hit-and-run capture of the Rook (or whatever you want to
castle with) while moving to the destination (one square away here).
This to avoid the ambiguity with normal King moves (which for the
guarding always existed).

8 years agoAllow engine to force popup of its settings dialog
H.G.Muller [Sun, 31 Jan 2016 23:12:41 +0000]
Allow engine to force popup of its settings dialog

An engine can now force popping up of its settings dialog by sending
'feature done=3' to the GUI. It can clear its option list (e.g. for the
purpose of resending it because of altered settings) by sending
'feature done=0'. Such resending would cause the dialog to be updated
when it was already open, or close it and pop up a new one when the
engine specifies it has to be redesigned by ending the list with
'feature done=2'.

8 years agoChange pieceToCharTable order of pieces beyond Lion
H.G.Muller [Sun, 31 Jan 2016 16:28:40 +0000]
Change pieceToCharTable order of pieces beyond Lion

The positions in the pieceToCharstring no longer correspond to internal
piece type, but are remapped such that more useful symbols reside near
the beginning. The piece types themselves could not be re-ordered,
as this would alter the calculation of the opening-book hash key.

8 years agoExpand numer of new piece types to 2 x 11
H.G.Muller [Sun, 31 Jan 2016 14:53:05 +0000]
Expand numer of new piece types to 2 x 11

The number of pieces added between basic and promoted series, and between
the latter and King is increased to 11, and they are ordered differently.
The image used for the Chu-Shogi White-Horse piece,which was a duplicat
of the Knight, is now replaced by a winged Knight.

8 years agoUse flexible promotion assignment
H.G.Muller [Sat, 30 Jan 2016 08:09:03 +0000]
Use flexible promotion assignment

The promoted partner now comes from an array, rather than by adding
a constant (11, or 27 in chu) to the base type. The array is initialized
so the first 11 pieces (the old 'base pieces') point to the second 11
(the old 'promoted series'), and the latter point back (so the array
also contains the demotions!). The pieces above 21 (= Lion) point to
themselves.
  Parsing of the pieceToChar string now considers ^, - and * prefixes
rather than independent IDs. Nevertheless it is the - and ^ that get
stored in the pieceToCharTable (the latter as '+') for the corresponding
piece. But the ID that follows them specifies what other piece they are
the demoted or promoted partner of, rather than their own ID, and is
thus used to update the promoPartner array for both of them.
  A * prefix does mean the following ID is the ID assigned to the piece,
but that the piece promotes to Tokin (if the latter is assigned a '+').
  The default pieceToChar string for varaint chu is adapted to use this
new assignment mechanism of promotion partner. (Chu is so far the only
variant that needed other pairing than the default.)

8 years agoLet PROMOTED and DEMOTED macros use argument
H.G.Muller [Fri, 29 Jan 2016 16:41:58 +0000]
Let PROMOTED and DEMOTED macros use argument

These macros were expanding to offsets added to what followed them.
Now the thing that followed them is passed to them as an argument.
This will allow them to expand the prmomotion or demotion to a table
lookup, rather than just an addition. Where PROMOTED appeared in a case
label, though, it was just a readability enhancement for the fixed
assignment, and a new macro PROMO equal to the old PROMOTED is introduced
for that.

8 years agoFix Chu promotion with added pieces
H.G.Muller [Fri, 29 Jan 2016 09:32:02 +0000]
Fix Chu promotion with added pieces

There were still some hard-coded 22s in the code, which no longer described
the difference between Pawn and Tokin and the number of promotable pieces,
now that new pieces have been added.

8 years agoMake move to own piece a swap rather than capture
H.G.Muller [Thu, 28 Jan 2016 16:55:15 +0000]
Make move to own piece a swap rather than capture

This is useful for Tamerlane Chess, where you can one time during the
game have your King swap places with a friendly piece.

8 years agoImplement 'choice' engine->GUI command
H.G.Muller [Thu, 28 Jan 2016 16:32:19 +0000]
Implement 'choice' engine->GUI command

A new CECP command is implemented: With 'choice XYZ' in reply to a
'lift' or 'put' command an engine can redefine the promotion choice
of the promotion move that emitted these to X, Y or Z. (Always capitals!)
For now only affects sweep & detour promotions, not the promotion
popup.

8 years agoLet target-square highlighting prevail over legality test
H.G.Muller [Thu, 28 Jan 2016 13:08:28 +0000]
Let target-square highlighting prevail over legality test

For engine-defined variants the highlight command is accepted even
with legality testing on. If an engine explicitly marks a square as a
legal destination for the picked-up piece, XBoard now always accepts
the move, even when according to its own move generation, even when based
on the engine's supplied 'piece' commands, going there would be illegal,
and legality testing is on.

8 years agoAdd support for Multi-PV Margin
H.G.Muller [Thu, 28 Jan 2016 11:32:12 +0000]
Add support for Multi-PV Margin

An engine option with a name containing multi, PV and margin is now
recognized, and will lead to printing of a multi-PV header (during
analysis in the Engine Output pane) even in absence of a MultiPV option.
Right-clicking the part of that header between 'fewer' and 'more'
allows tuning of the option value through horizontal mouse moving.
During this tuning the value is displayed in the message field of the
main window. When there is no MultiPV option to specify the number of
PVs, the margin value will be displayed in the header instead of the
number of PVs.

8 years agoFix highlighting in text memos (GTK)
H.G.Muller [Thu, 28 Jan 2016 08:51:37 +0000]
Fix highlighting in text memos (GTK)

The yellow highlighting as used in Engine Output to indicate the
walked PV, or in Move History to show the current move, was only
working the first time that text would be highlighted. Apparently
to unhighlight it the yellow tag had to be removed, rather than a
white tag applied.

8 years agoFix pasting of moves after starting from position file
H.G.Muller [Wed, 27 Jan 2016 19:14:07 +0000]
Fix pasting of moves after starting from position file

When starting from a position file boards[0] would be set to the position,
but initialPosition was not. In LoadGame() initialPosition would then be
copied to boards[0] before loading the game, and without FEN or variant
PGN tag would not be corrected.

8 years agoMove Common Engine menu item to Engine menu
H.G.Muller [Wed, 27 Jan 2016 15:49:20 +0000]
Move Common Engine menu item to Engine menu

The new name of this menu item is 'Common Settings'.

8 years agoFix double-clicks for copying in Edit Position mode
H.G.Muller [Wed, 27 Jan 2016 15:03:04 +0000]
Fix double-clicks for copying in Edit Position mode

The time measurement between clicks on the same square in Edit Position
mode was seeing presses as well as releases, so that a fast click would
be mistaken for a double click on that square. Only presses should be
judged this way. In addition the piece should be grabbed for dragging
again on the second press, as the first release had ended the drag.

8 years agoFix book probing
H.G.Muller [Wed, 27 Jan 2016 10:22:42 +0000]
Fix book probing

The Zobrist key for Kings had been inadvertantly changed in the patch that
assigned new keys to the pieces added for Chu Shogi (the 'chu-promoted
series'), because the King would be considered as a chu-promoted piece.

8 years agoFix crash on pasting garbage FEN
H.G.Muller [Wed, 20 Jan 2016 20:30:51 +0000]
Fix crash on pasting garbage FEN

The auto-size patch had made XBoard crash-prone on pasting pure garbage
with Paste Position, because this would set the number of files or ranks
to values <= 0. Which would cause a floating pont exception during
drawing of the board in XBoard.

8 years agoPrevent changing time control during game (XB)
H.G.Muller [Wed, 20 Jan 2016 19:37:52 +0000]
Prevent changing time control during game (XB)

An attempt to pop up the Time Control Options dialog during a game
will now be met with an Error popup to say it cannot be done, like
in WinBoard. Before it would reset the game.

8 years agoFix Error popup in Tournament Options
H.G.Muller [Wed, 20 Jan 2016 19:31:34 +0000]
Fix Error popup in Tournament Options

Since Tournament Options has been assigned its own DialogClass (MasterDlg)
instead of being one of the TransientDlg, the Error popup should really
test if MasterDlg is already up, to know if its parent window is th
main window or not.

8 years agoUse ii in Betza notation for 3rd-rank Pawn push
H.G.Muller [Thu, 14 Jan 2016 18:16:50 +0000]
Use ii in Betza notation for 3rd-rank Pawn push

The 'i' modifier specifies the move is only for virgin pieces. We now
use 'ii' to indicate a move that can be made when the piece is standing
on the square in front of that were such a piece starts in the initial
setup. This is intended for Pawns that can still be pushed extra far
after they have made a first single step, such as in Wildebeest Chess,
where pawns on 2nd rank can move 1, 2 or 3 squares ahead, and on 3rd rank
can still move 1 or 2 (fmWifmW3iifmW2).

8 years agoFix spurious undo at game start
H.G.Muller [Thu, 14 Jan 2016 15:49:34 +0000]
Fix spurious undo at game start

For ping-supporting engines the logic in handling unexpected moves
is completely changed. Such moves can occur when an engine think is
interrupted by a 'force' command, which in many engines is only
processed after the think completes naturally with a move, and could
cross such a move anyway in engines that would abort the search promptly.
If the 'force' is the result of the user switching to EditGame mode,
such a move should be undone, if it occurs at game end or start,
the moves can be ignored, as the following 'new' will erase all memory
of them. So in EditGameEvent, if the engine was thinking, a flag is set
to indicate its upcoming move should be undone, and ping is sent after
'force'. The 'pong' response would arrive after the move (if any), and
clears the flag. In all other cases of ping imbalance, incoming moves
are ignored.
 While waiting for a pong after EditGameEvent the user interface is
frozen, and a message is displayed to keep the user quiet.

8 years agoSend ping in EditGameEvent
H.G.Muller [Thu, 14 Jan 2016 13:36:47 +0000]
Send ping in EditGameEvent

An EditGameEvent can interrupt tinking of an engine, and the engine
might or might not send back a move as a result of that thinking.
To solve this, a "force" command sent to an engine playing white or
black will now be followed by a "ping". (If supported, of course.)

8 years agoFix variant recognition in ICS mode
H.G.Muller [Wed, 13 Jan 2016 21:23:55 +0000]
Fix variant recognition in ICS mode

The patch that made recognizing variant names of the 'exotic variants'
(i.e. those beyond Shogi) more strict, by requiring an exact match,
had broken variant recognition on the Variant ICS. In that case it
has to act on strings like "ICS unrated xiangqi game", and this now
defaulted to variant normal. The requirement that the variant name
should be the first word of the string is now dropped in ICS mode.

8 years agoLet FENs handle Betza initial rights in castlingless variants
H.G.Muller [Wed, 13 Jan 2016 19:35:36 +0000]
Let FENs handle Betza initial rights in castlingless variants

When a variant has no castling, or is redefined to have no castling
through a 'piece' command for the King, the FEN castling field of a
written FEN will now contain the file ID of all pieces with initial
('i') moves in their Betza definition. On reading the virginity of
pieces not thus mentioned in the castling field will get their
virginity revoked.

8 years agoFix setting of initial virginity on PGN read
H.G.Muller [Wed, 13 Jan 2016 15:07:48 +0000]
Fix setting of initial virginity on PGN read

The back-rank virginity bitmaps were not cleared in ParseFEN.

8 years agoIncreas number of engine-defined variants to 15 (WB)
H.G.Muller [Mon, 11 Jan 2016 23:01:31 +0000]
Increas number of engine-defined variants to 15 (WB)

The number of engine-defined variants that can be selected in WinBoard's
New Variant dialog is increased from 9 to 15 by adding some radio buttons.

8 years agoFix parsing of OO castling when redefined
H.G.Muller [Mon, 11 Jan 2016 21:58:50 +0000]
Fix parsing of OO castling when redefined

A 'piece' command can redefine the castling stride of a King,
and OO castling for non-Fischer castling is internally encoded as the
King step, and thus has to know this.

8 years agoFix writing FEN castling rights for non-edge 'Rooks'
H.G.Muller [Mon, 11 Jan 2016 21:44:04 +0000]
Fix writing FEN castling rights for non-edge 'Rooks'

Non-Fischer castling rights were only recognized on FEN writing when
the castling partner was in the corner. Now it can be anywhere on the
correct side of the King.

8 years agoFix reading FEN FRC castling rights when King not on last rank
H.G.Muller [Mon, 11 Jan 2016 20:05:28 +0000]
Fix reading FEN FRC castling rights when King not on last rank

There was still a hard-coded rank 0 / BOARD_HEIGHT-1 there.

8 years agoFix Makefile for Dragon and minor Lion image
H.G.Muller [Mon, 11 Jan 2016 19:21:05 +0000]
Fix Makefile for Dragon and minor Lion image

These new pieces were not mentioned in the list of SVG data.

8 years agoAdd Wolf, Camel and Zebra bitmaps to WB
H.G.Muller [Mon, 11 Jan 2016 19:13:41 +0000]
Add Wolf, Camel and Zebra bitmaps to WB

Built-in images for some of the new pieces are added for WinBoard.
These are Wolf, Camel and Zebra, but also the duplicat Lion is defined.

8 years agoFix white Iron General image
H.G.Muller [Mon, 11 Jan 2016 15:03:24 +0000]
Fix white Iron General image

The white background of this image was not entirely filled.

8 years agoFlip Unicorn image
H.G.Muller [Mon, 11 Jan 2016 15:01:58 +0000]
Flip Unicorn image

There are now too many Knight-like piece images, that are too similar.
So the Unicorn from now on will look to the right.

8 years agoAdd white Zebra piece image
H.G.Muller [Mon, 11 Jan 2016 10:39:10 +0000]
Add white Zebra piece image

This image had not made it into git with the other new pieces.

8 years agoCorrect backup pieces for addition of minor Lion
H.G.Muller [Mon, 11 Jan 2016 10:35:22 +0000]
Correct backup pieces for addition of minor Lion

The added piece type was not put in the list of backup pieces, so that
the pieces beyond it got out of phase, and no backup for the Prince
would be found, leading to an error popup about missing default pieces.
The error message on this has now been improved to mention the piece
casing the trouble.

8 years agoNever castle when King has other initial moves
H.G.Muller [Sun, 10 Jan 2016 22:54:48 +0000]
Never castle when King has other initial moves

The ApplyMove routine assumed that any lateral King step of more than
a single square was a castling, and then swung the nearest piece in
that direction around the King. This failed in Grande Acedrex, where
the King can (amongst others) jump 2 squares sideways as an initial move.
So we now first check if the King has its moves redefined in a way that
does specify no castling but does specify other initial moves, and perform
any move as just a simple King move in that case.

8 years agoFix edit command for double-digit ranks
H.G.Muller [Thu, 7 Jan 2016 22:32:47 +0000]
Fix edit command for double-digit ranks

Rank numbers above 9 were printed as their internal 1-character
representation.

8 years agoAdd duplicat of Lion (and Flying Dragon)
H.G.Muller [Wed, 6 Jan 2016 19:12:10 +0000]
Add duplicat of Lion (and Flying Dragon)

Two more piece types are added: a duplicat of the Lion in the unpromoted
series, and a Flying Dragon as its promoted counterpart. This Lion does
not suffer from the Lion-trading restriction of Chu Shogi, and can be used
as a general piece. Its pictogram is somewhat smaller than that of the
Chu Shogi Lion.

8 years agoFix typos in winboard.c
H.G.Muller [Sun, 3 Jan 2016 13:09:24 +0000]
Fix typos in winboard.c

8 years agoLet parsing of O-O castlings pay attention to castling rank
H.G.Muller [Sun, 3 Jan 2016 11:38:18 +0000]
Let parsing of O-O castlings pay attention to castling rank

The parser assumed O-O and O-O-O castlings would always take place
on the back rank, even when the newly introduced castlingRank array
specified differently.

8 years agoFix FEN castling rank for Knightmate
H.G.Muller [Sun, 3 Jan 2016 11:22:25 +0000]
Fix FEN castling rank for Knightmate

The newly introduced castlingRank array was not correctly set on reading
a FEN for Knightmate, because it was looking for Kings rather than
Unicorns.

8 years agoReplace Flying Dragon piece image by Gnu
H.G.Muller [Sat, 2 Jan 2016 18:53:35 +0000]
Replace Flying Dragon piece image by Gnu

How could we not think of this before!

8 years agoAlso define Lance image for Amazon in WB
H.G.Muller [Tue, 29 Dec 2015 22:37:43 +0000]
Also define Lance image for Amazon in WB

8 years agoUse hoplit helmet for Copper General in Chu Shogi
H.G.Muller [Tue, 29 Dec 2015 22:33:52 +0000]
Use hoplit helmet for Copper General in Chu Shogi

8 years agoSkip in pieceToChar to Tokin always
H.G.Muller [Tue, 29 Dec 2015 21:46:17 +0000]
Skip in pieceToChar to Tokin always

The piece after the skip symbol '/' in the pieceToCharTable was
defined as CHUPROMOTED Pawn, which only is a Tokin in variant chu,
but a Cannon in other variants. The intension was to always skip
to Tokin, though.

8 years agoAssign new images to the new pieces
H.G.Muller [Tue, 29 Dec 2015 21:20:24 +0000]
Assign new images to the new pieces

The 5 new pieces behind Lion, and their chu-promoted versions,
are assigned the 9 new images. The 10th piece gets the Lance image,
to povide a duplicate for this that will not be considered a Pawn
in any variant (so it can be used for Amazon).

8 years agoAdd 2x9 new piece images
H.G.Muller [Tue, 29 Dec 2015 21:13:03 +0000]
Add 2x9 new piece images

Wolf, Camel, Zebra, Dragon, Wizard, Viking, Iron, Copper and Tower
images are added.

8 years agoFix parsing of pieceToChar strings
H.G.Muller [Tue, 29 Dec 2015 19:43:39 +0000]
Fix parsing of pieceToChar strings

The skipping to the chu-promoted series was not working. The character
that triggers the skipping has been changed from : to /, because : is
a narrow character potentially useful as ID suffix.

8 years agoFix color of white SVG pieces
H.G.Muller [Tue, 29 Dec 2015 17:02:08 +0000]
Fix color of white SVG pieces

The newer SVG pieces were bright white, rather than the ivory default color.

8 years agoFix piece command after ID-suffix patch
H.G.Muller [Sat, 19 Dec 2015 10:10:40 +0000]
Fix piece command after ID-suffix patch

Piece IDs without suffix or & behind them to make them count for both
colors were no longer recognized in 'piece' commands, because there
was a null character behind the extracted piece-name field. And this
null character was seen as occurring in the suffix string.

8 years agoFix bare-king adjudication in Atomic
H.G.Muller [Thu, 17 Dec 2015 11:44:09 +0000]
Fix bare-king adjudication in Atomic

In Atomic a bare King cannot win, but it can already have won, when
the last piece of that side captured or destroyed the opponent King
when exploding. The win-to-draw correction now recognizes this
situation, so that the win is uphold there.

8 years agoErase old logo before drawing new one (XB)
H.G.Muller [Wed, 2 Dec 2015 11:53:19 +0000]
Erase old logo before drawing new one (XB)

In case of an invalid or absent logo, the previous logo kept being
displayed. Now the area is painted grai first.
 Also fixes a bug in the expose area.

8 years agoAllow debug output to go to child process (WB)
H.G.Muller [Fri, 27 Nov 2015 20:01:22 +0000]
Allow debug output to go to child process (WB)

A -debugfile name starting with tree slashes will not be interpreted
as a file to write on, but (after stripping the slashes) as an executable
to run, and send the output to. This could be used by an external
broadcasting agaent.

8 years agoFix DarkSquare bug in piece counting
H.G.Muller [Fri, 27 Nov 2015 16:55:13 +0000]
Fix DarkSquare bug in piece counting

When counting pieces for adjudication purposes, a DarkSquare on the
board caused an out-of-bounds access to the counter array.

8 years agoFix piece commands for suffixed piece IDs
H.G.Muller [Thu, 26 Nov 2015 21:12:22 +0000]
Fix piece commands for suffixed piece IDs

Due to signed-/unsigned-char problems piece IDs suffixed with ' or !
would not be recognized. In addition a & behind it would not be correctly
recognized diue to the alignment problem the suffix character caused.
Both issues are fixed now.

8 years agoAllow skipping over black squares
H.G.Muller [Wed, 25 Nov 2015 18:26:54 +0000]
Allow skipping over black squares

'Skip pieces', defined with a 'j' prefix on a slider(asopposedto rider),
which skip the first square(s)of their path irrespective of occupation
should also be able to skip over holes in the board.

8 years agoDisplay new user logo when username is entered
H.G.Muller [Tue, 24 Nov 2015 19:10:27 +0000]
Display new user logo when username is entered

When the Edit->Enter Username type-in was used, a new user logo was
loaded, but not immediately displayed. While the old user logo could
already be up, during a man-machine game. Now it is also immediately
displayed.

8 years agoTry to load bitmaps for all pieces (WB)
H.G.Muller [Tue, 24 Nov 2015 19:00:16 +0000]
Try to load bitmaps for all pieces (WB)

WinBoard only contains build-in bitmaps for the first 22 piece types,
and also only associated filenames with those that can be used to
provide external images. Now a new naming convention for piece images
is introduced, like piece22_49s.bmp for a 49x49 bitmap for solid piece 22.
All pieces that were not loaded according to the old convention now
try to find images with this naming convention if a -pieceImageDirectory
is defined.

8 years agoFix sortng of mate scores
H.G.Muller [Tue, 20 Oct 2015 15:30:34 +0000]
Fix sortng of mate scores

With the new convention for mate scores (100000+DTM), lower numbers
represent faster mates and thus better scores, and the sorting of PVs
in the Engine Output window now takes that into account.

8 years agoPrint mate scores as #N in message field
H.G.Muller [Tue, 20 Oct 2015 15:22:53 +0000]
Print mate scores as #N in message field

8 years agoStart implementing EPD test suites
H.G.Muller [Tue, 20 Oct 2015 13:05:50 +0000]
Start implementing EPD test suites

An option -epd is added that can be used in combination with matchMode
to let XBoard do a test suite on a file of EPDs with a "bm" qualifier.
It would record the time to solution. Reporting still has to be implemented;
as yet unsolved problem is that currently black-to-move EPDs would
be presented to the second engine.

8 years agoSlip in 10 more piece types
H.G.Muller [Tue, 20 Oct 2015 12:43:27 +0000]
Slip in 10 more piece types

Five new piece type without a defined image are added to increase the
length to the unpromoted series from 11 to 16. They all map behind
the Lion, which remains the 11th piece. Five promoted types are added
as well, just before King. No images are defined for these pieces (yet),
not even image-file names, so they can only be used with the 'Tile'
fallback and a user-defined inscription.

8 years agoFix grayout
H.G.Muller [Mon, 19 Oct 2015 16:50:53 +0000]
Fix grayout

8 years agoFix exclusion header fix
H.G.Muller [Fri, 16 Oct 2015 12:40:58 +0000]
Fix exclusion header fix

8 years agoGrayout Machine Match menu when aborting match
H.G.Muller [Thu, 15 Oct 2015 21:41:09 +0000]
Grayout Machine Match menu when aborting match

Clicking the Machine Match menu item when a match or tourney is in
progress will make XBoard drop out of match mode when the game finishes.
The check mark will remain on the item until that moment. But now we
gray out the item to show that the match is scheduled for termination.

8 years agoBase tinyLayout decision on total board width
H.G.Muller [Thu, 15 Oct 2015 18:57:39 +0000]
Base tinyLayout decision on total board width

The decision whether to include system menu and use one-letter main menus
is now taken based on the total board width, rather than the square size,
to account for boards that do have other than 8 files.

8 years agoUse intermediate width menu bar in sizes 37 & 40 (WB)
H.G.Muller [Thu, 15 Oct 2015 18:45:41 +0000]
Use intermediate width menu bar in sizes 37 & 40 (WB)

Due to the increased number of main menus the menu bar wrapped to two lines
in sizes slim and small (which did not use the single-letter 'tinyLayout'
menu texts). An intermediate menu-bar format with 3-letter texts is now
provided as well.

8 years agoDisplay exclusion header only for engines supporting exclusion
H.G.Muller [Thu, 15 Oct 2015 15:25:21 +0000]
Display exclusion header only for engines supporting exclusion

The display of the exclusion header in the Engine Output window is made
dependent on the engine having emitted feature exclude=1 at startup.

8 years agoFix periodic updates GTK
H.G.Muller [Sat, 19 Sep 2015 17:35:07 +0000]
Fix periodic updates GTK

Only the first periodic update event would occur, because the clock function
did not retun True to encourage timer events to keep coming.

8 years agoMake -inscriptions a volatile option
H.G.Muller [Tue, 11 Aug 2015 07:38:19 +0000]
Make -inscriptions a volatile option

Saving unicodein the settings file does not work, and leads to an
octal escape sequence for non-ascii characters, which is not correctly
read back. For now saving thus is avoided.

8 years agoMake inscriptions somewhat smaller and non-bold
H.G.Muller [Fri, 7 Aug 2015 16:45:35 +0000]
Make inscriptions somewhat smaller and non-bold

8 years agoFall back on Tile SVG in pieceImageDirectory
H.G.Muller [Thu, 6 Aug 2015 21:49:02 +0000]
Fall back on Tile SVG in pieceImageDirectory

If a -pieceImageDirectory is given, but a needed piece is not found,
and -inscriptions are specified, we first fall back on a general
image White/BlackTile.svg. This can then serve as a background for the
various inscription glyphs, using the latter to distinguish the pieces.
E.g. the Tile image could be a shogi tile, and the inscriptions an utf8
string of kanji, to create Shogi pieces on the fly.

8 years agoTake account of glyph size when positioning inscriptions
H.G.Muller [Thu, 6 Aug 2015 17:41:28 +0000]
Take account of glyph size when positioning inscriptions

We calculate the position of the inscription from its pango extents.

8 years agoAlso write inscription on dragged piece
H.G.Muller [Thu, 6 Aug 2015 17:14:05 +0000]
Also write inscription on dragged piece