xboard.git
5 years agoRefrain from killing known protocol adapters
H.G.Muller [Tue, 18 Jun 2019 09:05:10 +0000]
Refrain from killing known protocol adapters

Killing 'engines' that run through an adapter and won't terminate fast
enough for XBoard's taste will always be very detrimental, as it will
kill the adapter, and leaves the actual engine (for which the adapter
was likely waiting) running, preventing the adapter would take action
against it. We will thus always refrain from killing engines when XBoard
knows they are running through an adapter, because it invoked the adapter
itself in response to the -f/sUCI option.

5 years agoAlso do not nice priority of a remote shell
H.G.Muller [Mon, 17 Jun 2019 11:59:04 +0000]
Also do not nice priority of a remote shell

When the engine is really running elsewhere the program used to
communicate it should not have lowered priority.

5 years agoDo not nice nice-aware adapters
H.G.Muller [Mon, 17 Jun 2019 11:55:52 +0000]
Do not nice nice-aware adapters

It is the engine process we want to run at lower priority, not the
adapter it is running through. So if we know the engine is running
through an adapter, because we invoked it ourselves due to -f/sUCI,
and we pass the adapter the value of the -niceEngines option (presumably
for it to set the priority of the engine it forks off by itself),
we refrain from nicing it.

5 years agoApply -niceEngines priority only to engines
H.G.Muller [Mon, 17 Jun 2019 11:49:01 +0000]
Apply -niceEngines priority only to engines

Child processes started to communicate with ICS should run at normal
priority, and the caller of StartChildProcess now determines whether
the CPU priority will be niced, depending on the task of the process.

5 years agoImprove Edit Position usage note
H.G.Muller [Mon, 3 Jun 2019 12:16:34 +0000]
Improve Edit Position usage note

Bullets for clearing the board and stopping multi-drops were added.

5 years agoFix browsing for souns folder in newer GTK
H.G.Muller [Mon, 3 Jun 2019 11:54:53 +0000]
Fix browsing for souns folder in newer GTK

The file chooser would grey out all folders unless the user would first
switch the filter to 'All Files', in newer GTK versions, when choosing
a sounds or piece-image directory. The problem could be traced to the
corresponding Options specifying an empty filter string, rather than
a NULL pointer. The file chooser would be started with this filter
selected, and at some point GTK changed to interpret the empty pattern
as 'nothing' rather than 'everything'. By specifying NULL for the filter
'All files' will be the only option, and automatically selected.

5 years agoPay attention to hint move in walking pobder PV
H.G.Muller [Mon, 3 Jun 2019 09:58:37 +0000]
Pay attention to hint move in walking pobder PV

When requesting to walk the PV of a pondering engine, it would only
work if that engine had printed the ponder move (in parentheses) as
first move of the PV. But the recommended mode in CECP would have
provided the ponder move in a 'Hint:' command, and start the PV after it.
So that the PV would always start with an invalid move (for the other
player). Backing up to the previous position such as would have to be
done when walking an old PV after the engine has moved, does not solve
this; we have to go one position forward rather than backward. Now
we first try to put the hint move before the PV, if the engine supplying
the PV provided the hint, and pondering is on, before we try to back up.

5 years agoFix echoing of ICS commands in ICS/Chat window
H.G.Muller [Sat, 1 Jun 2019 13:58:01 +0000]
Fix echoing of ICS commands in ICS/Chat window

The ICS output pane did not show the commands submitted to the ICS
by typing in the input field. Now it does, but to prevent the password
from being shown this is made dependent on the value of 'remoteEchoOption'.
Which, to this end, had to be made an external variable shared through
backend.h.

5 years agoFinish change in Clear Board
H.G.Muller [Sat, 1 Jun 2019 12:47:59 +0000]
Finish change in Clear Board

Clock clicks in Edit Position mode now first displays a 'palette board',
then clears any non-Kings, then sets up the start position, and finally
restores the position that was erased by the palette board (if that was
different from the start position). This continues cyclically.
  The clearing of non-royals spares the four center squares, which would
have been empty already in an unmodified palette board. This allows a user
that wants to set up a position with very few pieces to first drag those
to the center, before clearing all other non-royals away, and finally
moving what is left to the desired location. That saves him the trouble
of eliminating the unneeded pieces one by one from the pallette board.

6 years agoProvide user interface for promotion drops
H.G.Muller [Sun, 22 Apr 2018 19:20:37 +0000]
Provide user interface for promotion drops

Pressing the Shift key during a drop move will attempt to drop the promoted
version of the piece.

6 years agoImplement auto-promotion
H.G.Muller [Sat, 21 Apr 2018 19:02:52 +0000]
Implement auto-promotion

A piece that in the pieceToCharTable is marked as a promoted version of
some other piece by using a '-' instead of a '^' will now define both
partners as auto-promoting. This means promotion suffixes on SAN moves
for them will be suppressed an ignored, while in protocol moves they will
always be added. It will also be allowed to drop these pieces in promoted
form. The notation for this will use the nickname of the promoted version,
rather than a +X notation.

6 years agopartial Eit Position change
H.G.Muller [Mon, 16 Apr 2018 19:50:18 +0000]
partial Eit Position change

