xboard.git
13 years agoUpdate texi file for new menu organization
H.G. Muller [Mon, 29 Nov 2010 08:58:00 +0000]
Update texi file for new menu organization

The descriptions are shuffled around and organized into sections
corresponding to the new main menus. Where necessary the name of the
items was changed to their new names. The items removed from the File
menu (the next/previous/same stuff) are nowmoved to the section "other
shortcut keys", as the key bindings for some of them are still active.

13 years agoUpdate info on key bindings in texi file
H.G. Muller [Mon, 29 Nov 2010 08:06:14 +0000]
Update info on key bindings in texi file

The texi file was still listing the old XBoard key bindings. Where
necessary this is now changed to the new (WinBoard) bindings, and all
the new bindings were added.

13 years agoAdd XBoard key bindings for Revert and Truncate
H.G. Muller [Mon, 29 Nov 2010 08:04:53 +0000]
Add XBoard key bindings for Revert and Truncate

Use Home key as accelerator for Revert, End for Truncate, as in WinBoard.

13 years agoDivorce the Edit and Show Tags/Comment menu items
H.G. Muller [Sun, 28 Nov 2010 22:12:14 +0000]
Divorce the Edit and Show Tags/Comment menu items

In WinBoard the items in the Edit and View menu for Tags and Comment now
have different IDs, so they can be independently controlled. Only the
items in the View menu are check-marked. The items still do the same.

13 years agoAlter WinBoard menu text
H.G. Muller [Sun, 28 Nov 2010 22:08:26 +0000]
Alter WinBoard menu text

The texts are slightly adapted, mostly by choosing more convenient
tabbing characters for the new menu organization. The translation
template is updated accordingly.

13 years agoLet move-history window scroll to bottom after adding move
H.G. Muller [Sun, 28 Nov 2010 19:24:46 +0000]
Let move-history window scroll to bottom after adding move

By activating the scrollbar of the viewport through XtCallActionProc
the move-history window is scrolled to the bottom.

13 years agoFix Shogi promotion popup
H.G. Muller [Sat, 27 Nov 2010 13:38:14 +0000]
Fix Shogi promotion popup

The texts were adapted to shogi by printing new text items over the
Queen and Knight buttons, but these did not alwys cover it. Now the text
on the buttons is changed as it should be. Also the window title is
adapted.

13 years agoApply gettext macros to menu texts
H.G. Muller [Fri, 26 Nov 2010 10:22:06 +0000]
Apply gettext macros to menu texts

Now texts and references are separated, the texts in the tables can be
decorated with the N_() macro, so that the _() macro no longer has to be
applied when they are used. (This makes the texts appear in the .po
files.)

13 years agoAdapt some XBoard menu texts
H.G. Muller [Fri, 26 Nov 2010 10:12:58 +0000]
Adapt some XBoard menu texts

The "Show" prefix is removed from the "View" menu items, as this seems
implied. An ellipsis is added to the Engine #N Settings items, which
could not be there before, because periods in a menu name would break
any reference to it. For some other names the ellipsis was deleted.
(These were not refered to, but who knows what we will do in the future.)

13 years agoSeparate menu text from menu name in XBoard
H.G. Muller [Fri, 26 Nov 2010 10:03:35 +0000]
Separate menu text from menu name in XBoard

The text string in the menu-definition tables was used both for the menu
text, as well as for referencing the items from the code (for enabing or
checkmarking). Now these can be defined separately, so that altering the
menu texts is possible without breaing any references to the item.
(Moving them to another menu would still break XBoard, though!)
Currently the texts and names are still the same.

13 years agoBugfix XBoard menu translation
H.G. Muller [Fri, 26 Nov 2010 09:48:54 +0000]
Bugfix XBoard menu translation

The gettext macro N_() was applied to the menu definition tables, but
this would break any translation, as these items are both used as menu
texts as well as reference for enabling and checkmarking. The routines
that create the menus already apply _() dynamically to these items when
they are used as menu texts.

13 years agoRestrict drops in variant seirawan to back rank
H.G. Muller [Fri, 26 Nov 2010 09:10:55 +0000]
Restrict drops in variant seirawan to back rank

Drops aren't really llowed at all in Seirawan Ches, but there exists an
engine that supports a variant where drops on the back-rank are allowed.