6 years agoAllow clock click for board clear also with piece menu
H.G.Muller [Wed, 28 Feb 2018 16:20:55 +0000]
Allow clock click for board clear also with piece menu

6 years agoImplement Edit Positon multi-dropping
H.G.Muller [Wed, 28 Feb 2018 14:44:41 +0000]
Implement Edit Positon multi-dropping

Right-clicking a piece in Edit Position mode now 'lifts it off the board',
and makes it available for dropping multiple times, by left-clicking
empty squares while no piece is selected (highlighted) for moving.
Left-clicks on occupied squares select the piece for moving as usual,
but this does not erase the memory of the 'lifted' piece types. This way
click-click moves remain possible in between drop events, e.g. to get a
piece out of the way.
 The type of the piece that will be dropped is indicated in the message
field. Right-clicking an empty square (which is an invalid action, as empty
squares cannot be lifted for dropping) pops up a note with an overview of
what can be done in Edit Position mode.
 This is an alternative for sweep selection as a method of dropping pieces
on the board. For now it replaces the piece menu. Multiple drop clicks to
the same square will increment the piece type, so piece types not in the
original position can still be created. It doesn't seem possible to do
anything with a board that is completely empty, though!

6 years agoFix crash by using texture in black square
H.G.Muller [Fri, 9 Feb 2018 16:11:27 +0000]
Fix crash by using texture in black square

When BlankSquare was called with square_color = 2 to black out a square
(as when drawing holdings), it tried to use a non-existent texture bitmap
for this when background textures were on, risking a segfault in Cairo.

6 years agoFix promoting pieces in Shogi
H.G.Muller [Fri, 26 Jan 2018 13:14:30 +0000]
Fix promoting pieces in Shogi

Because of a bug in a boolean expression the Gold had become a promoting
piece. The promotion procedure on user moves is now only triggered if
the piece itself was not defined as promoted, AND its partner is defined
as promoted.

6 years agoFix Edit Position with engine-defined variant
H.G.Muller [Fri, 26 Jan 2018 13:01:19 +0000]
Fix Edit Position with engine-defined variant

Submitting a new position starts a new game, but the position would be
set up before the engine had the time to reply to the 'variant' command
wit a 'setup'. As a consequence WinBoard would be unaware of the correct
starting position, with as a consequence that Pawns might not be considered
virgin for their Betza 'i' moves.
 Now even late reception of a 'setup' command from the engine when
startedFromSetupPosition is true will cause initialPosition to be
initialized. The assumption is that XBoard was already switched to the
variant before, so that the 'setup' command is not needed for defining the
pieceToCharTable used to interpret the FEN that set up the position.

6 years agoFix Seirawan gating at Rook square in PGN castling moves
H.G.Muller [Wed, 8 Nov 2017 10:30:05 +0000]
Fix Seirawan gating at Rook square in PGN castling moves

The 'reverse gatings' were written as RxK also in PGN, which was ugly.
Now a file disambiguator behind the ID of the gated piece is used for
all castling gatings (also those at the King square). On input omission
of the disambiguator defaults to King square.

6 years agoFix RxK castling from engine in variant seirawan
H.G.Muller [Tue, 7 Nov 2017 20:53:01 +0000]
Fix RxK castling from engine in variant seirawan

The RxK notation for castling with gating at the Rook square was mistaken
for a non-compliant castling notation in games without Fischer castling,
and corrected to the compliant notation by adjusting the to-square, assumed
to be the Rook. But this backfired for RxK, where it is the King. Now
castlings with the to-square on the central file are exempted from this
correction.

6 years agoAdd option -defaultInstallProtocol
H.G.Muller [Thu, 2 Nov 2017 11:43:23 +0000]
Add option -defaultInstallProtocol

A persistent option is added to determine the initial setting of the
protocol-selector combobox in the Load Engine dialog. It must be given
a value 0-4 corresponding to the choice order. This is mainly intended
for configuring Shogi or Xiangqi packages, to select USI or USI (for which
auto-detection does not work).

6 years agoAdd option -defaultEngineInstallDir (XB)
H.G.Muller [Thu, 2 Nov 2017 11:25:10 +0000]
Add option -defaultEngineInstallDir (XB)

A new option is added to configure what appears in the Directory text
entry of the Load Engine dialog when you pop that up. It is volatile,
and intended for use in the masted config file, to set what is convenient
for Linux or OS X.

6 years agoPay attention to dont-add-to-list checkbox again
H.G.Muller [Thu, 2 Nov 2017 11:14:13 +0000]
Pay attention to dont-add-to-list checkbox again

Although it is questionable whether this checkbox will remain in the log
run, as long as it is there we better obey it.

6 years agoFix installing chosen protocols
H.G.Muller [Mon, 30 Oct 2017 22:00:42 +0000]
Fix installing chosen protocols

6 years agoRedesign XBoard Load Engine dialog
H.G.Muller [Mon, 30 Oct 2017 21:56:15 +0000]
Redesign XBoard Load Engine dialog

The XBoard Load Engine dialog now also uses a combobox for protocol
selection, and the order of the controls is changes, with some extra
explanatory text.