13 years agoLet Analyze File annotate the loaded game
H.G. Muller [Thu, 25 Nov 2010 18:44:37 +0000]
Let Analyze File annotate the loaded game

By not suppressing the auto-play loop in AnalyzeFle mode, we step
through the game while the engine is analyzing, and store the PV info
that the engine produces, as well as the full PV (as variation comment)
with each move.

13 years agoRevive Analyze File menu item in WB
H.G. Muller [Thu, 25 Nov 2010 18:41:05 +0000]
Revive Analyze File menu item in WB

We will keep this menu after all, becase it can be given a new meaning.

13 years agoFix spurious scores in comments
H.G. Muller [Thu, 25 Nov 2010 18:31:52 +0000]
Fix spurious scores in comments

The comment popup is also used to display engine PV info, but when the
contents of the window is written back when we select a variation,
it was treated as a real comment. This is fixed now by checing in
ReplaceComment() if the comment starts with the PV info, and if so,
ignore the latter. This solves the problem, but I guess the real bug is
that selecting a variation tries to write the comment even if it did not
change.

13 years agoDisplay error for wrong use of Machine Match
H.G. Muller [Thu, 25 Nov 2010 18:26:34 +0000]
Display error for wrong use of Machine Match

13 years agoReorganize XBoard menus
H.G. Muller [Wed, 24 Nov 2010 12:30:08 +0000]
Reorganize XBoard menus

13 years agoReorganize WinBoard menus
H.G. Muller [Wed, 24 Nov 2010 10:02:19 +0000]
Reorganize WinBoard menus

New main menus Edit, View and Engine are added; the step menu
disappears. The menu items are redistributed over the new menus.
Sometimes duplicates are created. No adaptation of short-cut characters
as made yet (as this affects translation).

13 years agoremoved trailing whitespaces from NEWS
Arun Persaud [Sun, 21 Nov 2010 04:20:27 +0000]
removed trailing whitespaces from NEWS

13 years agomerged readme_HGM.txt into the NEWS file
Arun Persaud [Sun, 21 Nov 2010 04:19:30 +0000]
merged readme_HGM.txt into the NEWS file

seems like a better place for the release notes, although those releases where not officially part of GNU, but the NEWS file already covers similar releases, so it might as well cover all of them.

13 years agotypo in date of developer release
Arun Persaud [Sun, 21 Nov 2010 02:24:19 +0000]
typo in date of developer release

but will leave the tagged version as it is, since it's still a unique version number

13 years agonew developer release
Arun Persaud [Sun, 21 Nov 2010 02:11:01 +0000]
new developer release

13 years agoadded latest version of parser.c
Arun Persaud [Sun, 21 Nov 2010 02:12:41 +0000]
added latest version of parser.c

13 years agoupdated Changelog, etc for developer release
Arun Persaud [Sun, 21 Nov 2010 02:05:56 +0000]
updated Changelog, etc for developer release

13 years agoRevert "adding gnu-readline support"
Arun Persaud [Sun, 21 Nov 2010 00:22:00 +0000]
Revert "adding gnu-readline support"

This reverts commit c95ef32a700132a134f335f857ca6f1b6f3c169f.

Conflicts:
backend.c

better to use the (relatively) new ICS input box then add readline support.

13 years agoRevert "bugfix: fixed readline support with icslogon option"
Arun Persaud [Sun, 21 Nov 2010 00:19:32 +0000]
Revert "bugfix: fixed readline support with icslogon option"

This reverts commit b9cdd7422ad1037d7376bce4f8f2db2669396e83.

Conflicts:
backend.c

better to use the (relatively) new ICS input box then add readline support.

13 years agoMake Hoplite moves irreversible in Spartan Chess
H.G. Muller [Fri, 19 Nov 2010 22:10:35 +0000]
Make Hoplite moves irreversible in Spartan Chess

Consider Lance moves in variant Fairy (where the Lance represents the
Spartan Hoplite Pawn) as Pawn moves, so they reset the 50-move counter.

13 years agoGive Lance moves of Amazon in variant super
H.G. Muller [Fri, 19 Nov 2010 20:09:24 +0000]
Give Lance moves of Amazon in variant super

Now that Lance is no longer a wild-card piece the moves of Amazon must
be programmed explicitly, to keep the possibbilty to play Superchess
with legality testing on.

13 years agoChange representation of Bede in variant fairy initial position
H.G. Muller [Fri, 19 Nov 2010 17:32:16 +0000]
Change representation of Bede in variant fairy initial position

This used to be Lance, but the promoted Bishop (Dragon Horse)
is more applicable. Especially now that Lance is supposed to move like a
Berolina Pawn.

13 years agoMake yyskipmoves also suppress examining of drop moves
H.G. Muller [Fri, 19 Nov 2010 17:28:19 +0000]
Make yyskipmoves also suppress examining of drop moves

Not sure if this does any good, but it seemed illogical that this would
happen in all other moves, but not drops.

13 years agoDefine moves for Dragon Horse outside Shogi
H.G. Muller [Fri, 19 Nov 2010 17:23:05 +0000]
Define moves for Dragon Horse outside Shogi

Let it move like Bishop + Wazir + Dababba.

13 years agoFix safety crash when appending comments
H.G. Muller [Wed, 17 Nov 2010 12:40:20 +0000]
Fix safety crash when appending comments

The length limit imposed on safeStrCpy was one too short when copying
an existing comment to the space allocated for the longer (concatenated)
one. It allowed no space for the terminating '\0'.

13 years agoFix safeStrCpy
H.G. Muller [Wed, 17 Nov 2010 12:38:00 +0000]
Fix safeStrCpy

The test for when to terminate a non-fiting string was one off, and the
debug message was written stdoutin stead of debugFP.

13 years agoFix default holdings size for variant seirawan
H.G. Muller [Tue, 16 Nov 2010 11:40:31 +0000]
Fix default holdings size for variant seirawan

The holdings for 7 pieces werealways considered an overrule, so that the
variant name was prefixed with "8x8+7_".

13 years agoFix home-dir crash
H.G. Muller [Mon, 15 Nov 2010 10:36:21 +0000]
Fix home-dir crash

When confronted with a path name starting with ~ and not containing a /
XBoard would segfault.

13 years agoFix one-click moving on up-click
H.G. Muller [Sun, 14 Nov 2010 20:45:55 +0000]
Fix one-click moving on up-click

(First) up-clicks were not always ignored: in Edit-Game mode with
one-click moving enabled this could lead to a capture being made on
the down-click, and the recapture on the correspoding up-click.
This has now been corrected, and only the down-click of a first click
can lead to selecting a piece or a one-click move.

13 years agofixed buffer size for snprintf
Arun Persaud [Tue, 16 Nov 2010 02:15:40 +0000]
fixed buffer size for snprintf

13 years agoAccept Seirawan-style gating suffixes
H.G. Muller [Sat, 13 Nov 2010 22:04:14 +0000]
Accept Seirawan-style gating suffixes

The parser rules were extended to accept / as an equivalent of = in
promotion-suffix notation (e.g. Nf3/H in stead of Nf3=H).

13 years agoUse Falcon and Alfil as built-ins for Seirawan chess
H.G. Muller [Sat, 13 Nov 2010 21:55:32 +0000]
Use Falcon and Alfil as built-ins for Seirawan chess

Where available (size 49 and 72) we use Falcon for Archbishop and Alfil
for Chancelor, to better conform to the Seirawan names Hawk and Elephant.

13 years agoImplement entering gating moves with mouse
H.G. Muller [Sat, 13 Nov 2010 19:02:31 +0000]
Implement entering gating moves with mouse

A move with a back-rank piece that starts when a piece in the holdings
is selected will be interpreted as a gating move in variant seirawan.
The front-end uses a 'gatingPiece' selected this way todisplay it on the
from square during animate dragging.

13 years agoImplement variant seirawan
H.G. Muller [Sat, 13 Nov 2010 17:56:15 +0000]
Implement variant seirawan

Set upthe position, including Hawk and Elephant in holdings, in
InitPostion(). Suppress putting captured pieces in holding. Let
promoChar indicate gating in ApplyMove(). Remove gated pieces from
the holdings there. Let GenLegal() generate RxK-type castlings to act as
base for gating on Rook square. Gatings are tested for legality
based on the holdings content and whether they occur on the back
rank. Disambiguate() also tests this. Make sure the gated pieces are
printed as move suffixes in CoordsToAlgebraic().

13 years agoAdd -variant seirawan to menu
H.G. Muller [Sat, 13 Nov 2010 17:42:27 +0000]
Add -variant seirawan to menu