6 years agoFix installing with chosen protocol
H.G.Muller [Mon, 30 Oct 2017 21:54:12 +0000]
Fix installing with chosen protocol

The tryNr variable should be set by the Load Engine dialog even when
there is no auto-detection, to make the engine be added to the list.

6 years agoFix chosen WB v1 install
H.G.Muller [Mon, 30 Oct 2017 21:24:30 +0000]
Fix chosen WB v1 install

The autodetect patch had made it impossible to force an engine to be
installed as WB v1, because the v1 flag set by the dialog was overwritten.

6 years agoRedesign WinBoard Load Engine dialog
H.G.Muller [Mon, 30 Oct 2017 17:11:24 +0000]
Redesign WinBoard Load Engine dialog

The checkboxes for protocol choice are replaced by a combobox, which
also contains an autodetect option. This is encoded through the kludge
of setting isUCI = 3.
 The fields that do not usually have to be specified are now put in
group boxes, which make it more clear the user can ignore them.
For this a ew control type GroupBox had to be defined, and supported
in the GenericPopup.

6 years agoAlso update engine list when saving engine settings
H.G.Muller [Sun, 29 Oct 2017 21:20:48 +0000]
Also update engine list when saving engine settings

The 'Make Persistent' button in the Engine Settings dialog will now
also cause the -engineList file to be read before being processed,
and be written back after it, to keep the list up to date for all
open XBoard instances. There still is a problem here, that when another
instance has changed settings of the currently loaded engine, this engine
is no longerrecognized as being in the list. But at least the user will
be warned in such a case that makig the settings change persistent has
failed.

6 years agoImplement separate engine list for WinBoard
H.G.Muller [Sun, 29 Oct 2017 19:54:37 +0000]
Implement separate engine list for WinBoard

Reading the engine list before popping up Edit Engine List and Load Engine
is now also done in WinBoard.

6 years agoLocate engine list in separate file
H.G.Muller [Sun, 29 Oct 2017 19:34:37 +0000]
Locate engine list in separate file

The option -firstChessProgramNames, which contains the list of registered
engines, can now be kept in a dedicated settings file. This file will
be read at startup after the normal settings file and command-line
arguments. It will also be read and saved when dialogs altering the
engine list are used (Load Engine and Edit Engine List). This will
effectively cause changes in the engine list made by any XBoard instance
to be instantly broadcasted to all other instances. The name of this
engine-list file can be specified by the new persistent option -engineList.
If this is set to an empty string (the default), this new feature will
not be used, and the list in the normal settings file will be used
as always. This list is currently still written in the user settings file,
together with the other settings.

6 years agoDecrease feature timeout to 1 sec
H.G.Muller [Sun, 29 Oct 2017 15:02:35 +0000]
Decrease feature timeout to 1 sec

The feature timeout used to be 10 sec, which seems ridiculously long
at present-day computer speeds. It is reduced to 1 sec, but actually
twice this will be used because of the "uci" probe that will follow the
"protover 2" probe, and will use the same timeout.

6 years agoImplement (unconditional) protocol auto-detection
H.G.Muller [Sun, 29 Oct 2017 14:56:10 +0000]
Implement (unconditional) protocol auto-detection

By sending "uci" to the engine after the feature timeout expires,
and redoing the engine replacement with UCI ticked when "uciok" is
received, UCI engines will install properly even when they are first
assumed to be CECP engines. An extra timeout period is taken to wait
for the possible "uciok" response. If this expires too, the engine is
assumed to be WB v1.
  Adding the engine to the engine list had to be deferred until the
protocol is known. This means the "-protocolVersion 1" option can now
also automatically added to the engine line for v1 engines.

7 years agoDo not accept engine 50-move claims in Makruk
H.G.Muller [Wed, 22 Feb 2017 19:53:32 +0000]
Do not accept engine 50-move claims in Makruk

Normally draw claims are always accepted after 100 reversible ply, even
when -ruleMoves is set different from 50. In Makruk this would allow
engines to cheat, as there is in general no 50-move limitation there.
Now the claims are considered false (but adjudication can still be
configured).

7 years agoImplement Makruk counting rules
H.G.Muller [Wed, 22 Feb 2017 19:34:36 +0000]
Implement Makruk counting rules

Adjudication is now performed based on the Makruk counting rules, assuming
the players count in the way most favorable for them. This means that when
the maximum count is N, the game is adjudicated draw immediately after the
Nth move since the counting could have started when the opponent is bared,
but only on the next move when not, to give him the opportunity to checkmate
when he was not counting. This adjudication is switched off if -ruleMoves
is set to a negative value, (normally this would be 0 in Makruk), and is
also dependent on legality testing being on.

7 years agoRemove castling rights from Suicide start position
H.G.Muller [Wed, 1 Feb 2017 12:15:25 +0000]
Remove castling rights from Suicide start position

Suicide was initialized with castling rights, while the move generator
in fact would suppress any castling. The fake rights would appear in FENs,
and break probing of the GUI book.

7 years agoFix e.p. capture in ICS play
H.G.Muller [Tue, 17 Jan 2017 17:53:27 +0000]
Fix e.p. capture in ICS play

The new e.p. rights were not set when the position was obtained
by parsing an ICS board, rather than from applying a move to a previous
position.