13 years agoFix acceptance of null-move with legality testing off
H.G. Muller [Sat, 13 Nov 2010 21:52:09 +0000]
Fix acceptance of null-move with legality testing off

A second click on the same piece was interpreted as a to-square rather
than deselection of the piece.

13 years agoFix one-click bug
H.G. Muller [Sat, 13 Nov 2010 21:49:43 +0000]
Fix one-click bug

Disambiguate was imagining captures, so an only capture by double
clicking your own piece did not always work.

13 years agoFix mouse-driver buglet
H.G. Muller [Sat, 13 Nov 2010 19:08:32 +0000]
Fix mouse-driver buglet

The highlights were not cleared on moves that went vertically off board.

13 years agoList some undocumented commands as compliant
H.G. Muller [Fri, 12 Nov 2010 16:17:41 +0000]
List some undocumented commands as compliant

The engine->GUI commands setboard and setup are now always printed in
the debug file as well.

13 years agoList Hint with compliant commands
H.G. Muller [Fri, 12 Nov 2010 16:05:22 +0000]
List Hint with compliant commands

This command was omitted, so that in some -engineDebugOutput modes it
would not appear in the debug file.

13 years agoRestrict use of escape expansion
H.G. Muller [Fri, 12 Nov 2010 16:02:53 +0000]
Restrict use of escape expansion

Only expand escape sequences like \n and \t in telluser(error) comamnds
that ask for it by preficing the messages by double backslash. Otherwise
backward copatiblity is too severely broken for messages that display
DOS-style filenames.

13 years agoMake safeStrCpy safe
H.G. Muller [Fri, 12 Nov 2010 12:56:33 +0000]
Make safeStrCpy safe

SafeStrCpy was causing a lot of out-of-bound write accesses, as it was
always writing the character at the length limit of the destination.
Now no memory is accessed that is is not needed to hold the copy.

13 years agoAllow clicked name internal to the icsMenu command string
H.G. Muller [Sun, 7 Nov 2010 20:37:10 +0000]
Allow clicked name internal to the icsMenu command string

A command in the /icsMenu that was specified to contain the selected
text or clicked word always appended this word at the end. Now the user
can also configure it to appear in the middle, by putting a %s in the
command string where he wants it to appear.

13 years agoLet Engine #2 Settings start second engine
H.G. Muller [Sun, 7 Nov 2010 20:33:19 +0000]
Let Engine #2 Settings start second engine

If the second engine is not yet running, it would be impossible to use
the settings dialog for it, as the features have not been received and
the dialog will be empty. So the user could not adjust the engine
parameters before starting a match. Using this menu now automatically
starts the engine, and delays the appearence of the popup untill the
features are received, using a similar mechanism as in
TwoMachinesEventIfReady().

13 years agoNewly lexed parser.c
H.G. Muller [Mon, 1 Nov 2010 18:40:26 +0000]
Newly lexed parser.c

13 years agoFix bug in parsing illegal Pawn captures
H.G. Muller [Sat, 6 Nov 2010 18:55:31 +0000]
Fix bug in parsing illegal Pawn captures

When a pawn move of type exf5 was illegal, the parser made an attempt to
interpret it as e.p. capture of f5. This, however, messed up the move,
so that it was now permanently mistaken for e5xf6. Even in cases with
legality testing off, where you would want the original move to be
accepted despite the fact that it was illegal.

13 years agoKeep last PV while clearing engine-output display
H.G. Muller [Sat, 6 Nov 2010 18:49:45 +0000]
Keep last PV while clearing engine-output display

When ponder is on, the display is cleared immediately when the last line
of thinking output appears by the appearing ponder output. So you would
never get the chance to see it. This line is now re-written after
clearing, so it appears at the bottom of the output for the next search.

13 years agoGive Lance moves of Berolina Pawn
H.G. Muller [Sat, 6 Nov 2010 18:45:18 +0000]
Give Lance moves of Berolina Pawn

In stead of using it as a wildcard piece, the Lance gets the moves of
the Berolina Pawn (straight capture, diagonal move). The initial double
osh can be a ump, though. (So it is really a Hoplite Pawn from Spartan
Chess.)

13 years agoUse SAN even on illegal moves
H.G. Muller [Sat, 6 Nov 2010 18:42:16 +0000]
Use SAN even on illegal moves

If there is only one piece of type T, moves like Ta1 or Txa1 are never
ambiguous, so adding the from square is just cumbersome.

13 years agoUse normal SAN for wildcard pieces
H.G. Muller [Sat, 6 Nov 2010 18:34:53 +0000]
Use normal SAN for wildcard pieces

SAN often can also be used with pieces we don't know the moves of, e.g.
if there is only one of that type. We just always get rank or file
disambiguators if there are more (even when they might be unnecessary).

13 years agoFix some warnings
H.G. Muller [Sat, 6 Nov 2010 13:52:12 +0000]
Fix some warnings

Unused variables were removed from parser.l

13 years agoAllow arbitrary nesting of sub-variations in PGN input
H.G. Muller [Sat, 6 Nov 2010 13:43:54 +0000]
Allow arbitrary nesting of sub-variations in PGN input

The parsing of subvariations is moved out of the state-machine parsing,
to allow arbitrary nesting. In stead of the entire sub-variation being
parsed by lex as Comment, it now returns Open and Close for the
corresponding parentheses, which are then handled in a wrapper routine
for yylex(): Myylex(). Problem was that yy_text is supposed to return
the entire parsed text of the returned symbol, which thus has to be
collected. To make this possible, yylex has to return everything that it
parses, (even white space!), and a symbol "Nothing" was added to return
in parsing rules that before just ate away irrelevant text without
returning anything.

13 years agoImplement setup (engine-GUI) command
H.G. Muller [Sat, 6 Nov 2010 20:48:47 +0000]
Implement setup (engine-GUI) command

This allows the frst engine (when legality testing is off) to overrule
the default opening position, in reply to the variant command. Syntax is
"setup (PIECE_TO_CHAR_TABLE) FEN_STRING"
where the FEN string is interpreted in the context of the given
pieceToCharTable (which is optional, and only delimeted by parethesis if
it is present).
Sendng the position to the second engine is delayed until the first
engine has responded to the ping after the new-game sequence, to make
sure it gets the chance to alter the position before it is sent to the
second engine. This feature is useful for playing variants that WinBoard
does not even know the opening positon for, and can be used even if they
are shuffle variants.

13 years agoRestrict use of a2a3 kludge
H.G. Muller [Sat, 6 Nov 2010 13:19:56 +0000]
Restrict use of a2a3 kludge

The kudge to send "a2a3" in stead of "black" to get black to move is
fatally flawed in varants that have no Pawn on a2. So in that case we
revert to use of the deprecated "black" command.

13 years agoRemember values set by -firstOptions, -secondOptions
H.G. Muller [Tue, 2 Nov 2010 12:06:58 +0000]
Remember values set by -firstOptions, -secondOptions

When an engine announces its option features, and the option name
matches that of a setting given in -first/secondOptions, the engine is
sent hte specified value, but this value was not remembered as current
value (but the latter  was left at the engine-announced default),
leading to inconsistent behavior in the Engine #N Settings dialog.

13 years agoMake test for valid promotion piece color-dependent
H.G. Muller [Mon, 1 Nov 2010 18:26:19 +0000]
Make test for valid promotion piece color-dependent

This is needed to make it work in variants where white and black have
different armies; quite likely white will promote to pieces that do not
exist in the black army, so we really have to make sure we test if the
white (upper-case) piece exists in this case.

13 years agoRemove validity test on promochar from parser
H.G. Muller [Mon, 1 Nov 2010 18:23:43 +0000]
Remove validity test on promochar from parser

The backend routines Disambiguate() and LegalityTest() will catch
invalid promotions, so no need to do it here.

13 years agoAdd the actual size-33 Shogi bitmaps
H.G. Muller [Sun, 31 Oct 2010 22:37:06 +0000]
Add the actual size-33 Shogi bitmaps

These were forgotten in the original commit that fixed the .rc file.

13 years agoDelete some stale promotion code
H.G. Muller [Sun, 31 Oct 2010 12:20:08 +0000]
Delete some stale promotion code

The correction of the promotion piece to Ferz in Shatran-like variants
in ApplyMove() was no longer needed, as the new promotion code already
does this in the move parser.

13 years agoAugment moves of some fairy pieces
H.G. Muller [Sun, 31 Oct 2010 12:08:52 +0000]
Augment moves of some fairy pieces