7 years agoLet repeated right-clicking upgrade placed piece in Edit Position mode
H.G.Muller [Fri, 13 Jan 2017 13:51:33 +0000]
Let repeated right-clicking upgrade placed piece in Edit Position mode

Right-clicking a square multiple timesin Edit Position mode will now make
it cycle through all pieces defined in the pieceToCharTable.
  When -monoMouse is set a click on an occupied square is interpreted as
a left-click. But an exception is now made for the piece that was just
placed: this will be treated as a right-click, so that this feature is
also accessible in monoMouse mode.

7 years agoFix usage of memory after free in -replace option
H.G.Muller [Fri, 13 Jan 2017 12:26:44 +0000]
Fix usage of memory after free in -replace option

The code for implementing the -replace option was using a string after
its memory was freed, which might not work in all allocation systems.

7 years agoAllow Make Persistent on engine loaded from recent-engine menu
H.G.Muller [Fri, 13 Jan 2017 12:22:27 +0000]
Allow Make Persistent on engine loaded from recent-engine menu

This method of loading an engine from the list was not yet recorded
in the currentEngine[] array.

7 years agoUse feature timeout when starting second engine for analysis
H.G.Muller [Thu, 5 Jan 2017 21:30:41 +0000]
Use feature timeout when starting second engine for analysis

When the second engine gets ivolved in the analysis, but has not been
used before, so that its features are unknown, we now wait for these
features (or time out in case of v1 engines) before initializing the
engine. Without this 'edit' could be used on engines that need 'setboard',
or false 'unsupported variant' errors could arise.

7 years agoFix awareness of settings changed by -firstOption
H.G.Muller [Thu, 5 Jan 2017 16:05:22 +0000]
Fix awareness of settings changed by -firstOption

Options of the type -file and -path that were set through -firstOptions
would not get their 'current value' updated, so that XBoard would not
set them properly on a reload because of reuse=0. In addition the default
value for all option types would be remembered as the value specified
by -firstOptions, rather than the engine default, possibly preventing
their saving on Make Persistent.

7 years agoFix ICS Crazyhouse play
H.G.Muller [Wed, 4 Jan 2017 19:40:08 +0000]
Fix ICS Crazyhouse play

The new way to associate promoted partners to pieces had woken up a latent
bug in the code that determined whether pieces in the ICS board are promoted
Pawns. This led to Pawns appearing out of nowhere on squares evacuated by
white Pawns.

7 years agoMake holdings scrollable
H.G.Muller [Sun, 25 Dec 2016 16:20:30 +0000]
Make holdings scrollable

When the hand size exceeds the number of board ranks R, the holdings will
either display either the first R-1 or last R-1 piece types. The remaining
square will then act as a toggle button between the two states. If there
is indeed material that is not displayed, the toggle square will display
a Prince of the opposite color. (The idea is that themes for games needing
this feature would define this piece as a vertical arrow glyph.)

7 years agoCorrect promotion zone for blacked-out ranks
H.G.Muller [Thu, 22 Dec 2016 20:22:28 +0000]
Correct promotion zone for blacked-out ranks

When the window height has to be larger than the board height, to accomodate
the holdings (as in Wa Shogi), this is done by defining the board height as
large as the holdings size, and blacking out the extra ranks. But when the
depth is calculated as 1/3 of the board height, it should use the real
board height, not the artificially enlarged one.

7 years agoDecouple board height from hand size
H.G.Muller [Thu, 22 Dec 2016 19:28:47 +0000]
Decouple board height from hand size

To make it possible to have holdings larger than the height of the board
window, (of which a selectable subset ca then be displayed), the holdings
size is now referred to a separate variable.

7 years agoGeneralize FEN e.p. field to handle diagonal and triple pushes
H.G.Muller [Tue, 6 Dec 2016 16:19:00 +0000]
Generalize FEN e.p. field to handle diagonal and triple pushes

In Berolina Chess a single square canot unambiguously indicate which
e.p. capture ispossible, as two initial double-pushes could cross over
the same square (and a 4th-rank Pawn could have come from two 2nd-rank
locations). So both the skipped square and the location of the corresponding
e.p.victim have to be mentioned in the e.p. field of a FEN. This is now
supported (in variant Berolina) on both reading and writing.
  In addition, the test for when an e.p. field has to be added is improved.
It was still using hard-coded rank numbers, only acting on 2->4 and 7->5
Pawn moves that stayed on the same file. Now it works on any advance of
more than one rank. For pushes of more than one rank the e.p. square is
biased towards the from-square. This makes it possible to distinguish
between a triple and a double-push that end on the same rank.

7 years agoFix recognition of variant seirawan in examined ICS games
H.G.Muller [Tue, 6 Dec 2016 11:46:07 +0000]
Fix recognition of variant seirawan in examined ICS games

The heuristic for guessing the variant when receiving an ICS holdings
command assumed Crazyhouse when the board width was 8, which prevented
correct interpretation of the holdings content. Now presence of H or E
in the holdings alter the guess to Seirawan Chess.

7 years agoImplement check-count field in FENs
H.G.Muller [Mon, 5 Dec 2016 12:22:40 +0000]
Implement check-count field in FENs