To get better disambiguation in variants that have to be played with
legality testing off, the Elephant is given also one-step moves (making
it a so-called Modern Elephant) in -variant fairy and great. The Dragon
King (Crowned Rook), which had no moves defined for it outside Shogi at
all, has been given Rook moves plus an orthogonal 2-jump, so that it
can get SAN moves when used as Dababba or Short Rook. (Illegal moves
currently aways force long algebraic notation...)

13 years agoBugfix safeStrCpy patch, WinBoard
H.G. Muller [Mon, 8 Nov 2010 21:57:56 +0000]
Bugfix safeStrCpy patch, WinBoard

The use of sizeof on pointers was detected through the same method as
the previous patches, this time while compiling WinBoard. A typo in
jaws.c was fixed as well.

13 years agoBugfix for safeStrCpy patch for XBoard
H.G. Muller [Mon, 8 Nov 2010 22:03:13 +0000]
Bugfix for safeStrCpy patch for XBoard

By a trick (temporarily redefining safeStrCpy in common.h as
((char*) (a=1/(4-3rdArgument))) ) a compile-time warning (division by 0)
could be generated for every occurrence where the size argument was equal
to 4, i.e. where the 1st argument was likely a pointer rather than an
array. These cases are now fixed. The file xoptions.c, which is the
only ne that does not #include common.h had to be fixed by making
the #define in the file itself.

13 years agoFix spurious promotions with legality testing off
H.G. Muller [Sun, 31 Oct 2010 12:16:01 +0000]
Fix spurious promotions with legality testing off

The recent promotion patch had broken playing without legality testing
completely: without legality testing one always gets the piece that was
asked for, but a NULLCHAR should not be taken as a request for a piece!
But it was, and this resulted in any moved piece turning into a white
Pawn! For true promotions the piece was always black, which was also not
very useful.

Also revert to the use of '+' as internal Shogi promoChar, because
pre-processing turns out not to be possible when reading a game file.
In stead parse any trailing '+' on moves as promoChar. Downside: '++'
can no longer be recognized as checkmate symbol.

13 years agoMake deferral default in Shogi promotions
H.G. Muller [Fri, 29 Oct 2010 20:54:18 +0000]
Make deferral default in Shogi promotions

Because '+' is intercepted by the parser as check indicator, Shogi moves
are pre-processed to change a trailing '+' into an internally used
alternative '^'. The testing if a promotion character is OK is now done
in LegalityTest() and Disambiguate(), which return ImpossibleMove when
the character does not correspond to any piece, and IllegalMove when in
Shogi anything other than '^' or '=' is used. (Except for the ICS
notations.) On output, in CoordsToComputerAlgebraic() and
CoordsToAlgebraic(), the '^' is translated back to '+'.

13 years agoAnimate piece explosions in drag-drop moves and in XB
H.G. Muller [Thu, 28 Oct 2010 15:51:34 +0000]
Animate piece explosions in drag-drop moves and in XB

This required some code restructuring: the decision if an explosion is
needed is now taken in a new routine Explode() in the backend. This then
calls the front-end driver, and it returns the info if there was an
explosion or not, so the caller (AnimateMove() or the mouse driver) can
take action to repair the damage to the board caused by the blast wave.
A front-end driver for XBoard is provided as well, so that both
click-click (and replay, which is the same) and drag-drop atomic
captures are animated in XB as well as WB.
Explosions on rejected moves are suppressed.

13 years agoSuppress promotion popup if piece will explode
H.G. Muller [Thu, 28 Oct 2010 11:53:51 +0000]
Suppress promotion popup if piece will explode

In atomic, a Pawn capture to last rank is not really a promotion.
Fix choice to Queen.

13 years agoMake Knight hop first straight, then diagonal
H.G. Muller [Thu, 28 Oct 2010 16:42:25 +0000]
Make Knight hop first straight, then diagonal

It used to be the other way around, which looked pretty illogical in
Xiangqi: to see Horses, which are blockable pieces there, move over an
occupied square.

13 years agoLet -oneClickMove also work in EditGame mode
H.G. Muller [Wed, 27 Oct 2010 18:04:01 +0000]
Let -oneClickMove also work in EditGame mode

There is really no reason why people that lke one-clcik moves enough to
switch them on would not want to use them too when editing a game.
This solves a nast inconsistency, as before it used to work in -ncp mode
on the _first_ move, as the mode is then BeginningOfGame, and not yet
EditGame, and we do want it to work for BeginningOfGame, as this is
also the game mode when you start playing as white.