A field of the form N+M between e.p. field and ply counter is now associated
with the CHECK_COUNT game state on reading and writing. It is only written
when non-zero (which again should only happen in 3check). In addition a field
of the form +N+M after the full-move number is recognized on reading as the
SCIDB check counter, which indicates checks given.

7 years agoKeep track of number of remaining checks
H.G.Muller [Mon, 5 Dec 2016 11:01:17 +0000]
Keep track of number of remaining checks

Another off-board square is now allocated forkeeping track of the number
of remaining checks each side can suffer before losing. When this double
counter is 0, counting is disabled. Otherwise each check will decrease
the count of the checked side, and when it reaches 0 the check will be
treated as a checkmate. In variant 3check the counters will be initialized
to 3, otherwise to 0.

7 years agoRemeber last-moved piece in only one Board square
H.G.Muller [Mon, 5 Dec 2016 10:15:48 +0000]
Remeber last-moved piece in only one Board square

The amount of game-state data (castling rights, e.p. state...) carried
along in the extra rank above the real board is getting a bit out of hand.
Rather than storing rank and file of the last-moved piece in two separate
off-board squares in that rank, we now combine them into a single number
(which would still allow boards of upto 64 files).

7 years agoFix legality testing with mandatory capture
H.G.Muller [Mon, 5 Dec 2016 08:54:30 +0000]
Fix legality testing with mandatory capture

When a capture was possible in suicide/giveaway/losers, only the board
markers of all non-captures were cleared, but not the legality of the
corresponding destination squares in the array legal[][]. The patch that
forced destinations to be legal when the engine had highlighted them had
therefore broken rejection of illegal non-captures in this case.

7 years agoAdd msimg32 library to makefile.gcc for WinBoard build
H.G.Muller [Fri, 2 Dec 2016 10:16:52 +0000]
Add msimg32 library to makefile.gcc for WinBoard build

The AlphaBlend function would be an undefined reference without this library.

7 years agoFix Game List highlighting (WB)
H.G.Muller [Fri, 2 Dec 2016 08:25:13 +0000]
Fix Game List highlighting (WB)

The binary search for finding the current game amongst the listed ones
in the Game List was not looking in the first 32 displayed entries.

7 years agoAlso allow Make Persist on engines loaded through -fe / -se
H.G.Muller [Fri, 2 Dec 2016 08:09:18 +0000]
Also allow Make Persist on engines loaded through -fe / -se

The options -fe and -se are another way to select engines from the list,
and MakePersistent should also work in this case. So the engine lines
retrieved for the given nicks are now also remembered.

7 years agoReport error when saving of engine settings fails
H.G.Muller [Fri, 2 Dec 2016 08:00:19 +0000]
Report error when saving of engine settings fails

When the current engine was not chosen from the Engine List, or is no
loger in there, we now print a complaint in the message field.

7 years agoRemember engine lines selected in Startup Dialog (WB)
H.G.Muller [Fri, 2 Dec 2016 07:48:20 +0000]
Remember engine lines selected in Startup Dialog (WB)

The comboboxes in the Startup Dialog do contain complete engine lines
from the Engine List, so selecting an engine from there should also allow
use of the Make Persistent button in the Engine Settings dialogs. To this
end the selected lines are now remembered incurrentEngine[].

7 years agoAllow WinBoard to use bitmaps with alpha channel
H.G.Muller [Wed, 30 Nov 2016 21:27:35 +0000]
Allow WinBoard to use bitmaps with alpha channel

When the primary image of a piece (*o.bmp or *s.bmp) has a format with
32 bit/pixel, it is assumed to be in ARGB format, with transparent
background. It is then drawn over the board accordingly by new code
(using the Win API AlphaBlend routine). This code ignores the allWhite
and flipBlack options for the moment.
  The cascade for loading bitmaps has been changed as well: WinBoard
now first tries to load an image with name like piece0_49o.bmp from the
pieceImageDirectory if the traditional name (like p49o.bmp) is not found,
before falling back on built-in images.

7 years agoMake it possible to save XBoard piece images as Windows bitmaps
H.G.Muller [Wed, 30 Nov 2016 16:16:50 +0000]
Make it possible to save XBoard piece images as Windows bitmaps

A new option -bmpSave N would make XBoard save the images of the first
N pieces of each color, plus the King, as a Windows .bmp file with alpha
channel (32 bits/pixel). This happens in a sub-directory 'bmaps'. After the
black King is saved, XBoard will exit.

7 years agoImplement less kludgy way for conditional string options
H.G.Muller [Wed, 30 Nov 2016 13:46:07 +0000]
Implement less kludgy way for conditional string options

A new option -replace can now define a string, and when the existing value
of the next encountered string option does not exactly match that, the
latter is ignored. The @@@@@ kludge for conditionally replacing empty
strings is removed, as this can now be achieved through -replace "".
The value of -replace is reset to NULL (not ""!) as soon as it has been
used for comparison, irrespective of the result. This makes -replace a
'hyper-volatile' option.
 The conditional setting of UCI2WB as -uxiAdapter in xboard.conf is now
changed to use this mechanism.

7 years agoAdd Tower, Sword and Gnu piece images (WB)
H.G.Muller [Sat, 26 Nov 2016 10:39:24 +0000]
Add Tower, Sword and Gnu piece images (WB)

Bitmaps for the Tower and Sword piece types are added to WinBoard for
size bulky (72x72) and middling (49x49), so the first 26 contiguous pieces
all have built-in images in these sizes. Gnu images are also added.

7 years agoOnly consider kingless positions as in-check in Atomic
H.G.Muller [Sun, 27 Nov 2016 22:35:24 +0000]
Only consider kingless positions as in-check in Atomic

The check test returned 1000 (as special version of TRUE) when there
was no King that could be exposed to capture, under the assumption that
this would mean it had been exploded by the preceding move. But this was
counter-productive in variants without King (such as Horde). So now it
is only done in Atomic Chess, and all other variants return FALSE if there
is nothing on the board that could be checked.

7 years agoImplement understanding of Xiangqi UBB format
H.G.Muller [Sun, 27 Nov 2016 22:19:14 +0000]
Implement understanding of Xiangqi UBB format

Xiangqi games are often distributed in HTMLpages in a compressed format
iterpreted by a viewer script. XBoard's game parser now understands this
format.

7 years agoConfigure XBoard to use UCI2WB as adapter for UCI dialects
H.G.Muller [Sun, 27 Nov 2016 20:57:50 +0000]
Configure XBoard to use UCI2WB as adapter for UCI dialects

The -uxiAdapter option is conditionally set for using UCI2WB in the
master settings file, in a way that would overrule the user settings
only if the latter still has it as an empty string.

7 years agoIntroduce contitional string options
H.G.Muller [Sun, 27 Nov 2016 17:03:51 +0000]
Introduce contitional string options

A string option that specifies a value starting with "@@@@@" (five at signs)
will be treated in a special way: if the current value of this option is
not the empty string, it will not be changed. If it is, it will be set
to the given value after the @@@@@ prefix has been stripped off the latter.
 This is introduced to make it possible to set hitherto unused persistent
options from the master settings file, by includig them in the latter after
the user settigs file was read. Options in this location will overrule
whatever was in the saved settings, effectively making the option volatile
with a new default. But by using the @@@@@ prefix for the value, users
that already have assigned a value to the option will not be affected,
and only for users that were not yet using the option a new value will
be defined for it.

7 years agoFix saving engine settings after registering new engine
H.G.Muller [Sun, 27 Nov 2016 16:30:25 +0000]
Fix saving engine settings after registering new engine

The remebered currentEgine after a new registration through the Load Engine
dialog would be terminated by a linefeed, unlike after loading an engine
that already was in the list. This caused the -firstOptions to be added
on the next line. Now both cases omit the linefeed.

7 years agoImplement saving of (modified) engine settings
H.G.Muller [Sun, 27 Nov 2016 13:47:03 +0000]
Implement saving of (modified) engine settings

The Engine #N Settings dialogs will now have an extra button at the top,
labelled "Make Persistent". Pressing it will 'OK' the dialog, and in
addition will add all non-default settings of the options to the engine
line in the Engine List (-firstChessProgramNames), as a -firstOptions
XBoard option. If such an option is already in the engine line, its value
will be altered to the newly specified settings. The function ResendOptions
was modified to also allow returning the options as a string, rather
than sending them as 'option' commands to the engine.
 Currently this will only work for engines that were loaded through the
Load Engine dialogs, not for those specified with -fcp/scp at startup.
Because the latter need not be in the engine list. The Load Engine
dialogs will make XBoard remember the entire engine line of the engine
that was last loaded, and pressing the button will search a line exactly
like it in the engine list, to add/change its -firstOptions option.
It would fail silently if no such line is found.

7 years agoOnly resend changed options on xreuse restart
H.G.Muller [Sat, 26 Nov 2016 12:56:16 +0000]
Only resend changed options on xreuse restart

For engines that specify reuse=1, a new engine process is started for
every game. This new process is made aware of the option settings as
they were specified by the user during the live of its predecessors.
Now this resending is limited to the options that have different value
from their original default. To achieve that, the default values are
now remembered (in the last 104 bytes of the Option.name buffer, which
was allocated way too large): 4 bytes for integet value, 99 char text.

7 years agoFix storage of values of engine string options
H.G.Muller [Sat, 26 Nov 2016 11:33:54 +0000]
Fix storage of values of engine string options

Originally all option definitions given in option features were stored
in a static array of generous size (MSG_SIZ). But this was changed to
allocated memory for not wasting space on unused option slots. The allocated
memory wasonly large enough to hold the default value of the option,
which could very well be an empty string. Changing the option setting
to a longer strig would then produce memory corruption through buffer overrun.
Now the memory allocated for option features is again at least MSG_SIZ.

7 years agoFix bug in storing time of first move
H.G.Muller [Fri, 25 Nov 2016 21:59:35 +0000]
Fix bug in storing time of first move

TwoMachinesEvent() reset the clocks for re-calculating time odds (as the
first engine would play white, while any previous Reset() would have
assumed it played black). But it did not save the start time in the
tmeReamaining array. Actually TwoMachinesEvent() was not supposed to
unconditionally reset the clocks, and this bug was introduced when the
ResetClocks was moved out of the conditional, separating it from saving
the start times. It is nowput back inside the conditional, but the
condition is now also incorporating the case TwoMachineEvent() was called
at the start of a game (i.e. no moves done). When used to resume a game
in progress it keeps the existing clocks (except for engines that do not
support time/otim).