13 years agoMake -flipBlack and -allWhite option volatile
H.G. Muller [Wed, 27 Oct 2010 17:40:22 +0000]
Make -flipBlack and -allWhite option volatile

As these options are very Shogi specific, and the variant is volatile,
it seems logical to make them also volatile. Not completely sure about
-allWhite, though. It cold be useful if you want, for example, to play
wth dark-brown pieces for black, as any color but black looks much
better with outline pieces than with solid pieces.

13 years agoProvide some sample board-texture pixmaps
H.G. Muller [Wed, 27 Oct 2010 17:33:44 +0000]
Provide some sample board-texture pixmaps

Wood and marble themes are provided as textures for light and dark
squares, plus two complete Xiangqi boards (wood and evenly colored).
These should probably not goint the distro tar ball.

13 years agoThe -overrideLineGap option is made to work in XBoard
H.G. Muller [Wed, 27 Oct 2010 17:25:56 +0000]
The -overrideLineGap option is made to work in XBoard

Although XBoard already allowed this in the -boardSize specification,
it is still seful to globally disable grid lines, e.g. for an
oriental Xiangqi board. And it converges XB and WB.

13 years agoImplement board textures in XBoard
H.G. Muller [Wed, 27 Oct 2010 17:18:41 +0000]
Implement board textures in XBoard

The -darkBackTextureFile and -liteBackTextureFile options now wrk in
XBoard too, for loading a pixmap that will be used to cut out the dark
and light square backgrounds. The cutting algorithm is such that the
pixmap image is completely restored if the size was that of the total
board (e.g. a drawing of a Xiangqi board).

13 years agoComplete WB (western) bitmaps for Shogi at size 33
H.G. Muller [Wed, 27 Oct 2010 10:11:02 +0000]
Complete WB (western) bitmaps for Shogi at size 33

The Lance was not replacing Queen in some sizes where the bitmaps were
already available, and new bitmaps for the promotion Golds were added.

13 years agoMake starting new variation dependent on shift key
H.G. Muller [Fri, 22 Oct 2010 18:30:06 +0000]
Make starting new variation dependent on shift key

The shift key is read during mouse events, and posted in a global
variable, which can then be used by the back-end. The decision to start
a new variation (pushing the game tail rather than clipping it off) when
entring a move in Edit Game or Analyze mode is made dependent on this.
The move-typein also records the shift-key state.

13 years agoFix merging bug
H.G. Muller [Fri, 22 Oct 2010 18:25:06 +0000]
Fix merging bug

A %g format was used to print an int in sending the level command,
because decimal points were dropped when merging patches. Also an unused
variable was removed to suppress a warning.

13 years agoAdd set of shogi pixmaps for XBoard
H.G. Muller [Mon, 18 Oct 2010 17:50:09 +0000]
Add set of shogi pixmaps for XBoard

The -size 64 pieces from gShogi (and originally XShogi) are made
suitable for loading by XBoard, through redefining the transparent
background color as either light or dark square color. These bitmaps are
not included in the XBoard build, and perhaps should not even be
included in the source distribution, but made available in a separate
distribution?

13 years agoImplement -flipBlack in XBoard
H.G. Muller [Mon, 18 Oct 2010 17:46:33 +0000]
Implement -flipBlack in XBoard

When -flipBlack is true, the white and back piece pixmaps are swapped in
flipView. The idea is that the black pieces are upside-down versions of
the white (Shogi) pieces, so that swapping white and black in effect
turns all pieces upside down, which is what should happen in flipView.

13 years agoDisable some very verbose debug printing
H.G. Muller [Mon, 11 Oct 2010 19:06:41 +0000]
Disable some very verbose debug printing

The internationalization seems debugged enough to do without them.

13 years agoAdd option -variations to control variation-tree walking
H.G. Muller [Mon, 11 Oct 2010 18:52:10 +0000]
Add option -variations to control variation-tree walking

Just so that users can switch it off if the find it annoying.

13 years agoAllow full promotion suffixes on SAN piece moves
H.G. Muller [Mon, 11 Oct 2010 19:01:00 +0000]
Allow full promotion suffixes on SAN piece moves

This facilitates the parsing of (non-standard) Shogi moves in ICS
protocol. It can also be useful for Seirawan Chess, where a future
implementation of it can use promotion suffixes to indicate gating.

13 years agoAllow lower-case piece indicator in drop-move notation
H.G. Muller [Mon, 11 Oct 2010 12:07:02 +0000]
Allow lower-case piece indicator in drop-move notation

As it seems that XBoard also sends such moves in zippy play, it seems
more fair to recognize them from the engine as well.

13 years agoFix bug in ICS variant switch for Shogi
H.G. Muller [Sun, 10 Oct 2010 19:26:11 +0000]
Fix bug in ICS variant switch for Shogi

Because a test for 8x8 variants was done by <= VariantShogi,
rather than <, spurious move-list fetching occurred in Shogi.

13 years agoFix WinBoard Lance bug
H.G. Muller [Sun, 10 Oct 2010 19:23:09 +0000]
Fix WinBoard Lance bug

The choice between Lance and Queen was made on appData.variant, in stead
of gameInfo.variant. Because of this it was not always up-to-date in ICS
games.

13 years agoAdapt WinBoard to Shogi implementation on Variant ICS
H.G. Muller [Sun, 10 Oct 2010 19:15:06 +0000]
Adapt WinBoard to Shogi implementation on Variant ICS

The Variant ICS does not use the '+P' notation for promoted pieces,
neither in the board, nor in SAN, but simply indicates any Gold by 'G',
and uses 'H' and 'D' for +B  and +R. The Shogi promotion code in
LegalityTest() and Disambiguate(), which are used in move Parsing, are
adapted to handle this. Deferred promotions sent to the ICS now use an
== suffix.

13 years agoInherit promoted-info that ICS does not give from previous board
H.G. Muller [Sun, 10 Oct 2010 19:07:18 +0000]
Inherit promoted-info that ICS does not give from previous board

The ICS does not tell us in Crazyhouse (or Shogi) if a piece is
primordial or a promoted pawn (or a promoted other piece). We now derive
this info from the previous board. The option -disguisePromotedPieces
controls this feature.

13 years agoLimit multi-session clock handling to non-ICS games
H.G. Muller [Sun, 10 Oct 2010 19:03:29 +0000]
Limit multi-session clock handling to non-ICS games

In ICS games a time forfeit crashed XBoard, apparently because the
fullTimeControl string is not properly set when we try to use it to see
if a sudden-death session is indeed the last session.

13 years agoChange evalgraph scale in drop games
H.G. Muller [Fri, 8 Oct 2010 09:47:34 +0000]
Change evalgraph scale in drop games

Score swings tend to be much larger in Crazyhouse and Shogi, so the
vertical rangee in those games is doubled to (-14, 14).

13 years agobugfix: fixed readline support with icslogon option
Arun Persaud [Thu, 14 Oct 2010 06:05:05 +0000]
bugfix: fixed readline support with icslogon option

The icslogon option sends the login and password, so we don't need to handle
special cases for the readline buffer.

13 years agofixed some typos that were introduced during the sprintf->snprintf changes
Arun Persaud [Fri, 8 Oct 2010 03:35:26 +0000]
fixed some typos that were introduced during the sprintf->snprintf changes

13 years agoFix uninitialized variable in book code
H.G. Muller [Thu, 7 Oct 2010 09:59:33 +0000]
Fix uninitialized variable in book code

The variable ' power' was used uninitialized in case -bookVariation was
set to 0, which can be an error even if it was only multiplied by zero.

13 years agoFix menu translation bug
H.G. Muller [Wed, 6 Oct 2010 12:20:03 +0000]
Fix menu translation bug

The menuText array was declared too small, so that the last entry of the
File menu got out of bounds and was overwritten by the first of the Mode
menu.

13 years agoAllow -timeIncrement to be a float
H.G. Muller [Tue, 5 Oct 2010 19:14:08 +0000]
Allow -timeIncrement to be a float

The increment can now be fractional seconds. The printing in
ParseTimeControl() and SendTimeControl() is done with %g format, so that
for integer increment there is backward compatibility with the old level
command.

13 years agoadding gnu-readline support
Arun Persaud [Wed, 31 Mar 2010 03:24:49 +0000]
adding gnu-readline support

should make the user interface for xboard a bit nicer. In the end we want to have a separate input window, but this probably will have to wait until the GTK version.