7 years agoImprove identification of e.p. victim
H.G.Muller [Thu, 24 Nov 2016 18:47:46 +0000]
Improve identification of e.p. victim

The move generator now generates e.p. moves of default Pawns based on
the file of the skipped square of the previous multi-push, rather than
the e.p. rights (which were set only if ApplyMove suspects an e.p. capture
is actually possible, which might not be the case when opponent Pawns do
not capture as expected). A standard Pawn capturing to an empty square
will now always capture the previously multi-pushed Pawn. Only if there
is none it will guess where the victim should be based on FIDE rules,
and would not capture any non-Pawns in that location.
  This heuristic should work for default Pawns against any other kind
of Pawn. The existence of e.p. rights might not be recognized when
comparing positions, however, so that rep draws could be declared after
a two-fold repetition.

7 years agoTreat Betza-defined e.p. capture
H.G.Muller [Wed, 23 Nov 2016 16:46:20 +0000]
Treat Betza-defined e.p. capture

Pieces with redefined moves that include an e.p. capture will now
not be subject to the heuristic that deletes a suspected e.p. victim
during board update (which was only applied to Pawns and Lances).
When they move to the e.p. square (still set by Pawn or Lance multi-
pushes in the old hard-coded way), this will remove the last-moved piece
(which created those e.p. rights).

7 years agoDetect breaking of input pipe from engines (GTK)
H.G.Muller [Wed, 23 Nov 2016 14:17:03 +0000]
Detect breaking of input pipe from engines (GTK)

In the GTK version the input events were not set up to trigger when
the pipe broke, which led to delayed detection of crashing engines.

7 years agoObey -firstFeatures option at startup
H.G.Muller [Wed, 23 Nov 2016 14:13:40 +0000]
Obey -firstFeatures option at startup

The -firstFeatures, which are supposed to overrule features of the first
engine, were ignored when this engine was loaded at startup.

8 years agoupdates NEWS, Changelog, DIFFSTAT and SHORTLOG
Arun Persaud [Mon, 1 Aug 2016 03:53:21 +0000]
updates NEWS, Changelog, DIFFSTAT and SHORTLOG

8 years agoupdated po/pot files
Arun Persaud [Mon, 1 Aug 2016 03:46:54 +0000]
updated po/pot files

8 years agonew version number for release 4.9.1
Arun Persaud [Mon, 1 Aug 2016 03:45:22 +0000]
new version number for release 4.9.1

8 years agoFix crash when logging out from ICS
H.G.Muller [Thu, 28 Jul 2016 17:49:02 +0000]
Fix crash when logging out from ICS

The patch that sent "logout" to the ICS on a fatal error backfired when
the 'fatal error' was a disconnect, and caused a crash on Mac. We now
suppress sending of this "logout" command in the disconnect case,
communicated in a kludgy way (by requesting exit status 6666).

8 years agoDefer book faking input move until ping balance
H.G.Muller [Thu, 28 Jul 2016 12:24:27 +0000]
Defer book faking input move until ping balance

The use of ping after editing a position had broken the book handling:
'go' would be sent in the same batch of commands as this 'ping', so that
in case of a book hit the book move selected on behalf of the engine
would be fed back to XBoard before the engine had the opportunity to
restore the ping balanceby sending 'pong'. Now the book move is fed
through ScheduleDelayedEvent(DeferredBookMove) rather than instantly,
when a MachineWhite/BlackEvent sets the engine playing.

8 years agoFix setting up btm positions with 'edit'
H.G.Muller [Tue, 26 Jul 2016 20:04:14 +0000]
Fix setting up btm positions with 'edit'

The kludge to put black on move through a2a3 only works when there is
a (normally moving) Pawn on a2. Otherwise the 'black' command has to be
used. But this did take the engine out of force mode. So now we send
another 'force' command after this 'black'.

8 years agoFix bare King adjudication
H.G.Muller [Fri, 22 Jul 2016 07:12:36 +0000]
Fix bare King adjudication

The increase of the number of piece types to 66 gave the BlackKing code
131, wich is > 127, so that using a signed char for it makes it < 0.
This cause the black King in the adjudication code to be seen as a white
piece. When black then checkmates with 2 pieces, only 1 piece is seen
(Q), and then assumed to be a bare King! Now the piece value is passed
through an (int) to prevent this.

8 years agoFix check testing in games without King
H.G.Muller [Sun, 17 Jul 2016 21:53:17 +0000]
Fix check testing in games without King

A position without King was always considered as in check (because of
Atomic), which is rather illogical and undesirable in games where no
King participates (as it makes every move illegal).

8 years agoFix disambiguating Pawn moves in Xiangqi
H.G.Muller [Sun, 17 Jul 2016 21:14:10 +0000]
Fix disambiguating Pawn moves in Xiangqi

When multiple Pawns can go to the same square a move written as to-square
only is interpreted as the forward push, rather than a sideway move.

8 years agoFix King leaving Palace in Xiangqi
H.G.Muller [Sun, 17 Jul 2016 21:06:19 +0000]
Fix King leaving Palace in Xiangqi

The rewrite of the move generator had overlooked this.

8 years agoFix compile error Xaw build
H.G.Muller [Mon, 16 May 2016 20:21:36 +0000]
Fix compile error Xaw build

The variable initialSquareSize was not defined in the Xaw build,
and now has been moved to dialogs.h (which is part of both builds).

8 years agoupdates NEWS, Changelog, DIFFSTAT and SHORTLOG
Arun Persaud [Sun, 15 May 2016 17:15:38 +0000]
updates NEWS, Changelog, DIFFSTAT and SHORTLOG

8 years agoupdated po/pot files
Arun Persaud [Sun, 15 May 2016 17:05:40 +0000]
updated po/pot files

8 years agonew version number for release 4.9.0
Arun Persaud [Sun, 15 May 2016 17:03:04 +0000]
new version number for release 4.9.0

8 years agoForgotten header for previous patch
H.G.Muller [Thu, 12 May 2016 13:49:26 +0000]
Forgotten header for previous patch

8 years agoAbbreviate DATADIR to ~~ while saving XB themes
H.G.Muller [Tue, 10 May 2016 19:52:56 +0000]
Abbreviate DATADIR to ~~ while saving XB themes

The path name of theme files is typically quite long in XBoard, where
installed data is very deep in the file-system tree. This path is now
recognized, and replacend by its abbreviation ~~ when storing a theme
in the -themeNames option.

8 years agoFix crash on too-long theme definitions
H.G.Muller [Tue, 10 May 2016 18:46:49 +0000]
Fix crash on too-long theme definitions

Long file names for texture and pieces could make theme definitions
so long as to overflow the buffers used to hold them. The buffer
size is now doubled.

8 years agoFix debris after click-click explosion near board edge
H.G.Muller [Tue, 10 May 2016 18:29:37 +0000]
Fix debris after click-click explosion near board edge

The redrawn grid was not exposed for board edges a knight's jump
away from an explosion square after a click-click capture in variant
atomic. This was due to the smartness in preventing overlapping
exposures of neighboring square, deferring the task to expose the grid
to squares that were beyond the edge. Now all squares in the explosion
range are exposed including grid.

8 years agoFix highlights clearing when highlight last move off
H.G.Muller [Tue, 10 May 2016 18:26:56 +0000]
Fix highlights clearing when highlight last move off

When moves are not highlighted, the selected piece still is. But
this highlight should be erased after the move.

8 years agoFix redrawing of pieces dragged off board (bug #47888)
H.G.Muller [Tue, 10 May 2016 17:42:09 +0000]
Fix redrawing of pieces dragged off board (bug #47888)

The board was not redrawn after a piece was dragged off board,
leaving the piece 'invisibly' in its original position, and also
leaving the target squares marked.

8 years agoDescribe new Edit menu items in texi file
H.G.Muller [Mon, 9 May 2016 05:36:39 +0000]
Describe new Edit menu items in texi file

8 years agoAdd Mute all Sounds menu XB
H.G.Muller [Mon, 9 May 2016 05:08:18 +0000]
Add Mute all Sounds menu XB

XBoard now also has a menu item to mute all sounds (except the Play
button in the Sounds dialog) at the topof the Options menu, like WinBoard.

8 years agoDescribe use of blue highlights in protocol specs
H.G.Muller [Sun, 8 May 2016 18:04:36 +0000]
Describe use of blue highlights in protocol specs

The function of 'blue' markers, and the role of the 'choice' command
in this is explained in the CECP specs.

8 years agoFix forgetting 'choice' command after promotion
H.G.Muller [Sun, 8 May 2016 17:35:10 +0000]
Fix forgetting 'choice' command after promotion

The promotion restriction specified by a 'choice' command is now reset
at the start of every new move, so that future promotion moves won't
use it too. In addition,the 'choice' command is ignored when legality
testing is on.

8 years agoFix description of Tournament Options in texi file
H.G.Muller [Sun, 8 May 2016 12:39:18 +0000]
Fix description of Tournament Options in texi file

Some headers were not exactly equal to the dialog texts because of typos,
frustrating the help clicks. And matchPause was not described at all.

8 years agoFix multi-leg promotions
H.G.Muller [Sat, 7 May 2016 21:33:35 +0000]
Fix multi-leg promotions

Two-leg promotions were sent as gibberish to the engine (and thus
rejected). It was also pretty annoying that XBoard's own idea of
what should be promotions was still applied even when highlighting
denied promotions (because the zone was different than assumed, or
a promotion-on-entry rule applies). Now the legality markers from
the GUI move generator are different from the red and yellow markers
from an engine highlight command, and the latter are taken as a denial
of promotion, and will suppress it.

8 years agoErase markers before processing highlight FEN
H.G.Muller [Sat, 7 May 2016 20:10:34 +0000]
Erase markers before processing highlight FEN

Markers from the Betza generator were only half-heartedly erased when
a color-FEN camein through a highlight command, because FENs tend to
skip empty squares in stretches. This was already fixed for the legal[][]
array, but now it is fixed for the markers itself as well.