From: H.G.Muller Date: Mon, 18 Apr 2016 10:30:15 +0000 (+0200) Subject: Create new (empty) branch for board themes X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=b10966961672512a212cc61192d0b08cf91c4c0c;hp=e147dd97d26b46902200491dbe0a8755266555d3;p=xboard.git Create new (empty) branch for board themes --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c9e73f0..0000000 --- a/.gitignore +++ /dev/null @@ -1,75 +0,0 @@ -*~ -*.o -.deps/ -Makefile -Makefile.in -aclocal.m4 -autom4te.cache/ -cmail -./config.h -config.log -config.status -configure -copyright.info -config.h.in -depcomp -mdate-sh -missing -./parser.c -po/*gmo -po/POTFILES -po/stamp-po -stamp-h -stamp-h1 -stamp-vti -texinfo.tex -version.texi -xboard -xboard.info -xboard.man -ylwrap -config.guess -config.h -config.sub -copyright.aux -copyright.cp -copyright.dvi -copyright.fn -copyright.ky -copyright.log -copyright.pg -copyright.tp -copyright.vr -parser.c -xboard.aux -xboard.cp -xboard.cps -xboard.fn -xboard.ky -xboard.log -xboard.pdf -xboard.pg -xboard.toc -xboard.tp -xboard.vr - -# gettextize -f files -ABOUT-NLS -config.rpath -m4/gettext.m4 -m4/iconv.m4 -m4/lib-ld.m4 -m4/lib-link.m4 -m4/lib-prefix.m4 -m4/nls.m4 -m4/po.m4 -m4/progtest.m4 -po/Makefile.in.in -po/Makevars.template -po/Rules-quot -po/boldquot.sed -po/en@boldquot.header -po/en@quot.header -po/insert-header.sin -po/quot.sed -po/remove-potcdate.sin diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index f19c6ff..0000000 --- a/AUTHORS +++ /dev/null @@ -1,270 +0,0 @@ -Contributions of xboard and WinBoard authors by file -(get files names via git log --pretty=oneline --name-only --author= v4.2.7..HEAD |sort |uniq) - -0. Files covered - -The first group are included in the xboard distribution. The second -group are included in the WinBoard source distribution but not in the -xboard distribution. All are part of the joint xboard/WinBoard source -base and are covered by the same copyrights and licensing terms. - -AUTHORS -autogen.sh -backend.c -backend.h -backendz.h -bitmaps/* -book.c -ChangeLog -childio.c -childio.h -cmail.in -cmail.man -common.h -config.h.in -configure.ac -COPYING -COPYRIGHT -engine-intf.txt -FAQ.html -frontend.h -gamelist.c -gettext.h -ics-parsing.txt -INSTALL -lists.c -lists.h -Makefile.am -moves.c -moves.h -NEWS -parser.h -parser.l -pgntags.c -pixmaps/* -po/* -README -shogibitmaps/* -sounds/* -ToDo -uci.c -xboard.c -xboard.h -xboard.texi -xedittags.c -xedittags.h -xengineoutput.c -xgamelist.c -xgamelist.h -xhistory.c -xhistory.h -xoptions.c -zic2xpm.c -zic2xpm.man -zippy.c -zippy.h -zippy.README - -winboard/bitmaps/* -winboard/COMPILING -winboard/config.h -winboard/defaults.h -winboard/help/* -winboard/help.c -winboard/help.h -winboard/jaws.c -winboard/makefile.gcc -winboard/makefile.ms -winboard/parser.c -winboard/resource.h -winboard/shogibitmaps/* -winboard/WB4Jaws.dev -winboard/wclipbrd.c -winboard/wclipbrd.h -winboard/wedittags.c -winboard/wedittags.h -winboard/wengineo.c -winboard/wevalgraph.c -winboard/wgamelist.c -winboard/wgamelist.h -winboard/whistory.c -winboard/winboard.c -winboard/winboard.h -winboard/winboard.rc -winboard/winboard.rtf (compiles to winboard.hlp) -winboard/wlayout.c -winboard/woptions.c -winboard/woptions.h -winboard/wsettings.c -winboard/wsnap.c -winboard/wsnap.h -winboard/wsockerr.c -winboard/wsockerr.h - - -1. Wayne Christopher - -Wrote from scratch (I believe) bitmaps.xchess/*80*.bm. Other bitmaps -in the bitmaps.xchess directory were derived from these by shrinking -and some hand-tuning. By default these bitmaps are no longer used. -Their copyright status is unclear. - -2. Chris Sears and Dan Sears - -Wrote from scratch parser.l, xboard.c, xboard.h, xboard.man. Parts -(sometimes small) of these files were later moved by Tim Mann to -backend.c, backend.h, childio.c, common.h, frontend.h, and parser.h. - -Chris and Dan's original work is copyrighted by Digital Equipment -Corporation with licensing terms similar to what the X Consortium uses -(see the file COPYRIGHT). All the work listed below is copyrighted by -the Free Software Foundation and covered by the GPL (see the files -COPYRIGHT and COPYING). - -3. Tim Mann - -Wrote from scratch FAQ.html, backendz.h, childio.h, comment.in, -config.h.in, configure.in, engine-intf.txt, ics-parsing.txt, moves.c, -moves.h, pgntags.c (split from backend.c by Jochen Wiedmann), -xedittags.c, xedittags.h, xgamelist.c, xgamelist.h, zippy.README, -zippy.c, zippy.h, winboard.rtf, config.h, defaults.h, resource.h, -wedittags.c, wedittags.h, wgamelist.c, wgamelist.h, winboard.c, -winboard.h, winboard.rc. - -Major additions and changes to nearly all other files listed in -section 0. - -4. John Chanak - -Addition to xboard.c, mostly later moved into backend.c. - -5. Evan Welsh - -Wrote from scratch cmail.in and cmail.man. Additions to backend.c and -xboard.c. - -6. Elmar Bartel - -Wrote from scratch the Metafont code from which bitmaps/* were -generated. The Metafont code itself is not included in the package. - -7. Jochen Wiedmann - -Wrote from scratch gamelist.c, lists.c, lists.h. Wrote xboard.texi, -mostly based on xboard.man and cmail.man. Minor additions to backend.c. - -8. Frank McIngvale - -Wrote from scratch zic2xpm.c and zic2xpm.man. Additions to backend.c, -xboard.c, and xboard.man. - -9. Hugh Fisher - -Additions to backend.c and xboard.c. - -10. Allessandro Scotti - -Made many additions to the WinBoard user interface and graphics -capabilities, such as new windows for engine output, board textures -and font-based piece rendering. These changes became collectively known -as Winboard_x. - -change to: backend.c, backend.h, backendz.h, bitmaps/analyze_14.ico, -bitmaps/analyze2_14.ico, bitmaps/baloon_14.ico, bitmaps/black_14.ico, -bitmaps/clock_14.ico, bitmaps/ponder_14.ico, bitmaps/trans_14.ico, -bitmaps/unknown_14.ico, bitmaps/white_14.ico, common.h, config.h, -frontend.h, gamelist.c, lists.c, lists.h, moves.c, moves.h, parser.c, -parser.h, pgntags.c, readme.htm, uci.c, winboard/defaults.h, -winboard/resource.h, winboard/wclipbrd.c, winboard/wclipbrd.h, -winboard/wedittags.c, winboard/wedittags.h, winboard/wengineoutput.c, -winboard/wevalgraph.c, winboard/wgamelist.c, winboard/wgamelist.h, -winboard/whistory.c, winboard/winboard.c, winboard/winboard.h, -winboard/winboard.ini, winboard/winboard.rc, winboard/wlayout.c, -winboard/woptions.c, winboard/woptions.h, winboard/wplugin.c, -winboard/wplugin.h, winboard/wsnap.c, winboard/wsnap.h, zippy.c, -zippy.h - - -11. H.G. Muller - -Heaviliy modified winboard.c, backend.c, moves.c and parser.l, to -allow board sizes other than 8x8, and many non-orthodox Chess pieces, -so that WinBoard is now capable of playing variants like Shogi and Xiangqi. -Also implemented displaying of the Crazyhouse holdings, and many adjudication -and other backend options. This version of WinBoard, (4.3.xx) containing all -of the WinBoard_x options, became known as WinBoard_F. - -changes to: acconfig.h, aclocal.m4, AUTHORS, backend.c, backend.h, -backendz.h, bitmaps/*, book.c, childio.h, cmail.in, common.h, -config.guess, config.h, config.h.in, config.sub, configure, -configure.ac, configure.in, copyright.texi, engine-intf.html, -FAQ.html, frontend.h, gamelist.c, ics-parsing.txt, install-sh, -lists.c, lists.h, Makefile.am, Makefile.in, manual.html, -mkinstalldirs, moves.c, moves.h, parser.c, parser.h, parser.l, -pg_key.c, pgntags.c, pg_show.c, pixmaps/*, pxboard, README, READ_ME, -readme_HGM.txt, shiphtml, shogibitmaps/*, texi2man, ToDo, uci.c, -winboard/bitmaps/*, winboard/config.h, winboard/cygwin.mak, -winboard/defaults.h, winboard/help.c, winboard/help/*, -winboard/internationalize, winboard/jaws.c, winboard/jaws.h, -winboard/jaws.rc,winboard/language.txt, winboard/makefile.gcc, - winboard/makefile.ms, winboard/metascript.txt, winboard/parser.c, -winboard/readme.txt, winboard/resource.h, winboard/shogibitmaps/*, -winboard/wchat.c, winboard/wclipbrd.c, winboard/wclipbrd.h, winboard/wedittags.c, -winboard/wedittags.h, winboard/wengineo.c, winboard/wengineoutput.c, -winboard/wevalgraph.c, winboard/wgamelist.c, winboard/wgamelist.h, -winboard/whistory.c, winboard/winboard.c, winboard/winboard.h, -winboard/winboard.htm, winboard/winboard.ini, winboard/winboard.rc, -winboard/winboard.rtf, winboard/wlayout.c, winboard/woptions.c, -winboard/woptions.h, winboard/wplugin.c, winboard/wplugin.h, -winboard/wsettings.c, winboard/wsnap.c, winboard/wsnap.h, xboard.c, -xboard.h, xboard.texi, xedittags.c, xedittags.h, xengineoutput.c, -xgamelist.c, xgamelist.h, xhistory.c, xhistory.h, xoptions.c, zippy.c, -zippy.h, zippy.README - -also: worked on the installer files (not in the tar-ball, but available via Savannah) - -12. Arun Persaud - -changes to: acconfig.h, AUTHORS, autogen.sh, backend.c, backend.h, -backendz.h, book.c, ChangeLog, childio.c, childio.h, cmail.in, -common.h, config.h.in, configure.ac, COPYING, COPYRIGHT, -copyright.texi, FAQ.html, frontend.h, gamelist.c, gettext.h, -.gitignore, gpl.texinfo, ics-parsing.txt, INSTALL, install-sh, -lists.c, lists.h, Makefile.am, moves.c, moves.h, NEWS, parser.c, -parser.h, parser.l, pgntags.c, pixmaps/pixmaps.h, po/de.po, -po/LINGUAS, po/Makefile.in.in, README, READ_ME, shogibitmaps/README, -texi2man, ToDo, TODO, uci.c, uci/uci_protocol.txt, winboard/bitmaps/bitmaps.h, -winboard/wchat.c, winboard/config.h, winboard/defaults.h, -winboard/jaws.c, winboard/parser.c, winboard/readme.txt, -winboard/shogibitmaps/README, winboard/WB4Jaws.dev, -winboard/wclipbrd.c, winboard/wclipbrd.h, winboard/wedittags.c, -winboard/wedittags.h, winboard/wengineo.c, winboard/wengineoutput.c, -winboard/wevalgraph.c, winboard/wgamelist.c, winboard/wgamelist.h, -winboard/whistory.c, winboard/winboard.c, winboard/winboard.h, -winboard/winboard.rc, winboard/wlayout.c, winboard/woptions.c, -winboard/woptions.h, winboard/wsnap.c, winboard/wsnap.h, -winboard/wsockerr.c, winboard/wsockerr.h, xboard.c, xboard.h, -xboard.texi, xedittags.c, xedittags.h, xengineoutput.c, xgamelist.c, -xgamelist.h, xhistory.c, xhistory.h, xoptions.c, zic2xpm.c, -zic2xpm.man, zippy.c, zippy.h, zippy.README - - -13. Eric Mullins - -Makefiles for different compilers for windows, several changes for -those compilers - -change to: AUTHORS, backend.c, backend.h, backendz.h, -common.h, frontend.h, gamelist.c, README, winboard/bcc32.cfg, -winboard/borland.mak, winboard/COMPILING, winboard/config.h, -winboard/cygwin.mak, winboard/help.c, winboard/help.h, -winboard/jaws.c, winboard/makefile.gcc, winboard/makefile.ms, -winboard/mingw32.mak, winboard/msvc7.mak, winboard/msvc.mak, -winboard/resource.h, winboard/res/winboard.exe.manifest, -winboard/WB4Jaws.dev, winboard/wevalgraph.c, winboard/winboard.c, -winboard/Winboard.dev, winboard/winboard.dsp, winboard/winboard.dsw, -winboard/winboard.h, winboard/winboard.ini, winboard/winboard.rc, -winboard/woptions.c, winboard/wsettings.c, -xboard.c - -also: prepared installer files for winboard (not in the tar-ball, but available via Savannah) diff --git a/COPYING b/COPYING deleted file mode 100644 index 94a9ed0..0000000 --- a/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/COPYRIGHT b/COPYRIGHT deleted file mode 100644 index 10aa927..0000000 --- a/COPYRIGHT +++ /dev/null @@ -1,56 +0,0 @@ -XBoard -- a graphical chessboard for X - -Original authors: Dan Sears and Chris Sears -Enhancements (Version 2.0 and later): Tim Mann - -Copyright 1991 by Digital Equipment Corporation, Maynard, -Massachusetts. - -Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, 2007, -2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. - -Enhancements Copyright 2005 Alessandro Scotti - - -XBoard's alternative piece bitmaps (bitmaps.xchess) are derived from the -bitmaps in the XChess program, which was written and is copyrighted by -Wayne Christopher. - -The following terms apply to Digital Equipment Corporation's copyright -interest in XBoard: ------------------------------------------------------------------------- -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. ------------------------------------------------------------------------- - -The following terms apply to the enhanced version of XBoard distributed -by the Free Software Foundation: ------------------------------------------------------------------------- -GNU XBoard is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU XBoard is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see http://www.gnu.org/licenses/. * ------------------------------------------------------------------------- diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 500bdd4..0000000 --- a/ChangeLog +++ /dev/null @@ -1,18806 +0,0 @@ -ChangeLog for XBoard/WinBoard ------------------------------ - -(latest entries created by git log --no-merges --pretty="%ai %an <%ae>:%n%s%n%n%b" vlast.. ) - -2014-10-24 00:04:22 -0700 Joshua Pettus : -removed gtk theme from OSX app - -2014-10-23 23:33:18 +0200 H.G.Muller : -Add persistent Boolean option -fixedSize - -When set, this option suppresses sizing of the board and clocks when -the window is sized by the user. This is achieved by wrapping the entire -dialog in a non-expanding hbox. - -2014-10-23 21:23:14 +0200 H.G.Muller : -Also do dual-royal test in variant shogi - -For the benefit of Sho Shogi we also have to be prepared to find a -Crown Prince in variant shogi, so it can be used as a parent variant -for Sho Shogi with legality testing on. - -2014-10-23 16:22:54 +0200 H.G.Muller : -Fix promotion in Betza move generator - -The Betza move generator was geenrating allmoves as NormalMove, but in -that case XBoard would not allow the move to have a promotion suffix. -Now Pawns and Lances reaching last rank will be assumed to promote. - -2014-10-22 13:06:25 +0200 H.G.Muller : -Attempt to make GTK sizing work with tiling WM - -The Rezise routine now takes the size of the entire dialog table -(for me always equal to the outer-window size), and checks if the -actual outer window is smaller. If it is, it shrinks the board to fit, -under the assumption that a tiling window manager offers only a limited -'viewport' to our dialog, and we want everything to be visible inside that. - -2014-10-22 11:04:47 +0200 H.G.Muller : -Fix -xbuttons window width GTK - -Because Label options not followed by a SAME_ROW element were only -packed into the first two columns of the dialog table, the board window -reserved space for a third column behind the message window if there -was no button bar. - -2014-10-21 20:37:41 -0700 Arun Persaud : -mac: only use gtk compile flag, if osxapp is enabled - - -2014-10-21 22:40:39 +0200 H.G.Muller : -Prevent unknown variant getting button in -ncp mode - -Normally we fake the engines play the requested variant, for the benefit -of engines that do not send a variants feature (e.g. v1 engines). But this -should not be done if there is no engine, as it would lead XBoard to -believe an unknown variant name is an engine-defined variant supported -by a currently loaded engine, and create a button for it in the New Variant -dialog. - -2014-10-21 22:07:09 +0200 H.G.Muller : -Fix variant-name recognition - -StringToVariant did recognize whether the name to recognize had suffuxes -compared to the tabulated name, but not if it had prefixes. So 'shoshogi' -would be recognized as 'shogi'. - -2014-10-21 21:52:21 +0200 H.G.Muller : -Suppress duplicat autoInstalls - -If the engine line constructed for -autoInstall already occurs in -the engine list, we should not install it again. - -2014-10-21 18:41:03 +0200 H.G.Muller : -Base new square size on board widget allocation GTK - -No longer pay attention to the size of the top-level window, but base -everything on the size of the board widget itself. - -2014-10-21 13:45:51 +0200 H.G.Muller : -Ignore first configure event - -The first configure event will be the one that adds the window decorations -to the board window, and must not be used to calculate a new square size, -but to expand the outer window instead. - -2014-10-21 11:35:21 +0200 H.G.Muller : -Let GTK dialogs open with actual-size Graph widgets - -The Graph Option size values are now uses as size_request, to give -proper dialog sizing at popup. But the size_request is then reset -so that free sizing by the user becomes possible. - -2014-10-19 13:16:43 +0200 H.G.Muller : -Fix display of Spin Options with negative range - - -2014-10-17 21:35:25 -0700 Arun Persaud : -line numbers in PO got updated - - -2014-10-17 21:23:47 -0700 Arun Persaud : -updated ChangeLog, DIFFSTAT and SHORTLOG - - -2014-10-17 21:17:56 -0700 Arun Persaud : -updated NEWS - - -2014-10-17 21:17:28 -0700 Arun Persaud : -forget a few __APPLE__ ifdefs; changed to OSXAPP - - -2014-10-17 00:01:44 -0700 Arun Persaud : -fix typo and prefix - -AC_PREFIX_DEFAULT was always set, even if AS_IF didn't get called? Some kind of caching? -Using just prefix=... seems to work though - -2014-10-16 23:34:22 -0700 Arun Persaud : -USE OSXAPP instead of APPLE and fix withval->enableval in AC_ARG_ENABLE - - -2014-10-16 21:44:33 +0200 H.G.Muller : -Fix loading of engine-defined PGN games - -Somehow there could be disagreement over what the official opening -position of an engine-defined variant was during loading of the game. -It then refused Betza-defined castling, which tests the corner pieces -based on this initial position. We now assume the FEN tag, which such -a PGN game will always contain, holds the official opening position, -so that castling will always be assumed possible (if there is a corner -piece). - -2014-10-16 20:29:27 +0200 H.G.Muller : -Preserve parent variant for PGN of engine-defined game - -Rather than decoding an unknown variant name, (which will result in -'normal'), we keep the currently set (parent) variant when an -engine-defined variant is currently set that matches the name in -the PGN variant tag of the loaded game. - -2014-10-16 17:54:13 +0200 H.G.Muller : -Fix some uninitialized variable bugs - -The writing of Seirawan castling rights in FEN was still dependent on a -now unused variable, and encountering a VariantMen tag in a PGN file -could have created the misconception the memory was full. - -2014-10-16 17:41:01 +0200 H.G.Muller : -Update Game List after tag selection changed - -When the Game List Options dialog changes the tags to be displayed in -the Game List lines, we now automatically redo the entire Game List. - -2014-10-16 16:38:00 +0200 H.G.Muller : -Always accept piece commands in variant great - -Great Shatranj belongs to the variants XBoard does not know the rules of, -and should thus always accept engine piece commands. - -2014-10-15 21:28:36 -0700 Arun Persaud : -make all tests for strings in configure use the same scheme - - -2014-10-15 21:23:26 -0700 Arun Persaud : -updated Changelog, DIFFSTAT, and SHORTLOG - -2014-10-15 21:06:36 -0700 Arun Persaud : -fix osxapp enable option in configure.ac - - -2014-10-15 21:06:00 -0700 Arun Persaud : -remove experimental from gtk build option - - -2014-10-15 21:02:38 -0700 Arun Persaud : -only enable osxapp build target on apple systems, clean up configure.ac a tiny bit - - -2014-10-15 20:57:28 -0700 Arun Persaud : -update NEWS file - - -2014-10-15 23:48:14 +0200 H.G.Muller : -Don't switch to engine-defined variant on game loading - -When loading a game from PGN the variant tag will have been decoded as -'normal' in case of an engine-defined variant, and we certainly would -not want to switch to that. Better stay in the variant the user had -selected before, and hope for the best. - -2014-10-15 21:50:44 +0200 H.G.Muller : -Implement displaying of variant tag in Game List - -The variant tag was displayed as an empty string in game-header lines. -Processing it during PGN load was not able to handle engine-defined -variants anyway; they were recognized as 'normal'. A new field in the -GameInfo struct now holds variantName in text form, and this is the -primary place from which it is displayed in the Game List. - -2014-10-15 21:06:53 +0200 H.G.Muller : -Update Game List when setting new Game List Tags - -Using the Game List Tags dialog to alter the gae header lines now -automatically causes an update of the Game list according to the new -tags specification. - -2014-10-15 20:26:31 +0200 H.G.Muller : -Reset move entry on Clear Board - -The board markers would stay on when the board was cleared, and a -no-longer-present piece would stay selected, leading to deletion of the -first piece that you tried to select. - -2014-10-14 09:38:05 +0200 H.G.Muller : -Split Tournament dialog in side-by-side panes - -This seems to cure a sickness in some Xaw versions, which refused -to display text in the text widgets, or make them sensitive for mouse -clicks if the last three buttons were added. It also helps keeping -the 'OK' button on-screen in the GTK version. - -2014-10-12 19:43:24 +0200 H.G.Muller : -Remember position obtained from setup - -When the engine sends a setup command, it should be remembered as -initialPosition, in order for the castling 'rook' test of the Betza -move generator to work. - -2014-09-13 12:35:12 -0700 Joshua Pettus : -Add build script to configure for a XBoard.app for OS X - -This relies on the the gtk build and adds some special code in -gtk/xboard.c so that XBoard can be installed inside the app directory -independ on where the app file is located. - -2014-10-12 10:09:51 -0700 Arun Persaud : -replaced hardcoded pngdir with built-in ~~ - -don't need to create xboard.conf from xboard.conf.in anymore - -2014-10-12 00:18:50 +0200 H.G.Muller : -Some improvement on new Shogi SVG pieces - - -2014-10-11 10:55:41 -0700 Arun Persaud : -updated spanish, ukranian, and dutch translation - - -2014-10-11 19:42:03 +0200 H.G.Muller : -Fix logos Xaw - -The patch for logo standard left a typo and an excess line in the Xaw -version. This is fixed, and also implements the user-logo cascade for -the Xaw version. - -2014-10-11 19:26:23 +0200 H.G.Muller : -Try also /home//.logo.pgn for user logo - -The user logo now also has a cascade, first looking in the user's home -folder for a file .logo.png, and then in the -logoDir for .png. - -2014-10-11 16:38:03 +0200 H.G.Muller : -Fix ICS logo display - - -2014-10-10 18:14:09 +0200 H.G.Muller : -Show current variant on New Variant buttons GTK in bold - -If an engine-defined variant is selected, we compare its name to the -inscription on the button, otherwise we compare the variant numbers. -(Test to trigger this is a bit awkward, to not inadvertantly apply it -to the ICS Text Menu, which also has colored buttoms.) - -2014-10-10 17:01:51 +0200 H.G.Muller : -Increase number of engine-defined-variants Buttons XB - -An third column is added to the New Variant dialog when necessary. - -2014-10-09 23:25:26 +0200 H.G.Muller : -Force GTK logo size to quarter board width - -This is what GTK will do anyway, because clocks and logos are in a hbox -that equally divides space, so telling XBoard different just misinforms it. - -2014-10-09 17:08:45 +0200 H.G.Muller : -Replace default Shogi pieces - -The SVG Shogi pieces are replaced by a new set, made by Joshua Pettus. -This set also contains and Elephant and Crown Prince. - -2014-10-09 09:35:33 +0200 H.G.Muller : -Implement new logo standard - -XBoard now looks in the system directories for plugin logos, -/usr/(local/)share/games/plugins/logos, according to the cascade --logoDir, engine dir (-fd,-sd), /usr/local/..., /usr/... - -2014-10-09 08:47:25 +0200 H.G.Muller : -Relocate OS X' LOCALEDIR - - -2014-10-08 21:56:28 +0200 H.G.Muller : -Fix check test with multi-leg moves - -The check test after a multi-leg move was still using the same kill -square in the opponent's reply, making it blind to King captures in -a second leg. So far we got away with that because the Shogi multi-leg -pieces also can reach all their potential victims in a single step, -but with engine-defined multi-leg moves there is no guarantee this -will always be the case. - -2014-10-08 21:55:17 +0200 H.G.Muller : -Fix infinite loop in cylinder moves - - -2014-10-07 19:13:54 +0200 H.G.Muller : -Let t on final leg in Betza notation forbid checking - -To allow approximate definition of pieces that are too difficult to -describe exactly, we can revoke their capture rights on Kings, -to prevent imagined moves that happen to threaten a King forces the -opponent to evade this imagined check, making most of his moves illegal. -Then the piece can be safely replaced by an upward-compatible one, -leaving rejection of the extra moves to the engine. - -2014-10-07 18:56:59 +0200 H.G.Muller : -Implement Betza hr and hr as chiral move sets - -To easily separate right- and left-handed moves on oblique atoms -(which needs opposite use of l and r in their multi-leg continuations), -the direction sets hr and hl are added. - -2014-10-07 08:20:06 +0200 H.G.Muller : -Preserve other Betza mode bits on setting default modality - - -2014-10-06 20:20:00 +0200 H.G.Muller : -Switch to new Betza orth-diag conversion standard - -The interconversion from orthogonal to diagonal atoms is now possible -for any 4-way atom, based on specification of an 'in-between' direction, -irrespective of modality. Also take backward out of default continuation -direction-set. - -2014-10-03 10:31:47 +0200 H.G.Muller : -Implement Betza t modifier for hop-own - -The 't' modifier will restrict any form of hopping as specified by -p or g modifiers to friendly pieces. This only works on non-final legs. - -2014-10-02 19:32:45 +0200 H.G.Muller : -Implement directional modifiers on KQ, and let y&g upgrade - -The Betza y and g modifiers now not only change range, but also upgrade -the directional capabilities of the atom to full non-degenerate 8-fold. -Directional modifiers can now be used in that symmetry too, to maximally -exploit this, and implement 4-fold pieces that make 45-degree turns. -Let oblique continuation legs also use the non-degenerate system. - -2014-10-02 15:19:09 +0200 H.G.Muller : -Implement Betza y modifier - -The non-standard modifier 'y' is the spontaneous counterpart of 'g', -changing the range of the atom, and upgrading its directionality. - -2014-10-02 10:21:43 +0200 H.G.Muller : -Implement Betza g modifier for non-final legs - -The g modifier is implemented as a p that turns a rider into the -corresponding leaper when it hops, and vice versa. This is done by -stripping off any existing range indicator, and making the range -infinite by suffixing '0' when the old range was 1 (whether implied -or explicitly written). Except that for sliders/steppers this is done -by atom-name conversion after stripping off the range. Limited range -thus in general turns into leaper (D -> D0, Dn -> D), but with FWK -W3 -> R and R3 -> W, etc. - -2014-10-01 15:32:14 +0200 H.G.Muller : -Implement Betza a modifier - -This is pretty complex, and might overload the current primitive two-leg -legality testing when pieces are defined that can reach squares only in -two legs. - -2014-10-01 09:28:32 +0200 H.G.Muller : -Implement Betza j on W,F as skip first square - - -2014-10-04 21:56:14 +0200 H.G.Muller : -Always accept piece commands for Falcon and Cobra - -The wild-card pieces Falcon and Cobra do not have any moves assigned to -them, and XBoard would accept any move for them even when legality -checking is on. So for these pieces it is always better to trust the -engine's piece definition. - -2014-10-04 21:52:51 +0200 H.G.Muller : -Fix pieceToCharTable of Falcon Chess - -This variant was using the Falcon piece, but defining ID F for the -unused Lance instead. - -2014-10-04 19:59:13 +0200 H.G.Muller : -Don't preserve setup position on board-size change - -Normally the setup command sent by an engine is ignored if the user -already has set up a position, to not render it impossible to do the -latter. But if the setup command orders a different board size nothing -the user has set up can possibly remain valid. - -2014-10-04 19:39:06 +0200 H.G.Muller : -Reset move entry on stepping through game - -A forward or backward step through the game after selecting a from-square -did not erase the latter, so that it became impossible to select a -from-square for an opponent move, as it would be interpreted as the -to-square for the patially entered move. This was especially annoying -with legality testing off, as the legality test there, based on the -square markings, does not reset the entry state either, but waits -until you do click a legal to-square, so that you had to attempt -moving with pieces of the side not to move to get out of this state. -Now stepping through another position will reset the move-entry state -completely, always considering the first click a from-square selection. - -2014-10-07 20:55:00 +0200 H.G.Muller : -Fix engine-defined variant as startup - -Non-standard names were all recognized as 'normal' in InitBackend1(). -Now if the -variant argument was not "normal", it is assumed to be an -engine-defined variant if we run with engine. - -2014-10-07 18:53:50 +0200 H.G.Muller : -Fix clipping of board GTK - -ResizeBoardWindow now measures the with of the window dressing by -brute force, interrogating GTK both for the width of the top-level -window and the board widget, and subtracting the two. - -2014-10-08 18:28:09 +0200 H.G.Muller : -Fix writing of Seirawan960 virginity in FEN - -When variant seirawan was played with Fischer castling, only the -castling rights were written, and not the virginity of other pieces. -Now all virgin files are dumped in Shredder-FEN style. - -2014-09-29 21:07:17 -0700 Arun Persaud : -update po/pot files - - -2014-09-29 21:00:42 -0700 Arun Persaud : -new version number for release 4.8.0 - - -2014-09-13 14:33:37 -0700 Arun Persaud : -fixed whitespace error in configure.ac for os x - - -2014-09-20 10:06:17 -0700 Arun Persaud : -update gettext configuration to not include any generated files in git - -before we had a somewhat mixed setup, which seems to create problems -when a different gettext version was installed on the users machine compared -to the version used to generate the files in git. This should solve -the problem. The user will now have to generate these files using autopoint, -which we call from autogen.sh. - -2014-09-28 22:19:00 +0200 H.G.Muller : -Configure XBoard for -size 49 in master settings - -Now the code for auto-sizing works, it turns out this does more harm than -good in the GTK build, as it takes maximum size that fits the screen as -initial size, and the board window then cannot be shrunk below that. -So we configure a hard -size 49 for a cold startup. - -2014-09-28 21:27:22 +0200 H.G.Muller : -Implement ff etc. in Betza parser - -Dupliacated directional modifiers can be needed with oblique moves -to unambiguously specify a direction set, e.g. ffrrN. - -2014-09-28 13:40:13 +0200 H.G.Muller : -Rename PGN Pieces tag to VariantMen - -Following a suggestion from Steven Edwards, this indeed makes a much -clearer name. Also add code to skip the tag on reading, rather than -allowing it to end up with the 'extra tags', as the latter could lead -to duplication of the tag on subsequent saves. - -2014-09-28 11:18:10 +0200 H.G.Muller : -Suppress use of promo-Gold bitmaps in Tori Shogi (WB) - -In Tori Shogi the Swallow Pawn does not promote to Tokin, so the use -of a Gold General pictogram would only be confusing. So we stick to -the regular fairy bitmaps in Tori, which is recognized by the board -having 7 ranks in Shogi. - -2014-09-28 10:55:10 +0200 H.G.Muller : -Prevent board-size oscillations - -It could happen that after resize there was room for enlarging the -squares by one pixel, but that this crossed the boundary where the line -gaps also become wider, and there is no room for making both squares -and line gap. This would cause perpetual oscillations of the window size. -Resizing is now suppressed when a 1-pixel square-size increase would also -result in a line-gap increase. - -2014-09-28 10:09:17 +0200 H.G.Muller : -Allow use of second-row pieces for non-promoted in drop games - -Second-row pieces were automatically demoted on capture, but this -should really happen only when the piece-to-char table says it is a -shogi-promoted piece (assigned a '+' there). Pieces assigned a letter -should really stay themselves. - PieceToNumber had to be adapted to skip '+' pieces in order to count -correctly for second-row pieces, as did the code in UserMoveEvent() that -mapped the from-square onto the piece type. (Why do we do that anyway? -The piece type was displayed on the from-square!) - -2014-09-26 20:24:05 +0200 H.G.Muller : -Fix reset of 50-move counter on FRC castling - -The FxR internal representation was taken a bit too seriously! - -2014-09-26 20:15:33 +0200 H.G.Muller : -Fix abort of machine game on variant mismatch - -When the second engine did not support the current variant, and we clicked -Two Machines, there was an error popup, but the Two Machines menu item -stayed checkmarked. Now we explicitly uncheck it, and switch to EditGame -mode. - -2014-09-26 19:47:08 +0200 H.G.Muller : -Make unsupported variant on loading 1st engine non-fatal - -Like in the startup code, when the loaded engine does not play the -currently selected variant, we now figure out what the engine does play, -and switch to that. The error message still pops up, but not non-fatal. - -2014-09-25 23:37:24 +0200 H.G.Muller : -Print PGN Piece tag listing engine-defined pieces - -A newly defined PGN tag is printed, which summarizes all non-standard -pieces. Black copies of identically named white pieces are suppressed. -In the future also non-standard naming should be reported here. - -2014-09-25 19:11:21 +0200 H.G.Muller : -Always accept piece commands in partly supported variants - -Normally piece commands are ignored when legality checking is on, as -XBoard's idea of legality should obviously overrule the engine's. -In variants that are not or only partly supported, however, XBoard has -no own idea of what is legal, so it is better to take the engine's -advice than enforcing wrong rules. - -2014-09-25 12:29:15 +0200 H.G.Muller : -Size seek graph to also cover board rim WinBoard - -The seek graph always used the plain board size, but in WB it is -possible to diplay a rim around the board, and the seekgraph would -then be positioned in the upper-left corner of the rim, leaving the -lower and right board edge and rim uncovered. Its size is now increased -to fill the entire window (as leaving a rim around it seems not useful). - -2014-09-25 11:48:00 +0200 H.G.Muller : -Reparse ambiguous move under built-in rules - -When a move parses as ambiguous under engine-defined piece locomotion, -we re-parse it with XBoard's native idea of the pieces, just in case -it is a move from a game that was saved without the engine having -redefined the pieces. This keeps games created before the introduction -of the 'piece' command loadable. - -2014-09-25 11:14:06 +0200 H.G.Muller : -Prevent multi-path moves from parsing as ambiguous - -In Cylinder Chess the MovesFromString() generator might generate duplicate -moves, one wrapping, the other direct. When they were both counted as -matching the SAN input move, Disambiguate() would think it an ambiguous -move. So a move that came from the same square as the one we already -have must not be counted. - -2014-09-24 21:47:59 +0200 H.G.Muller : -Fix cross-edge e.p. capture in Cylinder Chess - -ApplyMove() did not remove the e.p. victim when an edge-crossing e.p. -capture was made, because e.p. rights are only set to neighboring files -(after checking there is a Pawn there to capture). The e.p. heuristic -has now been changed to also assume e.p. on file-changing Pawn moves -that span a large number of files, assuming that these will be wrapping -moves. Eventually we should change to better e.p. logic that can be -integrated with engine-configured move generation, as the current system -would fail for any Pawn that captures more than just neighbor ranks. - -2014-09-24 19:43:27 +0200 H.G.Muller : -Implement Betza o modifier for cylinder boards - - -2014-09-24 17:02:37 +0200 H.G.Muller : -Improve virginity test for engine-defined pieces - -Two squares in the board are now reserved for flags that indicate -whether back-rank pieces have been touched. This allows MovesFromString() -to accurately test virginity of these pieces, rather than having to assume -it when the piece matches that in the opening position. For other ranks -the latter test is still used, as these are normally (irreversible) Pawns, -which cannot return there (and in drop games, when they would, would again -be considered virgin enough for the purpose of double-pushing!). - -2014-09-24 13:20:31 +0200 H.G.Muller : -Implement Betza p and g modifiers in piece command - - -2014-09-24 08:28:40 +0200 H.G.Muller : -Repair piece defs with showTargetSquares off - -The proxy legality checking based on marking of target square was -rejecting all moves when target squares were not highlighted. - -2014-09-23 21:53:55 +0200 H.G.Muller : -Allow definition of castling in piece command - -Castling is defined by the O atom, with a suffix indicating the number -of steps the King must step in the direction of the corner. Kings keep -their normal castling unless overruled by this. Can currently only be -used on the variant's royal piece, as XBoard's ApplyMove() is not smart -enough to understand displacing the corner piece is implied when it is -used on other pieces. - -2014-09-23 21:49:44 +0200 H.G.Muller : -Update description of piece command in protocol specs - - -2014-09-23 14:52:16 +0200 H.G.Muller : -Improve SAN of Pawn moves and allow Betza e.p. definition - -The move descriptions in 'piece' commands can now use 'i' and 'n' -modifiers to define a blockable double push. ('n' only work for moves -of stride 2!) The test for initial moves now is based on comparison with -the opening position, rather than on a way-to-generous heuristic. (This -still does not prove in generak the piece did not move, though, but it -does for Pawns.) A new 'e' modifier stands for e.p. capture; to implement -this the rank and file of the e.p. square are now stored in the board. -(EP_STATUS was holding the file of the moved Pawn, which in Berolina Chess -is not the file of the e.p. square!) - The generation of SAN moves for Pawns can now reliably distinguish between -captures and non-captures even in Berolina, when the move generator informs -it whether the move was e.p. capture. - -2014-09-22 22:48:50 +0200 H.G.Muller : -Retune -stickyWindows GTK - -This still does not work well, and in particular windows refuse to stick -to the top of the board window. - -2014-09-22 21:59:00 +0200 H.G.Muller : -Fix detection of screen size GTK - -A gdk call that can get the screen without there first being a window -mapped to it is used now. This fixes initial sizing of the board window -on a cold start. - -2014-09-22 21:57:23 +0200 H.G.Muller : -Configure a size for the Eval Graph - -If no size for the Eval Graph window is configured in the master -settings file, the window will pop up as 2x4 pixels. - -2014-09-22 20:39:21 +0200 H.G.Muller : -Prevent crash on specifying non-existent texture XB - -By setting the texture width to 0 when the texture could not be loaded, -XBoard will never attempt to draw it. - -2014-09-22 20:30:50 +0200 H.G.Muller : -Configure some themes in XBoard master settings - -The -themeNames option is set to contain some themes that could be -defined with the default pieces and textures that come with XBoard. - -2014-09-22 18:48:00 +0200 H.G.Muller : -Remove debug printf - - -2014-09-21 16:47:41 +0200 H.G.Muller : -Control Eval Graph with mouse - -Let mousewheel control evalZoom, and right-click toggle between -normal view and differential view ('blunder graph'). - -2014-09-21 16:10:19 +0200 H.G.Muller : -Add extra font field to Option struct - -Storing the font in the textValue field was too kludgy, as this field -is already heavily used in the various Option types, for storing handles, -or defining colors and callbacks. A 'font' field is now added at the end, -so that it can be optionally initialized in the rare case it is needed. - -2014-09-21 13:44:11 +0200 H.G.Muller : -Repair damage done by merging with v4.7.x - - -2014-09-21 08:36:22 +0200 H.G.Muller : -Sort fail lows and fail highs below others - -Every more recent line should always float up aove lines that were -indicated to be fail lows or fail highs through ? or ! PV suffixes. - -2014-09-20 12:58:32 +0200 H.G.Muller : -Describe the new texture conventions in manual - -The exact rules for how textures are scaled in response to their -filename is described in the manual. - -2014-09-19 10:22:14 +0200 H.G.Muller : -Force exactly overlayed texture scaling through filename - -A filename suffix -NxM.png on a texture image will cause XBoard to scale -the image as if it were the image of a complete board of N files and M -ranks, to make the square size equal to that of the current board, -and adjust the cutting parameters such that contiguous squares are cut -out of it. (If the current board format is larger than NxM, the remaining -space will be padded with white!) - If N=M=0, N and M are assumed to correspond to the current board size, -and the bitmap will be scaled to fit the height of the board. - If no suffix is present, the old cut-and-tile algorithm is used. It will -be assumed the texture bitmap is intended for a single square, unless the -pathname contains a file that starts with "xq", in which case it is assumed -that the file contains a Xiangqi board. - -2014-09-18 23:30:09 +0200 H.G.Muller : -Allow two Pawns per file in Tori Shogi - -When the board has 7 ranks it is assumed to be Tori Shogi, and the -requirement for maximally one Pawn per file is relaxed to two. - -2014-09-18 23:08:36 +0200 H.G.Muller : -Test legality even when off if engine defined pieces - -After reception of a piece command XBoard will mark target squares -even when legality testing is off, and now also will require the lifted -piece to land on a marked square (like when the engine highlighted them -through a highlight command). - A problem is that this does not work for drops, as drops do not mark -target squares. So drops are always accepted. Which of course is bad -for Pawn drops. But there really is no way yet for an engine to specify -how pieces can be dropped, similar to the 'piece' command. - -2014-09-17 22:32:43 +0200 H.G.Muller : -Fix texture scaling - - -2014-09-17 13:41:58 +0200 H.G.Muller : -Implement engine-defined pieces - -When legality testing is off, XBoard now listens to 'piece' commands -to redefine its move generator. After such a piece command is received, -target-square marking also can be used when legality testing is off. -The engine keeps in charge of legality testing, though. - Only a very basic version of Betza notation is currently understood for -the move description: mode modifiers have to appear in the order mcd, -and gpz modifiers are ignored. Multi-leg moves as in Betza 2.0 is not -implemented at all. A leading i modifier limits the moves to the first -two ranks, which is no good at all. (But XBoard does not keep track of -which pieces have moved, and this at least would work for Pawns in a -FIDE-like setup, in particular Berolina.) - -2014-09-17 09:44:15 +0200 H.G.Muller : -Scale texture bitmaps that are not large enough - -Texture bitmaps are now sized up by an integer factor to be at least -as large as the board (if they seem intended for a full XQ board, which is -assumed when they are larger than 256x256) or the square. This necessitated -the textures to be re-initialized in InitDrawingSizes whenever the window -size changes. - -2014-09-16 19:04:19 +0200 H.G.Muller : -Ignore color arguments not starting with # - -Old settings files from xpm-using version might still contain color -designations like 'white' or 'red'. Since Cairo would interpret these -as black, it is better to ignore them, so the default color is used. - -2014-09-15 15:30:40 +0200 H.G.Muller : -Implement -autoInstall option - -When -autoInstall is a non-empty string, XBoard will scan the system's -plugin specs directories for UCI and WB protocol, to see if new engines -were added since the last settings save. If so, they are added to the -list of installed engines. - The variants listed in the plugin-spec files are currently ignored, -but the option is already configured to install engines for all variants. - -2014-09-14 22:47:55 +0200 H.G.Muller : -Fix typo - - -2014-09-14 21:41:04 +0200 H.G.Muller : -Make inlined functions static - -Clang apparently chokes on non-static inline functions, -and they were not used from other files anyway. - -2014-09-09 20:29:15 -0700 Arun Persaud : -updated spanish translation, added new polish translation - - -2014-09-13 09:12:54 +0200 H.G.Muller : -Look for logo in engine dir first (GTK) - -When setting engine logos, we look for a file logo.png in the engine -directory, before trying .png in the -logoDir. This is useful -on OS X. Fix bug that checks for existence of -fd/sd rather than -logoDir, -when using the latter (also in Xaw). - -2014-09-11 23:10:59 +0200 H.G.Muller : -Fix checkmarking of OS X menu items - -The routine MarkMenuItem() was moved to xboard.c, where it can see -the OSX-specific #defines, and calls to sync_menu_bar were added -to it, and to EnableNamendMenuItem(). - -2014-09-11 22:48:10 +0200 H.G.Muller : -Fix crash of tournament dialog GTK - -The font/color disambiguation of the Option.textField in Label and -ulti-line TextBox options cannot stand it if unused elements are -initialized as "" rather than NULL. - -2014-09-11 19:17:55 +0200 H.G.Muller : -Let OS X display dock icon - - -2014-09-11 12:41:50 +0200 H.G.Muller : -Fix Xaw button color error - -The textValue field, now also used to indicate font, was used in two -places when popping up buttons, and the font patch only addressed one. - -2014-09-11 10:23:42 +0200 H.G.Muller : -Make SVGDIR a variable - -Replace all occurrences of SVGDIR in the source by svgDir, a char array -that is initialized to SVGDIR, so that it can be altered at run time. -This is needed to make portable apps. Where SVGDIR was used in string -concatenation, the code had to be re-written to use snprintf to do the -concatenation at run time, through a new function LoadIconFile. -The extension of image files used there is now made dependent on the -__APPLE__ switch, so that it can use .png in OS X (which does not seem -to understand SVG icons). - -2014-09-10 21:20:40 +0200 H.G.Muller : -Fix warning in dead code Show - - -2014-09-10 20:49:38 +0200 H.G.Muller : -Reorder variants, to comply with Polyglot book specs - -XBoard's variant number is used as a key to access Polyglot opening -books, and thus cannot be changed without consequences. (As it was when -we introduced ASEAN and Chu Shogi.) - We also renamed Chu Chess to Elven Chess (under which name it is now -described on chessvariants.org). - -2014-09-10 19:52:12 +0200 H.G.Muller : -Reserve piece command in protocol specs - - -2014-09-10 18:54:45 +0200 H.G.Muller : -suppress Alien Edition standard variants - -Variants that are standard in the Alien Edition should not be -recognized as engine-defined variants: the engines that announce -them will not respond with the required setup command, so allowing -the user to select them just leads to trouble. - -2014-09-10 13:51:44 +0200 H.G.Muller : -Fix SetWidgetFont GTK - -This was testing for an empty font spec in the wrong way, with as a side -effect that some pointers to font strings would be interpreted as colors. - -2014-09-10 15:56:59 +0200 H.G.Muller : -Update protocol specs - - -2014-09-09 21:43:39 +0200 H.G.Muller : -Let message field and button bar use GTK -messageFont - -The -messageFont spec (using the default coordFont pixel size, like the -others) is now used to modify the fonts of message field and buttons -in the button bar. They pass a pointer to the appData font variable in -their Option's textField. This conflicts with the use of this field in -buttons for specifying a color, as done in the New Variant buttons. -This is resolved by checking if the first byte of the pointed-to value -is a #. The Xaw version must ignore the textField if it does not -specify a color. - -2014-09-09 20:51:54 +0200 H.G.Muller : -Fix GTK fonts - - -2014-09-09 19:57:52 +0200 H.G.Muller : -Use coordFont default pixel size for other fonts - -The message-font is way too large for the dialogs. A better solution -would be to redo the entire table of SIZE_DEFAULTS in xboard.h, as -this file is front-end-specific anyway. - -2014-09-09 19:39:50 +0200 H.G.Muller : -Use -gameListFont in Game List - -Not implemented in a very generic way, but hacked into the code that -added the handler. There aren't many other listboxes that would need -adjustable font. - -2014-09-09 16:49:18 +0200 H.G.Muller : -Fix Chat window for Xaw build - -The ICS output field and Hide button are removed from the ICS Interaction -window, to make it similar to the old Chat window. This required adding -some tests in the handlers of this window, to prevent segfaults due to -accessing it. - -2014-09-09 15:53:29 +0200 H.G.Muller : -Fix infinite-regression problem on OS X - -Apparently the OpenFile handler can already be called during -gtkosx_application_ready (or gtk_signal_connect), so we have to make -sure 'suppress' is set before we call those. - -2014-09-09 10:47:41 +0200 H.G.Muller : -Correct for .Xresources form->paneA renaming in manual - -In the Xaw build the name of the form widget of dialog.layout.form... -hierarchy was changed to paneA, paneB, ... when allowing multi-pane -dialogs through the Break Option (such as the Engine Output window). - -2014-09-09 10:36:42 +0200 H.G.Muller : -Use GTK fonts in Engine Output and Move History - - -2014-09-08 20:42:11 +0200 H.G.Muller : -Include some conditional OS X fixes - -DATADIR must be corrected to ~~ in the OS X app, and the info command -must be started in a different way. - -2014-09-08 20:12:08 +0200 H.G.Muller : -Fix WB DoEvents error - - -2014-09-08 19:06:35 +0200 H.G.Muller : -Limit auto-extending to click on first move of PV - -Even when auto-exted on clicks on the tail of a PV will no longer cause -any moves to be added to the game. Only clicks on or before the first -move can do that now. - -2014-09-08 16:20:26 +0200 H.G.Muller : -Animate multi-leg in auto-play and forward event - -Replaying multi-leg moves is now also done by animating both legs. -In addition, the highlights are set on final and intermediate square, -rather than from-square. -(There seems to be a great deal of code duplication here. Why doesn't -AutoPlayOneMove simply call ForwardInner?) - -2014-09-08 14:45:51 +0200 H.G.Muller : -Fix key bindings for non-menu functions - -The accelerator keystrokes for next game, previous game and debug mode, -which don't have menu items, and are grouped in the menu table 'noMenu', -were not treated in the building of the translation table, as 'noMenu' -does not occur on the menu bar. An extra iteration is done now to -treat this menu group. - -2014-09-08 14:24:59 +0200 H.G.Muller : -Fix Xaw key bindings - -The routine to automatically construct the translation table for -accelerator keys did not respect the rule that more specific keystrokes -(like :MetaHome:) have to be defined before more general ones -(like :Home:). As a result Alt+Home would activate the Revert -item, intended for plain Home. - -2014-09-08 14:20:08 +0200 H.G.Muller : -Define default font names - - -2014-09-08 09:25:18 +0200 H.G.Muller : -Fix MSVC problems - -Book.c did not include config.h, and thus missed the redefinition of -snprintf (which is not known in MSVC). The use of 'inline' in parser.c -also needed an MSVC redefinition, now added to winboard/config.h. - -2014-09-08 09:22:55 +0200 H.G.Muller : -Fix GTK font patch - - -2014-09-07 23:35:22 +0200 H.G.Muller : -Replace strcasecmp by StrCaseCmp - -The MicroSoft compiler does not know strcasecmp, so we better use -our own function for this everywhere. - -2014-09-07 23:28:29 +0200 H.G.Muller : -Let GTK build pay attention to font arguments - -Multi-line text edits now use the initial value of the Option.textValue -field as a pointer to a (char*) holding a font name, to be used for -the text displayed in it. (After which they overwrite the field with -the textView handle.) The font options -tagsFont, -commentFont, icsFont, --moveHistoryFont and -gameListFont are now activated in the GTK build, -to control the corresponding memos. - -2014-09-07 13:58:15 +0200 H.G.Muller : -Fix auto-display comment option in General Options - -This options had the same ID as auto-Queen, making it ignored. - -2014-09-07 13:43:48 +0200 H.G.Muller : -Call DoEvents during time-consuming operations - -Processing of a game file for reading it, searching positions, saving -selected games or creating a book from them can take minutes. To keep -the application responsive during that time, the main loops of those -tasks calls DoEvents(). A possible risk is that the user can now do -too much, and will initiate actions that interfere with the tast in -progress. - -2014-09-07 13:32:49 +0200 H.G.Muller : -Fix GameListHighlight WB - -The routine to highlight a game line in the Game List listbox of WinBoard -used an extremely inefficient linear search to find the game amongst the -selected games. This has now been replaced by bisection, after finding -an upper limit to the number of entries in the listbox by doubling -a trial size. - -2014-09-07 12:10:50 +0200 H.G.Muller : -Provide DoEvents function in front-ends - -A routine to process all pending events in a non-blocking way is now -provided in the Xaw, GTK+ and WinBoard front-ends, so that time-consuming -tasks (such as PGN loading or opening-book creation) can call it to keep -the user control over the application alive. - -2014-09-06 23:13:01 +0200 H.G.Muller : -Fix syntax error in bitbase code - - -2014-09-06 22:35:22 +0200 H.G.Muller : -Describe Save Selected Games menu in manual - - -2014-09-06 22:29:43 +0200 H.G.Muller : -Let Save Games as Book only use selected games - -The book-creation code now only takes games into account that are -selected for display in the Game List. - -2014-09-06 22:20:19 +0200 H.G.Muller : -Rewrite key-binding section of manual - -This section still wrongly described the key-binding procedure from -before the rewrite of the XBoard front-end. - -2014-09-06 13:21:13 +0200 H.G.Muller : -Connect scroll event to Graph Option in GTK - -The mouse wheel is now detected in graphics widgets, and passed to -the user handler as button 4/5 mouse events. - -2014-09-06 13:15:55 +0200 H.G.Muller : -Make sure node count is positive - -Engines that print the node count as an int overflow into negative values -when the count exceeds 2G. This is really an engine bug, but as it -interferes extremely annoyingly with the alignment of the Thinking Output -XBoard now repairs it by adding 4G to undo the overflow. - -2014-09-05 14:03:49 +0200 H.G.Muller : -Connect mousewheel to Forward/BackwardEvent (XB) - -The mouse buttons 4 and 5 are now processed in the handler for the -board widget. - -2014-09-05 13:41:34 +0200 H.G.Muller : -Fix size of time in Engine Output window - -When the thinking time exceeds an hour, the format hr:min:sec is now used, -in stead of min:sec.cents. This prevents the field from extending beyond -the tab stop when thr hours kick in, and should work upto 100 hrs. -(Going beyond that at the moment does not seem useful.) - -2014-09-04 22:57:07 +0200 H.G.Muller : -Verify if font-spec looks like one in Xaw - -To make XBoard resistant to mixed use of Xaw and GTK builds, which -would not understand each others font specs stored in the settings -file (they have in common), we now determine if the value looks like -an X-font. If it doesn't, the Xaw version ignores it. The GTK build already -ignored it if it did lool like an X-font spec. - -2014-09-04 17:03:55 +0200 H.G.Muller : -Fix alignment in Engine Output window - -Numbers above 1000M would become too wide for their field. This is -solved by introducing the abbreviation 'G'. Values below 10M or 10G -now get an extra digit in their fraction, so that the precision is -at least 1%. - -2014-09-01 14:44:54 +0200 H.G.Muller : -Add Save Selected Games menu item - -A menu item to save all selected games in the Game List on a single -file is added. - -2014-09-01 12:03:58 +0200 H.G.Muller : -Add final piece count to search criteria - -The Load Options dialog now has a text field in which a range can be -entered (like 8-10). Position search will then only select games that -had their final number of pieces in this range. - -2014-08-29 21:15:29 +0200 H.G.Muller : -Fix castling rights on using -lgf - -The dummy InitPosition to force loading pieces was taking place after -InitBackend2(), while the latter could have already loaded a game -from an -lgf argument (which would then be spoiled by the InitPosition). -It has been moved to before InitBackend2() now. - -2014-07-29 15:03:04 +0200 H.G.Muller : -Fix crash on double-click in Game List Tags - -A double-click in the Game List Tags listbox has no function, but it -crashed XBoard, because the textValue field of teh ListBox Option definition, -supposed to contain a pointer to the user-supplied handler, contained a -pointer to an empty string. - -2014-07-02 14:34:53 +0200 H.G.Muller : -Fix typing of null moves - -Entering a null move through the move type-in could fail because the -to-square coordinates (not used in its encoding) could have invalid values, -which would reject the move in an early stage of UserMoveEvent(). -Null moves are now exempted from this vaidity test, while variants where -null moves are legal now accept them in any gameMode. - -2014-07-02 14:04:22 +0200 H.G.Muller : -Fix adjusting clocks in Xaw version - -The handler attached to Label options failed to flip the sign of the -option number when a button other than Button1 was pressed, so that time -would always be subtracted on Shift + ClockClick and never added. -Shift now also suppresses interpretation as null move when playing. -(In Analyze / EditGame mode it is still null move starting a variation.) - -2014-07-02 12:37:18 +0200 H.G.Muller : -Fix null-move entry during play - -Null moving by clicking the clock was only accepted in Edit Game and Analyze -mode, while in Chu Shogi and spin-offs it is also allowed during play. -An F_NULL_MOVE flag was introduced to make it easy to test for such variants, -and Machine White/Black mode now also interpret clock clicks as a null move -if the opponent's flag has not yet fallen. - -2014-04-09 09:53:56 +0200 H.G.Muller : -Let EditPosition double-click on piece promote it - -For pieces with Shogi-like promotion (i.e. if the promoted piece has -pieceToChar defined as '+'), let a second click on it in Edit Position -mode promote or demote it (as the case requires) when the piece menu is off, -rather than remove it (as was the old behavior. - -2014-04-09 09:19:43 +0200 H.G.Muller : -Make EditPosition pallette work in Asian variants - -Construction of the pallette position was not working in variants that -did not have Pawns start on 2nd rank, or that had multiple ranks of pieces. -Now the algorithm is applied to all ranks. - -2014-04-05 23:00:17 +0200 H.G.Muller : -Fix crash on opening Tags window Xaw - -Suppressing the optional book button made the Xaw generic popup crash, -because the following button had the SAME_ROW modality, and was thus -positioned w.r.t. a non-existent widget. - -2014-04-05 20:39:55 +0200 H.G. Muller : -Fix writing of Chu-Shogi FENs - -Promoted pieces were getting the wrong ID letter, of the piece demoted -by 11, rather than 22. - -2014-04-01 18:20:29 +0200 H.G. Muller : -Allow pseudo-engines to adjust the clocks - -Implement new options -first/secondPseudo, which declare the corresponding -engine to be a pseudo-engine, which will then be granted super-powers -through some new engine->GUI commands. For instance, to adjust the time -remaining on the GUI clocks through wtime and btime commands (using msec). - -2014-04-01 12:00:14 +0200 H.G. Muller : -Fix piece inscriptions - - -2014-04-01 11:16:48 +0200 H.G. Muller : -Fix reading Chu Shogi FENs - -The X (for Phoenix) was interpreted a 10 empty squares. - -2014-03-17 23:26:08 +0100 H.G. Muller : -Fix loading positions in engine-defined variant - -Paste Position did not work when an engine-defined variant had redefined -the pieceToCharTable, as the position would be interpreted and sent to the -engine before receiving the setup command. Copying the pieceToCharTable -received from an earlier game to appData cures this, because it will then -be used by InitPosition, which would reset the table to default otherwise. - Another problem was that setupSpoiledMachineBlack would not be reset -after a game with no moves, leading to a spurious 'go' command to the engine. - -2014-03-17 23:05:33 +0100 H.G. Muller : -Render inscriptions on Chu-promoted pieces in red - - -2014-03-17 22:56:07 +0100 H.G. Muller : -Allow writing text on pieces - -A new persistent string option -inscriptions allows the user to define -characters to be written on the various piece types. The string is -interpreted as UTF-8. This option is useful for on-the-fly synthesis -of Shogi pieces, where the string can contain the various kanji in -the canonical pieceToCharTable order. Except that only a single color -has to be given. - -2014-03-12 22:08:04 +0100 H.G. Muller : -Fix initial sizing of board - -Previous patches had destroyed the ability to obey the -size option. - -2014-03-10 21:15:30 +0100 H.G. Muller : -Fix width of menu bar - -The truncated name might not have been terminated with '\0'. -TinyLayout now specifies the number of characters kept in the menu names. -In the OS X version truncating is never needed, as the menu bar is -at the top of the screen, independent of board size. - -2014-03-09 20:38:51 +0100 H.G. Muller : -Fix warnings fonts patch - - -2014-03-02 23:10:50 +0100 H.G. Muller : -Implement (clock-)font handling in GTK - -The options -clockFont, -coordFont and -messageFont are activated, -and supposed to have string values like "Sans Bold 12". The default -values have the point size as 'wild-card' %d, however "Sans Bold %d", -and are expanded by a printf with the point size taken from the defaults -table. The expanded versions are saved back into the settings file, -prefixed with a size tag, as usual. - So far -clockFont is the only font that is actually applied while -writing. - The 'clock kludge' was interfering with the initial sizing, as for some -sizes the initial clock-widget height happened to be equal to the final -height. It was therefore abandoned, and we seem to be able to live without -it. - Sizes smaller than 49 were dominated (for 8-wide boards) by the menu bar. -Therefore tinyLayout now uses single-letter menu labels. - -2014-03-02 20:45:57 +0100 H.G. Muller : -Also search indirection files in user's .xboard tree - - -2014-03-02 18:53:17 +0100 H.G. Muller : -Fix error Engine Output text highlighting - -In wengineoutput.c higeTextStart and End where decalred both static and -extern, which somecompilers justifiably don't like. - -2014-03-01 16:09:09 +0100 H.G. Muller : -Fix Board-dialog bug WB - -The drawing code for the sample square did ot restore the correct brush. - -2014-02-28 21:48:19 +0100 H.G. Muller : -Fix various warnings - -Mostly written but never read errors. Also removed a debug printf that was -causing a format warning. - -2014-02-26 16:34:52 +0100 H.G. Muller : -Kludge repair of expose after startup resize - -Redraw of the main board after resize is delegated to DragProc, which is -scheduled after a delay, to make sure the user is done sizing (mainly to -reposition docked windows). But at startup the program-requested resize when -an engine does not support variant normal and needs a different board format -takes so long that the finale size expose occurs after the DragProc timeout. -As a result, the board was never drawn on the resized canvas. - This is quite hard to fix in a satisfactory way. For now the suppression -of board redrawing during resize is disabled during the first 10 seconds -after startup, as any resize during that time is likely to be the result -of a program request. - -2014-02-26 13:08:50 +0100 H.G. Muller : -Use first engine as default for second - -Rather than having the same fixed default for both engines, we noww only -have a fixed default for the first, and use the actual first as default -for the second. One advantage is that this guarantees the second engine -plays the same variants as the first by default. - -2014-02-23 23:51:20 +0100 H.G. Muller : -Allow adding played move to book - -A button is added in the Edit Book dialog to prime XBoard for adding the -next move entered through the user interface to the book window, without -actually playing it. - -2014-02-23 22:54:55 +0100 H.G. Muller : -Play move right-clicked in Edit Book dialog - -A handler for button-3 down-clicks is added to the Edit Tags dialog, -which fakes the clicked word was typed in the move type-in box. - -2014-02-23 19:23:28 +0100 H.G. Muller : -Fix pop-down of ChatDlg and TextMenuDlg from menu - -Unlike other windows these two would not react to clicking the menu item -once they were up. Now they pop down in that case. - -2014-02-21 11:10:41 +0100 H.G. Muller : -Preserve window width on board-format change - -When a variant switch would cause recalculation of the board window, -we now first recalculate square size to keep the window width fixed. -Also adapt initial width on high boards. - -2014-02-18 22:37:31 +0100 H.G. Muller : -Equip Board Options dialog with themes listbox - -The option -themeNames is made persistent for XBoard, and its value is -displayed in a listbox added to the View -> Board dialog. The user -can select themes from this, and manipulate the contents similar to -the engine list in Load Engine. A textedit allows the user to define a -theme name for the current settings, and doing so adds the theme to the --themeNames list. - -2014-02-07 11:22:44 +0100 H.G. Muller : -Implement copy function in ICS Text Menu - -A command consisting of the word $copy will place the clicked word on -the clipboard. When there was already text selected during the click, -that selected text will be used for $copy and $name, rather than the -right-clicked word. - -2014-02-07 09:48:31 +0100 H.G. Muller : -When ICS Console open EOF from keyboard is no error - -In case the user started without a terminal, we just close the input source, -and suppress future writing to the xterm. - -2014-02-06 18:46:21 +0100 H.G. Muller : -Leave xterm at start of new line after quitting XBoard - - -2014-02-06 18:36:41 +0100 H.G. Muller : -Also display channel tell in ICS Console during private chat - -Channel tells of players for which a chat wa opened were displayed in that -chat, as well as in the channel chatbox, if the latter was open. But when -there was no channel chatbox it would not appear as colorized channel tell -in the console. This is now fixed, and in the private chat box such a -message is indicated as 'broadcast'. - -2014-02-05 23:08:50 +0100 H.G. Muller : -Write broadcasts also to private chatbox of talker - -The shouts or channel chatboxes capture messages first, but if a private -chat with the talker is opened, it now goes there too. Prefixed with -the type of broadcast. - -2014-03-02 13:18:34 +0100 H.G. Muller : -Fix Xaw Chat Console - - -2014-02-05 22:38:09 +0100 H.G. Muller : -Let Ctrl-O key open chat for last talker - - -2014-02-05 22:15:03 +0100 H.G. Muller : -Add End Chat button - -This button clears the current chat, so that it becomes free for -assignement to another partner. - -2014-02-05 21:59:10 +0100 H.G. Muller : -Ctrl-N in chat opens empty chat - -This key isequivalent to pressing the left-most New Chat button. -If no unused chat present, it the command will be ignored. - -2014-02-05 21:29:42 +0100 H.G. Muller : -Preserve unfinished input lines during chat switch - -This is problematic, as apparently we cannot write in widgets that are -active with key hits, so attempting to write it back in response to Tab -did not work. This is now done with a delay, for lack of a better method. - -2014-02-04 13:57:16 +0100 H.G. Muller : -Recognize Esc and Tab in ICS Console input - -Esc is used to close the chat, or transfer focus to the board window. -Tab is used to navigate between chats (or open the first). Priority -is given to dirty chats. - -2014-02-03 20:35:31 +0100 H.G. Muller : -Let ICS Console pop up GTK in stead of ICS Input Box - - -2014-02-03 19:45:44 +0100 H.G. Muller : -Add context menu to ICS console XB-GTK - -A right-click handler is added to the output memos of the ICS Interaction -window. It pops up the ICS text menu. It is remembered whether the menu -was already up; if not, it will be popped down after a command is selected -from it. Like the WinBoard context menu, the commands will be able to use -the clicked word. -The -icsMenu 'command' $chat is now recognized as a special case, not to -be sent to the ICS, but executed by XBoard. It will assign one of the -five chats to the clicked name. If no empty chat is available, the last -chat will be used (but not cleared). - The -icsMenu in the master config file is now configured to contain -this command, but unfortunately this will not become effective for users -that already have a settings file. -The Text Menu now puts $input commands in ICS Console Input field when the -ICS Input Box is not up. - The text placed in the input field for completion (as per $input directive) -turned out to be selected in GTK, so that when you stated typing, it was -erased again! - By making the Text menu dialog subject to WindowPlacement control, -and interrogating the poition of the ICS Console window, the Text Menu -can be popped up such that the mouse pointer is on the bottom-left button. - -2014-02-02 21:17:00 +0100 H.G. Muller : -Integrate ICS output into Chat Window - -An extra pane has been added to the Chat Window to display the ICS output. -In GTK this output is colorized just as in the xterm. For Xaw this is not -possible. This pane is always visible, and the chat output can be hidden, -to double its size. Entered input will go to the selected chat (when not -hidden) as a tell or shout, or to the ICS as a command. The Chat-Partner -field is hidden together with the chat pane and the Hide button. Each of -the five chats now has a dedicated button; for unused chats (empty Chat- -Partner field) these now gets the text 'New Chat' inscribed on it. -Focussing is made more intelligent (to the Partner field when shown and -empty, otherwise to the input field). -The Up and Down arrows now work in the input field to recall old input. - ScrollToCursor() was broken in GTK, because a mark was made for only -a single buffer. Now each buffer has its own end mark. - Another problem was that using ScrollToCursow immediately after a memo -was shrunk (because a neighboring one expanded) it would still use the -old memo size, so that the bottom part remained out of view. Delaying it -50 ms solved that problem. - A new option -icsUp was added to store the visibility in the settings. -It is updated only in ICS mode. The ICS Console pops up automatically -when the stored parameters say so. It is also made sticky. - Unlike the xterm the textView does not extend background color to unwritten -positions behind the line. A separate GTK call is now added to set the -unwritten part to the same color as the background in normal text. - A control was added in the ICS Options dialog for setting the colors -of normal text (-colorNormal). - -2014-02-02 17:27:26 +0100 H.G. Muller : -Add logo-size control XBoard - -This is mainly for the benefit of OS X useres who cannot find their -settings file. It requires a restart to become effective, which is -really sub-standard. - -2014-02-02 17:18:56 +0100 H.G. Muller : -Add Edit Engine List menu item to XBoard - -In OS X the settings file is hard to find... - -2014-02-02 16:41:13 +0100 H.G. Muller : -Fix warnings - -Some unread variables are commented out, rather than removed, because they -can be useful for future development. - -2014-02-02 16:33:34 +0100 H.G. Muller : -Fix moves of Spartan Captain - -The rewrite of the move generator did no longer pay attention to rookRange, -so that the Spartan Captain moved like a Rook. - -2014-02-02 16:18:07 +0100 H.G. Muller : -Add Option type 'Skip' - -The value -1 used to suppress rendering of option controls was drawing -error messages, because enums are unsigned. So a new member Skip was added -to the enum. - -2014-02-02 14:40:16 +0100 H.G. Muller : -Detect Fischer castling in FENs - -Castling rights with unorthodox piece placement imply Fischer castling. -Make sure shuffling is done after detecting this, because it means K & R -can also be shuffled (as long as K remains between both R). - -2014-02-02 14:09:19 +0100 H.G. Muller : -Allow shuffling indicators in FEN - -If the back ranks are enclosed by < > in a FEN, the route to shuffle -initial positions is invoked on it. - -2014-02-02 13:51:37 +0100 H.G. Muller : -Allow wild-cards in FEN - -A question mark in a FEN will now be interpreted as a piece randomly -chosen from the holdings. (From which it will be removed.) Intended -for use in symmetric black/white pairs; when used on asymetric locations -or with non-identical holdings the results will be undefined. - -2014-02-02 10:40:18 +0100 H.G. Muller : -Fix Seirawan reverse-castling animation - -In Chess960 animation of castlings is suppressed, because the move is encoded -as KxR, so that the to-square in general is not the final destination of the -King. So it is just confusing to the eye to see the King slide to the Rook, -and then jump to an entirely different square. In S-Chess castlings can -similarly be encoded as RxK (to indicate gating at the Rook square), and -animation of those moves should be suppressed for the same reason. But it -wasn't, and in Fischer castlings denoted as RxK this even caused the Rook -to disappear when it didn't need to moved. - Perhaps one day a smart method of animating Fischer castlings can be -designed. (E.g. remove Rook, animate King move to true to-square, place Rook? -But what if the King doesn't move at all? Animate Rook then? Normal castlings -now animate the King, and then just displace the Rook.) - -2014-02-02 10:22:25 +0100 H.G. Muller : -Make Fischer castling generally available - -A new volatile option -fischerCastlings allows every variant to be played -with Fischer castling, which so far was only allowed in variants FRC/CRC. -This only makes sense in shuffle variants, where King and Rooks might not -be in their orthodox locations. But even when they are, it has consequences -for the user interface, which will require dragging King on Rook as the only -way to enter castling. Like -shuffleOpenings the setting will be cleared -as soon as you switch variant (unless you switch to FRC/CRC, where they -Fischer castling is on by default). It can be set from the New Shuffle dialog. - -2014-01-19 22:41:52 -0800 Arun Persaud : -updated po/pot files - - -2014-01-19 22:19:10 -0800 Arun Persaud : -new version number for developer release - - -2014-01-19 22:15:33 -0800 Arun Persaud : -updated Dutch translation - - -2014-01-19 20:44:33 +0100 H.G. Muller : -Put ponder checkbox in Common Engine dialog WB - -This is yet another duplicate of the one in General Options and Adjudiactions. - -2014-01-19 20:27:59 +0100 H.G. Muller : -Expand %s in -openCommand to DATADIR and fix OSX settings-file name - -This can be used in OS X to biggy-back a cd to a directory in the App -on the open command. - -2014-01-18 23:42:01 +0100 H.G. Muller : -Add some checkboxes in General Options dialog WB - -Checkboxes are added for -variations, -memoHeaders and -autoExtend. - -2014-01-18 23:26:03 +0100 H.G. Muller : -Fix warning in CheckTest - - -2014-01-18 22:40:27 +0100 H.G. Muller : -Fix printing of engine-output headers - -They were not printed on analyis of the first position after opening -the Engine Output window. - -2014-01-16 23:07:28 +0100 H.G. Muller : -Fix sticky windows on Win8 - - -2014-01-16 22:54:32 +0100 H.G. Muller : -Drag touching edges together (WB) - -When an auxiliary window is dragged by an edge, the snap code now checks -if that edge was touching another window. If so, that other window is sized -to keep touching the dragged edge. Unless it was also touching the main -window. - -2014-01-15 22:35:23 +0100 H.G. Muller : -Implement new mate-score standard - -Matescores are now indicated in the protocol as +/- 100000+DTM, -and in the Engine Output window as #DTM or #-DTM. - -2014-01-15 21:28:51 +0100 H.G. Muller : -Put fail-high/fail-low indicators in protocol specs - - -2014-01-15 20:43:55 +0100 H.G. Muller : -switch to new tbhits protocol - -The extended info is now expected as 3 bare integers, the last one -separated from the PV by at least one tab character. -The protocol extension is described in the CECP specs document. - -2014-01-14 22:37:30 +0100 H.G. Muller : -Fix sorting of Engine Output - -The moveKey of the top line was never stored, so that more recent -lower scores could not pass it even if they had the same move. - -2014-01-14 22:35:22 +0100 H.G. Muller : -Handle fali-low & fail high - -A ? or ! at the end of the PV are now also written behind the score. - -2014-01-14 20:31:46 +0100 H.G. Muller : -Implement extended thinking output - -The PV field can now start with three quantities, selective depth, -engine speed and tablebase hits, disguised as PGN comment. XBoard will -strip that off, and allow them to be displayed in separate columns of -the engine-output window. - -2014-01-14 14:46:47 +0100 H.G. Muller : -Allow hide/show of columns in Engine Output - -A new persistent Boolean option -memoHeaders enables a new feature: -text headers are shown above the depth, score, nodes, time columns in the -engine output. Right-clicking them will subsequently hide the corresponding -data, and move the column header to above the PV in a 'not shown' list, -where it can be clicked again to re-open the column. -Configure maseter settings to switch -memoHeaders on by default. - -2014-01-14 09:55:40 +0100 H.G. Muller : -Fix ManProc for OS X - - -2014-01-14 10:02:22 +0100 H.G. Muller : -Fix access to ~~/themes/conf for OS X - -In OS X DATADIR is a variable. - -2014-01-13 19:23:30 +0100 H.G. Muller : -Add 'Continue later' button to Tournament dialog XB - -To do GenericReadout without triggering a call to the OK function, -we introduced a new value for the option-number parameter, -2. - -2014-01-13 17:32:28 +0100 H.G. Muller : -Fix Tournament Options dialog - -Deleting a Label option had renumbered the remaining Options, breaking -the dialog and causing a crash when an engine was selected. A considyency -check is now added to catch this condition, and throw an error popup -when we mess up again. - -2014-01-13 17:09:01 +0100 H.G. Muller : -Allow popup of TC and Common Engine from Tournament dialog - -A new dialog class MasterDlg was added, similar to TransientDlg, -but to allow two dialogs to be up simultaneously. The Tournament Options -dialog was migrated to this class, so it can now get buttons to pop up -the Time Control and Common Engine dialog, like WinBoard. It even has -a button for the General options dialog. -Special care had to be taken to prevent popdown of the MasterDlg when -a Transient child is still up (similar to browser or error childs). - -2014-01-13 16:21:59 +0100 H.G. Muller : -Add --show-config special option - -This prints a list of configure parameters, and then exits. If a second -argument is given, it only prints the value of that config parameter, -so that tricks like cp *.svg `xboard --show-config Datadir`/themes/chu -can be used in install scripts of packages with piece images. - -2014-01-13 14:25:30 +0100 H.G. Muller : -Overhaul kill code - -Engines were not always forcefully killed in XBoard, which could make -the tournament manager hang when an engine became unresponsive to "quit". -The various levels of killing are now revised, and the -delayAfterQuit -is absorbed in DestroyChildProcess(). There is a hard killing mode 9, -which immediately sends SIGKILL, intended for engines that have already -proven to malfunction or could not start at all. In other cases SIGTERM -is sent according to specs, but a SIGKILL is scheduled -delayAfterQuit + 1 -sec later just in case the SIGTERM would be ignored. - -2014-01-13 13:38:47 +0100 H.G. Muller : -Fix name of master settings file in OS X - -The name needs to be relative to the bundle path, but ~~ expansion -did not work for compiled-in defaults, as the expansion takes place -when parsing an option. The dataDir is now also kept in an array rather -than as a pointer, to allow it to appear in statically initialized tables. - -2014-01-08 16:25:25 +0100 H.G. Muller : -Fix Chu promotion of L, HM and GB - -The promotion popup would not be shown for HM and GB with legality testing -on because the piece types used for them were wild-card pieces. The Lance -was treated as a Pawn in HasPrmotionChoice(). - -2014-01-08 16:09:15 +0100 H.G. Muller : -Remove redefine of DATADIR that leaked in from v4.7.x - -2014-01-05 12:52:46 -0800 Arun Persaud : -updated po/pot files - - -2014-01-05 12:51:50 -0800 Arun Persaud : -new version number for release 4.7.3 - - -2014-01-05 10:58:48 -0800 Arun Persaud : -updated copyright to 2014 in menu.c - - -2014-01-05 10:37:56 -0800 Arun Persaud : -removed .DS_Store file from git - - -2014-01-05 10:34:08 -0800 Arun Persaud : -Updated copyright notice to 2014 - - -2014-01-05 10:27:53 -0800 Arun Persaud : -cleanup some trailing whitespaces - - -2013-12-29 13:46:40 +0100 H.G. Muller : -Fix crash on use of dialog Browse buttons GTK - -The code to set a filter did not expect multiple extensions, and would -cause a buffer overrun when there were. - -2013-12-27 20:12:23 +0100 H.G. Muller : -Make building of Windows .hlp file optional - -By using && and || operators in the build recipe, the building of WinBoard -with Cygwin is now not aborted whe the Help Compiler is not installed. - -2014-01-05 11:47:18 +0100 H.G. Muller : -Use __APPLE__ compile switch for OS X - -It seems that on Apple machines the compiler will always define the -symbol __APPLE__, so this is now used instead of OSX, which had to -be defined with a -DOSX compiler flag. The gtkmacintegration header -is now using <> in stead of "" in its #include. (Strange enough both -were working.) - -2014-01-04 12:18:30 +0100 H.G. Muller : -Expand ~~/ to bundle path (OSX) - -DATADIR is #defined in WinBoard as "~~" to make the expansion a no-op -there. Same for Linux compiles. For OS X it is #defined as a variable, -obtained from GTK-OSX at startup. - -2013-12-29 23:27:12 +0100 H.G. Muller : -Activate ManProc in GTK - - -2013-12-29 22:14:06 +0100 H.G. Muller : -Remove use of strndup - -The use of strndup was actually unsafe, as the length was passed using -an ordinary strlen. strndup was not availableon OS X 10.6, and is now -replaced by an ordinary strdup, which should be save enough. - -2013-12-29 22:09:10 +0100 H.G. Muller : -Put some OSX code into gtk version - -Under control of #ifdef OSX code is added to integrate the GTK front-end -into OS X. This involves moving the menu bar to outside the window, and -catching the signal that OS X sends to running applications when opening -another instance was requested. Som files are renamed to conform to the -file tree of the OS X App package. - -2013-12-27 21:47:55 +0100 H.G. Muller : -Cure weirdness when dragging outside of board - -Dragging outside the board (when people maximized the window) did not -properly restore background, (leaving a trail of dragged piece). Filling -the canvas with white when it is creatd cured this. The problem most likely -was that unitialized cairo surfaces had transparancy, and writing back -transparancy doesn't helpmuch to erase things. - -2013-12-09 14:52:32 +0100 H.G. Muller : -Fix sorting of lines in Engine Output - -Lines tat were fail-lows or fail-ighs should get the scores on the basis -of wich they are sorted corrected to that of te line (for the same move) -superceding them, so that other moves can rise to above them, when they -score higher than the corrected score. - -2013-12-05 20:08:35 +0100 H.G. Muller : -Make filler variant button inactive - - -2013-12-05 17:50:21 +0100 H.G. Muller : -Fix packing of FRC castlings - -The routine for packing moves to the internal database format was not -working for FRC castlings, totally messing up position search for FRC -and CRC. - -2013-12-05 16:23:53 +0100 H.G. Muller : -Fix Xaw file-browser New Directory - -Prevent people from using the error messages that will be printed here -as directory name by pressing New Directory a second time after first -pressing it with an empty or existing name. - -2013-12-05 16:14:02 +0100 H.G. Muller : -Widen Xaw text entries for larger square sizes - -Presumably people will use larger fonts if they use larger board squares. -(And in any case te default fonts would be larger.) This means they need -more space to see what is the current value of text options. - -2013-12-05 15:47:26 +0100 H.G. Muller : -Remove width limiting of shuffle checkbox - - -2013-11-28 13:30:40 +0100 H.G. Muller : -Allow castling and e.p. to be edited in opening book - - -2013-09-16 22:32:32 +0200 H.G. Muller : -Repair FRC A-side castling legality testing - -XBoard allowed A-side castling when a rook started on the a-file, -and the b-file was blocked. - -2013-09-16 22:27:50 +0200 H.G. Muller : -Repair XBoard from node-count patch - -u64 was #defined in backend.h, which unfortunately was almost alwats -(Not sure why WinBoard did not suffer from this!) This, and related -definitions have now been moved to common.h (which is always #included -first). - -2013-09-15 20:13:06 +0200 H.G. Muller : -WinBoard multi-monitor support - -A patch provided by Tim Kosse - -2013-09-15 19:28:54 +0200 H.G. Muller : -Fix node count range - -The node count was still clipped to 32 bit because one of the structs -it passes through (FrontEndProgramStats) had the nodes field declared -as an unsigned long. - -2013-09-15 19:12:42 +0200 H.G. Muller : -Fix adjudication of Giveaway stalemates - -The case where the side-to-move would win by stalemate was not treated -in the Adjudicate switch. - -2013-08-30 17:33:59 +0200 H.G. Muller : -Fix buffer overflow in parser - -When a line ended with a comment, the parser had to read a line ahead -to check if there was a PGNresult following, without being able to -throw away the previous line yet. This could lead to buffer overflow -in a long game where every line ended in a comment. The buffer now is -cleansed of already parsed data when starting on a new syntactical unit. - -2013-08-27 22:55:52 +0200 H.G. Muller : -Fix -zippyVariants option - -Due to the change of cps->variants from (char []) to (char *), copying -zippyVariants to it on behalf of v1 engines would no longer work. This -is fixed by using ASSIGN() in stead of safeStrCpy(). - -2013-08-26 18:25:55 +0200 H.G. Muller : -Fix initial board sizing WB - -The initial board size was based on the assumption the board would be 8x8. -This could push auxiliary windows off screen if the board was smaller, -after which EnsureOnScreen would undock them and park them in the upper- -right corner before the board assumed its true size. InitPos() is now called -before the initial sizing to et the board format correctly, InitDrawingSizes() -had to be made resitant to calling before a board size was picked for this -(because InitPos() might call that too). - ActivateTheme() now uses the new board size, not the previous one (as was -indicated by size -2), so that -boardSize specifications inside a theme -will take effect. - Board size petite should not be forbidden for Shogi; all pieces exist there. - -2013-08-26 14:40:57 +0200 H.G. Muller : -Fix grabbing of selected piece - -A second static click on a selected piece should deselect it, but an attempt -to drag an already selected piece should not 'bounce off'. It was already -possible to move a selected piece to another square, but the dragging was -not animated. This is now fixed, by only skipping the code to start dragging -when the second click is part of the only-move double-click for only capture. -(Before it was skipped on any second click.) - -2013-08-26 13:35:47 +0200 H.G. Muller : -Allow entry of negative numbers in spin control (WB) - -Windows numeric controls do not accept negative numbers, so in case the -range of a spin option can go negative, the style ES_NUMBER should not be -set on the control. - -2013-08-26 11:37:27 +0200 H.G. Muller : -Allow drops / promotions/ deferrals to be edited into book - -For no real reason only NormalMove would be accepted when parsing the list -of book moves. - -2013-08-26 11:28:54 +0200 H.G. Muller : -Fix GUI book after setup position - -The routine to send move to the engine would automatically append a 'go' -is a preious setboard had put the engine in force mode, but this should -not happen on a book hit, where the engine should even be put in force mode -if it was not yet there. - -2013-07-05 18:32:46 +0200 H.G. Muller : -Fix book creation - -Due to duplicate use of the same file pointer variable the game file would be -closed before any games were read from it. - -2013-05-20 11:14:01 +0200 H.G. Muller : -Make PGN parser immune to unprotected time stamps - -The parser choked on time stamps of the form dd:dd or dd:dd:dd if one -of the fields happened to be 00, because it wouldmistake that for a -non-compliant king-side castling. By excluding this interpretation when -the 00 is immediately preceded or followed by ':' this is now prevented. - -2013-05-05 08:03:00 -0700 Arun Persaud : -updated po files for new release (make distcheck) - - -2013-05-05 07:57:22 -0700 Arun Persaud : -new version number for release 4.7.1 - - -2013-05-05 07:53:54 -0700 Arun Persaud : -updated Changelog, NEWS, etc. - - -2013-05-02 22:47:44 +0200 H.G. Muller : -Update zippy.README - -It is explained how to generate multi-line commands for -zipyGameEnd. - -2013-04-01 20:43:36 +0200 H.G. Muller : -Fix Xaw file browser - -The 'next page' entry of the Xaw file browser contained a \177 character -to keep at sorted at the bottom. This caused trouble for gettext. -Now the sorting range is adapted so the 'next page' is never part of it. - More seriously, the listbox fill code had a wrong cast when testing for -an empty listbox on the first element, so that it only tested the low byte -of the pointer, in stead of the entire pointer for NULLness. As a result -the contents of the listboxes could suddenly disappear when even when it -was non-empty, because the first filename was allocated at an unlucky address. - -2013-03-22 19:23:25 +0100 H.G. Muller : -Make Chat Box window obey -topLevel option - -It was always popping up as a dialog of the main board, covering it. -One could argue it should always be to-level. - -2013-03-19 13:20:24 +0100 H.G. Muller : -Fix scrolling of Chat Box - -Seems the problem is that scroll_to_iter does not work until after some time, -needed to calculate line heights. Use scroll_to_mark instead, after clumsily -adding a text_mark. - -2013-03-17 10:33:31 +0100 H.G. Muller : -Fix GTK SetInsertPos - -SetInsertPos() was not yet ported to GTK, with as a result that the cursor -was positioned at the start of a line recalled in the ICS Input Box, -rather than at the end. The code also called SetInsertPos to force scrolling -to that point in the text (which in Xaw is an automatic side effect). So for -multi-line text edits this function calls ScrollToCursor(). For some reason -this does not work when replacing texts in the Chat Box memo, when switching -chat, although it does work in the same memo when a line is added to the -existing text. - -2013-03-07 21:38:43 +0100 H.G. Muller : -Print score of final position in Analyze Game - -The score/depth of the final position of the analyed game is added -(as an explicit comment) behind the PV of the forelast position. -To make this work, a new 'addBraces' mode (3) had to be added to -AppendComment, which suppresses stripping of the score/depth from -the comment. - -2013-03-12 18:50:08 +0100 H.G. Muller : -Fix horrible bug in reading scores from PGN - -Reading scores like -0.94 flipped the sign, because the integer part --0 would read as 0, and thus was no reason for sign flipping. - -2013-03-10 12:43:59 +0100 H.G. Muller : -Fix disappearence of pieces that were moved illegally - -Dragging damages the from-square, but it is not marked as such, because -selective board redraws to update highlights and such would draw the piece -that is really still there, making it flash on the from-square before -the position after the move is drawn. This, however, backfires when the -move was illegal, as then there is no draw of a new position, and the -from-square stays empty. For now this is solved by making DisplayMoveError() -order a total redraw. (As this is rare, only done in case of an error, -and might even throw up a pop-up, the performance cost of this is acceptable.) - -2013-03-20 17:50:33 +0100 H.G. Muller : -Fix quoting of book name in tourney file - -The argument of -polyglotBook was written to the tourney file unquoted, -which effectively made it disappear if it was an empty or blank string. - -2013-03-07 18:11:31 +0100 H.G. Muller : -Provide compatibility with Alien Edition setup command - -The setup command of the Alien Edition has a board-size specifier -(possibly as prefix on a parent-variant name) between pieceToCharTable -and FEN. The regular version would choke on that, precluding engines -designed for the Alien protocol extension to have their setup processed -when running under regular XBoard. This patch makes it skip the extra info. - -2013-03-07 17:52:02 +0100 H.G. Muller : -Fix saving of analyzed game - -Anotated games after batch-mode Analyze Game were not auto-saved, -because the GameEnds() call supposed to do that was called with a NULL -argument for resultDetails. Now it is called with the resultDetails as -pre-existing in the gameInfo, or an empty string if none exist. This bug -was masked by the fact that in standard game ends (mate, etc.) the -analyzing engine would declare game end and supply a message. - Also makes a distinction between Analyze Game and regular Analyze mode -when resuming analysis after loading a game; only the former now would -trigger a batch analysis. - -2013-03-07 17:48:45 +0100 H.G. Muller : -Fix spurious popup after batch-mode Analyze Game - -A batch analysis of games was not properly terminated, because the game -mode was tested after it had already been changed. No oldGameMode is -tested in stead. - -2013-03-02 22:21:29 +0100 H.G. Muller : -Let XBoard -autoBox option also affect move type-in - - -2013-03-02 22:17:31 +0100 H.G. Muller : -Fix GTK box popup - -Key values > 255 are used for PgUp, PgDown etc., so to pop up only on -printables needs a two-sided test. - -2013-03-01 12:50:06 +0100 H.G. Muller : -Fix fatal error on unsupported board size - -When a board size unsupported by the engine was requested through the -New Variant dialog, this was discovered while the dialog was still up, -causing the error message to pop up as a child of the New Variant dialog, -so that it would immediately be taken down as the latter closed. -As a result it could not be confirmed, so that XBoard would not exit, and -was left in a pathologic state (ignoring window-close). This is fixed -by performing Reset (which detects the error) after PopDown of New Variant. - -2013-03-01 12:39:40 +0100 H.G. Muller : -Accept setup command for non-standard board size - -The code to test if board-size is standard for the current variant -has been moved to a subroutine, to allow its calling when receiving -a "setup" command from the engine. - -2013-03-01 11:57:01 +0100 H.G. Muller : -Fix buffer overflow in feature parsing - -String features (variants, egt, myname and option) relied on a buf[MSG_SIZ] -for processing their value. The Nebiyu engine had combobox options that -required more than that. All string features are now stored in allocated -memory rather than in static arrays, and StringFeature allocates a buffer -of sufficient size for them. Only limitation now is the low-level input -buffer in the InputSource threads, whih is a static buffer of 4096 -(=INPUT_SOURCE_BUF_SIZE) characters. - -2013-02-27 23:44:55 +0100 H.G. Muller : -Fix vertical sizing of GTK board - -The clipping of the boad at the bottom was due to resizing of the clock -height when we first write it with a big font. This patch delays calculation -of the final size until after the clock height changes. - -2013-02-26 21:13:32 -0800 Arun Persaud : -Updated German translation - - -2013-02-26 20:27:24 -0800 Arun Persaud : -Updated Ukrainian translations - - -2013-02-26 17:59:43 +0100 H.G. Muller : -Fix of argument error - -Oops. Pevious patch for skipping unknown multi-line arguments -was still buggy. - -2013-02-26 17:44:10 +0100 H.G. Muller : -Let popping up of WinBoard chatbox for channel open it - -WinBoard now issues a +ch command for a channel when you pop up a chatbox -for that channel. A work-around is added for the fact that the public -FICS seems to ignore the first such command. - -2013-02-26 17:27:59 +0100 H.G. Muller : -Make skipping of unknown option smarter - -To make XBoard better resistant to the presence of disbanded or future -options in its settings file, encountering those is no longer a fatal error. -But the error recovery only consisted of skipping the rest of the line. -This fails badly on string options with a multi-line value, which is -enclosed by {braces}. We now detect that case, to skip to } instead. - -2013-02-26 17:15:39 +0100 H.G. Muller : -Add -backupSettingsFile option - -For better configurability of WinBoard, an option is added to optionally -read a settings file, namely if no other settings file (other than the -master file) was read so far. This can be used to import settings from -a previous version, without destroying its settings file. - -2013-02-26 16:55:20 +0100 H.G. Muller : -Repair WinBoard compile error - -__GITVERSION was not defined in WinBoard, as it was only defined with a -compiler flag by ./configure, which WinBoard does not use. - -2013-02-26 16:47:58 +0100 H.G. Muller : -Work-around for Xt selection bug - -In some Xt implementations calling extend-end with 0 params causes a crash, -although the mmanual specifies this should default to a call with 'PRIMARY'. -The default selection is now explicitly mentioned in all extend-end calls. - -2013-02-24 09:31:57 -0800 Christoph Moench-Tegeder : -fix bug #38401: xboard.texi doesn't build with texinfo-5.0 (tiny change) - -xboard-4.7.0's documentation is not buildable with texinfo-5.0, it fails with a lot of error messages from makeinfo like -./xboard.texi:1026: @itemx must follow @item -makeinfo seems right, @itemx is not used as described in the texinfo manual. -Attached patch puts each item of the "Options" menu in it's own @subsection and formats the description of each item as a @table as neccessary. This way, xboard builds again and the manual doesn't look too bad. - -2013-02-24 09:09:54 -0800 Arun Persaud : -updated po/pot files - - -2013-02-24 09:04:48 -0800 Arun Persaud : -new version number for developer release - - -2013-02-20 21:28:36 +0100 H.G. Muller : -Try to make life more bearable in Xaw menus - -The alignment still sucks, but not as much as before. - -2013-02-20 19:26:17 +0100 H.G. Muller : -Fix -topLevel option - -This option was copletely ignored, after the refactorig. - -2013-02-20 18:16:00 +0100 H.G. Muller : -Fix testing for valid window placement Xaw - - -2013-02-20 12:15:08 +0100 H.G. Muller : -Suppress printing of status line in dual-board mode - - -2013-02-20 11:56:12 +0100 H.G. Muller : -Fix sizing of slave board GTK - -For lack of a known method to specify a default size for Graph widgets, -we have to use the same system as for the main board: create with 0x0 size, -and measure the size of the outer window to determine margins. -After every popup we then resize to the required board size plus these -margins. (Awful...) - -2013-02-20 10:08:09 +0100 H.G. Muller : -Better handling of undefined window parameters - -Repositioning and resizing a newly created dialog was based on the width -parameter of the stored sizing info being valid. Now it is separately -tested if the position is valid, so that sizing and moving can be done -independently. This allows us to store position info, but not size info -for the slave board, so that it automatically will use the size of the -main board when first opened. - -2013-02-19 19:14:49 +0100 H.G. Muller : -Limit debug print to debug mode - - -2013-02-19 19:14:00 +0100 H.G. Muller : -Fix repositioning of GTK windows - -After 'hide' and 'show' GTK would not position the window in the same place, -but center it on the parent. Now we reposition the window after 'show' based -on the WindowPlacement data (if available). - -2013-02-19 18:52:41 +0100 H.G. Muller : -Remember window params of slave board - -The slave board now has been assigned a WindowPlacement, which is also -saved in the settings file, through new options -slaveX/Y/W/H. - -2013-02-19 17:48:39 +0100 H.G. Muller : -Fix repairing of arrow damage - -The '2' bit in damage[][] to indicate the arrow was erroneously cleared, -rather than kept. - -2013-02-18 19:55:20 -0800 Arun Persaud : -fix OK-response in gtk dialogs, see c7f8df124 - -the fix in c7f8df124 needs to be applied to both of those if cases - -2013-02-18 17:11:32 -0800 Arun Persaud : -removed two more translations from debug output - - -2013-02-18 17:09:30 -0800 Arun Persaud : -fixed segfault of g_markup_printf_escaped which needs utf-8 strings - -defined text-domain as utf-8 solved this - -2013-02-18 13:38:51 -0800 Arun Persaud : -fixed gtk-warning - - -2013-02-18 10:06:36 -0800 Arun Persaud : -removed some translation calls for messages in the debug log - - -2013-02-18 09:46:53 -0800 Arun Persaud : -add keyboard shortcuts back into Xaw version - - -2013-02-17 14:13:30 -0800 Arun Persaud : -in debug mode also print the git-version if available during build - - -2013-02-18 21:19:05 +0100 H.G. Muller : -Print game-list timing messages only in debug mode - - -2013-02-18 21:01:35 +0100 H.G. Muller : -Fix title of top-level windows - - -2013-02-18 18:51:44 +0100 H.G. Muller : -Cure GTK warning in top-level windows - -There is no OK button in top-level windows, so the 'response' signal is -not defined, and should not be connected. - -2013-02-18 18:33:34 +0100 H.G. Muller : -Fix graying of Revert menu item - -The new code was checkmarking it in stead of enabling it! - -2013-02-18 11:38:29 +0100 H.G. Muller : -Add -onlyOwnGames option - -This suppresses auto-saving of ICS observed games. - -2013-02-18 11:17:16 +0100 H.G. Muller : -Allow display of 50-move counter in zippy mode - -No chance it could be considered cheating there. - -2013-02-18 10:48:53 +0100 H.G. Muller : -Add new vertical pixel fudge - -With the new GTK window type the board is 13 pixels too small. - -2013-02-18 10:29:17 +0100 H.G. Muller : -Don't add PV moves on board clicking in AnalyzeMode - -Playing PV moves by right-clicking the PV was only intended for clicks -in the engine Output window, selecting from multi-PV analysis output, -where by default it plays only the first move. PV walkig by right-clicking -the board, however, would start the walk at the end even in AnalyzeMode, -and thus add the entire PV. Which is probably not useful. So adding moves -in that case has now completely been suppressed, so it can be used for -harmless viewing of the latest PV. - The behavior has also been made subject to a persistent Boolean option --appendPV, configured to true, with a checkbox in General Options. - A checkbox has also been added there for controlling the -variations option, -which is now also configured to true. - -2013-02-18 10:25:40 +0100 H.G. Muller : -Remove checkbox for 'Move Sound' - -This function is better controlled from the Sounds dialog. - -2013-02-18 09:59:48 +0100 H.G. Muller : -Make switching between board windows absolute - -Selecting the window in which to draw the board when the slave board for --dualBoard was up was done by a toggle. For unknown reason this could cause -a situation where the drawing took place in the other window than the -intended one. The code is made more robust by explicitly specifying which -window to draw in, based on the partnerUp flag. - -2013-02-18 09:50:48 +0100 H.G. Muller : -Warn about experimental nature of dual board - -The message field, which for now is unused, now contains a warning message. - -2013-02-17 10:49:21 -0800 Arun Persaud : -add close buttons to gtk windows - -use windows instead of dialogs for toplevel elements - -2013-02-16 19:02:52 -0800 Arun Persaud : -keyboard accelerators for both front ends. - -moved them out of the string definition, so that gtk can add them automatically. -Also wrote a function that loads them for X11. - -TODO: add them again when creating X11 menu names - -2013-02-15 11:03:02 -0800 Arun Persaud : -added rotated shogi pieces for -flipback option and moved them to the themes directory - - -2013-02-14 17:27:27 -0800 Arun Persaud : -add test for pkg-config - -exit configure in case we can't find it. - -2013-02-14 13:02:08 +0100 H.G. Muller : -Only perform e.p. capture if there are rights - -The heuristic for e.p. capture was such that any non-forward move with -a Pawn to an empty square would delete the piece behind its new location -(Xiangqi exempted). This is now limited to cases where EP_STATUS indicates -that the deleted piece was a Pawn that performed a double-push on the -previous move. (Or if there is unknown EP_STATUS.) - This makes XBoard more generally suitable for use with variants that have -non-conventional Pawn moves (with legality testing off). To guarantee this -will not have any unexpected effects in normal Chess, this patch will only -be active if legality testing is off. - -2013-02-11 16:25:09 +0100 H.G. Muller : -Unreserve tourney game on exit during engine load - -While waiting for the feature timeout we are not yet in TwoMachines mode, -so quitting XBoard at that stage would not unreserve the upcoming game. -A global flag 'startingEngine' similar to 'waitingForGame' now signals -this condition. - -2013-02-10 13:40:10 +0100 H.G. Muller : -Better fix of feature timeout - -The previous fix of the 2nd engine's done=1 aborting the 1st engine's -feature timeout by starting the game caused problems with v1 engines, -or other engines that would never send done=1. It is now fixed by -explicitly testing for a pending feature timeout after resurrecting -the 1st engine, rather than having TwoMachinesEventIfReady wait for -initDone to be set by reception of done=1. - Also refrain from freezing the UI between match games, as in TwoMachines -mode the UI is mostly disabled anyway. - -2013-02-08 16:24:23 +0100 H.G. Muller : -Connect Ctrl key in WinBoard - -The Control key is now checked during move entry, for excluding moves -during analysis, or for copying pieces when editing a positions. But the -WB front-end did not read it out yet! - -2013-02-08 16:23:58 +0100 H.G. Muller : -Fix Makefile for install of Xiangqi pieces - - -2013-02-08 15:35:44 +0100 H.G. Muller : -Add Xiangqi piece images to project - -Let the images install in themes/xiangqi. - -2013-02-08 15:14:43 +0100 H.G. Muller : -Revive -flipBlack option - -The -flipBlack option in the cairo version is now implemented the same -way as it was in XBoard, swapping white and black pieces in filpView mode. -This requires a set black piece images that are the upside-down versions -of the white ones. - -2013-02-07 13:55:59 +0100 H.G. Muller : -Remove empty-square SVG images from project - - -2013-02-06 19:00:35 +0100 H.G. Muller : -Add desktop stuff for .xop MIME type. - -Icons and desktop file were missing, as was the automake code to package them. - -2013-02-06 16:48:33 +0100 H.G. Muller : -Update NEWS file - - -2013-02-06 14:48:27 +0100 H.G. Muller : -Add boolean -autoBox option - -This option controls the automatic popup of the ICS Input Box on typing -a printable character, which was annoing to some. The option can be -set from the ICS Options dialog. - -2013-02-06 10:56:20 +0100 H.G. Muller : -Draw both coords in a1 - -The lower-left board square needed two inscriptions, but DrawOneSquare() -only allowed one, so that the file ID would not be written. Now two strings -can be passed, and when align > 1 to indicate the alignment of the top -string, it is still checked if a bottom string is present as well, which -then is drawn with alignment 1 (= bottom right). - The rank coord or piece count can now also be double digit. - -2013-02-05 23:03:42 -0800 Arun Persaud : -updated po files for new release (make distcheck) - -2013-02-05 23:02:07 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - -2013-02-05 22:52:42 -0800 Arun Persaud : -new version number for release of 4.7.0 - -2013-02-05 11:56:10 +0100 H.G. Muller : -Let initial setting of Twice checkbox reflect current state - -The Twice checkbox in the Tournament dialog of WinBoard was by default -starting unticked. It is more convenient to have it preserve the current -state, however, based on the -lpi or -lgi value. Like the auto-incremet -checkbox already did. - -2013-02-04 22:07:05 +0100 H.G. Muller : -Put GTK warning in about-box - - -2013-02-04 21:59:05 +0100 H.G. Muller : -Fix warnings of build server - - -2013-02-02 15:58:04 +0100 H.G. Muller : -Fix GTK error auto-raising board - -The variable mainwindow is not set in the gtk2 version. Unfortunately -it is still used to determine default board size... - -2013-02-01 19:42:12 +0100 H.G. Muller : -Update Dutch WB translation - - -2013-02-01 19:37:06 +0100 H.G. Muller : -Add some new strings to WB translation template - - -2013-02-01 19:34:32 +0100 H.G. Muller : -Assign shortcut char to WB menu item - -The new Save games as Book item did not have a shortcut yet. - -2013-02-01 19:31:18 +0100 H.G. Muller : -Let WinBoard start in its installation folder - -The current directory in WinBoard was not automatically the same as the -installDir returned by SearchPath. Especially not if used without shortcut -by file association. - -2013-02-01 19:29:26 +0100 H.G. Muller : -Fix warning in WinBoard - - -2013-01-30 14:25:57 +0100 H.G. Muller : -Fix expose of to-square with grid off - -The code relied on drawHighlight to request an expose evet for the entire -square, but when lineGap = 0, drawHighlight is a no-op. - -2013-01-29 08:39:30 +0100 H.G. Muller : -Fix library order - -On OS X dialog windows could not get focus if -lXaw appeared after --lX11 -lXt in the linker command. This was cured by moving -@FRONTEND_FLAGS@ (which expands to -lXaw) first in the LDADD parameter -of the automake file. - -2013-01-28 17:38:26 +0100 H.G. Muller : -Preserve PGN tags when loading engine - -Switching to EditGame mode would normally erase the tags, but when analyzing -a loaded game this would be undesirable. When the engine is playing, keeping -the tags is dubious, but it is not obvious what to put in a new name tag, -so we leave that for now. - -2013-01-28 17:23:47 +0100 H.G. Muller : -Preserve mode on engine loading (sometimes) - -That the mode always switched to EditGame after engine loading was -particularly annoying at the start of a game (where leaving BeginningOfGame -mode would disablethe Time Control dialog, and the engine would not -automatically reply if you start playing) and AnalyzeMode. These two -modes are now preserved, BeginningOfGame by refraining from calling -EditGameEvent() and sending 'force' to the new engine, and AnalyzeMode -be calling AnalyzeModeEvent() after the engine is loaded and repositioned. - -2013-01-28 14:14:19 +0100 H.G. Muller : -Catch unknown engine in tourney games - -When an XBoard instance is playing on a tourney it can happen that it is -using a settings file with an engine list not yet containing a certain -participant, because that participant was just installed in the instance -that created the tourney file, but it did not save those modifications yet. -This error is now caught, and leads to an error popup and stopping of the -tourney play. This error was made non-fatal to allow the user to decide -if he wants to quit with or without saving the settings (which, after all, -does not seem up-to-date). - -2013-01-26 18:08:37 +0100 H.G. Muller : -Adjudicate pawn-drop mate as loss in Shogi - -Mating with a Pawn drop is illegal in Shogi, but rather than burdoning -the legality-testing by this complex rule, we simply invert the result -for such a mate. After all, Shogi customs are such that everything illegal -leads to an immediate loss. - -2013-01-25 10:05:44 +0100 H.G. Muller : -Adjudicate perpetual checks as loss also in Shogi - -The Xiangqi code for recognizing perpetual checks is now also activated for -Shogi, but in this case we bail out before checking for perpetual chases. -The mini-Shogi case is then recognized as a win for gote. - -2013-01-25 09:55:56 +0100 H.G. Muller : -Stalemate is a win in Shogi - -In regular Shogi this never occurs, but in the mini variants it happens -often enough. - -2013-01-22 20:49:34 +0100 H.G. Muller : -Fix engine timeout problem in match mode - -Reload of a reuse=0 engine would cause a done=1 event which would be -abort the feature timeout of the other engine in the first game. - -2013-01-22 20:32:33 +0100 H.G. Muller : -Enforce -popupMoveErrors - -One move error was using DisplayError(), in stead of DisplayMoveError(), -and thus did not obey the -popupMoveErrors option. - -2013-01-21 15:30:29 +0100 H.G. Muller : -Update texi file - - -2013-01-21 10:26:20 +0100 H.G. Muller : -Fix some warnings - - -2013-01-20 19:09:05 -0800 Arun Persaud : -Updated German translation - - -2013-01-19 17:54:59 +0100 H.G. Muller : -Do delayed board draw also with -stickyWindows false - -Only CoDrag needs to be suppressed on a configure event with --stickyWindows false, not the board redraw. - -2013-01-18 11:11:48 +0100 H.G. Muller : -Let tellothers command add comment to PGN in local mode - - -2012-12-30 15:19:57 +0100 H.G. Muller : -Allow use of ~ in pieceToChar for shadow pieces in any variant - -The use of shadow-pieces for promoted Pawns was limited to Crazyhouse and -Bughouse. But this is not necessary, and in fact undesirable, as it made -it impossible to implement Crazyhouse960, which combines shadow promotions -with Fischer castling (only available in variant fischerandom)s, and thus -has to be played as 8x8+5_fischerandom, using the Crazyhouse -pieceToChaTable. - -2012-12-30 15:06:33 +0100 H.G. Muller : -Resend engine-defined options after reuse=0 reload - -When the engine process is re-spawned for a new game under -xreuse setting, -any alteration of engine settings brought about through the Engine Settings -dialogs would be lost, and revert to the engine's default. This is now fixed -by re-sending all options (known from the previous load of the same engine) -with the current settings immediately after "protover 2", and ignoring the -engine's option features. Rather than clearing the option list, and -redefining it from the option features. - -2012-12-30 14:58:16 +0100 H.G. Muller : -Implement aborting of games on engine request. - -A new game-end command is added. For bakward compatibility it is disguised -as an old one, namely "1/2-1/2 {Engine Abort Request}". These resultDetails -are recognized as special, and rather than ending the game in a draw (which -GUIs not implementing this), the game will be completely 'expunged' from -the match or tourney it is part of, leaving no trace in the saveGameFile. - -2012-12-30 14:54:43 +0100 H.G. Muller : -Store some more tourney params in tourney file - -The hash and threads settings, as well as ponder and book options are now -also saved in the tourney file, so that tournaments can be played in -parallel where these parameters differ, and no mess up can occur on -restarting a touney after doing something else. - -2012-12-23 11:26:31 +0100 H.G. Muller : -Do not automatically save aborted games in tourney PGN - -When the game result is 'unfinished', we prompt for a filename rather -then using the specified saveGameFile if a tourney is in progress. - -2013-01-19 08:35:52 -0800 Arun Persaud : -fix configure bug that showed up on OS X (couldn't find X11/Dialog.h) - -X_CFLAGS (set by AC_PATH_XTRA) was not used in Makefile.am. It was used in tests for X11/Dialog.h, etc. so configure worked, but make didn't. - -2013-01-18 22:26:13 -0800 Arun Persaud : -Updated Ukrainian translations - - -2013-01-09 07:57:43 -0800 Arun Persaud : -removed trailing whitespace - - -2013-01-09 07:49:20 -0800 Arun Persaud : -Updated copyright notice to 2013 - - -2012-12-22 22:46:21 +0100 H.G. Muller : -Do not move to forwadMostMove when unpausing AnalyzeMode - - -2012-12-22 22:44:50 +0100 H.G. Muller : -Use Ctrl key in AnalyzeMode to exclude entered move - - -2012-12-22 20:40:26 +0100 H.G. Muller : -Implement insufficient mating material for Knightmate - -KBK is draw with Royal Knight. With exo-pieces also KNK and KFK. - -2012-12-22 20:25:51 +0100 H.G. Muller : -Fix rep-draw detection in drop games - -In games like Crazyhouse every move is reversible, as captured pieces -can eventually change sides again, and be dropped back on the board. -So we have to search back a full 100 ply for repetitions, passing captures -and Pawn moves. - -2012-12-11 22:33:07 -0800 Arun Persaud : -updated po/pot files - - -2012-12-11 22:18:05 -0800 Arun Persaud : -new version number for developer release - - -2012-12-10 14:48:05 +0100 H.G. Muller : -Prefer pause mode on pondering engine over 'easy' - -If the thinking engine is stopped after its move because it does not -support pause, is is still better to use pause on the pondering engine -than to switch of its pondering with 'easy', as the latter might not -be instantaneous. Also switch off pondering in the thinking engine before -it gives the move, just in case it does not respond immediately to -easy / hard. - -2012-12-10 13:40:47 +0100 H.G. Muller : -Update WinBoard translation template - - -2012-12-10 13:35:41 +0100 H.G. Muller : -Fix min-Shogi promotion zone - -In integer arithmetic N*2/3 is not the same as N - N/3, with as a result -that the white promotion zone was 2 ranks deep on 5x5 boards. This only -happened in LegalityTest, but because this would classify all moves to -4th rank an non-promotions, they would be printed with a faulty -deferral (=) sign as promochar in SAN. - -2012-12-10 13:32:49 +0100 H.G. Muller : -Do not clear PGN tags on Analyze File - - -2012-12-10 13:28:37 +0100 H.G. Muller : -Fix -fSAN in AnalyzeFile mode - -The exception that a PV relates to currentMove rather than forwardMostMove -applies not oly in AnalyzeMode, but also in AnalyzeFile. Furthermore, -PvToSan did not properly restore the pushed game tail in this case. - -2012-12-08 16:02:09 +0100 H.G. Muller : -Improve scaling of border bitmap (WB) - -The StretchBlt mode is set from dither to delete. - -2012-12-05 16:34:58 +0100 H.G. Muller : -Implement use of pause / resume protocol commands - -Engines that implement feature pause=1 will be paused during their move -on a pause event; pondering engines will be controlled either through -'pause' or (if they don't support that) 'easy', which both should work -instantaneously. If the thinking engine does not support 'pause', the pausing -will be deferred to when it produces its move, and is implemented by not -relaying the move, and switch off pondering for both. - -2012-12-03 12:58:36 +0100 H.G. Muller : -Fix Loop-Chess promotions - -Loop Chess is not a supported variant, but hould be playable as Crazyhouse -with an altered pieceToCharTable, not defining the shadow promotion pieces. -But with legality testing on promotion to shadow piece would take place -even if the shadow piece was not defined. - -2012-12-02 22:44:55 +0100 H.G. Muller : -Fix move highlighting with animation off - -In WB the moving of SetHighlights to after the animation had broken the -highlighting of engine moves, because it was also moved after DrawPosition. -While it is DrawPosition that actually draws the highlights. Now it has been -moved to just before DrawPosition. - -2012-12-02 11:09:14 +0100 H.G. Muller : -Start browsing in currently-selected folder (WB) - -The folder-browse dialog always started at My Computer, while file browsing -started in the globally last-used folder (which might not be related at all -to the file entry we are now browsing for). - -2012-11-29 23:38:18 +0100 H.G. Muller : -Implement book-creation functions - -A new menu item triggers conversion of the currently loaded PGN file -to a Polyglot book, saved with the GUI-book filename. A (volatile) option --mcBookMode alters the probing algorithm to build a book from scratch by -playing games (and using a form of learning). - -2012-11-29 22:23:44 +0100 H.G. Muller : -Use colors in Board-Options dialog also for font pieces (WB) - -The piece color settings now control the pieceColor or fontPieceColor -settings, depending on the setting of -usePieceFont. - -2012-11-29 22:14:05 +0100 H.G. Muller : -Implement auto-creation of ICS logon file - -Under control of the new option -autoCreateLogon (which can be set from -the ICS Options dialog) the first two lines in response to the ICS "login:" -pompt will be saved on a newly created logon file (if logon from such -an existing file failed). - -2012-11-29 21:56:02 +0100 H.G. Muller : -Add Themes dialog (WB) - -This dialog, done by the generic popup, contains controls for many settings -that so far could only be controlled by options. It also introduces the -concept of 'themes', sets of options stored in the multi-line option --themeNames. - Add some dummy routines to suppress compile errors in functions that -cannot be called yet in XBoard. - -2012-11-29 21:32:03 +0100 H.G. Muller : -Allow external piece bitmaps and board border (WB) - -The -pieceImageDirectory is now also used for WinBoard, to indicate -a directory of .bmp files, used to replace the built-ins. The outline -and solid bitmaps can be full-color. This allows winBoard to use the -WinBoard-zeta graphics. A new option -border can indicate a bitmap file -used to draw a half-square-wide border around the board. - A white background has to be drawn underneath the black pieces, to avoid -color-interference with the board, just like happens for the white pieces. -These backgrounds now always use bright white, rather than -withePieceColor. - -We still have to work on the scaling of the zeta (600x600) bitmaps to -the actual board size, as for some bitmaps the stratchblt is ugly. - -2012-11-29 21:05:15 +0100 H.G. Muller : -Add 'Continue Later' button in Tournament dialog (WB) - -This button makes it possible to accept the values specified in the -dialog without immediately starting the tournament (as OK does), -so you can re-open the dialog later, and OK it then. - -2012-11-29 20:25:35 +0100 H.G. Muller : -Load opponent logo based on handle in ICS play (WB) - -The logos for handles on FICS are sought in folder logos\freeches.org\*.bmp, -etc. If no logo for the handle is found there, the logo of the ICS is -displayed as usual. - -2012-11-19 20:35:05 -0800 Daniel Dugovic : -Fix configure script for --enable-zippy (tiny change) - -reported and patch by Daniel. - -edited by Arun Persaud: -- also fixed #ifndef ZIPPY -> #if !ZIPPY -- didn't change #if -> #ifdef - -2012-11-10 00:12:34 -0800 Arun Persaud : -don't define X_LIBS when using gtk-frontend - - -2012-11-07 22:16:09 -0800 Arun Persaud : -updated po/pot files; added new frontend files - - -2012-11-07 22:14:20 -0800 Arun Persaud : -fix configure script for --with-Xaw and --with-gtk - -made Xaw the default and included xaw or gtk sources as extras -in case the other frontend is selected for make distcheck - -2012-11-07 21:13:38 -0800 Arun Persaud : -new version number for developer release - - -2012-10-31 09:55:02 +0100 H.G. Muller : -Draw frames around memos and listboxes - - -2012-10-30 17:39:59 +0100 H.G. Muller : -Adapt lineGap during sizing - - -2012-10-30 15:04:32 +0100 H.G. Muller : -Fix clock highlighting - - -2012-10-30 10:59:45 +0100 H.G. Muller : -Fix Chat Box - -The genric TypeInProc is re-instated, and replaces ICSKeyEvent as primary -handler for special keys in one-liner text edits. - -2012-10-29 19:46:27 +0100 H.G. Muller : -Pay attention to NO_CANCEL dialog flag - - -2012-10-29 14:18:33 +0100 H.G. Muller : -Fix clock clicking with GtkEventBox - -Like in WinBoard the button-3 case is now handled in the primary -event handler (and communicated to it in a kludgy way). It would be -better if this was absorbed in ClockClick(). - -2012-10-28 22:25:22 +0100 H.G. Muller : -Fix logo placement - -Graphs were not recognized as possible SAME_ROW elements. A Graph requesting -FIXED_H (which only the logos did) is now packed into a (borderless) aspect -frame. - -2012-10-25 23:04:42 +0200 H.G. Muller : -Add window positioning - -Sticky windows now sort of works, but needs unexplained fudge factors. -Reopening a persistent dialog centers it on the board, and disobeys -the positioning command. The WindowPlacement of the BoardWindow was -again added (it was commented out during development). - -2012-10-22 22:41:14 +0200 H.G. Muller : -Make board sizing work through subtracting fixed height - -There is now no attempt to give a size to the board drawing area, so it -can later be sized as small as we want. The frame width is determined -by subtracting the nominal board size from the actual window size, -(because the clocks will have that width, and the board will startas 1x1), -while the vertical margin is determined as the difference between the -bactual window height, the drawing-area height minus a fudge of 25 pixels -to compesate for the erroneously allocated blank space below the board. - -2012-10-22 21:09:51 +0200 H.G. Muller : -Fix warnings - -The highTextStart/End are now declared in engineoutput.h, shared between -nengineoutput.c and xengineoutput.c. Unused variables were removed. -Also fix warnings in xboard.c and xoptions.c. - -2012-10-22 17:40:08 +0200 H.G. Muller : -Delete emptied front-end files, and move rest to gtk directory - -Remove #ifdeffed-out Xt code that has GTK implementation. The xgamelist -and xhistory have been completely cleared off content, and were removed. - -2012-10-27 00:12:42 +0200 H.G. Muller : -Add copy-paste - -The code from gtk-xt could be used with almost no modification. - -2012-10-21 09:09:01 +0200 H.G. Muller : -Some experimenting with sizing - -Does not work as intended yet. - -2012-10-21 23:04:49 +0200 H.G. Muller : -Add task-bar icon - -Funny enough it was necessary to swap the two svg icons to make this work! - -2012-10-20 10:29:37 +0200 H.G. Muller : -Make some tall dialogs multi-column - -A dummy button was added to the last row of New Variant to make the -number even. A legality-test warning as put in the New Variant dialog -Fix width of tourney-file in Match dialog - -2012-10-20 21:14:33 -0700 Arun Persaud : -updated some icons to SVG - - -2012-10-20 19:57:58 +0200 H.G. Muller : -Add displaying of icons - -A new Option type, 'Icon', was added for this as in GTK Icons and Labels -need different types of widget. The icons are now svg, so we could -remove the icon pixmaps. - -2012-10-20 14:25:41 +0200 H.G. Muller : -Fix button bar - - -2012-10-20 14:03:48 +0200 H.G. Muller : -Add BarBegin, BarEnd options - -This makes the button bar display correctly. Also fix v-sizing of menu bar. - -2012-10-20 10:01:35 +0200 H.G. Muller : -Add listbox double-click callback - -This function was formerly performed by WheelProc. - -2012-10-19 17:29:40 +0200 H.G. Muller : -Add hiding / showing second Engine Output pane - -The handle of the GTK table for the second engine is stored in the -EndMark handle by GenericPopUp, so it can be used later to hise/show -that table. - -2012-10-19 17:15:58 +0200 H.G. Muller : -Use different tables for different dialog columns - -Making the same table wider (in steps of 3) to get multiple columns -does not work, because it forces options to align vertically. This -wrecks dialogs like Load Engine, where one column contains a very -high option (listbox). Now differnt tables are created for each column, -packed in a new itermediate hbox. In case of the Engine Output window, -a vbox is used instead to cause vertical stacking. - Only multi-line text-edits and listboxes are now allowed to take up -vertical space changes, while only the middle colum of the table -can take up horizontal size changes. Within packing boxes space is -equally distributed. - The labels above the particiant-selection widgets had not the same width -as the textview / listbox, leading to misplacement of the second label. - For Engine Settings the spontaneous breaking into columns did not -involve a SAME_ROW flag, so the 'columns' were stacked vertically. -In addition the columns were too tall for GTK. They are now 20 options max. - -2012-10-19 13:46:37 +0200 H.G. Muller : -Deselect first char in Move Type-in and ICS Input Box - -After popup the Move Type-In had the typed character in it, but it was -selected, so that typing a second character would erase it again. -Same for the ICS Input Box. A prototype for CursorAtEnd is now also added. - -2012-10-19 13:33:50 +0200 H.G. Muller : -Close Move Type-in on Enter - -The code is squeezed into the ICSKeyEvent callback. - -2012-10-18 21:57:50 +0200 H.G. Muller : -Add access routines to checkboxes and FocusOnWidget - -The handler of the filter field needs it to return focus to -the listbox. - -2012-10-18 21:42:49 +0200 H.G. Muller : -Add game-list callbacks - -The callbacks for listbox and filter text are treated by the same callback, -which does both key presses and button double-clicks. -Giving focus back to the listbox after filtering does not yet work! - -2012-10-18 16:27:57 +0200 H.G. Muller : -Add optional callback to Label Options - -For some reason this does not work. The callback isn't called! - -2012-10-18 13:40:55 +0200 H.G. Muller : -Add type-in event to board for popping up box - - -2012-10-18 13:12:48 +0200 H.G. Muller : -Add Shift detection - -The state of Shift and Ctrl was only probed on button clicks, so it -is now read out of the button-event struct in the relevant button handlers. -For backwad compatibility, they store it in a global, so the routine -ShiftKeys can take them from there. - -2012-10-18 12:35:20 +0200 H.G. Muller : -Remove some unneeded low-level X11 code - -Things like tabbing between controls, mouse-wheel scolling etc. are all -automatic in GTK, and thuse don't need to be ported. - -2012-10-18 10:12:27 +0200 H.G. Muller : -Add file browser - -The gtk-xt code for browsing in response to menu items rather than dialog -browse buttons) was grafted. It seems desirable to merge the two browsing -functions, though. Pass extra params used by Xaw to FileNamePopUpGTK. -The code was altered to use DelayedLoad. - -2012-10-18 09:54:41 +0200 H.G. Muller : -Fix ListBox, and add some support routines - -The srolled-window for the listbox used a uninitialized variable for its -width, causing a crash. Now it pays attention to the Option.max and .value -size hints. The access routines were copied from gtk-xt. HighlightWithScroll -could just a wrapper for HighlightListBoxItem, as GTK auto-scrolls. - -2012-10-17 20:01:37 +0200 H.G. Muller : -Connect CommentClick handler - -This can make use of generic memo callback, so it could be entirely -backend. Therefore it was moved to dialogs.h. As it shared a global with -some other back-end popup routines to remember the current move, these -could now be moved out of xboard.c too. (Well, not so for the X11 front-end, -so it has now been put in a header. :-( ) - -2012-10-17 19:41:11 +0200 H.G. Muller : -Fix animation - -Because FrameDelay does block the event loop, even though it releaes the -CPU, expose events start to lag behind the actual drawing. By combining -expose events for overlapping squares, rather than decompose them into -3 rectangles, this problem seems to go away. But only if there is an -extra exposure on the squares to be drawn also non-overlapping frames -will be properly drawn (?!). - -2012-10-17 14:40:59 +0200 H.G. Muller : -Implement highlighting in engine output by through generic method - -HighlightMove was made generally available for all text. It is now just a -wrapper for the generic HighlightText, and could be moved to the back-end. -(This requires the initialization to be widget specific, and the flag -indicating it has been done is now stored in the Option.min field.) - -2012-10-17 14:33:28 +0200 H.G. Muller : -Let engine-output memos use new generic callback - - -2012-10-17 13:53:03 +0200 H.G. Muller : -Add scrolling of Move History - -To have access to the textview, its handle is now stored in the -Option.textValue field. - -2012-10-17 13:11:23 +0200 H.G. Muller : -Add highlighting in move list - -For now it is assumed the normal background will be white (for clearing -the highlight). - -2012-10-16 19:44:40 +0200 H.G. Muller : -Make generic memo-event handler, and connect history callback - -Large text widgets can now define a user handler in their Option.choice -field. If they do, agneric callback is added tothem, which catches mouse -events. Button release and pointer motion pass their coordinate and type -to the specified user routine. Button presses in addition retrieve -the text from the widget, set the cursor in it to the clicked point, -and convert it to a character position, also passed to the user. - The user is responsible for ignoring events he is not interested in. - -2012-10-16 15:58:58 +0200 H.G. Muller : -Add key-handler for ICS Input Box - -In contrast to the X11 code, all intercepted keys are now treated by -the same callback. The ICS Input Box callback triggers on Up, Down and -Return key, and refers to these symbolically. - -2012-10-16 15:05:45 +0200 H.G. Muller : -Highlight Pause button - - -2012-10-16 13:52:41 +0200 H.G. Muller : -Better cleansing of xboard.c from X11 types - -The #includes for X11 files were still in there. - -2012-10-16 13:28:32 +0200 H.G. Muller : -Add text insertion in engine-output memos - - -2012-10-16 09:34:02 +0200 H.G. Muller : -Append recent engines to engine menu - -This is now entirely moved to the back-end, by doing it in the table -from which the menus are later generated. The special callback for engine -items is abandoned, and the euProc for such items is left NULL to flag -that RecentEngineEvent should be invoked with the applicable engine number. -To calculate the latter a global variable firstEngineItem is dynamically -set to the length of the regular engine menu. - -2012-10-15 22:17:50 +0200 H.G. Muller : -Transfer more gtk-xt code, and add some new - -Add input-source handling -Graft color picker ( callbeack in the text field is still missing!) -Handle contents of label widgets (store handles in Option for access) -Add printing of clocks -Add printing of window title -Pay attention to BORDER attribute of Label Options (pack in frame) -Delete ReadBitmap code (also remove #including of bitmap files for icons) -Fix layout of textviews (adapt to newer Option format, incl. wrap, scroll) -Support vertical stacking in Break Option (no table widening when !SAME_ROW) -Make default horizontal scroll policy automatic (for engine-output window) -Fix disabling of unused spinners in TC dialog - -2012-10-15 20:47:33 +0200 H.G. Muller : -Connect dialog Browse buttons to GTK browser - - -2012-10-15 19:52:17 +0200 H.G. Muller : -Implement menu checkmarking and enabling - -odes in the (later over-written) handle field specify which items -are to be checkmarked, and by what style button. - -2012-10-15 16:18:12 +0200 H.G. Muller : -Attach expose handler and connect to mouse events - -The GraphExposeProc is conected to the Graph widgets. A gdk draw routine -is used to copy the buffer bitmap to the display. It is also connected -to button and motion-notify events. - In this version the board can be fully operated with the mouse. - -2012-10-14 22:00:14 +0200 H.G. Muller : -Transfer most available gtk-xt code to xoptions.c - -GenericPopUp and PopDown are grafted from gtk-xt into gtk2. -The version compiles, but segfaults before doing anything, with error -messages about unexpected cases in GenericPopup for Graph and PopUp Options -of the main board. The spin options need special treatment in GetWidgtText. - -2012-10-15 11:41:33 +0200 H.G. Muller : -Give LoadListBox two extra parameters - -It often occurs that we just want to swap two elements, and reloading -the entire listbox would be a very inefficient way to do this in widget -sets that allow access to a single element. - -2012-10-14 20:36:34 +0200 H.G. Muller : -Remove all X11 code by #ifdeffing it out - -With #ifdef TODO_GTK we disable all X11 code, in order to get a compiling -X11-free version. The disabled sections can then be replaced by code -for another widget set, the X11 version still showing what it was supposed -to do. - -2012-10-14 17:37:18 +0200 H.G. Muller : -Move timer functions to new file xtimer.c - -The timers for the clocks, periodic analysis events and ScheduleDelayedEvent -go into a separate file. - -2012-10-14 15:31:56 +0200 H.G. Muller : -Make xevalgraph.c backend - -The only front-end stuff left in xevalgraph.c was an unnecessary reading -of the window size (which could be obtained from the WindowPlaceent struct), -and drawing (all cairo now). The drawing was moved to draw.c, and the -remaining part renamed nevalgraph.c. - -An attempt to list them in a less chaotic way. - -2012-10-14 14:34:09 +0200 H.G. Muller : -Cleanse back-end code of all references to X11 types - -When compiling for X11, common.h #included X11/Intrinsics.h so that -X11-specific data types could still be used throughout the back-end part -not shared with WinBoard. By temporarily disabling this, error messages -could be generated on all such occurrences, and were then solved. This -included the following: - The InputSource struct is not uses in usystem.c at all, and its definition -could be moved to xboard.c. InputSourceRef, which logically should heve been -defined as (InputSource *), is in reality (void *), so the back-end can -pass it around. - Some non-platform-dependent stuff of general interest had prototypes -(or external vars) in xboard.h. This is now moved to a new header xboard2.h, -to allow it to be shared without bringing in X11 dependence. - The EngineOutputProc was defined inconsistently, but the header was not -sufficiently shared to flag this error. This has been repaired now, by moving -the template to menus.h. - -2012-10-14 13:39:47 +0200 H.G. Muller : -Remove xedittags.c, .h from project - -The tiny bit of code that was left was absorbed in dialogs.c, the one -prototype to menus.h. - -2012-10-14 12:53:20 +0200 H.G. Muller : -Remove inclusion of frontend.h from backendz.h - -This did not seem to serve any purpose at all. - -2012-10-14 12:49:28 +0200 H.G. Muller : -Split xhistory.c in front-end and middle-end part - - -2012-10-14 12:21:09 +0200 H.G. Muller : -Move MarkMenuItem to xoptions.c - -This to make xoptions.c completely independent from the inclusion of -frontend.h. The prototype is moved to menus.h. - Loose end: DrawPosition in board.c does not see the prototype. -Very suspect that it wants to see it. Why would it have to correct the -flipView setting??? Better se to it that it is correct to start with! - -2012-10-14 12:14:07 +0200 H.G. Muller : -move testing for no options to back-end - -The test if an engine has options and display a note instead of -the Engine Settings dialog when this is not the case is moved -to outside of GenericPopUp, to make the later independent of calling -other routines. - -2012-10-14 11:20:16 +0200 H.G. Muller : -Remove some unnecessary header includes - - -2012-10-14 10:47:21 +0200 H.G. Muller : -Move ICS-engine analyze and AnalyzeGame code to shared back-end - -This code was still duplicated between WB and XB in the front-ends. -Because of its incorporation in AnalyzeModeEvent the 'middle-end' -function AnalyzeModeProc could be eliminated. AnalyzeModeEvent was made -to return an int to flag its success, and keep the JAWS code based -on it out of XBoard. - The AnalyzeGame code is now incorporated in AnalyzeFileEvent(). - -2012-10-26 10:28:59 +0200 H.G. Muller : -Add configure switches for Xaw vs GTK. - -This patch is an adapted version of the one Arun made at the end of the -gtk2 branch. It uses the exact same version of his configure.ac, but the -Makefile.am is adapted to the situation in master at the beginning of it, -after duplication of the X11 front-end files in the xaw directory for -preserving them, while the versions that will be modified to GTK front-end -are still in the xboard directory. - -2012-10-25 11:12:41 +0200 H.G. Muller : -Prepare xoptions.c for middle-end changes - -Some changes that can be pre-empted, such as the splitting of Label -into Label and Icon Option type, and some dummy wrappers are already -implemented, so they can be used when needed by GTK. - -2012-10-25 09:20:03 +0200 H.G. Muller : -Preserve copies of the X11 front-end in xboard directory - -The X11 front-end has been moved to the xaw directory, but copies -are retained for modifying them to gtk versions. - -2012-10-24 08:55:27 +0200 H.G. Muller : -Move X11 front-end to directory xaw - - -2012-10-31 18:18:02 +0100 H.G. Muller : -Fix initial enables in TC dialog - - -2012-10-30 14:47:24 +0100 H.G. Muller : -Fix image extension used for browsing to .pgn - - -2012-10-28 21:39:19 +0100 H.G. Muller : -Fix WinBoard compile error on enum PEN - - -2012-10-30 11:20:54 +0100 H.G. Muller : -Fix crash in promotion popup - -There were not enough entries for Capablanca Chess with legality-testing off, -where King is also presented as a choice. - -2012-10-28 18:19:23 +0100 H.G. Muller : -Fix message in New Variant dialog - -Even in -ncp mode the message was referring to the 'current engine'. - -2012-10-28 18:16:20 +0100 H.G. Muller : -Fix crash on animation after resizing - -The animate buffers were still holding pointers to a discarded cairo surface. - -2012-10-21 14:49:45 +0200 H.G. Muller : -Fix variant-dependent pieces - -The code to select the actually used piece images from the available ones -(from InitDrawingSizes) is now made into a subroutine, and also called -after resizing the pieces. - -2012-10-26 10:18:48 +0200 H.G. Muller : -Replace marble texture pixmaps by png - - -2012-10-26 10:13:27 +0200 H.G. Muller : -Replace xiangqi board pixmaps by png images - - -2012-10-26 10:08:44 +0200 H.G. Muller : -Remove the texture pixmaps from project - -These were already replaced by png textures. - -2012-10-23 15:02:56 +0200 H.G. Muller : -Fix re-rendering of svg on resize - -The previously prepared bitmaps were retained if we resized, rather then -rendering the svg atthe new size. - -2012-10-21 15:48:30 -0700 Arun Persaud : -update po/pot files - - -2012-10-21 15:47:12 -0700 Arun Persaud : -new version number for developer release - - -2012-10-21 11:10:36 -0700 Arun Persaud : -we still need a few bitmaps, so the directory needs to be included in Makefile.am - -make distcheck complained about this - -2012-10-21 15:56:43 +0200 H.G. Muller : -Rename svg shogi pieces, so they become usable - -Only white pieces are present. For black they would have to be flipped. - -2012-10-21 15:54:25 +0200 H.G. Muller : -Fix bug in resizing on variant switch - -The fix of the garbage pixels had unfortunately broken this. - -2012-10-21 15:15:01 +0200 H.G. Muller : -Fix bug in fallback mechanism - -After failure to load a piece from a specified -pieceImageDirectory -the default theme was not tried, because the cairo function to load -from a pgn file returns a valid handle even if the file does not exist. - -2012-10-21 14:58:42 +0200 H.G. Muller : -Get svg error message - - -2012-10-21 14:49:45 +0200 H.G. Muller : -Fix variant-dependent pieces - -The code to select the actually used piece images from the available ones -(from InitDrawingSizes) is now made into a subroutine, and also called -after resizing the pieces. - -2012-10-16 12:08:25 +0200 H.G. Muller : -Remove caveat on available pieces fromNew Variant dialog - -In the cairo version all pieces are available at all board sizes. - -2012-10-21 11:41:11 +0200 H.G. Muller : -Remove some unused images from png directory - -Currently only the three board texture files are used. But the piece -images are still left, because they might be useful if we ever want -to mae XBoard configurable for not using librsvg. - -2012-10-21 10:40:37 +0200 H.G. Muller : -Fix bug in resizing - -The nominal size of the window was not set in the correct Option struct. - -2012-10-21 09:58:23 +0200 H.G. Muller : -Prevent odd-width line shift in length direction - - -2012-10-21 09:48:29 +0200 H.G. Muller : -Print missing-pieces error message to console - -The GUI might not yet be up at this point.In addition, suppress -the rest of the code, because it could give segfaults. - -2012-10-21 09:30:26 +0200 H.G. Muller : -Fix garbage pixels on the right of the board - -The extra pixel that is requested in sizing the board window back to -an available size because we ofte get one less pixel than we ask for -can lead to a line of garbage pixels next to the board. This is combatted -by limiting expose events to the true board area, remembering that in the -Graph Option rather than the actual window size, and suppressing resizing -when the latter only exceeds the stored width by more than 1 pixel. - -2012-10-15 10:27:14 +0200 H.G. Muller : -Trim board-window size - -The board window will sometimes be a pixel larger than requested. -The ReSize routine will now reset the size values in the Graph Option -to what they were supposed to be, to prevent expose events will -draw nonsense in the extra space. - -2012-10-13 23:26:10 +0200 H.G. Muller : -Adapt docs for svg/png in stead of bitmap/pixmap - - -2012-10-13 09:35:31 +0200 H.G. Muller : -Spontaeous changes in gettext stuff - - -2012-10-13 08:03:48 +0200 H.G. Muller : -Move Shogi svg pieces to own directory - - -2012-10-13 07:57:48 +0200 H.G. Muller : -Remove unnecessary Xt colors and call to MakeColors - - -2012-10-13 07:50:56 +0200 H.G. Muller : -Code cleanup: move expose redraw to draw.c - - -2012-10-13 07:37:45 +0200 H.G. Muller : -Suppress warning for InitDrawingHandle - - -2012-10-13 07:33:15 +0200 H.G. Muller : -Make fallbackPieceImageDirectory hardcoded - - -2012-10-13 07:18:23 +0200 H.G. Muller : -Increase drag delay too 200 msec - -On my slow laptop it can take more than 100 msec to reallocate bitmaps -in the generic expose, with as a consequence that the DelayedDrag event -is not processed before the timeout expires. The timeout event then triggers -a redraw, which again takes so long that the timeout expires before the -event to reset the timer could be processed, and this just perpetuates -itself, leading to a large series of queued redraws, and a long waiting time -for an image to appear after the sizing stops. - -2012-10-13 07:01:05 +0200 H.G. Muller : -Fix segfault on faulty command-line option - - -2012-10-12 14:42:26 +0200 H.G. Muller : -Suppress anti-aliasing in -monoMode - -In the color-substitution code, always use bi-level alpha and color. - -2012-10-12 13:34:04 +0200 H.G. Muller : -Remove piece pixmaps from project - - -2012-10-12 11:47:25 +0200 H.G. Muller : -Implement proper fallback cascade - -Try in order cached svg, cached bitmap, user png, user svg, default svg. - -2012-10-12 11:06:06 +0200 H.G. Muller : -Cache svg handles - - -2012-10-12 10:45:29 +0200 H.G. Muller : -Install svg pieces in themes/default - -The svg pieces are installed with the XBoard data in the directory -.../xboard/themes/default . A new option -fallbackPieceImageDirectory -is added, and is configured in the master settings file to point to -these pieces. This options, which replaces -svgDirectory, is volatile, -and the menu control to set it is removed. The -pngDirectory option -is renamed to -pieceImageDirectory (-pid). - -2012-10-12 10:02:50 +0200 H.G. Muller : -Remove bitmaps from project - - -2012-10-12 09:55:07 +0200 H.G. Muller : -Install the wood textures as png - -The xboard.conf has to be edited to set these as default textures, -in stead of the .xpm files. - -2012-10-12 09:50:31 +0200 H.G. Muller : -Add hatched board texture - -A png file with hatching is added, so it can be used for dark squares -in a monochrome theme. It is installed in a new data directory -.../xboard/themes/textures. - -2012-10-11 22:21:06 -0700 Arun Persaud : -added a black and white theme to replace the mono option - - -2012-10-11 20:56:42 -0700 Arun Persaud : -added SVGs to dist files in automake - - -2012-10-11 19:44:22 +0200 H.G. Muller : -Fix exposure of atomic captures - -The grid lines had to be repaired too, so damage marker 2 had to be used. - -2012-10-11 19:13:24 +0200 H.G. Muller : -Fix animation with textures off - -The blank square was not shifted to (0,0) when drawing the animation buffer. - -2012-10-11 19:08:49 +0200 H.G. Muller : -Fix 1-pixel offset of grid lines on some cairo implementations - - -2012-10-11 09:51:07 +0200 H.G. Muller : -Solve odd lineGap problem - -Not all cairo versions seem to round the same when an odd-width line -is to be drawn at integer coordinates. So now we explicitly ask it -to be drawn centered on half-odd-integer coordinates. - -2012-10-09 18:52:43 +0200 H.G. Muller : -Add -trueColors option - - -2012-10-09 14:56:16 +0200 H.G. Muller : -Always render svg pieces anew on size change - -The svg pieces are now unconditionally rendered to supply the pngPieceImage -master source otherwise read from png file. This is then fed into the -original png code (so that if for some reason it fails, we fall back on png -pieces, and finally on built-in pixmaps). - -2012-10-09 14:06:47 +0200 H.G. Muller : -Fix rsvg version in configure.ac - - -2012-10-08 19:54:19 -0700 Arun Persaud : -initial svg rendering - - -2012-10-08 18:34:05 -0700 Arun Persaud : -added cairo and librsvg to configure process - - -2012-10-08 18:32:55 -0700 Arun Persaud : -added SVGs - -converted from inkscape SVG to plain SVG before adding - -2012-10-10 21:19:25 +0200 H.G. Muller : -Adapt Eval Graph code to new drawing system - -The eval graph now triggers an expose after drawing, and gets its size -from the Option fields. - -2012-10-10 20:37:58 +0200 H.G. Muller : -Fix expose requests seek graph - - -2012-10-10 20:07:53 +0200 H.G. Muller : -Make draw handle for board globally available - - -2012-10-10 19:45:39 +0200 H.G. Muller : -Let expose requests pay proper attenton to widget - -So far, expose requests were always assumed to be for the board widget, -preventing display of the labels. - -2012-10-10 18:45:59 +0200 H.G. Muller : -Fix initial display of logos - -The logos were selected and printed during the initialization, -before the main event loop was started. So the expose events during -widget creation, which created the drawing surfaces, were only processed -after the initial drawing of logos, so that there was nothing to draw on! - -2012-10-10 17:25:25 +0200 H.G. Muller : -Fix alignment of highlight expose - - -2012-10-10 17:19:52 +0200 H.G. Muller : -remove NewSurfaces - - -2012-10-09 13:57:40 +0200 H.G. Muller : -Make expose handler generic - -The Graph Option now returns two handles in hitherto unused fields of its -Option struct: Option.choice is a cairo handle of a memory buffer the user -must draw to, while Option.textValue is the handle to the widget. -Expose events copy the memory buffer to the display for the exposed area. -A routine DrawExpose() is supplied to let the user generate expose events. - -2012-10-06 21:30:59 +0200 H.G. Muller : -Reload piece images when pngDirectory is changed - -The OK function of the board options dialog now tests for a change -in pngDirectory and passes a parameter to InitDrawingParams to tell -it to destroy the old images. This cause a reload on scaling the pieces. - -2012-10-06 20:16:54 +0200 H.G. Muller : -Suppress redraw during sizing - - -2012-10-06 20:10:18 +0200 H.G. Muller : -Fix bug in resize trigger - -Even if the square size does not change, the window has to be shrunk -back to fit the board. - -2012-10-06 19:54:50 +0200 H.G. Muller : -Make Piececolor options work on png pieces - -The scaled, antialiased bitmaps are now colored according to the option -settings. This is done by decomposing every pixel in a white, black and -transparency component, which is possible because the opacity is -directly give in the alpha channel, and black originally was a hard zero. -So what you se in the red channel must be white (as the original white -was #FFFFCC), and the rest of the opacity must be due to black. - The color to be replaced (white for the white pieces, black for the black -pieces) is then replaced by the original weight of this color times the -color from the option. - -2012-10-06 17:53:25 +0200 H.G. Muller : -Plug resource leak on rezising with pixmaps - - -2012-10-06 16:19:41 +0200 H.G. Muller : -Fall back on built-in pixmaps if png pieces unreadable - - -2012-10-06 14:21:11 +0200 H.G. Muller : -Do coordinate text alignment with cairo - - -2012-10-06 13:40:12 +0200 H.G. Muller : -Some cleanup - - -2012-10-06 12:14:16 +0200 H.G. Muller : -Clean up drawing code - -Now all routines only draw through cairo, the destination surface can -be passed to them, making it possible to do the duplicate drawing -to the memory board image in a cleaner way. - -2012-10-06 11:37:20 +0200 H.G. Muller : -Check in draw.c, draw.h - - -2012-10-06 11:26:24 +0200 H.G. Muller : -Remove all bitmap & pixmap drawing - -All Xt code for drawing the board is now removed, as are the --pixmapDirectory and -bitmapdirectory option. This version is now -completely dependent on cairo for handling of all graphics anywhere. -(The build-in pixmaps are still left, though, for later use as an -alterative cairo source when no png files are found.) - -2012-10-06 10:29:06 +0200 H.G. Muller : -Separate off drawing routines from xboard.c - -A new source file draw.c is created to hold all code associated with -board drawing. The routines for loading bitmaps and creating colors -were left in xboard.c, though, as they are also used for handling -icons and colors of widgets. - -2012-10-05 19:53:04 +0200 H.G. Muller : -Fix erasing dots in seek graph - -The cairo dots were just a little bit bigger than the old ones, so they -were not properly erased, but left a remnant. - -2012-10-05 19:25:58 +0200 H.G. Muller : -Cleanup CairoOverlayPiece - - -2012-10-05 19:22:34 +0200 H.G. Muller : -Draw arrow also on backup image - - -2012-10-05 19:16:30 +0200 H.G. Muller : -Fix highlight clearing - - -2012-10-05 18:59:30 +0200 H.G. Muller : -Remove acceleration trick - - -2012-10-05 18:54:01 +0200 H.G. Muller : -Implement variant-dependent png piece symbols - - -2012-10-05 18:42:51 +0200 H.G. Muller : -Fix clearing of markers dots with promo popup - - -2012-10-05 18:32:24 +0200 H.G. Muller : -Also render coordinates to backup board - - -2012-10-05 18:30:35 +0200 H.G. Muller : -Remove debug print - - -2012-10-05 18:29:13 +0200 H.G. Muller : -Let cairo also do evenly colored squares. - - -2012-10-05 17:56:43 +0200 H.G. Muller : -Make dragged piece for excluding moves transparent - - -2012-10-05 17:42:18 +0200 H.G. Muller : -Fix DrawSeekText - - -2012-10-05 17:40:55 +0200 H.G. Muller : -Redo coordinate / piece-count printing ith cairo - - -2012-10-05 15:40:14 +0200 H.G. Muller : -Also use cairo on slave board - -With dual-board observing the drawing should be redirected to the -slave board, so SwitchWindow should also switch the xlib-surface to -one for the slave window. - -2012-10-05 15:12:41 +0200 H.G. Muller : -Cure flashing of piece on from-square - -In a drag-drop move the piece was flashed on the from square after the -user dropped it on the to-square, because highlights were set before the -move had updated the board. And highlighting with arrow can cause a redraw -of the last board. Same with setting or clearing marker dots. - -2012-10-05 14:20:12 +0200 H.G. Muller : -Specify proper condition for using cairo animation - - -2012-10-05 14:07:53 +0200 H.G. Muller : -Allow resizing of board window - -In full png mode the size of the board window is no longer locked. -After resizing, the square size is calculated as the largest one that -would fit the window, and the window is then shrunk around it. To prevent -excessive redrawing during sizing, the redraw is delayed by putting it -in DragProc. - -2012-10-05 10:41:02 +0200 H.G. Muller : -Switch to using 64x64 png images - -The bitmap scaling works better when the needed factors are not too large, -as the svg rendering's anti-aliasing did not blur more than 1 pixel. -So after shrinking too much the images are not effectively anti-aliased -anymore. - -2012-10-05 10:16:47 +0200 H.G. Muller : -Maintain in-memory copy of the board image - -As reading back from the xlib-surface proves incredibly slow (cairo probably -converts the entire image from Xt format to cairo format when we set it -as a source, even though we only want to read a few dozen pixels), we now -keep an exact copy of the board image as a cairo bitmap in memory. This -restores the speed of the animation, but unfortunately leads to awful code. - -2012-10-04 22:15:05 +0200 H.G. Muller : -Do animation with cairo - -Unfortunately this is incredibly slow. - -2012-10-04 18:36:08 +0200 H.G. Muller : -Allow back-texture files to be PNG, (drawn with cairo) - - -2012-10-04 15:10:37 +0200 H.G. Muller : -Add png pieces - -A new directory with 256x256 png piece images is added to the source tree. - -2012-10-04 15:01:05 +0200 H.G. Muller : -Add mode to draw PNG piece images through cairo - -The PNG images have to be supplied as files in a -pngDirectory (a new -option) with a 256x256 bitmap. They are then scaled by cairo to the -desired square size. This does not work very well for the smaller sizes. - -2012-10-03 14:45:07 +0200 H.G. Muller : -Redo marker dots with cairo - - -2012-10-03 14:27:14 +0200 H.G. Muller : -Redo highlights with cairo - - -2012-10-03 14:07:37 +0200 H.G. Muller : -Make convenience routine SetPen globally available - -The routine to set a pen as specified by a color string that was used -in xevalgraph is moved to xboard.c, where there also is lots of demand -for it. The arrow drawing now uses it for setting the highlightSquareColor. - -2012-10-03 12:28:30 +0200 H.G. Muller : -Redo grid with cairo - - -2012-10-03 12:00:07 +0200 H.G. Muller : -Redo arrow highlighting with cairo - - -2012-10-03 11:20:12 +0200 H.G. Muller : -Redo seek graph with cairo - -New front-end services DrawSeekOpen() and DrawSeekClose() have been -added, and are called from the back-end to enclose any drawing activity. -In WinBoard these had to be defined as dummies. - -2012-10-02 15:31:26 +0200 H.G. Muller : -Redo logos with cairo - -The logos must now be .png files, and are internally handled as their -filenames. (So no preparation of a drawable from it at startup.) -Cairo allows them to be scaled to the requested logoSize. - -2012-10-02 14:02:23 +0200 H.G. Muller : -Fix Eval Graph resolution problems - -Anti-aliasing had to be switched off to get a crisp graph. A second problem -was that the dashed lines were drawn in both directions, with interfering -dashes. - -2012-10-02 10:54:48 +0200 H.G. Muller : -Redo Eval Graph drawing with cairo - - -2012-10-21 10:21:33 +0200 H.G. Muller : -Fix button-border-width bug in monoMode - -The kludge of signalling we are dealing wih a button rather than a label -was wrongly implemented in case of momoMode. - -2012-10-21 10:14:24 +0200 H.G. Muller : -Reserve more space for button bar - -In some board sizes the button bar was wider than the code guessed, -so the window width would be determined by the message + buttons row rather -than the board. - -2012-10-21 11:24:18 +0200 H.G. Muller : -Fix WinBoard compile errors - - -2012-10-13 09:33:39 +0200 H.G. Muller : -Fix non-NLS compile error for XFontStruct - - -2012-10-12 12:04:17 +0200 H.G. Muller : -Fix browsing for path - -A pathname was still prefixed with the cuurent directory. - -2012-10-07 21:00:10 +0200 H.G. Muller : -Use Pause state in AnalyzeMode to imply move exclusion - -The pause state was not used in AnalyzeMode so far. Now it is used to -imply all entered moves are for exclusion/inclusion. - -2012-09-30 18:55:13 -0700 Arun Persaud : -new version number for developer release - - -2012-09-30 22:16:14 +0200 H.G. Muller : -Fix broken -ics and -cp options - -The patch to specify engines and ICS by nickame broke the use of the -regular options to do this, because they could also reset them. Now -this is fixed by only setting them (through |= in stead of =). - -2012-09-30 22:01:52 +0200 H.G. Muller : -Update texi file - -The description of exclude-moves, multi-game ananalysis and duo-analysis -is added. - -2012-09-30 10:07:58 +0200 H.G. Muller : -Resolve conflict between -mps and -inc options - -The age-old problem that a persistent valid -inc value will cause -mps -to be ignored is solved by the kludge of storing these two as a single -option (-mps) in the settings file, and declaring the other (-inc) volatile. -The range of negative numbers (invalid as -mps value) was available for -that, and now is used to store the negated value of -inc in msec. -For backward compatibility, specification of -inc causes interpretation -of -mps in the old way. The forcing of -inc to -1 in the master settings file -could be safely removed because of this change, so that the time increment -now is a persistent option. - -2012-09-29 23:13:04 +0200 H.G. Muller : -Allow entry of fractional increment in WB time-control dialog - -The numeric edit is changed to a general text edit, and code is added -to convert the text it contains to and from float, with proper error check. - -2012-09-29 23:05:33 +0200 H.G. Muller : -Preconfigure -icsNames in xboard.conf - -Although XBoard has no startup dialog with an ICS combobox, the -icsNames -option is now used to select lines from with the -is option, and in -interpretation of positional arguments. The most common ICS are configured -together with a short nickname, so that commands like "xboard fics" will work. - -2012-09-29 22:58:12 +0200 H.G. Muller : -Allow ICS nickname as positional argument - -If an argument is encountered that is not preceded by an option name, -it is now first checked if it corresponds to the nickname of an ICS -in -icsNames. If so, it is assumed to be the value of an -is option, -selecting -ics mode with that ICS and all the options installed with it. - -2012-09-28 20:28:05 +0200 H.G. Muller : -Cure some sick behavior in XBoard Engine Output right-clicks - -When a PV-walk is in progress, the PV is highlighted by selecting it, -and this focuses the attention of the scroll bar on it, so it remains in -view. But after release, that line was kept in view, rather than scrolling -back to the top of the window (where the header line bust be available -for clicking) - -2012-09-28 13:28:17 +0200 H.G. Muller : -Allow Analyze Game to auto-step through entire game file - -If the game index is set to auto-increment (-lgi -1), the Analyze Game -function will automatically load the next game of the current game file -(starting to auto-play/annotate that) when the end of the current game is -reached. This flushes the annotated game if auto-saving was set, -so that eventually all games in the file will be annotatd and saved. - The game index is automatically set to auto-increment when we load -a file while in Analyze Game mode, but switching this mode on while a game -is already loaded will stop at the end of that game, as usual (if -lgi was -not explicitly set). - -2012-09-28 13:24:33 +0200 H.G. Muller : -Let second engine move in lockstep during dual analysis - -When the second engine is also analysing (as indicated by its stat variable -second.analyzing), we send all moves / undos / positions / in&excludes that -go to the first engine also to second. - -2012-09-27 19:07:58 +0200 H.G. Muller : -Allow second engine to analyze too - -Clicking the Analysis menu when analysis is already in progress will -now toggle the secon engine to analyze the same position. For now, -this lasts only until the position changes (or you leave analyze mode), -after which the second engine is always switched off, and the Engine -Output window returns to single pane. Each pane now has its own header -line; the exclude header is suppressed in the second pane. - -2012-09-27 18:11:23 +0200 H.G. Muller : -Add options -fe, -se, -is to load installed engines/ics from list - -The volatile string options -fe, -se ('first/second engine') load the first -and second engine of the given nickname in the -firstChessProgramNames list, -including all options that were installed with it (similar to when in -WinBoard the that engine line had been selected through the Startup Dialog's -combobox). The option -is is similarly used to retrieve the line for an -ICS in the -icsNames list. - -2012-09-27 18:02:24 +0200 H.G. Muller : -Add check on validity of tourney participants - -Before allowing OK of the Tournament Options dialog, it is now checked -whether all participants (which are given as nicknames) can be found -in the list of installed engines, so that no problems will occurr with -non-existing engines during the tourney (if typos crept in after hand- -editing the list). - -2012-09-25 16:21:42 +0200 H.G. Muller : -Implement --help option - -The list of options is printed before exiting. Some attempt is made -to do it in a nice way. - -2012-09-23 20:10:58 +0200 H.G. Muller : -Implement variant seirawan in -serverMoves option - -Write the gating moves such that the ChessLive! viewer will understand them. - -2012-09-23 20:05:07 +0200 H.G. Muller : -Workaround for FICS bug - -FICS does not properly understand SAN, and thinks bxc3 can be a Bishop move. -This broke 'Upload to examine', because that uploaded in SAN. In case the -SAN starts with Bx or bx, it now uses long algebraic (with = before the -promo char). - -2012-09-20 18:17:55 +0200 H.G. Muller : -Define XOP mime type for XBoard - -Supply a white-knight icon for this mime type, called application/x-xboard-opt, -and a sesktop file to associate it with running XBoard with this settings file. - -2012-09-20 17:24:29 +0200 H.G. Muller : -Pay attention to extension of 'positional' arguments - -An argument without preceding option name was assumed to be an -lgf argument. -This patch still does that by default, but if the argument ends in .fen, .epd, -.trn, .ini or .xop it is considered an -lpf, -tf or -opt argument. - In addition, an implied -lpf or -lgf argument also imply the option -viewer, -which inserts the -viewerOptions string into the command line, and proesses it -as options. A new option -tourneyOptions is similarly inserted for an implied --tf argument. These strings should contain all options needed to start XBoard -fully configured as game viewer or tourney playing agent on the mentioned file. - -2012-09-20 15:29:42 +0200 H.G. Muller : -Let windows stick to right display edge (WB) - -Auxiliary windows docked to the board window from below or to the right, which are -pushed out of view when the board window resizes, will be trimmed to just touch the -diplay edge (if sufficient width or height remains). When the board window shrinks, -auxiliary windows touching the edge will be resized so they remain touching it. - -2012-09-20 15:20:36 +0200 H.G. Muller : -Round board size to one where piece images available (WB) - -When using built-in bitmaps, in sizes where unorthodox pieces are needed, but not -available, the size is temporarily rounded to one of the sizes where they are. - -2012-07-03 17:21:53 +0200 H.G. Muller : -Fix bug in Edit Position - -Due to = in stead of == the variant was always set to S-Chess in -EditPositionDone(). - -2012-08-28 21:24:51 -0700 Daniel Macks : -bug #37210: Mishandling of X11 -I flags (tiny change) - -AP: applied patch from bugtracker and added one missing 'save_cppflags="$CPPFLAGS"' - -2012-06-02 14:31:18 -0700 Arun Persaud : -bug #36229: changed ICS_* from define to enum - - -2012-05-28 13:58:00 -0700 Arun Persaud : -bug #36229: changed STATE_* from define to enum - -enabling better compiler checks - -2012-05-28 13:50:50 -0700 Arun Persaud : -bug #36229: changed PEN_* from define to enum - -This should allow better checks by the compiler - -2012-05-28 13:01:15 -0700 Arun Persaud : -fix bug #36228: reserved identifier violation - -variables and macro names beginning with _ are renamed to XB_. More consistent naming of include guards. -See link in bug report. - -2012-05-28 12:36:37 -0700 Arun Persaud : -Updated German translation - - -2012-04-30 20:06:00 -0700 Arun Persaud : -new version number for developer release - - -2012-04-24 11:23:04 +0200 H.G. Muller : -Decapitalize promoChar in move parser - - -2012-04-23 14:12:10 +0200 H.G. Muller : -Keep track of virginity of back-rank pieces in variant seirawan - -The forelast rank of the Board array is now used in VariantSChess to -contain flags that indicate virginity of the back-rank pieces, one bit -for white, the other for black. Legality checking of gatings now makes -use of this info. FENs mention all virgin pieces not implied by castling -rights in the castling field, by printing the corresponding file IDs, -as long as holdings are non-empty. The FEN reader now also understands -this format. EditPositionDone fakes virginity for all pieces that are -on their starting square. - -2012-04-17 19:49:24 +0200 H.G. Muller : -Suppress clear-board message after pasting FEN - -The message field is now always cleared when you leave EditPosition mode. - -2012-04-17 19:45:33 +0200 H.G. Muller : -Fix faking of castling rights after editing position with holdings - -The queen-side rook was always imagined at X=0, which is in the holdings -when these exist, so that Q-side castling in such games was never allowed -after EditPosition. - -2012-04-20 10:29:36 +0200 H.G. Muller : -Fix WB Engine Settings window - -The listbox patch has broken this window, by making it only list the -first option of the engine, by switching to the next column based on a >= -test rather than == test. Fixed by using 1000 as invalid value for the -break point, rather than -1. - -2012-04-20 00:01:08 +0200 H.G. Muller : -Fix key binding of DebugProc - -The name used for binding was DebugProc, while the ite was named Debug. - -2012-04-16 20:51:50 +0200 H.G. Muller : -Fix ICS Text Menu popup - -The space for the option names needed to be allocated. - -2012-04-16 20:37:06 +0200 H.G. Muller : -Fix disabling of Load Engine menu - - -2012-04-15 22:53:24 +0200 H.G. Muller : -Port chat boxes to XBoard - -A new menu item Open Chat Window is added to the View menu. It opens a -window that can handle 5 chats. A row of buttons on top selects which is -the foreground chat partner, to which we type, and whose incoming messages -will be displayed in the memo. The leftmost 'button' is not really a button, -but a text edit, and the active partner is displayed there (so it can be -altered). Selecting another chat partner through a button, moves that partner -to the text-edit, and reshuffles the buttons. Incoming messages in a chat -that is not foreground make the corresponding button color orange. - -2012-04-16 20:27:08 +0200 H.G. Muller : -Allow chaining of single-line text-edits to top - -For the benefit of the chat window, a text-edit plus leading description -can now also be chained to the top edge of a dialog. The chaining of the -(degenerate) multi-line ICS Input Box and Move Type-In was entirely to the -bottom, which has now been corrected. - -2012-04-12 09:30:24 +0200 H.G. Muller : -Add logo widgets in main board window - -New options -logoSize and -logoDir are added. The former enables logo display, -when non-zero and not too big. The latter is used by -autoLogo. The options - -firstLogo and -secondLogo also work. Problem is that the clock height -is larger than the logo height, and for now a nasty trick in GenericPopUp -is used to position the next element (message field) w.r.t. the clocks, -rather than the last element of the row above (the logo): in case of a -SAME_ROW Graph element, 'last' is kept at the previous element. - -2012-04-19 10:48:41 +0200 H.G. Muller : -Fix crash on time forfeit with -st option - -When fixed time per move was set from the command line, the time-control -strings were not set. This let to a crash when an engine forfeited. -The GetTimeQuota function is now made resistant to a NULL pointer here. - -2012-04-19 10:39:12 +0200 H.G. Muller : -Solve WinBoard name clashes, fix zippy-analyze menu graying - -Some of the function names used in the refactored X11 front-end collided -with Windows system names from winboard.h, or with names of internal routines -in WinBoard front-end files (so they could not be declared in frontend.h). -These were renamed. Some prototypes in engineoutput.h contained X11 types, -and they were moved to xboard.h. - In addition, two menu-item names were corrected to two-part names. - -2012-04-18 12:00:43 +0200 H.G. Muller : -Offer primitive paging in file browser - -If there are more than 1000 files that would have to be displayed, -the number will be limited to 999, and a 'next page' entry will appear -at the bottom. Clicking that will give you the next group. - This is an emergency measure only, as it interferes with sorting -(grouping is based on order inside the directory, i.e. kind of arbitrary, -and sorting is only done within a group.) There is no such thing for the -folder list yet. There is no way to go back to a previous page, other -than closing and re-opening the browser, or selecting another file type. - -2012-04-18 11:16:58 +0200 H.G. Muller : -Add pixmap as file type known to browser - -Users can browse for a pixmap to set the board texture. - -2012-04-17 15:45:27 +0200 H.G. Muller : -Fix warning about signedness - -Note: the promoChar in ExcludeMoves was explicitly defined to make -sure the kludge promoChar = -1 for indicating best move works. But it -should be equivalent to casting the promoChar to (signed char) just -before the comparison. - -2012-04-17 15:44:15 +0200 H.G. Muller : -Fix warnings about character index - - -2012-04-17 15:37:53 +0200 H.G. Muller : -Move ManProc to xboard.c - -It calls ManInner, which requires X11 data types, even if the values are NULL. - -2012-04-17 15:27:21 +0200 H.G. Muller : -Move FileNamePopUp to dialogs.c - - -2012-04-17 15:15:03 +0200 H.G. Muller : -Fix readout of numeric combobox - -As currently no numeric comboboxes are used, this bug was silent. - -2012-04-17 15:10:54 +0200 H.G. Muller : -Shuffle prototypes to correct header, or add them there - - -2012-04-17 14:15:15 +0200 H.G. Muller : -Fix MenuNameToItem - -This function could crash when called with ann argument that did not -contain a period, while the idea was that it should handle this as if the -item is in noMenu (for user-specified key binding to non-menu funtions). - -2012-04-16 19:43:03 +0200 H.G. Muller : -Fix click-click under-promotion animation save - - -2012-04-17 11:02:39 +0200 H.G. Muller : -Define TOPLEVEL in winboard.c - - -2012-04-17 10:59:33 +0200 H.G. Muller : -Add two new strings to WinBoard language file - - -2012-04-17 10:51:02 +0200 H.G. Muller : -Fix second-engine variant test - -The test whether the second engine supports the selected variant took place -before the second engine was loaded, thus always coming to the conclusion -that the variant was not supported, and aborting the TwoMachines command. -The test is now moved to after second-engine loading (but before its -initialization, where non-supporting would become a fatal error). - -2012-04-16 12:11:09 +0200 H.G. Muller : -Fix clearing of ICS input box after send - - -2012-04-16 19:08:10 -0700 Arun Persaud : -enable -Wall -Wno-parentheses for all compilers that understand them - - -2012-04-16 13:18:37 +0200 Byrial Jensen : -Remove 5 unused variables from zippy code - - -2012-04-16 13:14:06 +0200 Byrial Jensen : -Remove unused static function ShowTC - - -2012-04-16 13:10:58 +0200 Byrial Jensen : -Remove unused static function MenuBarSelect - - -2012-04-16 13:07:01 +0200 Byrial Jensen : -Remove unused variable first_entry from function find_key - - -2012-04-16 13:01:09 +0200 Byrial Jensen : -Remove unused variable tm from function SaveGamePGN - - -2012-04-16 12:56:46 +0200 Byrial Jensen : -Remove unused variable delayedKing from function QuickScan - - -2012-04-16 12:52:57 +0200 Byrial Jensen : -Remove unused variable pdown from function UserMoveEvent - - -2012-04-15 04:25:59 +0200 Byrial Jensen : -Change some double literals to floats. - -To avoid unnecessary implicit promotions of float variables to double. - -2012-04-15 11:12:02 +0200 H.G. Muller : -Remove debug printf - - -2012-04-14 22:43:03 +0200 Byrial Jensen : -Translate "NPS" also in engine output window - - -2012-04-14 16:19:34 -0700 Arun Persaud : -removed unused variables (-Wunused-variable) - - -2012-04-14 15:37:05 -0700 Arun Persaud : -added m4 directory to search path for aclocal. As suggested by Michel Van den Bergh - - -2012-04-14 23:21:56 +0200 H.G. Muller : -Fix Eval Graph scale in drop games - - -2012-04-14 23:16:29 +0200 H.G. Muller : -Fix ArrowDamage out-of-bounds access on drop moves - - -2012-04-14 21:33:49 +0200 H.G. Muller : -Implement automatic partner observe - -Starting a game, or starting to observe one, now automatically issues a -'pobserve' command if dual-board is switched on, so that the partner game -will pop up in the secondary board (assuming it is bughouse). - The secondary board now displays the players in the title. (This (lightly) -breaks WinBoard again.) When the primary game ends, the secondary board -closes automatically. Initial sizing of the board is repaired, and now uses -the actual current board size, rather than the initial size of the main board. - -2012-04-14 15:43:30 +0200 H.G. Muller : -Fix crash due to empty PV - -Reception of a stat01 command before the first PV could cause a crash, -as apparently the parser cannot handle this. - -2012-04-14 13:27:48 +0200 H.G. Muller : -Suppress testing for availability in bughouse drops - -Give up on testing legality of bughouse drop moves; this only causes problems, -because the move list sent by the ICS is not accompanied by holdings updates. -So XBoard parses it thinking the holdings are empty, making every drop move -an ImpossibleMove. Bughouse can only be played on ICS, and we might as well -trust the ICS that it will only pass us legal moves. A user should not be -able to enter illegal drops; unavailable pieces cannot be grabbed from the -holdings, and typing is diverted to the ICS directly (which would reject the -illegal drop without XBoard even knowing about it). - Also improve switching to bh/zh, based on drop move in initial board. - -2012-04-14 09:11:22 +0200 H.G. Muller : -Fix some compile errors / warnings - - -2012-04-13 19:06:17 +0200 H.G. Muller : -Fix promotionPopDown on new move entry - -The promotion popup is non-modal, and old XBoard versions popped it down -as soon as the user clicked the board, so he could just enter a new move -to abort the promotion. This was broken in the new version, because the code -to do the PopDown and abort in HandleUserMove had not been ported. - -2012-04-13 18:38:51 +0200 H.G. Muller : -Use in-place sweep-selection for click-click under-promotion - -With detour under-promotion a piece cycles through all possible choices -during backwards dragging. But in a click-click move there is no dragging. -This used to be solved by letting the second click start a drag event of -the default promotion choice, which you could accept by immediately -releasing the mouse button, or drag around to change it first. - The dragging in this case seemed a little unnatural, because the to-square -was already indicated by the down-click. So it has been changed now to the -promo choice appearing on the down-clicked to-square, followed by -EditPosition-like sweep-selection on that square when one wants to under- -promote. The move is always accepted no matter where the up-click takes -place, except when it takes place on the from-square (which offers a last- -resort abort possibiliy). - Note that click-click promotion is essential in variants where it is not -obvious from the from-square alone that a promotion is imminent, but where -it depends on the to-square. (Such as Shogi.) There drag-drop detour under- -promotion is not possible. - -2012-04-13 16:05:16 +0200 H.G. Muller : -Improve arrow drawing - -The arrow is now erased together with the border highlights, by marking -the damage it did, and then doing a selected redraw of the board to let -the damaged square be re-drawn. Highlights of a previous move are now -cleared on the down-click that selects a new piece, so there never is an -arrow to infavorably interact with animation of dragging. - -2012-04-13 14:57:15 +0200 H.G. Muller : -Also do selective redraw with showTargetSquares on - -The XBoard DrawPosition now also keeps track of the previous marker state, -and redraws squares for which thi shas changed. As a result, the routine -MarkTargetSquares does no longer have to force to complete redraw. -(Breaks WinBoard?) - -2012-04-13 00:33:28 +0200 H.G. Muller : -Fix click-click sweep promotions to empty square - -These did not work, because DragPieceBegin would fail on an EmptySquare. - -2012-04-12 23:58:41 +0200 H.G. Muller : -Move clearing of target squares to after drag end - -A dragged piece that would partly overshoot its destination into a square -with a marker would effectively protect that marker from erasing, when the -erasing was done before the piece was released, because redrawal after the -move only would draw the target square. (Unlike erasing, which forces a full -redraw.) - -2012-04-12 23:49:27 +0200 H.G. Muller : -Fix double promotion popup - -Only the up-click of a click-click move gives a promotion popup now. - -2012-04-12 23:32:28 +0200 H.G. Muller : -Fix promotion popup - -The new GenericPopUp did not like it if the first button had 'SAME_ROW' set. - -2012-04-12 17:28:32 +0200 H.G. Muller : -Allow clearing of marker dots in any mode - -There might already be dots when you change to a mode where there should -be none, and you don't want them to stay on forever in that case... - -2012-04-12 17:00:55 +0200 H.G. Muller : -Fix redraw of secondary board on flipping view - - -2012-04-12 10:30:21 +0200 H.G. Muller : -Let clocks of secondary board count down - -The back-end now remembers what is the active clock, and the time left on it. -This is then decremented and updated together with the clocks of your own -game, using the partnerUp flag to divert the clock display to the secondary. - -2012-04-12 09:47:43 +0200 H.G. Muller : -Fix 3 forgotten symbolic widget references - - -2012-04-11 19:24:36 +0200 H.G. Muller : -Add sound files to browser menu - - -2012-04-11 13:04:24 +0200 H.G. Muller : -Add New Directory button to file browser - - -2012-04-11 09:54:51 +0200 H.G. Muller : -Detect engine exit during startup - -The case where engine startup failure does not result in a fatal protocol -message, like "No such file", but where it simply exits, is now also covered. - -2012-04-10 22:55:07 +0200 H.G. Muller : -Suppress popup for fatal error after tellusererror - -For cooperating better with Polyglot, and allowing more to-the-point -error messaging, the (awful) default message will be suppressed if the -dying engine already provided an explanation for its demise to the user. - -2012-04-10 20:28:45 +0200 H.G. Muller : -Fix Engine Output icon heights in international versions - -The text in a label option could not be an empty string, or it would be -'translated' to something of enormous size. So it is set to a space now. - -2012-04-10 20:21:56 +0200 H.G. Muller : -Fix internationalization - -The internationalization was broken by moving the XtSetLanguageProc -to behind 'bindtextdomain'. - -2012-04-10 20:03:46 +0200 H.G. Muller : -Make reference to board widgets symbolic - - -2012-04-10 18:39:25 +0200 H.G. Muller : -Don't strip path from engine name if directory given - - -2012-04-10 17:54:33 +0200 H.G. Muller : -Fix vertical chaining of Buttons and browser ListBoxes - - -2012-04-10 15:53:47 +0200 H.G. Muller : -Fix auto-play - -The 'narrow search' modification had broken auto-play, because all selected -games were marked as matching position 0, so that they would all start in -thr opening position. - -2012-04-10 13:30:44 +0200 H.G. Muller : -updated po/pot files - - -2012-04-10 11:54:50 +0200 H.G. Muller : -new version number for developer release - - -2012-04-10 13:22:40 +0200 H.G. Muller : -Update POTFILES.in - - -2012-04-10 13:21:33 +0200 H.G. Muller : -Fix Makefile EXTRA_DIST - - -2012-04-02 17:53:40 +0200 H.G. Muller : -Use Ctrl key in EditPosition mode to copy pieces - - -2012-03-28 23:51:28 +0200 H.G. Muller : -Fix bug in FRC castling for position search - -In FRC it is essential that both pieces are taken off the board before -any of them is put back, lest they obliterate each other. - -2012-03-28 12:25:20 +0200 H.G. Muller : -Fix bug on loading engine - -A newly loaded engine was put at the end of the game, rather than at the -current position, (which is required in EditGame mode). - -2012-04-06 17:02:21 +0200 H.G. Muller : -Add 'Narrow' function to position search - - -2012-04-06 10:52:45 +0200 H.G. Muller : -Reorganize main() a bit - -The font stuff goes into a separate routine, and the X11 stuff is -moved backwards as far as possible. - -2012-04-04 21:55:50 +0200 H.G. Muller : -Give the dual-board option a separate board window - -The second board window pops up whenever an alien board is received -during your game. Moves in it are highlighted by an arrow, irrespective -of the 'Highlight with Arrow' setting. The clocks are displayed, but do -not count down. - -2012-04-05 11:23:03 +0200 H.G. Muller : -Port engine grouping to Match Options dialog - - -2012-04-05 15:18:25 +0200 H.G. Muller : -Change default directory in Load Engine to "." - - -2012-04-05 10:49:56 +0200 H.G. Muller : -Port grouping to XBoard Load Engine Add highlight to Load Engine grouping - - -2012-04-06 17:19:33 +0200 H.G. Muller : -Fix default file types for browse buttons - - -2012-04-03 09:14:44 +0200 H.G. Muller : -New browser - -Redo file browser with GenericPopUp - -This had to solve quite some problems, because it wanted to use a ComboBox -option while a transient dialog could be up, was a non-engine dialog -while an engine dialog is up, and XRaiseWindow does not work properly. - Sorting is done alphabetically, or for digit groups by numeric value. - -2012-04-02 14:43:24 +0200 H.G. Muller : -Use ListBox in stead of ComboBox in Match-Options dialog - - -2012-04-02 14:09:15 +0200 H.G. Muller : -Use ListBox in stead of ComboBox in Load Engine dialog - -Make Load Engine listbox sensitive to double-clicking - -2012-03-26 17:06:33 +0200 H.G. Muller : -Add message about enabling in New Variant dialog - - -2012-03-31 20:27:20 +0200 H.G. Muller : -Move LoadGamePopUp to menus.c - - -2012-03-31 20:25:22 +0200 H.G. Muller : -Move DisplayMessage to dialogs.c - -Use the wrapper SetWidgetLabel to make it back-end. - -2012-03-31 15:23:30 +0200 H.G. Muller : -Fix switching debug option during session. - -Switching on debug mode during the session did not create the requested -debug file. - -2012-03-31 15:22:57 +0200 H.G. Muller : -Correct texi file for use of .Xresources - - -2012-04-02 19:19:30 +0200 H.G. Muller : -Fix recent-engines menu - -A new primitive to create an item in a given menu was added to do this. - -2012-03-31 10:54:22 +0200 H.G. Muller : -Switch back two two-part menu names - -The menu code is again completely changed; a handle field is added -to the MenuItem tables to store the widget for the item, and this info -is used to alter sensitivity or marking. MenuToNr is replaced by -MenuNameToItem, which looks up the two-level name directly in the -menu tables. Put all currently unused MenuProcs in noMenu table, -so they are available for key binding through the new method. - -2012-03-24 18:36:44 +0100 H.G. Muller : -Redo main board window with generic popup - -Some of the improvements in GenericPopUp (committed earlier) were added -especiall for this (menu and box Option types), and the commits that used -them to make a fully functional board, listed below, were collapsed into -this one. - -This uses the new box and menu features of the Generic popup. -Make option table shadow board consistent with refactor -Do main menus in shadow board - The board made by GenericPopUp now also has (functional) menus. The Expose - callback now also uses the new format (passing coordinates). -Use BoxEnd callback to decide about smallLayout - The shadow board now dynamically decides whether it should use smallLayout - positioning of the title-in-window widget, using a callback in the BoxEnd - option for the menu bar: If no reasonable amount of space is left behind - the menu bar, the title is forced under the clocks (smallLayout). -Do some mouse handling on shadow board - Only button 1 events for now. We have to keep track if the button is down! -Connect button 3 to shadow board - For now only for piece and PV manipulation: no context menus yet -Symbolic reference in option formatting -choice <-> textValue xboard.c -Improve expose callback shadow board -Implement context menus of shadow board - This uses the new generic PopUp option -TopLevel xboard.c -Make mock-up board available through menu item -Make clocks of shadow board sensitive to clicking -Make button bar of shadow board operational - The back-end Event functions are specified as user callbacks directly; - this is not very clean, as they are parameterless, but called with an int - argument. This should have no bad consequences, though. -Switch to using shadow board as main board - The menu marking and enabling had to b switched off for this, as it - only worked on the old menus. Remove HandleUserMove. -Deleting of unused shell variables, clocks to dialogs.c -Move BoardPopUp to dialogs.c - This required passing on fome front-end vars as parameters, and returning - apointer to the option list, to make the handles available in xboard.c. -Simplify InitDrawingSizes - Now that all widgets of the main window are properly chained, there is - no need to resize them when the board format changes: setting a new width - for the shell suffices. -Cleanup some unused Xt Args - -2012-03-31 10:53:46 +0200 H.G. Muller : -Remove unnecessary menu unmarking for Edit Tags - - -2012-03-29 19:09:34 +0200 H.G. Muller : -Split sync-after options in Match dialog into checkbox + label - -Now the checkbox texts are highlighted on hovering, we don't want the -explanatory text behind it to be highlighted with it. - -2012-03-26 17:12:33 +0200 H.G. Muller : -Make variant-unsupported-by-second error non-fatal - - -2012-03-23 20:06:15 +0100 H.G. Muller : -Redo Eval Graph with generic popup - -The Graph option of the GenericPopUp is used to implement the Eval Graph. -Compared to the previous implementation, which was drawing directly in the -form widget, the new one has one extra widget layer, but that did not -affect the code anywhere. Adapt eval title to width of eval graph. - -2012-03-23 15:17:14 +0100 H.G. Muller : -Redo Engine Output window with generic popup - -A new file nengineoutput.c holds the X-independent code. This makes use -of new capablities of GenerciPopup, for having Label widgets on same row, -stacking panes after a Break, and chaining Label and Text widgets. - -2012-03-21 23:00:05 +0100 H.G. Muller : -Redo Game List with generic popup - -Check in ngamelist.c -Redo Game List with generic popup - The X-independent code (i.e. almost all) is moved to a new file - ngamelist.c. -Make button in Game List to pop up Game List Options -Fix scrolling game list -Fix popup of existing Game List after loading file -Wheel-scroll game list -Symbolic reference game list -TopLevel game list -Put format flags with listbox options - -2012-03-21 17:58:27 +0100 H.G. Muller : -Redo Game List Options with generic popup - - -2012-04-05 21:56:52 +0200 H.G. Muller : -Add -dialogColor and -buttonColor options - -These only override system defaults if they are non-empty strings. - -2012-03-28 15:52:01 +0200 H.G. Muller : -Add -topLevel option - -This persistent Boolean option determines if the auxiliary windows -(Game List, Move List, Engine Output, Eval Graph, Tags and Comment) -use top-level shells (with their own icon on the task bar, and -independently closable). Other dialogs will always use transient shells. -(Also he modal Error and Promotion dialogs, for which the modality -presumably only serves to pop them down without special attention.) -A control for this was added in the General Options dialog. - -2012-03-20 15:30:00 +0100 H.G. Muller : -Redo ErrorPopUp with generic dialog - - keeps popping down error popup.Multiple Error popups remeain tricky; -add comment to describe problem with multiple ErrorPopUps. - -2012-03-20 10:22:46 +0100 H.G. Muller : -Redo PromotionPopUp with generic dialog - -The dialog is no longer modal. - -2012-03-19 21:56:48 +0100 H.G. Muller : -Redo AskQuestion dialog with generic popup - - -2012-03-19 21:55:58 +0100 H.G. Muller : -Major refactoring of GenericPopUp - -Allow more transient dialogs in GenericPopUp -Remove grab from promotion popup -Fix other generic popup over transient popup - To use the generic dialog generator for 'asynchronous' popups (Ask Qustion - or Error popup caused by engine), the currentOptions setting has to be - restored for the combo and checkbox callbacks of the transient to still - work after the asynchronous dialog returns. Note that only transient dialogs - can have check and combo controls. -Make generic calcel button suppressible - Also #define some more symbols for Option.min flags, - and move them to dialogs.h. -Change TypeInProc to general OK handler - The move type-in now has its own option list, to distinguish it from - the ICS input box, and give it its own OK handler. Rather than having - the translation for on the text widget call TypeInEvent directly, - we let it call GenericCallback, which calls GenericReadout, which calls - the OK proc, which does the job. - To be able to call GenericCallback from the TypeInProc, the recognition - of OK and cancel buttons had to be changed. This because it was too difficult - to arrange the calling widget had label OK or cancell. So these buttons are - no longer recognized by name, but by the option number passed as client data. - (This solves the problem that a user could not make buttons named 'cancel' - or 'OK'.) -Make Cancel button optional -Fix closing multiple popups of same kind - The GenericCallback figures out its own shell, so all buttons of - multiple dialogs keep working. External calls to PopDown only work - on the lastcreated instance of that kind, though (including those from - the Delete Window button, which can do 'cross-closing'). shellUp is now - a counter, and PopDowns are only prevented when it reaches 0 or the - current shell does not exist. (To know this, PopDown now resets shells[n] - to NULL when is shell is destroyed. - Beware of double PopDowns (through OK procs); they wreck the system. -Fix Delete Window button of multipe ErrorPopUps - The action routine for handling the Delete Window now pays attention - to the shell widget that the system passes to it, and temporarily - replaces shells[n] by it to let PopDown act on the proper instance. -Add ListBox dialog type to GenericPopUp -Fix vert sizing of ListBox -Put listbox widgets in viewport -Put listbox in viewport -Improved xoptions.c support for focussing and listboxes -Fix OK-row button positioning -Let GenericPopUp take parent and modality as arguments - This makes the code a bit more explicit and less kludgy. It also becomes - possible to call the same dialog (e.g. Load Options) from the main menu - and from another dialog (e.g. the Game List). -Support scroll function for generic popup listboxes -Fix scrolling -Move HighlightWithScroll to xoptions.c -Change scroll algorithm -Add mouse-wheel scroll to generic list boxes -Implement tabbing between text edits -Implement same-row text labels in generic dialog -Allow labels to specify their chaining in generic popup - The opt.min variable is used to specify the chaining: 0xF0 are the bits - for (left, right) chaining of the left side (0xC0) and right side (0x30). - The 0xC bits determine top or bottom chaining of the entire label. - Without anything spcified (0), the chaining is XtRubber. - TextBox options can also specify top-chaining of their top. All this was - needed to allow decent implementation of the Engine Output window with - the generic popup. (Although tags and comment popup ca benefit from the - latter feature.) -Let GenericPopUp support a Graph option - The Graph option results in an area where one can draw something. It is - positioned / chained similar to Label options. A handler for expose events - can be specified in the textValue field of the option. -Implement box widgets and menu buttons in GenericPopup - To enhance the capabilities of GenericPopUp such that it could create the - main window, it needs to be able tha packaging of controls into a box widget - (for mennu and button bar). Menu buttons are also required elements - (although they do look a lot like comboboxes?) Option types BoxBegin and - BoxEnd can now be used to bracket a group of controls that will be put - in a box widget. (Cannot be used recursively!) The positioning of the box - is similar to that of a Label, and is specified in the BogBegin option. - The code to shrink the menu buttons to fit is also incorporated, to act - on any box widget: if the BoxBegin option specifies a width, the elements - in it are shrunk to meet the requirement. Otherwise the box just gets the - size of the sum of its children (plus spacings). - Label options can now specify a font, casted into their textValue field. - (This is needed to get the proper size for the clock widgets.) -Implement callback in BoxEnd options - BoxEnd is a pseudo-option, to trigger packing the preceeding ones in - an earlier-opened box widget. In the process it calculates the size of - the box widget (and trims it if a size was specified for it in the - corresponding BoxBegin). The Option.target field of BoxEnd is now - interpreted as a callback, which can be use to take decisions based - on the determined size for the remaining options in the list, before - these are processed b GenericPopUp. -Refactor xoptions.c - Make a subroutine to set args shared by almost all widgets. Swap meaning - of '1'-bit in option.min flag of Break option, to be consistent with - SAME_ROW interpretation in other option types. -Make option tables consistent with refactored GenericPopUp - The flag for stacking in the Break option needed to be inverted, and - the BoardPopUp needed to pass the font in another field. Better use was - made of the improved chaining options too. -Improve Graph-option event handling - The user-supplied callback now gets 3 arguments passed: the event type - (0 = pointer motion, 1...5 button press, -1...-5 release, 10 = expose), - and two coordinates. For ouse events these are the pointer (x,y), while - for expose events they are the window size (w,h). The callback is now - specified in the option.target field of the Graph option. -Store engine options in malloc'ed memory - The Option.name field has been re-declared as (char*), from (char[MSG_SIZ]). - There are still MSG_SIZ chars allocated irrespective of actual size, because - the field is also supposed to store the textValue, which can be changed by - the user. But at least it means that unused options of the generous list - now don't waste much space. (And the prparated Option tables in dialogs.c - will shrink by a large factor as well.) -Improve GenericPopUp ComboBox handling. - The dialog type is now passed to the combobox callback as well, and this is - used to really figure out what option it is called for. -Allow numeric comboboxes - When no list of strings is given in Option.choice, the target is assumed - to be (int), and the number of the slected entry is stored there. Also - adapts the Label options that act as fillers to the new method for making - dummies (namely NULL in the Option.name field). -Put comboCallback in Option struct - Rather than having a general comboCallback variable for the entire current - dialog, each ComboBox option can now specify its own callback in the - target field of the option: the COMBO_CALLBACK bit of Option.min indicates - whether the target is a variable to be set or a callback. The callback can - still fetch the choice from the values array. -Allow generic CreateComboPopup also to do main menus - An extra parameter to CreateComboPopup determines if the menu texts - should be taken from a list of strings (the old method with engine- - supplied choices), or from a menu table of MenuItems. It can now also - recognize "----" as a menu break, and keeps margins (for the marking). -Make subroutine for determining curren combo selection -Various fixes to GenericPopUp -Delete one border-width setting -Fix max nr of args in GenerocPopUp -Fix button release events of Graph options -Fix generic Graph callback pointer motion coordinates -Make all format referencing in Option tables symbolic -Let Option.choice define menu texts, rather than Option.textValue - This is more logical than ussing textValue for it, because choice already - has the correct (char**) type, while textValue was (char*), and needed - casting everywhere. Note that for engine options, the fields were the - same anyway, so no back-end change was required. The textValue now - contains the (casted) list of actual string values, where these are - needed. (But for numeric and function menus they aren't.) -Add PopUp Option type - An new pseudo-Option is defined, to add a popup menu to a previous Graph - option. The actual popping up is done by the expose handler. - The function XUngrabPointer is the key to success here. A PopUp option - specifies a callback for handling the selection from the menu, which will - be called with the option number, exacty as with ComboBox options. -Update option explanation in dialogs.h -Make Spin and CheckBox callbacks pass dialog number - No longer rely on 'currentOptions' for getting the option belonging to - the callback, but get it out of the dialogOptions array indexed by dialog - type. This way things cannot be messed up by an asynchrounous error popup. - It also means that it is now save for non-modal dialogs to use these options. -Use button widget for text behind checkbox -Let listboxes use general formatting hints -Let GenericPopUp option always finish last pane after Break -Allow LisBox to specify select callback in Option.textValue -Use double-click to trigger ListBox callback -Make ListBox callback re-entrant -Fix multi-line Label options -Separate CreateMenuItem out from CreateComboPopup -Chain checkbox texts entirely left -Allow a user-specified callback to Label options - This is needed to implement the clocks. Let the CheckBox callback handle - it. For now ther is no distinction between different mouse buttons. - -2012-03-21 11:15:01 +0100 H.G. Muller : -Prevent double PopDowns - -Some DialogOK functions ordered an early PopDown themselves. This, -however, resulted in PopDown being called twice when they returned TRUE. -This interfered with the new system for allowing multiple instances of -the same dialog. So these functions are now fixed to suppress the -standard PopDown by always returning FALSE. - -2012-03-20 19:10:50 +0100 H.G. Muller : -Split usounds.c and usystem.c from xboard.c - -X-independent code was moved to separate files. The nef file usound.c -contains the sound handling, which in XBoard is trivial, because it uses -an external player, but could be replaced by a complex one on platforms -that have to handle the sound themselves. - The usystem.c file contains all non-X Unix-like stuff, such as fork, -pipe, system, getenv. I also contains some color parsing for the xterm -colors. This stuff could be useful on platforms that support Unix-like -system calls. - -2012-03-26 19:03:19 +0200 H.G. Muller : -Make routine to probe shift keys - -The code to probe Alt keys was taken out of MoveTypeInProc, and extended -to probing Ctrl and Shift keys too. These are now returned in the 6 LSB -of an int by ShiftKeys(). - -2012-03-19 13:15:11 +0100 H.G. Muller : -Remove one level of indirection on ICSInputBoxPopUp - - -2012-04-10 10:26:24 +0200 H.G. Muller : -Cleanup of xboard.c - -Remove AskQuestionProc -A bit of cleanup on xboard.c prototypes -Remove dead file-browser code -Delete vestigial jail code - All the stuff about jailColor was deleted. Only one fishy thing remains: - xpmJailSquare seems under some conditions used in BlankSquare to draw a - 'neutral' square. it is set to a copy of a light square image. But in the - current design 'neutral' means blacked out between board and holdings, - and even with image use, it should not resemble a light square... -Remove registering of CommentPopDown and TagsPopDown -Merge CopyGameSelection into CopyPositionSelection - -2012-03-19 11:38:17 +0100 H.G. Muller : -Move some back-endish routines from xboard.c to dialogs.c - -Move ICS input-history handling to dialogs.c -Move ICS Input Box text handling to dialogs.c -Move DisplayXxxx routines to dialogs.c -Move DisplayTitle to dialogs.c - A wrapper SetWindowTitle remains in xboard.c. - -2012-03-18 20:10:35 +0100 H.G. Muller : -Split back-endish part off xoptions.c, and move to dialogs.c - -Some MenuProcs for dialogs were also moved to dialogs.c from menus.c. -MoveTypeInProc which is an event handler for the board widget, -was moved to xboard.c, where it can be static. - -Identify dialogs by enum type - A new header dialogs.h is created, which defines an enum type DialogClass - that is now used to identify the various dialogs done by GenericPopUp. - The prototypes for GenericPopUp/PopDown, and other globals shared by the - dialogs code and other modules can go in here as well. -Remove ClearTextWidget - This did the same as SetWidgetText with an empty string. -Split X-code from PutText -Split back-end part from MoveTypeInProc -Take set-title out of comment popup -Sort MenuProcs in dialogs.c with their support functions -Declare globals in dialogs.c with functions where they belong -Add prototypes to dialogs.h -Move prototypes and globals from xoptions.c to dialogs.h -Make accessor DialogExists for dialog shells -Add dialogs.c to makefile: compiles and runs! -Combine 3 calls into front-end to InitDrawingParams -Move EditCommentProc and ICSInputBoxProc to dialogs.c -Pass option list as argument to GenericUpdate and GenericReadOut -Shorten argument name from currentOption to opts - This to prevent confusing it with the global variable of that name. - -2012-03-18 15:33:18 +0100 H.G. Muller : -Declare some shared global variables in backend.h - -The vlobals twoBoards and partnerUp were only shared through an extern -declaration in xboard.c - -2012-03-18 12:34:42 +0100 H.G. Muller : -Split back-endish part off drawing code and move to board.c - -Split DrawSquare in front-end and back-end part -Back-endize DrawHighlights and DrawPosition - The already existing wrapper FlashDelay is used as a kludge to do an XSync. - We now pass a code for the line color GC to the highight routine. New - wrappers are DrawGrid() and DrawBorder(). -Back-endize atomic explosions -Back-endize DrawArrow and DrawDragPiece - DrawDragPiece now calls DrawOneSquare with argument EmptySquare in stead - of the X-type referring BlankSquare. A new wrapper DrawPolygon fixes - DrawArrowBetweenPoints. -Move board-drawing logic to new file board.c - All X-independent drawing logic (board, squares, arrows, highlights, - some animation stuff) has been extracted from xboard.c, and moved to - a new file board.c, which is back-end (but unshared with WinBoard). - A new header board.h defines the cross-references (which of course - required some functions to be no longer declared as static). - A bit of code was moved from DragPieceBegin to BeginAnimation, which - now has an extra argument to indicate which piece should appear from - under a dragged piece. This makes DragPieceBegin free of XCopyArea calls, - so it could be moved too. -Make board.c truly back-end - Get rid of all X data types. For this the AnimState struct had to be - redefined: the GC and Pixmap was taken out and put in front-end arrays - indexed by anim agent (game and player). For this indexing a new enum - was defined. The XPoint type was also replaced by our own type of an - int pair (which is nasty, because the int size could be different). -Move more animation code to board.c - -2012-03-18 10:08:55 +0100 H.G. Muller : -Contract some awful code replication - -The code for making an X-color was replicated 6 times, and is now made -into a subroutine. The code for creating GCs was quite repetitive as well. - -2012-03-18 08:34:54 +0100 H.G. Muller : -Move more back-endish menu-related stuff from xboard.c to menus.c - -Move menu enabling to menus.c - Only the wrapper EnableMenuItem stays in xboard.c. A new wrapper - EnableButtonBar was necessary, because Training mode wants to enable/disable - that too. -Move all back-endish MenuProcs to menus.c - Many if the MenuProcs that could not be eliminated by listing the - corresponding back-end MenuEvent function as handler directly, are - still completely plactform indpendent. (E.g. when the MenuEvent needs - a parameter.) These are all moved to menus.c now. -Convert all dead MenuProcs to using MarkMenuItem - The MenuProcs for the option items that no longer exist were also - converted for check-marking their item in the new way, because we - might revive them for key binding. -Move the dead MenuProcs also to menus.c -Revive dead menu procs -Move GreyRevert to menus.c -Move ModeToWidgetName to menus.c -Move initial menu marking to menus.c - -A new function InitMenuMarkers was split off from main() to do this. - -2012-03-18 08:17:53 +0100 H.G. Muller : -Switch to use of short menu references - -The prefixes menuXxxx. for the item names are abolished. This made it -necessary to also add a MarkMenuItem function that can handle short names -for putting the xMarkPixmap on the items, as the names returned by -ModeToWidgetName are used for both enabling and check-marking. -Let MarkMenu use MarkMenuItem wrapper - -2012-03-17 10:47:04 +0100 H.G. Muller : -Refactor menu code, and move it to menu.c - -Supply new method for key binding - It is annoying that every menu item needs its X-specific handler routine, - because this handler has to be registered to X for becoming eligible as - a key binding. Another disadvantage of this method is that the user wanting - to make the binding has to know the name under which the menu function - is registered (e.g. FlipViewProc). - A new method is now made available, which uses only a single (X-specific) - routine, registered with X as "MenuItem", as generic key-binding handler. - The bindings can then be made by the user specifying "MenuItem(FlipView)". - This requires a new list of potential bindings, which should be filled - by the menu-creation routines. (Currently only contains only a predeficed - example.) -No longer register all MenuProcs with X - The list with available menu procs is moved to the user-maintained - menuItemList. Only QuitProc had to stay registered with X, because it is - used in CatchDeleteWindow. (So it is in both lists now.) In the future, - most of the list can be built automatically from the menu tables. -Alter type of MenuProcs to void(void) - By getting rid of the argument list with X-types, most menu procs can - become back-end. In the cases of ManProc and QuitProc the original - version had to be kept as well, because in ManProc the argument was - actually used (with key binding), while QuitProc is used for delete window. -Remove now unnecessary menu wrappers - Now the MenuProc have an empty argument list, those that also call a - single 'MenuEvent' without arguments have become completely redundant, - and have been taken out of the loop by calling the corresponding MenuEvent - directly. -Build menuItemList from menu tables - Rather than having an initialized table of name-proc associations (which - used to be the X registrations) for the menu items, we now build the list - during menu cration from the menu tables. The menu "ref" is now used as - proc name. This means the old MenuProc names used in the predefined - key bindings had to be changed to conform to this. Note that the bindings - would slice up names containing spaces in several parameters, so in the - translations the spaces were squeezed out of the item names. This requires - a hand-written comparison routine Equal() to identify the binding. -Remove prototypes of deleted MenuProcs -Move prototypes of platform-independent MenuProcs to menus.h - Create a new header file for the menu stuff, so that we can move - the corresponding handler routines out of xboard.c to a back-end file. -Extract back-end code from menu creation - The menu tables and code to interpret them is moved to a new file menu.c. - Only basic fuctions for creating a pop-down list and for adding an item - to it remain in xboard.c. - -2012-04-07 15:59:50 +0200 H.G. Muller : -Remove some unused (exclude-moves) variables - - -2012-04-07 15:57:54 +0200 H.G. Muller : -Install engine within current group - - -2012-04-07 15:53:29 +0200 H.G. Muller : -Switch to using listboxes for engine-selection in WinBoard - - -2012-04-07 15:36:02 +0200 H.G. Muller : -Implement Narrow button in WB Game List - - -2012-04-05 15:15:09 +0200 H.G. Muller : -Silence unjust warning - - -2012-04-04 12:18:43 +0200 H.G. Muller : -Fix memory corruption through InitString and second-engine loading - -The InitString and ComputerString options were not swapped when replacing -the second engine, so that the ChessProgramStates of the first engine -could point to an invalid (already freed) init string. Also make sure -that appData.directory contains its value in allocated memory, even -when hand-loading engines. - Some of the rare options were not swapped either, and would thus -always be loaded for the first engine when -singleEngineList was true. -They are now also all reset to their default, before engine load, -to prevent options of one engine to linger on for a next that does -not specify them. The intentional exception is -firstHost. - -2012-04-01 20:51:53 +0200 H.G. Muller : -Fix PV sorting during fail low - -When an engine reports a fail low as thinking output, and then re-searches -the same move with larger window, it now gets a lower score. This line -would then be sorted below the earlier fail low, because it was mistaken -for a multi-PV line for an inferior move. This patch suppresses PVs -overtaking each other if they start with the same move. - -2012-03-30 20:09:58 +0200 H.G. Muller : -Extend smallLayout regime up to size Medium - -Because of the increase number of menus, there is not enough space for a -title next to the menu bar at smaller sizes. In fact it is questionable if -the title should ever go on the same line as the menu bar. - -2012-03-30 10:38:27 +0200 H.G. Muller : -Fix parsing crazyhouse promotions with legality testing off - -With legality testing off, any promotion suffixes in a move are taken -'on faith'. But in crazyhouse the piece ID for normal pieces is used as -promotion suffix for promoted pieces, so this would Loop Chess rather than -Crazyhouse. Now attention is payed to presence of ID-less promotion pieces -(indicated by ~ in the pieceToCharTable), and if there are, these prevail -ovr the specified type. - -2012-03-30 10:07:04 +0200 H.G. Muller : -Fix browsing for save file in WB - -The generic popup browse buttons used the wrong flavor of browser, -which would only accept existing files. This was inconvenient when browsing -for a save file. The other flavor of browser is now used by default (so that -engine options also use it), and a new flag is added in the option.max field -(which was already indicating file type) to request readonly browsing for a -save file. - -2012-04-02 10:18:37 +0200 H.G. Muller : -Let clicking on header line exclude moves - -The exclude header in the Engine-Output window can now be clicked, to -toggle the exlusion of the listed move. Clicking on 'none' resets all -exclusions, clicking on 'best' excludes the first move of the latest PV. -The pseudo-move 'tail' represents all non-listed moves. - -2012-04-01 22:39:55 +0200 H.G. Muller : -Keep list of excluded moves in Engine Output header - -As long as there is still space, excluded or included moves are added -to a new header line in the Engine Output window (prefixed with + or - -depending on whether they are currently excluded or included). Future -in/exclusions of that same move then alter the prefix. - -2012-03-21 23:12:20 +0100 H.G. Muller : -Fix focus of Game List - -After focus was transferred to the filter text-edit, it was impossible -to get it back on the game list (to make the arrow keys working again). -A translation to left down-click is now used to assign focus, just as -it would for text edits. For unknown reason this only worked if the -translations were instated by Overriding, rather than Augmenting, -which again required the normal translation of downclick, Set(), which -selects the clicked item, to be explicitly mentioned as well. - -2012-03-16 22:41:19 +0100 H.G. Muller : -Fix taking effect of some option changes - -This fixes a bug reported at Ubuntu: when switching off move highlighting -in Two Machines mode, the last move before the switch stayed highlighted. -The GeneralOptionsOK() now clears any remaining highlights when highlighing -is off. Similar problems with blind-fold mode and coordinates, which require -a total board redraw to take effect, are now solved by also forcing such a -redraw in GeneralOptionsOK() when they change. - -2012-03-16 21:58:55 +0100 H.G. Muller : -Add exclude and setscore to protocol specs - - -2012-03-16 14:47:25 +0100 H.G. Muller : -Fix clock stop after dragging - -DelayedDrag always cancelled the previous drag timeout event, even when -this was no longer pending because it had already taken place, and the -event ID was resused by some other timeout (usually a clock tick). - -2012-03-14 21:06:28 +0100 H.G. Muller : -Implement exclude moves - -Dragging a piece by double-clicking it on the from-square in analysis mode -will not perform the entered move, but send an exclude or include command -to the engine for that move (provided the engine enabled this with -feature exclude=1), depending on if the move was already excluded or not. -To this end a map of excluded moves is kept, and cleared when we move to -another position through moving, undo, setboard or new. The user can see -whether he included or excluded the move, as exclude uses premove highlights. - Commands "exclude|include all" are sent when we throw a double-clicked -piece off board (vertically or horizontally, respectively), but after -exclude all the most recent PV move is included again. - Remaining problem is that promotions can only be excluded. - -2012-03-14 15:13:18 +0100 Byrial Jensen : -Mark new text "Click clock to clear board" for translation - - -2012-03-13 21:46:55 +0100 H.G. Muller : -More thorough switch to -ncp on engine failure - -The ProcRef and InputSource are now also cleared, and just to be sure there -are no surviving adapters, the child is killed when engine startup fails. - -2012-03-13 21:25:22 +0100 H.G. Muller : -Install engines as ./exefile in XBoard - -When a path name is split into directory and filename, the latter in Linux -must be preceded by ./ in order to make it executable in the directory -XBoard starts it in. - -2012-03-13 14:11:18 +0100 H.G. Muller : -Inform user in EditPosition mode how to clear board - -With -pieceMenu false the board is cleared by clicking the clock, but -since this is impossible to guess, it is now printed in the message field. - -2012-03-13 14:06:32 +0100 H.G. Muller : -Fix fall-back on -ncp mode - -When the requested engine could not be started, the user still had to -wait for the feature timeout to expire before the UI was re-enabled, -and the now-useless loading action would continue. In stead we now -cancel any scheduled continuation, thaw the UI immediately, and switch -the menus and gameMode to ncp straight away. - -2012-03-10 18:55:24 -0800 Arun Persaud : -updated po/pot files - - -2012-03-10 18:54:32 -0800 Arun Persaud : -new version number for developer release - - -2012-03-06 16:37:02 +0100 Byrial Jensen : -Fix typo (seach) in string. It is already fixed in branch v4.6.x - - -2012-03-04 14:52:34 -0800 Arun Persaud : -added some documentation about what's need to be done for a release and a bash-release script - - -2012-02-28 21:09:18 +0100 H.G. Muller : -Fix suspected bug in Makefile - - - - -2012-02-26 18:55:10 -0800 Arun Persaud : -add information about our webpage and were to report bugs into the help menu - - -2012-02-26 18:40:27 -0800 Arun Persaud : -fixed "make install-pdf": missing target for recursive make in po directory - - -2012-02-26 23:06:33 +0100 H.G. Muller : -Suppress recent-engines menu items in ICS mode - - -2012-02-26 22:45:12 +0100 H.G. Muller : -Fix 50-move counter in ICS mode - -Marking irreversible moves in the EP_STATUS did not work in ICS mode, -as ApplyMove,which did that is never executed there. Only the boards -sent by ICS are displayed,especially in observing mode. Now the status is -derived from the ICS mov strings (x in the SAN move, or P in the long move. - -2012-02-26 17:18:39 +0100 H.G. Muller : -Fix two 64-bit warnings - -Passing the engine number in a pointer variable to the callback needed -a two-step cast. - -2012-02-26 16:53:24 +0100 H.G. Muller : -Fix piece symbols on switch back to variant normal - -Variant switches were not properly detected, meaning the variable pieces -could keep a form belonging to a previous variant. (E.g. Queen remained -a Lance image after switching from shogi to normal.) - -2012-02-26 14:07:50 +0100 H.G. Muller : -Keep XBoard windows attached on resize - -Windows attached to bottom or right are displaced with the size increase. -Their perpendicular dimension is also scaled, to keep their edges at the same -fraction of the main window, unless they stick out. In the latter case the -fraction is clipped to 1, so that edge moves with the full size increase. - -2012-02-25 22:40:56 +0100 H.G. Muller : -Implement -stickyWindows in XBoard - -This makes the auxiliary windows move with the main window when they were -touching, as in WinBoard. A control is added in the General Options dialog. - -2012-02-25 21:14:03 +0100 H.G. Muller : -Use more reliable X-call for getting window position - -XtGetValues on XtNx, XtNy is unreliable. XGetWindowAttributes seems -to give more reliable results, and automatically accounts for the width -of window dressing. The -frameX/Y options are no longer needed bcause -of this, and were removed. - -2012-02-25 11:55:19 +0100 H.G. Muller : -Make frame width configurable in XB - -New persistent options -frameX, -frameY now can be used to specify -the amount by which Xt lies about the window coordinates. - -2012-02-23 20:01:55 +0100 H.G. Muller : -Use combobox line for recent engines when available - -The entry made in the -recentEngineList for the startup engine was -derived from the -fcp value, but this would ignore a possible nickname. -In WinBoard we now use the full combobox line to derive the entry. - -2012-02-23 09:29:17 +0100 H.G. Muller : -Fix translation of EngineOutputTitle WB - - -2012-02-23 01:34:12 +0100 Byrial Jensen : -Updated Danish translation - - -2012-02-23 00:59:36 +0100 Byrial Jensen : -One missed translation of cps->which - - -2012-02-22 19:58:41 +0100 H.G. Muller : -Undo translation of cps->which = first/second - -The string in cps->which should not be translated, because it goes into -the debug file to label engine I/O, and many tools for processing -debug files (broadcasters, PGN extractors) rely on this being "first" or -"second". In all contexts where "first" and "second" need to be translated, -cps->which itself is already enclosed in _(). - -2012-02-22 18:27:40 +0100 H.G. Muller : -Implement -serverFile option - -This writs an extra debug file with only engine communiation on it, -for the benifit of programs like TLCS. - -2012-02-22 17:46:16 +0100 H.G. Muller : -Implement -autoCopyPV - -This option causes automatic copying of the last position of a PV walk -to the clipboard. - -2012-02-16 14:58:45 +0100 H.G. Muller : -Delete some load-game debug printing - -The debug printing in Disambiguate was no longer needed. The printing -of the started process in XBoard that went to stderr is now diverted -to debugFP, so it ends up in the debug file. - -2012-02-16 14:41:43 +0100 H.G. Muller : -Move change of debug file to before game load - -Loading a game from -lgf is done before TwoMachinesEvent is called, -but logically belongs to the game. So the code to switch to the new -debug file for the game is moved to NextMatchGame now. - -2012-02-16 14:09:54 +0100 H.G. Muller : -Fix button grab for sweep selection - -The piece-menu initialization limited the grab of button events to those -occurring inside the board window (presumably intended to limit them to -the piece menu, but that does not pop up in sweep-selection mode). -This is now suppressed when -pieceMenu is off, so that selection continues -outside the the board. (Which is very convenient for pieces pu close to the -edge.) - -2012-02-16 13:16:13 +0100 H.G. Muller : -Don't leave piece selected after piece menu - -PieceMenuEvent left the just introduced piece selected, which is almost -never what one wants, as it makes it jump to the next square when selects. -Which is especially annoying if it captures the piece you wanted to grab... - -2012-02-16 12:57:47 +0100 H.G. Muller : -Fix use of middle button for position setup - -With sweep selection the actual drop is made on releasing the button, -and this event was not caught for button 2. Button-2 motion events were -also not caught by the sweep-selection handler. - -2012-02-16 23:53:08 +0100 Byrial Jensen : -Fix one more typo in the translator comments explaning "first" and "second" - - -2012-02-16 23:39:32 +0100 Byrial Jensen : -Fix typo in translator comments explaning "first" and "second" - - -2012-02-16 23:23:20 +0100 Byrial Jensen : -Add args.h to POTFILES.in and change the interface to ExitArgError() so msg is c format string - -Having msg as a format string will ease translations because then -badArg doesn't have to come last. - -2012-02-16 22:51:44 +0100 Byrial Jensen : -Mark the strings "first" and "sencond" for translation. - -... and assign the translated strings to cps->which in function InitEngine() - -2012-02-16 18:42:10 +0100 Byrial Jensen : -Use ngettext() instead of gettext() for a string to allow better translation. - - -2012-02-16 00:19:59 -0800 Arun Persaud : -translation: updated uk.po - - -2012-02-15 20:59:09 -0800 Arun Persaud : -modified configure and makefile for handling mimedb update - -the default configure will install them using the xdg commands (if they exist on the system) - -2012-02-13 22:29:48 -0800 Arun Persaud : -add configure test for xdg-programs to install mime types; can be disabled for building of e.g. rpms - -in case the target system doesn't have the xdg-programs available, we test for them. -Distributions often have their own macros to install these, so we add an enable option to configure - -2012-02-13 22:05:26 +0100 H.G. Muller : -Remove a debug printf - -The parsePV debug printf becomes extremely verbose with -fSAN, -sSAN, -so it was deleted. - -2012-02-12 22:18:24 -0800 Arun Persaud : -new developer release - - -2012-02-12 22:19:37 -0800 Arun Persaud : -updated po/pot files - - -2012-02-12 22:17:03 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - - -2012-02-12 07:52:54 -0800 Arun Persaud : -translation: updated uk.po - - -2012-02-12 11:38:30 +0100 H.G. Muller : -Leave height of row that only contains buttons free - -All elements of the GenericPopUp are still scaled to the text height, -including buttons appended behind them (browse or color buttons). -But we now make an exception for a row that only contains buttons, -as there is no harm in it being a little higher (and the buttons look -prettier that way). - -2012-02-12 00:01:24 +0100 H.G. Muller : -Fix OK button of error popup - -The error dialog popped up as a child of the board window, even when -DisplayError was called from a dialog. Now it checks if a transient -dialog is up, and if so, it pops up as a child of that, grabs focus, -and suppresses the system popdown of the transient dialog through a flag -dialogError until it is popped down itself. - -2012-02-11 20:07:39 +0100 H.G. Muller : -Update texi file - - -2012-02-11 10:18:02 -0800 Arun Persaud : -added some comments for translators - - -2012-02-11 10:08:46 -0800 Arun Persaud : -fixed comments for translators: comments starting with TRANSLATORS: are now copied to the po file - - -2012-02-11 19:01:49 +0100 H.G. Muller : -Also configure sweep selection - -To make sure this feature is tested, we set -pieceMenu false in the -master settings file. - -2012-02-11 18:26:34 +0100 H.G. Muller : -Fix date in copyright notice about-box - - -2012-02-11 17:15:11 +0100 H.G. Muller : -Fix switching animation masks on variant switch - -The masks for variant-dependent piees (E,H in Seirawan, promoted Golds -in Shogi, the Gothic Chancellor) were no longer updated in InitDrawingSizes -because of the patch to reduce X-server calls. - -2012-02-11 16:46:58 +0100 H.G. Muller : -Configure wider game list - -The game list was by default too small, so that there was no room for the -filter field. Now a width of 500 is specified, whcih works at -size 49 -as well as 72. - -2012-02-11 16:29:06 +0100 H.G. Muller : -Fix button chaining and combo/textbox label height - -Previous patches forgot to specify the height for the text labels on --combo and -text options, so they were still too high. Buttons that go -on the same line as the previous element should be chained right, not rubber. - -2012-02-11 15:52:52 +0100 H.G. Muller : -Make -pgnNumberTag option setable from menu - -The Save Options dialog now containes a checkbox for this. - -2012-02-11 15:48:52 +0100 H.G. Muller : -Configure some new features switched on - -The master settings file switches -showTargetSquares, -sweepPromotions -and -seekGraph on, so that they will get more testing. - -2012-02-11 14:43:53 +0100 H.G. Muller : -Fix heigth of multi-line labels - -The previous height patch overlooked that some labels are multi-line, -and need more height. - -2012-02-11 14:10:21 +0100 H.G. Muller : -Fix popdown seekgraph on forward-event XB - -Only the grid was drawn when the > or >> button were operated, because -a full redraw was not forced by ForwardInner. The recent patch to take -the seek graph down on such events did not account for that. (BackwardInner -always seems to do full redraw, however?) - -2012-02-11 12:59:04 +0100 H.G. Muller : -Put front-end support for -recentEngines in XBoard - -The engines are added to the menu. Problem is still that in XBoard -startup engines are given by command, rather than selected by combobox, -so the command rather than the nickname ends up in the menu. If this is -then selected, it cannot be found in the list. To limit the damage, -Fairy-Max is now pre-installed without nickname. -recentEngines is now -configured to 4. - -2012-02-11 11:53:39 +0100 H.G. Muller : -Better solution to button-height problem - -In stead of adapting the height of text widgets to that of buttons, -(as represented by the message widget), we now do the opposite, and -adapt the button & label heights. This is made safe by obtaining textHeight -from the fontSet's max_logical_extent, though an XExtendsFontSet() call. -Turns out the default height of text widgets is not exactly that, but -4 pixels larger for borders and margin. - The parameter XtNvertDistance is now used to align the checkboxes with -the following text widget, and their size is derived from textHeight as -well. - The XtNvertDistance is set to -1 for the lower spin button, so that it -its border coincides with that of the upper spin button. Their height is -set to textHeight/2. This makes their combined height just 1 pixel more -than that of the preceeding text widget. (Uh? 2 x tw/2 -1 > tw?), so for -other buttons we use that too (i.e. textHeight = font_extent + 5). - -2012-02-10 22:39:08 +0100 H.G. Muller : -Fix warning - -Deleting debug printing had made a variable unused. - -2012-02-10 22:26:39 +0100 H.G. Muller : -Fix sleeping bug - -The text-edit-height patch introduced a bug that did not have any consquences -(yet), as the extra arg erroneously included leftover from a previous -SetValues call happened to be the same as one of the intended args. - -2012-02-10 20:51:41 +0100 H.G. Muller : -Fix unloading of first engine on tourney start - -Because NextTourneyGame was loading a new engine before ReserveGame was -called to unload it with dummy game nr = -1), the first engine proc kept -hanging. - -2012-02-10 18:39:09 +0100 H.G. Muller : -Remove some of the most verbose debug output - - -2012-02-10 17:46:35 +0100 H.G. Muller : -Delete some unused WinBoard bitmaps - -There waere up-side-down knight icons that apparently hid by mistake -in the bitmaps directory: they were not part of WinBoard - -2012-02-10 17:39:48 +0100 H.G. Muller : -Cosmetic: change 4.5 to 4.6 in xboard.conf comment - - -2012-02-10 17:35:22 +0100 H.G. Muller : -Fix crash on empty combobox menu XB - -XBoard crashed when a combobox without items was opened, as could easily -happen in the Load Engine dialogs when -firstChessProgramNames contained -no items, as it would without configuring. Now the creation of the popup -menu is suppressed in that case. - -2012-02-10 17:13:36 +0100 H.G. Muller : -Fix position of checkbox XB - -With the large height the widget get in internationalization, the -checkboxes are position way too high above the text. To shift them down -a dummy borderless label widget is drawn above them (when needed). - -2012-02-10 15:07:35 +0100 H.G. Muller : -Fix heights in Engine Output window XB - -The icons did not fit in the space above the memos anymore, so the height -of this area is now left free. - -2012-02-10 14:55:48 +0100 H.G. Muller : -Derive height of text-edits in dialogs from message widget - -With internationalization the default height of buttons has inexpliquably -inreased compared to that of text-edits, messing up the layout of the -GenericPopUp. The message widget is now used as a emasure of how high -the widgets should be. - -2012-02-10 14:21:37 +0100 H.G. Muller : -Configure XBoard engines and textures - -The new -useBoardTexture option is needed in xboard.conf, as we want to -distribute with the texture on, while the compiled-in default is off. -A list of 4 engines has been configured (fairymax, fruit, crafty, gnuchess), -as the Load Engine and Match Options checkboxes crash XBoard when the list -is empty. The -recentEngines option is set to 0 to make sure the code -associated with it is never executed: the code is still experimental, -and the required front-end support is only present in WinBoard anyway. - -2012-02-10 13:30:58 +0100 H.G. Muller : -Update Dutch WinBoard translation - - -2012-02-10 13:18:48 +0100 H.G. Muller : -Create room in some WB dialogs for translations - - -2012-02-10 13:17:30 +0100 H.G. Muller : -Add 5 missing strings to WinBoard translation template - - -2012-02-09 23:03:58 -0800 Arun Persaud : -new developer release - - -2012-02-09 23:04:46 -0800 Arun Persaud : -updated po-filies - - -2012-02-09 22:59:05 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - -2012-02-09 22:44:39 +0100 H.G. Muller : -Fix non-bug in WinBoard - -The IDM_RecentEngines was not used in symbolic form everywhere. - -2012-02-09 18:46:08 +0100 H.G. Muller : -Fix MAXENGINES in WinBoard - -The front-end arrays for expanding the engine list measured 1000 entries, -in stead of MAXENGINES, leading them to overflow. - -2012-02-09 13:05:42 +0100 H.G. Muller : -Implement kludge to set options through Move Type-in - -A leading "!!! " will cause the rest of the line to be parsed as -command line. Very dangerous, as an unknown option (e.g. because of a typo) -will cause a fatal error, which makes XBoard exit. - -2012-02-09 13:04:44 +0100 H.G. Muller : -Put move number in Eval Graph title - - -2012-02-09 13:00:09 +0100 H.G. Muller : -Implement -pgnNumberTag option - -A new (persistent) boolean option controls if the sequence number is to -be written in saved tourney games as a Number tag, to make it easier -to correlate games with debug files. - -2012-02-09 12:55:52 +0100 H.G. Muller : -Create separate debug fil for each tourney game - -Users can now apecify a -debugfile with %d in its name, and this will -be replaced by the sequence number of the game. TwoMachinesEvent then -starts by opening a new file when the name has changed, so that each -game will go to a different file, with recognizable name. - -2012-02-09 12:51:25 +0100 H.G. Muller : -Fix bug in WB combobox readout - -The previous patch exposed a latent bug in the readout of the generic popup. - -2012-02-08 23:25:31 +0100 H.G. Muller : -Allow grouping of engines in engine list - -Lines "# GROUPNAME" and "# end" enclose a group in -firstChessProgramNames. - -2012-02-08 17:47:46 +0100 H.G. Muller : -Fix TidyProgramName - -A trailing .exe was not removed if the engine name was quoted. - -2012-02-08 17:45:42 +0100 H.G. Muller : -Put recently used engines in WB menu - -A new option -recentEngines specifies how many engines should be listed. -The list of nicknames is stored in the ettings file as -recentEngineList. -The engines are appended to the Engine menu. - -2012-02-04 19:37:51 +0100 H.G. Muller : -Fix registering of EditTagsProg - -This was registered with X as EditCommentProc! - -2012-02-07 23:04:49 +0100 H.G. Muller : -Increase max nr of engines to 2000 - -Move the #define for MAXENGINES also to common.h, so that both the -Load and Tourney dialog use the same maximum. - -2012-01-19 23:01:20 +0100 H.G. Muller : -Fix fix of switch to mono-mode - -The previous fix had == in stead of != for testing if mono-mode had changed. - -2012-01-19 22:21:38 +0100 H.G. Muller : -Make New Variant dialog visible in mono-mode - -All colored buttons did get a black background, and also black text... -Use timer background color in stead, which is white. - -2012-01-19 20:48:37 +0100 H.G. Muller : -Incease size of WB array of translated items - -For the BoardOptions dialog 42 items are now needed - -2012-01-19 17:18:25 +0100 H.G. Muller : -Implement Clone Tourney button XBoard - -This makes use of the new GenericUpdate(). - -2012-01-19 16:34:13 +0100 H.G. Muller : -Implement GenericUpdate function - -This does the opposite from GenericReadout: it copies the current -parameter values into the dialog. - -2012-01-19 12:19:27 +0100 H.G. Muller : -Fix arrow damage with highlightDragging XB - -With highlight dragging the highlights of the previous moves are cleared -when lifting the piece. Logically, this should also clear the arrow, but -to do that requires a board redraw, which is not done at this stage. (And -even then this would only be effective after marking the arrow damage, -which is not done yet either). As a temporary fix, we repair the arrow -by redrawing it. - This patch has moved marking of the arrow damage from DrawArrowHighlight -to a separate routine, so a future better fix can also call that when the -arrow should be erased. - -2012-01-18 16:01:50 +0100 H.G. Muller : -Prevent unnecessary loading of engines - -For engines that can be reused, the unloading at the end of a pairing -is in some cases wasteful, as the same engine will be used in the next -pairing as well. In simple gauntlets the gauntlet engine will always -stay first engine, while in multi-gauntlets the oppent engine will stay -the same for an entire round. In these cases unloading is now suppressed. - -2012-01-17 22:22:32 +0100 H.G. Muller : -Reset protocol version before loading new engine - -The protocol version was not reset, so if the previous engine was v1, -the newly loaded engine would not be sent a protover command, so -that its features would remain unknown! - -2012-01-17 19:33:32 +0100 H.G. Muller : -Give focus to board window after ICS login - -toprevent that the focus remains on any popped up chat boxes, it is -explicitlly set otherwise. The board window is preferred over the -ICS interaction window, because you can type from there to the ICS anyway, -and it makes all accelerator keys available. - -2012-01-16 14:37:05 +0100 H.G. Muller : -Fix seek-graph popup and popdown - -Clicking outside the board area in WB (e.g.on the clocks) would also -trigger seek-graph 'popup'. This is now suppressed by testing for -y-coord > 0. In addition, the seek graph is automaticaly taken down -when we step to another position in the current game (using buttons, -arrow keys or whatever). - -2012-01-15 21:29:11 +0100 H.G. Muller : -Suppress empty lines when observing on VICS - -Capture of the engine kibitzes when observing an engine game with --autoKibitz on was still leaking a linefeed on the Variant ICS -(but not FICS or ICC!?). - -2012-01-15 21:24:12 +0100 H.G. Muller : -Fix printing non-numeric kibitz with -autoKibitz - -Messages that were not considered kibitzed engine PV info for lack of -numeric content, were kibitzed as coming from "your opponent", which -is nonsense if you were iobserving, and masked the source. Fortunately -star_match[0] is still holding the original name, at that point. - -2012-01-11 17:33:29 +0100 H.G. Muller : -Fix 4 warnings - - -2012-01-11 17:00:38 +0100 H.G. Muller : -Use same translation of "vs." everywhere - - -2012-01-11 17:08:18 +0100 H.G. Muller : -Add new translations to WB language file - - -2012-01-11 16:20:17 +0100 H.G. Muller : -Fix re-allocation of PGN-cache memory - -It allocated 8 times too much! - -2012-01-11 12:47:38 +0100 H.G. Muller : -Fix height board dialog - - -2012-01-11 12:34:39 +0100 H.G. Muller : -Enable WB time-control dialog even when no clock mode - -The dialog could be called from the tournament dialog to set a TCfor -the tourney even when currently in game-viewer mode, so it'd better work. - -2012-01-11 12:28:43 +0100 H.G. Muller : -Exempt variant seirawan from -disguisePromoted inheritance - -This is not a variant where promoted Pawns have to be distingushed -from primordial pieces, as captured pieces do not go into the holdings. - -2012-01-09 21:23:52 +0100 H.G. Muller : -Add control for overrideLineGap in WB Board dialog - -Make it a checkbox to choose between 0 and -1. - -2012-01-09 20:56:40 +0100 H.G. Muller : -Add Ctrl-D as alternative to Ctrl+Alt+F12 in WinBoard - -The acellerator key Ctrl+Alt+F12 seems reserved on Windows 7. - -2012-01-09 20:52:05 +0100 H.G. Muller : -Fix seek graph for VICS - -The sought command on the open-source ICS code is ICC-like (no terminating -line), although the server is FICS like. So also accept prompt as seek-graph -trigger on FICS. - -2012-01-09 20:27:01 +0100 H.G. Muller : -Open WB startup chat boxes only after logged on - -The init code for opening the chat boxes ismoved to DisplayIcsTitle(). - -2012-01-07 20:31:34 +0100 H.G. Muller : -Install mime types directly - - -2012-01-07 20:29:10 +0100 H.G. Muller : -Install desktop files directly - - -2012-01-07 20:19:09 +0100 H.G. Muller : -Install icons directly - -Rather than letting make-install copy the pixmaps to the XBoard data -directory they are installed directly from the source files. The name -of the TRN icon was also corrected and changed. - -2012-01-05 18:41:13 +0100 H.G. Muller : -Update texi file and remove duplicate control - -Some missing option descriptions were added. The highlight-dragging -control was removed from the General Options dialog, as it did the same -as Show Target Squares. -highlightDragging wa changed to a volatile option -with default value true, making it effectively disappear as an XBoard -option. (In WinBoard it is still persistent.) - -2012-01-05 15:55:54 +0100 H.G. Muller : -Remove the direct commands to the engines - - -2012-01-05 21:15:11 -0800 Arun Persaud : -forgot to list new desktop files in EXTRA_DIST section in Makefile.am - - -2012-01-05 20:08:23 -0800 Arun Persaud : -added some autogenerated po files to .gitignore - - -2012-01-05 20:05:44 -0800 Arun Persaud : -added desktop and mime-type association to autoconf install process - -This should install and uninstall the mime assocciation and also the icons. -Also renamed the desktop files to avoid possible name collisions. - -2012-01-03 21:30:59 -0800 Arun Persaud : -code cleanup: make function definition confirm to GNU coding style - -change everything in the main directory to - -void -funcname (int a, int b) - -format - -2012-01-03 18:43:18 -0800 Arun Persaud : -Updated copyright notice to 2012 - - -2012-01-03 21:32:04 +0100 H.G. Muller : -Implement -viewerOptions - -A mechanism is added to allow the user to configure persistently if the -game viewer that starts on clicking PGN files will use -ncp mode, or -load an egine for analysis (or, in fact, do anything). This by introducing -a persistent string option -viewerOptions, which will be parsed as a -command line after the real command line when the option -viewer was present. - -2012-01-03 11:29:00 +0100 H.G. Muller : -Fix crash in auto-comment - -Trailing linefeeds in AppendComment were not properly stripped off, -leading to a mismatch between the allocted and used memory, and thus -possible buffer overruns. - -2012-01-02 23:46:18 +0100 H.G. Muller : -Fix crash at match end - -The -afterTourney option had broken old-style matches, because the ranking -string that was tested for "busy" is not set there at all, and remains a -NULL pointer, which strcmp doesn't like. - -2012-01-01 19:56:58 +0100 H.G. Muller : -Add desktop files for PGN viewer and tournament player - -The desktop files define startup commands for handling PGN, FEN and -tourney files, calling xboard with the proper command-line options. - -2012-01-01 19:53:02 +0100 H.G. Muller : -Add xml file for defining mime types - -The file xboard.xml defines application/x-chess-pgn, aplication/x-chess-fen -and application/x-xboard-trn as mime types for *.pgn, *.fen and *.trn files, -so these files can be associated with XBoard in various modes. - -2012-01-01 19:41:39 +0100 H.G. Muller : -Add icons for PGN and tourney files - -Icons are provided in two sizes: 32x32 and 48x48. - -2011-12-29 19:55:33 +0100 H.G. Muller : -Clear square markers on new game - -Now that the markers can stay on after a first click, they need to be -explicitly cleared when moving to another board, including a new game. - -2011-12-29 15:51:18 +0100 H.G. Muller : -Abandon single-letter menus in tinyLayout - -Now that the items on the main menu bar are clipped, it iso longer -necessary to abbreviate them. - -2011-12-29 15:38:46 +0100 H.G. Muller : -Implement peeking previous position in WinBoard - -The backspace key is used to temporarily display the previous position. - -2011-12-29 15:32:20 +0100 H.G. Muller : -Fix parsing of faulty PGN tags - -A closing bracket could be missed in a malformed tag - -2011-12-29 15:29:00 +0100 H.G. Muller : -Fix parser for variant seirawan - -The new parser didnot understand gating suffixes with /, and did not -allow any suffix at all on SAN castling moves. - -2011-12-28 22:32:38 +0100 H.G. Muller : -Try to not confuse ICS rating adustments as shouts - -An explicit pattern match for the rating adjustment is added before -matching the shouts. - -2011-12-28 22:21:54 +0100 H.G. Muller : -Describe -overrideLineGap option in texi file - - -2011-12-28 22:03:30 +0100 H.G. Muller : -Use in stead of Ctrl+. for peeking last move - -I commented out the explicit detection of the Ctrl key, as this -is not needed when there are no 'unnatural' Ctrl keystrokes used -for binding. - -2011-12-28 19:37:49 +0100 H.G. Muller : -Next try for menu-bar sizing - -This time request the width needed to just fit everything, and then start -shaving off pixels from the currently largest until the entire thing fits. - -2011-12-28 15:17:49 +0100 H.G. Muller : -Clip texts on menu bar - -The width of the items on the main menu bar is restricted so the bar -will never exceed board width. - -2011-12-28 14:01:53 +0100 H.G. Muller : -Fix format in temporary timing printf - - -2011-12-28 13:38:59 +0100 H.G. Muller : -Don't test drops as mate evasions in variant seirawan - - -2011-12-28 13:36:23 +0100 H.G. Muller : -Fix ICS castling rights - -Copying the castling rights together with CopyBoard seems to have -broken handling of ICS rights, where ParseBoard12 prepares a board -in a local variable, an copies it before parsing the rights. - -2011-12-28 13:35:10 +0100 H.G. Muller : -Fix initial holdings ICS seirawan games - - -2011-12-27 18:31:05 +0100 H.G. Muller : -Fix sending of S-Chess gating moves to ICS - -Normal moves did not get the gating suffix sent. - -2011-12-27 17:56:07 +0100 H.G. Muller : -Fix menu grayout after illegal move - -TheThinkingEnables were not reset to user state after the engine rejected -the entered move as illegal. - -2011-12-27 13:26:36 +0100 H.G. Muller : -Allow setting of holdings with edit command - -For the benefit of Fairy-Max' Seirawan Chess implementation, the edit command -no also sends holdings contents (if the engine sent feature xedit=1), encoded -as pieceType + '@' + holdingsCount (if the count is non-zero). - -2011-12-24 17:54:16 +0100 H.G. Muller : -Fix out-of-bounds access in check test - -Thepath to make the check test work with drops had broken the test -after null move (both have rf<0), which led to corruption of the high -word of the black clock. - -2011-12-24 17:51:22 +0100 H.G. Muller : -Fix legality of Spartan promotion to king - -In the check test promotion to King is only allowed if there are not -yet 2 kings. - -2011-12-21 22:17:01 +0100 H.G. Muller : -Fix switching back from mono-mode XB - -Suppressing unnecesary X-server calls in InitDrawingSizes had broken -switching back from monoMode, because the animVars have to be recreated -for that, and this was only done when the variant changed. - -2011-12-21 22:09:02 +0100 H.G. Muller : -Fix showTargetSquares in mono-mode XB - -Make the marker dots black (captures) and white, and draw a circle -in the opposite color around them in monoMode. - -2011-12-21 22:00:26 +0100 H.G. Muller : -Fix arrow highlighting in mono-mode XB - -Draw a line around it in darkSquare color in monoMode. - -2011-12-21 17:48:33 +0100 H.G. Muller : -Fix alignment of generic browse button XBoard - -The width ofthe browse button is now read back after creating it, -and subtracted from the preceding text edit. - -2011-12-21 14:41:31 +0100 H.G. Muller : -Add -afterTourney option - -Only the instance pinting the tourney result will execute this. - -2011-12-22 21:01:43 +0100 Byrial Jensen : -Fix buffer possible overflow when writings tags - -PGNTagsStatic() could overflow its buffer and is removed. PGNTags() do the work instead of calling it. -It starts by calculation the required buffer size and then allocate the buffer. -PrintPGNTags() now prints directly to the file without having a buffer. - -2011-12-22 15:01:31 +0100 Byrial Jensen : -One more string marked for translation - -And it is moved inside the if statement that uses it. - -2011-12-22 14:30:08 +0100 Byrial Jensen : -Fix checking of return value from snprintf() - -snprintf() returns the needed space excluding the trailing 0 byte, so -it has truncated if the returned valued is greater than or EQUAL TO the buffersize - -2011-12-19 16:49:31 +0100 Byrial Jensen : -Fix unportable memory initialisation - -Memory sat to zero by calloc() cannot safely be assumed to have the pointer value NULL - -2011-12-19 13:16:58 +0100 Byrial Jensen : -Add 2 strings for translation - - -2011-12-19 11:25:11 +0100 Byrial Jensen : -Remove the last 2 compile warnings in gamelist.h - - -2011-12-19 11:17:48 +0100 Byrial Jensen : -Add #include "moves.h" to gamelist.c for def. of CopyBoard() - - -2011-12-19 11:11:34 +0100 Byrial Jensen : -Definition of TimeMark moved from 3 c files to backend.h - - -2011-12-19 01:21:46 +0100 Byrial Jensen : -Transfer a pointer to the promoChar from PromotionPopUp() to PromotionCallback(). Fixes #34980 - - -2011-12-18 17:24:07 +0100 Byrial Jensen : -Duh! Initialise the argument to sscanf() inside the loop, so it always gets a known value when sscanf() fails. - - -2011-12-18 17:18:12 +0100 Byrial Jensen : -Give numeric options the value 0 if a non-numeric text is entered (one more place). Before the value ended up undefined. - - -2011-12-18 17:08:46 +0100 Byrial Jensen : -Give numeric options the value 0 if a non-numeric text is entered. Before the value ended up undefined. - - -2011-12-18 15:41:46 +0100 Byrial Jensen : -Fix possible crash on 64-bit systems when copying game or position - -The two convertproc's for X selections caused reads out of bounds on 64-bit systems. -I hope that this is the right solution. I am not experienced with X stuff, but it -follows that I have seen in other programs, testing shows that copying still works, -and the reading out of bounds have disappearinged with this patch. - -2011-12-18 13:26:20 +0100 Byrial Jensen : -Fix a possible crash in the file browser - -If the OK button was selected in the file browser when no file was selected -there was a read out of bounds which could crash xboard - -2011-12-17 22:54:34 +0100 Byrial Jensen : -Fix a memory leak in Sound Options - - -2011-12-16 02:57:20 +0100 Byrial Jensen : -Fix crash when selecting user soundfile due to free() of not malloc()'ed memory - - -2011-12-16 02:32:37 +0100 Byrial Jensen : -Make GenericPopUp() more readable by using more named flags instead of numerals - -Defines the flags SAME_ROW (value 1) and NO_OK (value 2) for use with buttons and endmarks. -There should no functional change. -Also add a code comment where a condition depends on an uninitialised value. There is no direct harm, as both -branches do the same (that is nothing) when the value is uninitialised. - -2011-12-15 02:51:36 +0100 Byrial Jensen : -Add NO_GETTEXT flag for combobox. Fix bug #34991 - -Define NO_GETTEXT flag to avoid calling gettext() for comboboxes, and define COMBO_CALLBACK -flag to call comboCallback() when an item is selected in a combobox (no new code for this, -just a symbolic value instead of a number). The flags are used for the min field of struct Option. -NO_GETTEXT is used for the Select engine combobixes in the Match Options and Load engine windows. - -2011-12-13 19:48:37 -0800 Arun Persaud : -only translate entries in CreateComboPopup if strlen>0; fixes #34991 - - -2011-12-12 19:06:26 -0800 Byrial Jensen : -fix for repeating key issue, with this allissues this bug should be closed; fixes #35000 - - -2011-12-12 18:45:05 -0800 Arun Persaud : -also don't translate selection in ComboSelect; fixes #34991 - - -2011-12-12 18:40:23 -0800 Arun Persaud : -make entries in CreateComboPopup not translateable; fixes #34991 - - -2011-12-10 16:06:47 -0800 Arun Persaud : -fix translation for engine list; fixes #34991 - -* click on browse button should be recognized in translated versions -* width of button should auto-scale - -2011-12-10 11:04:17 -0800 Arun Persaud : -change keybindings that don't use ctrl, make MoveTypeInProc ctrl aware; fixes #35000 - -two keybindings were using keys without modifiers, adjusted these to use the ctrl key. -Furthermore when typing in moves we need to check if ctrl was pressed and ignore those inputs. - -Also added documentation for these keybindings. - -2011-12-10 10:51:18 -0800 Arun Persaud : -replaced unicode character for "'" in xboard.texi - - -2011-12-10 10:08:48 -0800 Arun Persaud : -removed Iconify function. Should be handled by the window manager. - - -2011-12-08 20:53:13 -0800 Arun Persaud : -marked an error messages for translation - - -2011-12-08 20:33:29 -0800 Arun Persaud : -translation: updated uk.po - - -2011-12-03 17:52:23 -0800 Arun Persaud : -fixed size of XBoard icon to 48x48 - -the icon gets installed in the 48x48 directory, but was >200 pixel wide. This gave a warning during rpm creation. - -2011-12-03 08:07:32 -0800 Arun Persaud : -updated pot file - -marked a lot of new strings for translation - -2011-12-03 08:06:42 -0800 Arun Persaud : -added new files to po/POTFILES.in - - -2011-12-02 22:13:36 -0800 Arun Persaud : -marked more strings for translation - - -2011-12-02 20:08:01 -0800 Arun Persaud : -translation: added danish translation - - -2011-12-01 18:45:55 +0100 H.G. Muller : -Change encoding of seirawan ICS gating-castlings - -In stead of using upper/lower-case promoChar, the ICS now uses -RxK notation, like WinBoard writes in SAN, for better consistency. - -2011-11-30 15:38:21 +0100 H.G. Muller : -Put promo-suffix on ICS move in variant seirawan castlings - -The distinction upper-case / lowercase determines gating at R / K - -2011-11-28 11:56:18 +0100 H.G. Muller : -Refrain from making unnecessary resize X request - -The window resizing code in InitDrawingSizes is suppressed when no -change is needed. Similarly, changing piece bitmaps is suppressed when -we stay in the same variant (and InitDrawingSizes is called e.g. because -of chaging lineGap through the Board dialog). - -2011-11-27 22:27:00 +0100 H.G. Muller : -Fix parsing of O-O castling in variant janus - -The new parser did not realize it meant e1i1 rather than wild e1h1. - -2011-11-26 22:28:23 +0100 H.G. Muller : -Show 50-move counter also when observing ICS games - -To not cheat 50-move display was suppressed in ICS mode, -but for observing a game this made no sense. - -2011-11-26 22:22:07 +0100 H.G. Muller : -Ignore ICS game starts when already in game - -The advance switching of the variant on game-start messages was -disruptive for users with gin=1, which also sends such messages -for other games than your own. For now fixed by only reacting on -them when idle (detected by invalid game number). - -2011-11-11 18:16:19 +0100 H.G. Muller : -Fix WinBoard clock-click bug - -Clicking on the clock in WinBoard also called the LeftClick routine -for handling clicks on the board. This led to the from-square being set -to some inalid value, so that the next genuine board click was interpreted -as a to-click, with undesired effects, especially with legality testing off -or in EditPosition mode, where weird things are accepted. - -2011-11-06 17:20:01 +0100 H.G. Muller : -Add feature-override options - -A few (dangerous) options are added to allow a user to override -engine features, or change their defaults, by supplying a string -with feature commands (e.g. "sigint=0") which tricks XBoard into -thinking the engine sent that. There is a -featureDefaults which is -processed before the engine features, and -first/secondFeatures -which is parsed just before engine initialization. - This goes horribly wrong when the user wouldtry silly things like -including 'option' or 'done' features! - -2011-11-05 12:32:39 -0700 Arun Persaud : -translation: updated uk.po - - -2011-11-04 21:58:39 +0100 H.G. Muller : -Fix handling of -secondOptions option - -The -firstOptions and -secondOptions settigs were not swapped when --singleEngieList was true, so the second engine's options would never -be set in that case, but used for the first engine. - -2011-11-04 21:55:21 +0100 H.G. Muller : -Accept setup command in variant fairy even with legality testing on - -Variant fairy does not really have a defined opening position, but lots -of pieces defined, so we might want to play with legality checking on, -but still rely on the engine for the opening position - -2011-11-04 21:52:20 +0100 H.G. Muller : -Set pieceToCharTable by setup command even when ignoring FEN - -When the user starts from a set-up position, the egines default -openingposition has to be ignored, but the pieceToCharTable would -still be relevant. - -2011-11-04 21:48:24 +0100 H.G. Muller : -Change default sweep-promotion choicein queenless variants - -The initial scanning of the sweep piece until a defined piece is found -is now in the increasing direction (still starting at Queen), so that -the fairy pieces are suggested before R, B and N. - -2011-11-03 16:38:57 +0100 H.G. Muller : -Clear board markers when moving to other position - -Now the markers from -showTargetSquares would stay on after a first click -for the benefit of a click-click move, they would also stay on when not -finishing the move, but operating the < > buttons in stead to call up -other positions. ForwardInner and BackwardInner now clear the markers, -like they also cleared highlights. - -2011-11-01 18:30:22 -0700 Arun Persaud : -updated Changelog, NEWS, etc. - -2011-10-25 15:32:27 +0200 H.G. Muller : -Fix two warnings - -2011-10-24 20:00:28 +0200 H.G. Muller : -Don't adjust clock on right-click in EditGame mode WB - -This was a change that was already done for the left-clicks, but somehow -never made it togit for the right-clicks - -2011-10-24 19:50:25 +0200 H.G. Muller : -Change chase message in .lng files - -2011-10-24 19:31:08 +0200 H.G. Muller : -Let perpetual-chase message mention square - -In stead of a boolean, PerpetualChase now returns the square the chased -piece ends on (encoded as an int), and on adjudication it will be printed. - -2011-10-24 19:26:02 +0200 H.G. Muller : -Add mechanism to translate variable messages in WinBoard - -A message prefixed with % in the lng file will be considered a match -if it matches the start of the text to be printed, and the remaining -part of the latter will remain untranslated. This was needed to allow -translation of the perpetual change message, now it indicates the square -of the chased piece. - -2011-10-24 19:20:13 +0200 H.G. Muller : -Use other interpretation of Asia rules for chase detection - -The detection of perpetual chases now ignores pre-existing checks. - -2011-10-12 17:28:48 +0200 H.G. Muller : -Fix crash on loading garbage game file - -The code to cache games was not resistant to moves before a valid -game start, or a game filewithout any games at all. - -2011-10-08 20:43:52 +0200 H.G. Muller : -Incorporate variant type in book hash key - -This prevents booksforone variant being used for another, and allows -multi-variant books. - -2011-10-07 15:41:44 +0200 H.G. Muller : -Update language.txt file - - -2011-10-07 15:34:01 +0200 H.G. Muller : -Update Dutch lng file - - -2011-10-07 15:21:53 +0200 H.G. Muller : -Fix Load Options dialog WB - -Defined fastkeys; reordered elements so that fastkeys focus edit they -are intended for. Changed some of the more obscure texts. Corrected -list of transatble dialog items, adding a few missing ones. - -2011-09-13 20:01:42 +0200 H.G. Muller : -Fix some warnings - -Prototypes were added, ormoved from backend.c to backend.h. - -2011-08-26 12:44:08 +0200 H.G. Muller : -Put 'Load Next' button back in WB Game List - -The '>' button for loading the next (filtered) game is re-instated in the -WinBoard GameList. The main window has now accelerator keys Ctrl+Up and -Ctrl+Down for loading the previous and next filtered game. - -2011-08-26 12:31:59 +0200 H.G. Muller : -Speed up position search and consider side to move - -The position search is made to pay attention to the side to move, -which produces a speedup, because we only have to compare half the -game positions when looking for an exact position match. An addition -we now keep track of the total number of pieces, and abandon a game when -it drops below the number of pieces in the position we seek. - -2011-08-21 23:16:15 +0200 H.G. Muller : -Dynamically allocate move cache - -A small statically declared cache good for 250k moves (~3200 games) -will be expanded in steps of a factor 8 when it overflows. - -2011-08-18 18:40:38 +0200 H.G. Muller : -Translate search strings - - -2011-08-17 22:55:21 +0200 H.G. Muller : -Implement flipped search - - -2011-08-16 15:29:03 +0200 H.G. Muller : -Debug position search cache - - -2011-08-15 18:44:37 +0200 H.G. Muller : -profile - - -2011-08-18 18:01:54 +0200 H.G. Muller : -Translate search-mode strings - - -2011-08-15 16:59:39 +0200 H.G. Muller : -Quickscan - - -2011-10-23 16:04:00 +0200 H.G. Muller : -Fix duplicate loading of second engine in tourneys - -To decide if new engines should be loaded, it was tested if first.pr -equalled NoProc, assuming that ReserveGame would have left the engine -loaded if the next game would need the same engines. But a reuse=0 engine -could have caused termination of the first engine process anyway, while -the second would still be alive. So unconditionally starting of the second -engine would cause redundant engine processes to abound. - Now we only start new engine processes if both engine processes are dead. - -2011-10-23 15:53:32 +0200 H.G. Muller : -Fix PV walking with -fSAN - -The SAN options had broken the PV walking, because the shelving of the -walked PV to create space for the conversion to SAN of an incoming PV -would not be properly undone, but would add the walked PV to the game. - -2011-10-20 12:39:10 +0200 H.G. Muller : -Refine clock adjusting - -Adjusting the clocks by shift-clicking them is now only allowed with -autoCallFlag off, and an error-popup results when you do it otherwise. -Also, swtching to Edit Game mode won't reset the clocks to the stored -value anymore when you have just adjusted it. - -2011-10-12 17:43:33 +0200 H.G. Muller : -Fix crash on adding items near book end - -When Edit Book would add so many entries near the end of an opening -book that the end of the added info would surpass the old end of the -file, the copying of the tail got stuck in an infinite loop, extending -the file without limit with repeating info. - -2011-10-12 17:41:18 +0200 H.G. Muller : -Print message on wrong use of Clone Tourney - -The user is urged to first provide the name of an existing tourney file -when he presses the button without one. The button is also renamed. - -2011-10-12 17:38:33 +0200 H.G. Muller : -Fix invalid combobox entry WB - -A combobox label that was not in the list (because the user typed -it, rather than selecting one) would cause a crash. - -2011-10-12 17:23:57 +0200 H.G. Muller : -Fix crash on loading garbage game file - -XBoard crashed when a game file contained a PGN game result before -any valid game start, because data would be written in a game-list -node that did not exist yet. This would occur frequently when garage -was read; basically any asterisk in the data would do it. - -2011-10-11 23:31:01 +0200 H.G. Muller : -Add control to set -discourageOwnBooks WB - - -2011-10-11 20:53:52 -0700 Arun Persaud : -only require 0.17 of gettext - -This seems to solve many build issues with older distrubtions and doesn't seem to be a problem with newer ones. - -2011-10-11 23:31:01 +0200 H.G. Muller : -Add option -discourageOwnBooks - -This boolean option determines the default setting of the hasOwnBook -option before a tourney game starts. By setting it, the hasOwnBook -option is cleared, which would enable use of the GUI book, like the -engine was installedwith the /firstXBook option. An explicit option -on the engine install line can still overrule this, though. - A control to set this option has been added in the XBoard Match dialog, -and it is saved in the tourney file to force consistency. - -2011-10-11 22:58:01 +0200 H.G. Muller : -Reset initString and computerString on engine load - -These options are typically engine specific, and must thus be -reset to their default value before loading a new engine. - -2011-10-11 22:43:00 +0200 H.G. Muller : -Add Romanian lng file - - -2011-10-07 16:55:45 +0200 H.G. Muller : -Reactivate Falcon Chess - -Now the patent for this has expired, Fairy-Max plays it again. -So the XBoard support for it is now switched on, and an item for it is -added to the XBoard New Variant menu dialog. (WinBoard still had that.) -In the array the Lance was changed for the Falcon as a wild-card piece. - -2011-10-03 09:59:40 +0200 H.G. Muller : -Update texi file for new features - - -2011-10-03 10:30:30 +0200 H.G. Muller : -Update texi file for position search - -The new items in the Load Game Options dialog are described, as well -as the command-line options used to store them in the settings file. - -2011-10-03 09:28:50 +0200 H.G. Muller : -Remove paragraph about .Xresources from texi file - -Command-line options can no longer be set through .Xresources already -since version 4.5.0. - -2011-10-03 09:13:05 +0200 H.G. Muller : -Add Dutch WinBoard translation - - -2011-09-28 20:46:21 +0200 H.G. Muller : -Prevent Edit Book window from stealing focus (WB) - -In WinBoard updating the book window would give it focus. Now the -focus is given back to the main window, except when the Edit Book -window is first created. - -2011-09-28 20:42:00 +0200 H.G. Muller : -Make book-window update part of HistorySet - - -2011-09-26 16:01:28 +0200 H.G. Muller : -Fix position loading in tourneys - -In a tourney a position must be loaded when the engine is not yet -started, and the old version of LoadPosition could not handle that: -It would start up the engine, and send it commands unconditionally. - -2011-09-26 15:58:07 +0200 H.G. Muller : -Fix resetting -fSAN on engine change - -There were two places for loading another engine, Load (from menu) and -SetPlayer (in tourneys), and the previous patch for this missed the -second one. - -2011-09-26 15:51:49 +0200 H.G. Muller : -Make too-long game non-fatal - -GameEnds is now called when the maximum number of moves is exceeded, -rather than DisplayFatalError. Not sure if this properly terminates the -game in all situations, but DisplayFatalError (after calling GameEnds) -would also wait for the user to confirm the error popup before really -exiting, so that in an unattended automatically running tourney there -was not much fatal, and the entire tourney would in fact be finished. - -2011-09-26 15:46:58 +0200 H.G. Muller : -Keep book file open - -Rather than opening and closing the book file on every probe, it is -now only closed and opened when the name of it changed. - -2011-09-26 15:44:23 +0200 H.G. Muller : -Suppress playing of book moves with weight 0 - -Bookmoves with weight 0 could be played when the sum of the weights -of all moves from the position was 0. So it was not possible to suppress -the only move by giving it weight 0. This is now corrected. - -2011-10-01 15:00:47 -0700 Arun Persaud : -added NEWS for release of 4.5.3 - - -2011-09-29 20:31:23 -0700 Arun Persaud : -better contrast for XBoard icon on a dark background - - -2011-10-01 13:09:59 -0700 Arun Persaud : -translationproject.org: updated Ukrainian translation - - -2011-09-29 20:49:42 -0700 Arun Persaud : -updated pot file and send to translation project - - -2011-09-22 12:09:39 +0100 Thomas Adam : -(tiny change) Clarify "-name" option is Xt-only - -There's a set of standard options with will get used by Xt, before Xboard -itself will use them. "-name" is an Xt-only option which will set the name -and resource of the window to the value requested. It has nothing to do -with setting opponent/player names. - -Signed-off-by: Thomas Adam - -modified slightly by Arun Persaud (renamed itemx to item and fixed option name for CMAIL) - -2011-09-22 17:17:16 +0200 H.G. Muller : -Fix LoadGameOrPosition starting up engine - -When LoadGameOrPosition() is called from NextMatchGame(), the Reset() that -is called in LoadPosition() when you are running from a position file -would prematurely start up the engine (without waiting for features). -The kludge to suppress this behavior for the explicit call to Reset() -is now extended to encompass LoadGameOrPosition. - -2011-09-22 17:14:34 +0200 H.G. Muller : -Clear fSAN option before new engine load - -This to prevent the new engine will inherit it from the previous one. -As the command-line options an only set it, this has to be done by -explicit assignment. - -2011-09-13 23:02:35 +0200 H.G. Muller : -Fix some warnings (prototypes) - - -2011-09-13 19:55:44 +0200 H.G. Muller : -Fix write failures in concurrency - -In WinBoard a flood of writes by differentprocesses to the same PGN can -cause a "permission denied" error in fopen. This patch causes retries after -a random (5-15 msec) wait, in such cases. - -2011-09-13 19:52:19 +0200 H.G. Muller : -Move HistorySet to back-end - -This existed in exact duplicates in both front-ends. - -2011-09-13 19:46:36 +0200 H.G. Muller : -Make DoSleep front-end wrapper for msec sleep - -DoSleep was #defined as a macro for Sleep/ sleep, with an argument -indicating msec in WinBoard, but seconds in XBoard. Nuw it universally -uses msec, by defining it as a wrapperin the respective front-ends. -(For XBoard itwraps FrameDelay.) - -2011-09-10 22:35:14 +0200 H.G. Muller : -Fix playing sounds when -soundProgram is empty - -It made no sense to just send the names of the sound files to the shell. -So the soundProgram isnow tested for being an empty string, and if so, -PlaySound() is aborted. - -2011-09-10 14:01:58 +0200 H.G. Muller : -Add -afterGame option - -This option specifies a command line to be executed after each game of -a tournament. To execute the line, the function RunCommand() was added -in the front-end. For XBoard this was a simple call to system(); for -WinBoard part of the StartChildProcess code was cloned (without the pipe -stuff). - -2011-09-10 13:52:12 +0200 H.G. Muller : -Upgrade -serverMoves option - -The (undocumented) -serverMoves option was upgraded to conform to the -ChessLive! protocol extension for sending SAN tags. A bug that allowed -upper-case promoChar to leak through was also fixed, and code was added -to write engine PVs to file. Flushing of the game result to the -serverMoves -file was also fixed. - -2011-09-10 13:50:25 +0200 H.G. Muller : -Fix AppendComment - -The joining of two comments was not performed correctly if the second -one had the braces yet to be added: the closing brace was not added in -that case. - -2011-08-30 19:39:59 +0200 H.G. Muller : -Auto-popup ICS Input Box - -Typing to the board made the move type-in pop up, but in ICS mode -this is of course undesirable. Like in WinBoard, the ICS Input Box -should pop up in stead, and accept the typed character. This is now -realized. If the box already exists and has text in it, the typed -character is appended to that text, and the box is given focus. -Spaces now also are considered as printable. - -2011-08-30 18:27:58 +0200 H.G. Muller : -Slightly decrease sensitivity of sweep actions - -The sweep-selection of promotion and drop pieces, or step through the PV -was so sensitive that it was difficult to reliably make the intended choice. -It has now been reduced by a factor 1.5-2, and the sweep selection and -PV walk now also use a different value. - -2011-08-27 21:16:58 +0200 H.G. Muller : -Extra buttons in WB Tournament dialog - -A button to copy contents of the tournament fileto the dialog is added. -Buttons to invoke the Common Engine and Time Control dialogs are also added. - -2011-08-27 21:15:00 +0200 H.G. Muller : -Fix crash on typing non-existent enginein Load Engine dialog - - -2011-08-24 10:30:46 +0200 H.G. Muller : -Fix display state after failed analysis attempt - -When an engine responded to the "analyze" command with an "unknown command" -message, a Reset was done without altering the display, causing a -discrepancy between display and internal state, which caused confusion -when it finally corrected itself. I replaced the Reset call by an -EditGameEvent call, to preserve the loaded game. The Reset was presumably -used to allow for the case where the engine would be so upset by the -analyze command that it needed to be reset by a "new" command, but this -seems overly paranoic for an engine that just recognized the command -as an unknown one. - -2011-08-24 09:58:35 +0200 H.G. Muller : -Fix treatment of PGN score/depth info with linefeeds in them - -This is needed to make the PGN more Arena-proof. - -2011-08-24 09:51:10 +0200 H.G. Muller : -Fix quoting in Load Engine dialog - -A (space-contaning) engine name only needs quoting when there are parameters, -because the over-all engine command will be quoted anyway. For UCI engines -duplicate quoting is fatal, because when passed as the -ec argument of -Polyglot, it will be quoted yet another time, also with double quotes. - -2011-08-23 21:24:23 +0200 H.G. Muller : -Replace Analyze File by Analyz Game function - - -2011-08-22 22:16:58 -0700 Arun Persaud : -new developer release - - -2011-08-22 22:26:56 -0700 Arun Persaud : -update po files - - -2011-08-22 22:24:23 -0700 Arun Persaud : -updated Changelog, NEWS, etc. - - -2011-08-22 22:09:19 -0700 Arun Persaud : -malloc.h is not needed - - -2011-08-20 22:21:40 +0200 H.G. Muller : -Fix ICS move-list header mistaken for null moves - - -2011-08-18 18:53:09 +0200 H.G. Muller : -Allow two-games-per-opening to work with book - -A new option -seedBase is added, and written to the tourney file. -It allows all XBoard instances working on a tourney to generate the same -'random' openings in a deterministic way, based on this one-time seed -and the game number. When -loadGameIndex equals -2, it uses the same seed -for an odd and the following even game. - -2011-08-18 18:51:56 +0200 H.G. Muller : -Fix use of random - -In some places rand() was called explicitly, rather than through the -(configured) place-holder random(). - -2011-08-18 17:34:33 +0200 H.G. Muller : -Translate search texts - - -2011-08-18 10:29:35 +0200 H.G. Muller : -Add -useBoardTexture and -usePieceFont options - -These options suppress the use of the given texture files or piece fonts -without relying on the kludge to disable them by prefixing an asterisk -to the file or font name. Checkboxes have been added to the Board dialog -to control them. The user can now set piece font in WB font dialog. -The sample text can be used to specify the -fontPieceToCharTable, -the font name itself the -renderPiecesWithFont value. - -2011-08-16 23:10:59 +0200 H.G. Muller : -Fix crash on start without settings file - -A primordial -1 in currCurrent caused a crash when WinBoard was started -without ini filein game-viewer mode. - -2011-08-12 12:08:18 +0200 H.G. Muller : -Fix generic-popup failure after empty engine-settings dialog - -The error exit ofthe Engine #N Settings dialog in case of an engine without -options forgot to clear currentCps, with as a result that the generic popup -thought every subsequent popup was an empty one, and kept repeating the -'engine has no options' error message for every dialog. - -2011-08-10 11:27:22 +0200 H.G. Muller : -Allow substitution of engines during tournament - -Two buttons are added in the tournament options dialog, for upgrading -and for replacing a tourney participant. Lots of tests on the validity -of the request are done, and if all are passed, the tourney file is -written with the new participants (and in case of replace) with the -results of the replaced engines erased from the -results string. - -2011-08-08 11:00:12 +0200 H.G. Muller : -Fix up/down arrows in game list - - -2011-08-08 10:31:24 +0200 H.G. Muller : -Add key bindings for loading next/previous game of list - -These bindings are set both for the game list and the board window. -To make them useful, focus has to be transferred to the board widget -after loading (it tends to transfer to the tags window), which now -seems to work, but not always. From the game list the shellWidget -seems to get focus rather than the board, which is bad as it is not -sensitive to the key bindings. - -2011-08-08 09:58:31 +0200 H.G. Muller : -Allow deletion of last book move - -The book-edit function refused to delete the entiremove list, -for no good reason. This limitation now has been lifted. -Also the error message that the key for the current book entries -is different from that of the currentposition has been suppressed -if there were no entries found for the current position (so that the -book is positioned at the next key), so that it is possible to add -moves from scratch. - -2011-08-08 00:19:53 +0200 H.G. Muller : -Speed up parser - -Line numbers > 1, which are common, can exit already during move parsing, -to save lots of matching on resultsand castlings. - -2011-08-07 15:13:00 +0200 H.G. Muller : -Fix missing files in file browser - -The file browser was throwing away the first two files, assuming -they were "." and "..". Alas, this is no longer true on every Linux. -Now we actuallyc compare for these names, before skipping them. - -2011-08-06 11:57:59 +0200 H.G. Muller : -Delay file loading to allow expose event first - - -2011-08-06 09:29:22 +0200 H.G. Muller : -Fix paging - - -2011-08-05 22:39:41 +0200 H.G. Muller : -Better fix of crash on empty game list - -An empty list is now replaced by a list containig a simple message. - -2011-08-05 20:31:44 +0200 H.G. Muller : -Add plain arrows as key binding for stepping forward/backward - - -2011-08-05 20:30:03 +0200 H.G. Muller : -Debug position selection - - -2011-08-04 13:22:55 +0200 H.G. Muller : -Print progress during load / selection of game - -The title bar of themain window is used to display a running count -of the number of games loaded / searched. - -2011-08-04 12:44:45 +0200 H.G. Muller : -Parse PGN tags without allocating memory - -In WinBoard malloc/free did not seem to work when preparing the game list, -leading to a huge memory list when ParsePGNTag was used. The added code -parses the required tags in an alternative way as a work-around. - -2011-08-02 22:58:34 +0200 H.G. Muller : -Implement searching games in Game List for a position - -For this it was needed to reconstruct all positions of the games -without loading them, so they could be compared to the currently -displayed position. A new routine GameContainsPosition is made for that. - In Disambiguate, when the global quickFlag is set, we now do the -disambiguation ignoring check,and only if this leads to an ambiguous -move, we repeat it taking check into account to see if that resolves -the ambiguity. This causes us to miss if unambiguous moves are illegal -because they put their King in check, but who cares? - We now do not make game-list line when not needed. If we do not filter -by text, but by position, there is no need for preparing the game-list -line for games that are not selected. All for efficiency. - -2011-07-28 20:47:35 +0200 H.G. Muller : -Allow entry of variations in PlayFromGameFile mode - -Adding variations is more like editing a comment,and not really editing -the game. Therefore we allow it on loaded games. As soon as we are in a -variation, we temporarily switch to a (hidden) EditGame mode, restoring -the original mode when we revert to the main line. - We now also stay in PlayFromGameFile mode after loading a game, -And opening variation (fromtheComment window) in PlayFromGameFile mode -is also allowed. - -2011-07-27 18:47:45 +0200 H.G. Muller : -Force Move History refresh after loading/reverting variation - -The Move History window was not refreshed after switching to or from -a variation if that variation happened to have the same length as -the main line. Now a change in storedGames since the previous refresh will -force a full refresh to avoid this. For this to work, storedGames -did have to be decremented after ToNrEvent in PopInner, because ToNrEvent -calls HistorySet before the history is restored, so we don't want -it to snatch away the full refresh. A call to HistorySet had to be -added after PopInner is done restoring the move history. - -2011-07-27 17:45:12 +0200 H.G. Muller : -Popdown Comment window on new game - -What is in this window cannot possibly remain valid, and can even be harmful. - -2011-01-19 11:46:41 +0100 H.G. Muller : -Allow null move in analysis and edit-game mode - -In some games it is allowed to pass your turn. The internal -representation picked for such a null move is the drop of an empty -square, (EmptySquare,DROP_RANK,0,0). Computer-algebraic form is "@@@@", -SAN form is "--", (for compatibility with ChessBase / SCID), and the -non-compliant forms "null", "pass"and "Z0" are recognized in -the parser as well. ApplyMove() has to test for this special case -(to not actually clear a1), and a way to enter the pass for the user had -to be found (clicking the opponent clock, like in EditPosition mode). - The null move is made move irreversible to prevent repetition draws -spanning null moves being adjudicated. - Such entry of null move is now allowed in AnalyzeMode and EditGame mode. -Because Chess engines will not accept null moves, SendMoveToProgram had -to be adapted to send not the move, but the position after it in -case of a null move. This erases the move history in the engine, -so it will not react to 'undo' for that null move, so BackwardInner -had to be adapted to test for intervening null moves, and if one is -found, approach the target from the other side after loading the -earliest position before it not crossing another null move, and -then loading the moves upto the target. - XBoard clock clicks had to be fixed, to pay attention to the shift key. - -2011-07-25 21:58:58 +0200 H.G. Muller : -Give WinBoard Game List its own font - -The font fort he Game List used to be shared with the Engine Output and -Move History windows, but this made it impossible to use a figurine font -in the latter two (which displays piece symbols for capitals) without -messing up the Game List. An option -gameListFont has been added to specify -the font for the Game List(and save it in the settings file), while a -control for it is added in the fonts dialog. - -2011-07-21 19:02:01 +0200 H.G. Muller : -Fix crash on OK after Save Changes in Tags and Comment popup. - -The global variables tagsText and commentText were used to pass -a string obtained from a widget (and thus not malloc'ed), which -caused a crash when the GenericReadout tried to use those variables -for the new value. Fixed by using GenericReadout (which does malloc) -to read out the text,in stead of GetWidgetText. - -2011-07-16 09:31:12 -0700 Arun Persaud : -Revert "fixed segfault in xengineoutput", fixed in the backend now (from HGM) - -This reverts commit 33a0e73843115ff6d4eacaf963a38f2e8b20b295. - -2011-07-16 14:53:14 +0200 H.G. Muller : -Suppress some XBoard warnings - - -2011-07-15 11:21:29 -0700 Arun Persaud : -fixed segfault in xengineoutput - - -2011-07-11 20:04:57 +0200 H.G. Muller : -Disable -showTargetSquares in ICS mode - -Help like this is considered cheating on FICS, so it is disabled for -all 'classical' ICS variants. (For variants eyont Shogi we don't care.) - -2011-07-10 21:20:49 +0200 H.G. Muller : -Put grab on sweep-selecting in Edit Position - -A right down-click starting a sweep-selection event did not grab the -mouse events, so that an up-click outside the window would go -unnoticed, and the pointer motion stayed coupled to selecting the -piece until the next click. By returning 2 from the RightClick back-end -routine we request the grab. - -2011-07-09 13:50:58 +0200 H.G. Muller : -Write more labels on score axis of eval graph - -The labels for +/-1 and +/-3 are now also written, provided there is -enough space. - -2011-07-09 13:28:08 +0200 H.G. Muller : -Improve Eval Graph with -evalZoom and -evalThreshold - -The score range between -1 and +1 can now be blown up by a factor -specified through -evalZoom. The threshold below which histogram bars -are no longer printed (wich used to e hard-coded 25 centi-Pawn) can now -be set through the -evalThreshold option. - -2011-07-09 13:18:07 +0200 H.G. Muller : -Print reversible plies done in stead of plies to go - -Printing the number of plies left to the draw-adjudication point was -confusing when the N-move rule was set to a non-standard value. -In stead we now print the number of plies since the last irreversible -move, so the user can compare it to both the engine claim point (100) -and the adjudication point he set (which might be beyond 100). - -2011-07-09 13:13:49 +0200 H.G. Muller : -Let WB eval graph react ot single left-click - -Unlike in XBoard, the WinBoard eval graph awatys had required double- -clicking to go the the corresponding move, while there really is no -reason for this, as it is no text edit, and single-clicks have no function -(like select). - -2011-07-07 19:37:12 +0200 H.G. Muller : -Add -scoreWhite option - -This is similar to -absoluteAnalysisScores, except that it works in -all modes, and flips the score given by the engines in the engine-output -window when black is to move. - -2011-07-07 19:28:04 +0200 H.G. Muller : -Print 50-move counter in Engine-Output title - - -2011-07-07 18:50:56 +0200 H.G. Muller : -Display score/depth in Eval Graph title - -No longer print it in the comment window. - -2011-07-04 11:06:12 +0200 H.G. Muller : -Let -sweepPromotions also work for click-click moves - -A click-click promotion no longer causes auto-queening, but the down-click -on the to-square causes a Queen to stick to the mouse pointer, and then -allows the user to change it through dragging backwards before releasing it -with an up-click. - In WinBoard this required a slight change in DragPieceBegin, because -the dragged piece there only was made visible when the mouse pointer -actually started moving (and dragInfo.pos was set), presumably under the -assumption that before mouse move the piece was already on the clicked -square. Which in the case of a to-square was of course not true. (Because -a piece jumps to the mouse pointer when the click is not centered on a -square, this gives less jittery static clicks.) So DragPieceBegin has -been given an extra argument now, to indicate whether it should attach -the piece to the mouse pointer immediately. - To make the click-click sweepPromotions work in Shogi (for which the -drag-drop sweepPromotions could never work, because it is not clear the -piece has a posibility to promote when you pick it up), translation of -the sweep-selected piece to a Shogi promoChar had to e added. - -2011-07-04 10:45:04 +0200 H.G. Muller : -Improve -showTargetSquares on click-click moves - -The markers on move targets are now kept when a first click merely -selects a piece, rather than dragging it elsewhere. The second click -(by definition on the to-square) then clears the markers. - -2011-07-04 11:23:05 +0200 H.G. Muller : -Let PGN parser accept lower-case piece in drop moves - -The @ sign prevents amiguity with other notations anyway. - -2011-07-04 12:42:12 +0200 H.G. Muller : -Fix parser.c line endings - - -2011-06-29 20:29:12 +0200 H.G. Muller : -Fix writing searchTime in tourneyFile - -This had to be derived from the variable searchTime, which gives it -in seconds, as appData.searchTime (a string in minutes) is not reliable, -as it contains the command-line value, which might have been altered -through the time-control dialog. - -2011-06-29 20:25:00 +0200 H.G. Muller : -Fix resetting searchTime if other TC mode is chosen (XB) - -This fixes a bug in the new time-control dialog. - -2011-06-29 14:32:43 +0200 H.G. Muller : -Fix coords display on large boards - -The file indicators can now run upto 'w'. Only the lowest digit -of the rank number is printed, from a table that is valid to 22. - -2011-06-29 13:53:00 +0200 H.G. Muller : -Fix crash on making too-long FEN - -The buffer for in PositionToFEN was only 128 bytes, which was not enough -for large boards such as 19x19 Go. It is enlarged to MSG_SIZ(512) now. -There also is some approximate overflow checking added (but it is not -fool proof in case there are holdings...) - -2011-06-29 13:36:26 +0200 H.G. Muller : -Fix drop moves on boards with more than 10 ranks - -The internal encoding for rank 16 is '@', and thus ambiguous with drop -moves. They were always printed as 16, breaking drop games on large -boards. The ambiguity is now solved (for boards with more than 16 ranks) -by checking if the preceeding letter is upper case, in which case it -cannot be a fileindicator, but must be a piece, and thus a drop. - -2011-06-29 13:29:38 +0200 H.G. Muller : -Don't one-click move when legality testing is off - - -2011-06-23 21:18:11 +0200 H.G. Muller : -Reorder controls in Engine Setings dialog WB - -To get tabbing through the controls in left-to-right order, they are -now added to the template structure in that order. Also add a tabstop -to Label options, so that JAWS will read those. - -2011-06-23 14:02:50 +0200 H.G. Muller : -Add tab stops in WB generic popup - -The WinBoard generic popup did not put tab stops on push buttons, -including the OK and cancel button, with as a consequence that these were -skipped when tabbing through the dialog controls. In addition the tabbing -could not begin before the user selected one of the controls with the mouse. - Now all buttons have tab stops, and the cancel button is given focus -when the dialog pops up. - -2011-03-10 20:06:39 +0100 H.G. Muller : -Implement Grand Chess - -Grand Chess requires a lot of exceptional handling similar to Superchess -and Great Shatran, because it also allows only promotion to a captured -piece. In addition it shares the enlarged promotion zone with Makruk and -Shogi, as well as the fact that promotion can be deferred. The 10-rank -board furthermore required a better generalization of double-pushes and -e.p. captures. On such a board double puhes are now allowed from 2nd and -3rd rank, e.p. capture from 5th and 4th. - -2011-01-28 19:20:38 +0100 H.G. Muller : -Allow promotion to Pawn with legality testing off - -In stead of ImpossibleMove promotionto Pawn now merely is an -IllegalMove, so it can be played with legality testing off. - -2011-01-24 15:06:17 +0100 H.G. Muller : -Create some space in WB New Variant dialog - - -2011-06-20 23:53:49 +0200 H.G. Muller : -Allow double-digit rank numbers - -The parser already understood double-digit numbers on input, and -CoordsToAlgebraic produced them on otput. This patch also fixes sending -of the moves to the computer, for which the moveList was used. The latter -stored 10 as ':', etc,to always get a 4-char move, the characters of which -were frequently being converted to fromY or toY by adding/subtracting ONE. -To not break that the one-character encoding of rank number is kept in -moveList, but in SendMoveToProgram, characters > '9' are converted to -double digits. - -2011-06-23 11:26:48 +0200 H.G. Muller : -Add Absolute Analysis Scores in Genral Options dialog XB - - -2011-06-23 11:16:34 +0200 H.G. Muller : -Fix texi file, and update it further - - -2011-06-20 12:15:14 +0200 H.G. Muller : -Modified po - - -2011-06-22 17:51:51 +0200 H.G. Muller : -Update texi file - - -2011-06-22 11:02:45 +0200 H.G. Muller : -Restore echo after ^C in ICS password - - -2011-06-22 10:45:27 +0200 H.G. Muller : -Fix some warnings - - -2011-06-19 20:30:09 +0200 H.G. Muller : -Increase efficiency of SAN generation / disambiguation - -**************** Risky patch! ********************** -The algorithm used for disambiguating and generating SAN was extremely -inefficient, because it generated all pseudo-legal moves from the relevant -position, and then for each of those did a check test (involving generation -of all moves of the opponent), before determining if the move matched the -(proposed or given) SAN move. While it is pointless to generate moves -with a piece that does not match (let alone checking them for legality). -And for a piece that matches, it is pointless to test legality of moves -that do not match the to-square. - To speed up the process GenLegal and GenPseudoLegal have been equiped -with an argument that can indicate the piece type of the required move, -so they can skip generating moves with other pieces. TestLegality, -Disambiguate and CoordsToAlgebraic make use of this facility, and set also -(through global variables rFilter and fFilter) a to-square filter to be -applied in the GenLegalCallback before it tests the move for legality. - This patch is especially tricky for Crazyhouse, where the piece indicated -in the move might not be the piece actually on the board, because the latter -is a promoted Pawn, and has to be demoted toits base type before the -comparison. - -2011-06-19 16:18:15 +0200 H.G. Muller : -Fix compile errors WinBoard - -The patch to make non-existing options non-fatal broke WinBoard. All calls -to ExitArgError from it now supply a third argument TRUE to fix it. - -2011-06-19 14:28:09 +0200 H.G. Muller : -Add -fSAN / -sSAN options - -These options force the PV of the applicable engine to be converted to SAN. -They make use of the existing ParsePV routine, after shelfing a possible -PV (from user PV walking) to free the space after the last move. -Could be costly in terms of CPU usage. - -2011-06-19 10:56:25 +0200 H.G. Muller : -Cure flicker in Move History window, fix highlighting - -The highlighting of the current move in the Move List window by selecting -it did not always work, because some other windows were clearing their text -widgets by selecting the contents and killing it, thus snatching the -selection away. This has been changed to setting XtNstring to an empty -string as a method for clearing without side effects on the selection. -As a bonus the Engine Output window now also no longer has the black flicker -on clearing it. - In addition, triggering a scroll by setting the insertion point to the -end of the text caused excessive flicker in the Move List window, apparently -clearing it and redrawing from scratch, (even if there was no scroll motion), -to the point where on my slow laptop the move history stayed entirely blank -during a rapid succession of moves. This has been combatted by using the -end-of-line action procedure (which does not seem to suffer from this) to put -the insertion point at the end, when we need to scroll to close to the end. - -2011-06-18 23:48:13 +0200 H.G. Muller : -Fix crash on clearing new Move List window - -When a new game started and a previous game had filled the Move List -window, a crash occurred because an attempt was made to undo the -highlighting of a no-longer-existing move, and then scrolling to it. - -2011-06-18 20:46:57 +0200 H.G. Muller : -Use sound for ICS tells also with engine telluser popups - -The telluser and tellusererror commands now can be assigned a sound. - -2011-06-18 20:45:12 +0200 H.G. Muller : -Add Score in Move List option to general options dialog XB - -Now that we have a WinBoard-style Move History window, this option is -no longer a no-op in XBoard. - -2011-06-18 12:42:41 -0700 Arun Persaud : -new developer release - - -2011-06-18 12:38:32 -0700 Arun Persaud : -updated Changelog, NEWS, etc. - - -2011-06-18 12:51:10 +0200 H.G. Muller : -Update window itle after last game of match - -The result printed behind player names during a match would still be the one -without the game, differing from what the popup would show, which looked -sloppy enough for people to complain about it. -. - -2011-06-18 10:26:31 +0200 H.G. Muller : -Make WB generic popup translatable - -When used for internal settings (as in the Load Engine and Tournament -Options dialogs), the option names are now subectto translation. - -2011-06-17 21:05:00 +0200 H.G. Muller : -Redo Move History with generic popup in WinBoard style - -The use of color and boldness to make the move list more readable -unfortunately cannot work in Xaw; reverse video by selection is used as an alternative to highlight the current move. - -2011-06-17 21:19:41 +0200 H.G. Muller : -Remove stray else - -Due to an erroneous else, the window parameters of Move History were -not retreived (and thus incorrectly saved) when the Engine Output was up. - -2011-06-14 18:47:30 +0200 H.G. Muller : -Make non-existing opton in settings file non-fatal - -It is rather difficult to recover from a situaton where the settings -file contains an unknown option (e.g. because you downgraded to a -previous version that had fewer options), especially in WinBoard, where -the user settings file is in a hidden folder, and people might not be -able to find it, let alone edit it. By just skipping the line with the -offending option, rather than generating a fatal error, when reading -from a settings file, such options will be automatically purged from the -file as soon as you save settings. - Small problem is that the user cannot be warned, as the initialization -has not progressed far enough at this point to generate error popups. In -XBoard we can at least print to the console, but in WinBoard there is no -warning at all. But the worst thing that can happen is that new options -in a settings file of a more advanced version will revert to their -defaults. - -2011-06-14 18:20:37 +0200 H.G. Muller : -Change long form of -tf option to -tourneyFile - -This is a more logical name, and in the WinBoard docs it was already -described as such. Also remove the -processes option, which in the -current design of the tourney manager is no longer used. - -2011-06-14 18:17:08 +0200 H.G. Muller : -Fix default of -remoteUser - -This has to be an empty string, rather than NULL, to prevent XBoard from -segfaulting when the -gateway option is used. - -2011-06-14 13:32:38 +0200 H.G. Muller : -Add -at and -opt options as alternative for @ - -Windows XP and Vista shortcuts do not display command lines with @ in -them correctly, and these optionsprovide a work-around for that. - -2011-06-14 12:46:36 +0200 H.G. Muller : -Fix empty-string option values in XBoard - - -2011-06-14 12:40:11 +0200 H.G. Muller : -Fix crash on switching sound in Vista - -When choosing a new sound the wave form of the old one was free'ed, but -because built-in sounds are not really malloc'ed, this led to a crash. - -2011-06-14 12:36:16 +0200 H.G. Muller : -Update WB docs for tourney manager - - -2011-06-14 12:35:01 +0200 H.G. Muller : -Add icon to WB for tournament files - - -2011-06-10 16:52:01 +0200 H.G. Muller : -Redo Time Control dialog with generic popup - -As poor-man's disabling of the unneeded input fields, we print the word -"Unused" in them. - -2011-06-10 14:14:45 +0200 H.G. Muller : -Some refactoring in xoptions.c to separate out front-end - - -2011-06-10 12:38:08 +0200 H.G. Muller : -Redo New Shuffle Game dialog with generic popup - -The buttons are slightly renamed, and in stead of having an 'off' -button to clear it, shuffleOpenings now has its own checkbox, which is -ticked when a fixed or dynamic random is chosen with the buttons. - -2011-06-10 11:58:17 +0200 H.G. Muller : -Fix type of shuffleOpenings - -This was a Boolean option, and thus accessed by the args.h code as such, -while it was declared as an int (and used in backend.c as such). This -could have led to problems with different endianness. - -2011-06-09 23:57:43 -0700 Tim Mann : -Internationalize the file browser. - -The file browser was missed in the previous round of -internationalization and had gotten broken by setting international = -True in its widgets. I got nothing but segfaults trying to set -international to False in the file browser widget subtree when it was -True in the main window, so I gave up and did the -internationalization. It turned out to be pretty easy. - -As a tiny bonus fix, I removed some ../'s from includes, and you can -now configure and build xboard in a subdirectory again. This was -useful for building both --enable-nls and --disable-nls from the same -sources to compare functionality and make sure both still work. - -2011-06-08 20:26:28 +0200 H.G. Muller : -Fix crash at end of Swiss tourney - - -2011-06-08 17:33:34 +0200 H.G. Muller : -Fix display of logos - -The logo files are now sought relative to the WinBoard install -directory. Non-existing logos cause clearing of the logo, rather than -letting the logo of the prevous engine hang. Logo change is requested -explicitly from the back-end (when an engine is initialized for a new -game), rather than using the kludge in StartChileProcess. This required -a dummy UpdateLogos routine in the XBoard front-end. - -2011-06-08 18:02:31 +0200 H.G. Muller : -Fix parameter handling in adapter command - -A backslash was not considered the end of an option name, which was -fatal for UCCI2WB, which needs %fd\\%fcp in its command line. - -2011-06-08 17:16:54 +0200 H.G. Muller : -Clear Engine-Output pane when initializing engine - -This to prevent output from the previous game hanging there during the -next game, when the engine that is really playing is in book and -doesn't produce thinking output there. - -2011-06-08 17:20:01 +0200 H.G. Muller : -Fix display of last move of last match game - -When a game was adjudicated (e.g. because XBoard detected mate) GameEnds -would trigger an exit if it was the last game of the match, and thus -never returned, while the ShowMove was called only after return from -Adjudicate. An extra ToNrEvent is now used in GameEnd in this case to -cause ShowMove to be called before exiting. (Ugly kludge...) - -2011-06-08 17:38:43 +0200 H.G. Muller : -Fix concurrency in Swiss tourneys - -The pairing engine was consulted for the next round before all games of -the previous round were finished, if other XBoard instances were still -playing games. This caused the instances finishing early to stall -indefinitely. This is fixed by moving the Swiss pairing code to after -the syncInterval code. The normal pairing code (the call to Pairing) -must stay before it, because it determines the syncInterval. So ther is -a bit of tourneyType dependence cluttering up the code here. :-( - -2011-06-08 17:27:01 +0200 H.G. Muller : -Give error popup when pairing engine fails - -An invalid pairing now produces an error popup to inform the user, so he -knows why the tourney stagnates. - -2011-06-08 17:24:41 +0200 H.G. Muller : -Fix clock mode in tourney starting from -ncp mode - -When a tourney started from -ncp mode, which was allowed in MatchEvent, -because the tourney loads its own engines anyway, the menu enablings and -clockmode where not restored to their 'GNUMode' state. - -2011-06-08 17:11:31 +0200 H.G. Muller : -Fix round-robin schedule - -The first round was played twice, and the formulas used to derive the -pairing were not even-odd resistant anyway. Both even and odd number of -participants should work now. - -2011-06-08 17:08:55 +0200 H.G. Muller : -Fix interrupting tournament - -Stopping a tourney by using the Machine Match menu item did not wor -properly. - -2011-06-08 16:57:09 +0200 H.G. Muller : -Improve quoting of engine name on install - -Rather than always using double quotes for the engine command, the -engine filename is now double-quoted if it contains spaces (and no -double-quotes), and the comand is single-quoted if it contains -double-quotes (and double-quoted otherwise). - -2011-06-08 16:49:18 +0200 H.G. Muller : -Print sensible window title during tourneys - -Rather than the "(W-L-D)" in the title we now print game number and -total games, plus indication of the tourney type (rr, gt or sw). - -2011-06-08 16:44:16 +0200 H.G. Muller : -Let XBoard propose name of tourney file - -Add an option -defaultTourneyName to configure the name that will be -proposed in the Tournament Options dialog's tournament-file field. The -option can contain %y, %M, %d, %h, %m, %s for year, month, day, hour, -mintes, seconds of the curret time in %02d format, or %Y for the year in -%04d format. Any tournament -file name is ignored when no participants -are given. Participants without a tourney file remains an error. - -2011-06-08 16:30:34 +0200 H.G. Muller : -Improve Tournament dialog layout WB - - -2011-06-08 17:05:02 +0200 H.G. Muller : -Fix -matchGames option - -The new MatchEvent code had broken the -mg option, and used always --defaultMatchGames in stead. - -2011-05-30 19:55:13 -0700 Tim Mann : -Fixed small bugs in several .po files, enabling these translations to be used. They all probably need more work from the translation team. I don't speak any of these languages, but I did some spot checks either from my own knowledge or using Google Translate, and they generally look sane. - -- Several files were in utf8 but needed to be marked as such (that is, - "CHARSET" changed to "UTF-8"). Affected es.po, it.po, ru.po, vi.po, - zh_CN.po, zh_TW.po. - -- it.po was missing a \n at the end of one translation. - -- ru.po had unescaped double-quote marks in one translation. - -- vi.po needed to be normalized to Unicode normalization form C. With - this fix, more characters display correctly, though at least one is - still missing in the X core fonts that xboard is able to use. - See http://vietunicode.sourceforge.net/ for more about Vietnamese. - -- zh_HK.po was written in big5 and then utf8-encoded on top of that, - making it unusable. I stripped off the spurious utf8 encoding and - then used recode to convert the file to Unicode properly encoded as - utf8. - -Unfortunately, I wasn't able to test any of the Chinese translations, -as I haven't been able to get XCreateFontSet to work in Chinese -locales with any of the fonts I have installed, even after adding the -Ubuntu language support packages for both simplified and traditional -Chinese. I did spot check a bunch of the translations using Google -Translate. - -I've checked in a couple of tiny Perl scripts that I used to do part -of the fixups on vi.po and zh_HK.po in case we need them again. - -2011-05-30 14:12:53 -0700 Tim Mann : -The empty string can't be translated and it causes the gettext utilities to complain, so change _("") to "". - - -2011-05-30 13:21:06 -0700 Tim Mann : -Add a final wildcard default for fonts. This gives XCreateFontSet more freedom and lets it find fonts for some obscure charsets where fixed-bold or fixed-medium etc. may not have one. - - -2011-05-29 20:14:37 -0700 Tim Mann : -Added "misc-fixed" as a fallback font to handle locales where adobe-helvetica does not have all the required characters. The fixed font is ugly but does have a rather complete set of characters, while the helvetica font is missing Cyrillic characters (at least on my distro). I haven't found a way to get a nicer font that includes Cyrillic to work with XCreateFontSet, but I don't fully understand why. I'll try to improve things further in the future if I figure out what's all going wrong. - -In the process I had to rewrite the code to insert the pixel size into -a font name (replacing a "*" in that field). The new code is much -more general. - -2011-05-28 23:55:42 -0700 Arun Persaud : -translation: activated Ukrainian translation - - -2011-05-28 23:41:24 -0700 Arun Persaud : -translation: added new Ukrainian PO file from the TP - - -2011-05-28 21:07:08 -0700 Tim Mann : -Fix display of international characters outside the ASCII range. - -1) Set Xaw resources required for internationalization -- - *international and *fontSet. - -2) Untangle the new XFontSet-aware code from the old FindFont code. - It doesn't make any sense to apply the old (and obsolete) size - searching code from FindFont to a font set, which contains fonts - that are all the requested size. - -3) With these changes, the -font option doesn't work at all when given - on the command line. The -font option actually is parsed by the Xt - library, used to set the *font resource, and removed from argv - before xboard can see it, so the option didn't really work properly - with the new WinBoard-style option framework anyway. Now that - -font is even more broken, I changed the documented name of the - option to -messageFont and changed args.h so the option is saved in - ~/.xboard as -messageFont. - -2011-05-28 21:05:00 -0700 Tim Mann : -Move "hide thinking" option into alphabetical order. - - -2011-05-28 21:01:25 -0700 Tim Mann : -Fix a size mismatch in scanf. Untested, but the code could not have worked properly without this fix -- scanf would have written 32-bit values to 16-bit fields, thus smashing adjacent memory. - - -2011-05-23 19:05:36 +0200 H.G. Muller : -Fix layout tournament Load Engine dialog WB - - -2011-05-23 19:03:56 +0200 H.G. Muller : -Fix ArgTwo warnings - - -2011-05-23 19:00:00 +0200 H.G. Muller : -Add Swiss tourneys through pairing engine - -An external program can be designated pairing engine through the new -persistent option -pairingEngine. Defining the option will allow -tourneytype -1 to be chosen for Swiss. In this case the pairing engine -will be queried for a pairing before every new match game, by sending it -the -results string, plus the command 'pairing' + game number. - -2011-05-23 17:37:43 +0200 H.G. Muller : -Allow generic dialog to ignore OK - -The EndMark callback can now suppress popdown of the dialog on OK, when -it somehow does not like the values entered by the user. In XBoard this -required all the callbacks to return a value. -Caveat: A refused OK would still have set all new values given in the -dialog! - -2011-05-23 17:22:58 +0200 H.G. Muller : -Fix CR in multi-line WinBoard text-edits - -The generic popup did not add CR when strings containing '\n' were -printed in a multi-line text-edit, thus joining the lines. It was also -not possible to type a CR in a multi-line text-edit. - -2011-05-23 14:16:17 +0200 H.G. Muller : -Let mentioning completed tourney file add one cycle - -Secifying a tourney file of a fully completed tourney will now resume -that tourney with another cycle added. When there are still uncomleted -games in the tourney, the usual error message will appear. There are -also error popups added for when the user fails to specify a tourney -file, or gives too few participants. - -2011-05-16 11:02:08 +0200 H.G. Muller : -Make engine startup failure non-fatal in WinBoard - -Unlike XBoard, which forks first, the parent process WinBoard has direct -knowledge of a failure to execute the engine command, and used it to -trigger a fatal error. The code doing this has now been disabled. Only -in case of a first engine we switch back to -ncp mode in stead, but no -action is taken to 'bury' the deceased engine process. Like in XBoard, -errors in writing or reading the pipes will trigger this. - -2011-05-14 17:03:44 +0200 H.G. Muller : -Add secondry adapter command for UCCI or USI - -The option -uxiAdapter can define a second adapterCommand, which will be -invoked on encountering the options -fUCCI, -sUCCI and -fUSI, sUCI. - -2011-05-14 10:05:11 +0200 H.G. Muller : -Obey san feature when sending book moves - -Book moves were always sent in long algebraic, even when the engine had -said it wanted to receive SAN. - -2011-05-14 10:03:20 +0200 H.G. Muller : -Fix initialization of engine state - -Some of the initialization relied on variables being zero at startup, -which meant value from the previouly loaded engine hng on after loading -a new one. - -2011-05-11 23:06:20 +0200 H.G. Muller : -Take account of holdings in book key - -The board is numbered by rank, for comptibility with Polyglot format, -starting at a1. We then continue counting in the holdings 'files', in -up-rank direction, each holding spanning the full board height (even if -it is not fully used). Firstthe left (black) holdings, then the right, -Even in Shogi this limits the square number to < 99, which is below the -absolute limit of 128 (where we would run out of hash keys). - -2011-05-11 22:48:34 +0200 H.G. Muller : -Alow promotions and drops in book-editing - - -2011-05-11 20:15:58 +0200 H.G. Muller : -Include learn info in book edit - - -2011-05-09 21:55:10 +0200 H.G. Muller : -Adapt default directory of lng2po - -The path is prefixed with "../" to make it runable from the po directory. - -2011-05-09 21:20:35 +0200 H.G. Muller : -Recode some po files - -po files were generated with the aid of lng2po for Russian, -Vietnamese, Chinese(simp) and Chinese(trad), using encodings CP1251, -CP1258, GB2312 and BIG5, respectively. - -2011-05-09 20:11:32 +0200 H.G. Muller : -Implement Edit Book in XBoard - - -2011-05-09 09:52:54 +0200 H.G. Muller : -Improve WB Load Engine dialog texts - - -2011-05-09 09:48:27 +0200 H.G. Muller : -Make 'add to list' default in Load Engine dialog - - -2011-05-09 09:33:39 +0200 H.G. Muller : -Add -userFileDirectory option - -This volatile option is initialized from 'installDir'. It is -primarily intended for configuration of WinBoard through its master -settings file, and specifies an alternative place to create saveGameFile -or look for other user files, in stead of looking in the installDir. - -2011-05-09 09:10:47 +0200 H.G. Muller : -Add option -absoluteAnalysisScores - -This persistent option flips scores in the when black is thinking in -analysis mode, just before they are printed in the engine-output window. - -2011-05-08 17:47:40 +0200 H.G. Muller : -Automatically play moves of clicked PV in analyze mode - -The Shift key now no longer needs to be pressed to play moves from the -PV in analyze mode (so it could be given back its original meaning of -starting a variation with the entered moves). In analyze mode the PV -walk begins after the first move, so a static right-click plays the -first PV move. To just peek the PV you have to walk to the start of it -before releasing the mouse button. In other modes the PV walk -stillstarts at the very end. - -2011-05-08 17:07:18 +0200 H.G. Muller : -Let ParsePV always generate SAN move - - -2011-05-08 13:53:09 +0200 H.G. Muller : -Fix vscrolling in XBoard Engine-Output window - -After clicking the memos they scrolled to the bottom, because SetFocus -put the insertion point at the very end of the text. This behavior is -now reserved for text-edits containing less than 100 characters. - -2011-05-08 13:22:33 +0200 H.G. Muller : -Fix button sizing in generic popup - - -2011-05-08 13:02:52 +0200 H.G. Muller : -Allow changing MultiPV setting from Engine-Output window - -In analyze mode a header line is printed in the first engine-output -pane, which can be right-clicked to increase or decrease the number of -PVs. (Only with engines that support the MultiPV option.) - -2011-05-08 11:28:44 +0200 H.G. Muller : -No clearing of Engine-Output memos on stat01 - - -2011-05-07 23:27:50 -0700 Arun Persaud : -updated xboard.pot with released version - - -2011-05-07 22:56:53 -0700 Arun Persaud : -new developer release - - -2011-05-07 22:54:29 -0700 Arun Persaud : -updated ChangeLog, NEWS, etc. - - -2011-05-07 23:07:46 -0700 Arun Persaud : -deactivated new languages for the moment... - -po files need some cleanup, probably better to wait until the translation-project looked at them - -2011-05-07 18:44:24 -0700 Arun Persaud : -added translations generated via lng2po from all winboard languages - - -2011-05-07 18:40:23 -0700 Arun Persaud : -lng2po.sh: added command line options, GPL header - -also use a temporary file generated with mktemp instead of a hard coded one - -2011-05-07 17:53:10 -0700 Arun Persaud : -fixed access rights to winboard language files (644 instead of 655) - - -2011-05-07 14:55:55 +0200 H.G. Muller : -Import WinBoard language files into git - - -2011-05-06 23:14:02 +0200 H.G. Muller : -Let Shift+RightClick on PV actually play the PV moves - - -2011-05-06 18:06:48 +0200 H.G. Muller : -Make book-edit function WB - -The tags dialog is used to display the GUI book moves from the current -position, and will be updated when you step or move to another one. -The edited move list (with weights) can be written back to the book. - -2011-05-07 16:21:25 +0200 H.G. Muller : -Fix resetting engine options - -Not all options were reset, and -needsNonCompliantFEN was 'reset' -to a completely wrong value, so that bad FENs would be sent. - -2011-05-06 18:51:20 +0200 H.G. Muller : -Add -first/secondPgnName option - -This option replaces the tidy name of the engine in the PGN player tags -of engine-engine games. In WinBoard engines can be installed with this -option through a checkbox in the Load Engine dialog. - -2011-05-06 23:31:36 +0200 H.G. Muller : -Let XB generic popup define default file extensions - - -2011-05-06 18:25:38 +0200 H.G. Muller : -Save time-control settings in tourney file - -Because parsing the options and storing them in appData is not enough, -the time-control code setting the internally used parameters from the -appData info in InitBackend was made into a subroutine, and also caled -after parsing the tourney file. - -2011-05-06 20:40:34 +0200 H.G. Muller : -Put saveGameFile in tournament dialog - - -2011-05-06 19:17:56 +0200 H.G. Muller : -Plug memory leak, filenames relative to installDir - -String options are consistently freed now, before assigning a new value -to them through strdup. The init code now even does use strdup when -setting defaults. This is important for optionslike -lgf, which are not -saved in the settings file, and thus are usually left with their -default. When a dialog to set them then uses free, this causes a crash. -When setting the defaults uses strdup, ParseArgs can already free them. -This plugs an important memory leak, as ParseArgs in now called to parse -the tourney file before every tourney game (twice!), and the lists of -participants and results in it can be quite long. Macros are defined in -common.h to make the code look simpler. - Filenames entered through the generic popup are now interpreted -relative to the WinBoard installation folder, just as the saveGameFile -already was. The code handling the atter was made into a subroutine for -this. - -2011-05-06 22:02:53 +0200 H.G. Muller : -Add WB new popup prototypes - - -2011-05-06 18:58:08 +0200 H.G. Muller : -Add partcipants at bottom in tourney dialog (WB) - - -2011-05-06 18:56:53 +0200 H.G. Muller : -Fix range of tourneyType spin WB - - -2011-05-06 18:15:23 +0200 H.G. Muller : -Fix exit popup in tourney mode - -Only the instance finishing the last tourney game will cause a popup -with final standings. As long as there are still busy games, it exits or -switches back to idle mode silently. - -2011-05-06 18:11:47 +0200 H.G. Muller : -Fix stopping of match in tourney mode - - -2011-05-06 18:59:26 +0200 H.G. Muller : -Add default extension in file browser - - -2011-05-06 22:37:14 +0200 H.G. Muller : -Improve sizing of comment and tags dialogs - -There seems to be a bug in Xaw for the sizing of buttons; they get -unpredicatble and weird sizes when the size is not explicitly set, -possibly stretching the initial width of a dialog to rediculous values. -Sizing back to a remembered value from the settings file then makes -buttons overlapand text edits shrink to almost nothing. To prevent that -we now define exlicit sizes for the buttons in tags and comment popups. - -2011-05-06 21:00:25 +0200 H.G. Muller : -Fix generic combobox bug - -The patch placing gettext markers was done wrong, setting the -translated menu text outside the loop, so all entries became the same. - -2011-05-07 14:23:12 +0200 H.G. Muller : -Fix PV walking in analysis mode - -ParsePV assumed that the PV would always have been produced by an engin -thinking about the final position of the game (or the one before it). In -analysismode, however, the engine can be analysing positions internal to -the game, and the PV would be considered invalid. This is fixed by -cutting of the tail off the game (shelving it in variation fashion) -before starting the PV walk, and reverting afterwards. - For this the PushTail and PopTail routines had to be split into an -'inner' part, doing the pushing and popping, and an outer part, handling -menu graying and popdowns (which is undesirable in in this application). - -2011-05-03 00:24:10 +0200 H.G. Muller : -Lift length-limit on text-edits in WB generic popup - - -2011-05-04 13:53:05 +0200 H.G. Muller : -Lift limitation of text length in generic dialog XB - -All string options should now point to allocated memory, as strdup / -free is consistently used on them. This is OK for values received from -ParseArgs, but for non-arg intermediate variables that must receive strg -values, such as in the comment and tags popups, strdup has to be used to -initialize those. - -2011-05-04 14:53:02 +0200 H.G. Muller : -Implement Tournament Options dialog WinBoard - -The file browser now can select on extension WB generic dialogs, -with a default based on the option.max value of the option for which it -browses. A textBox can be forced to be multiline by putting the number -of extra lines in option.min. - -2011-05-04 15:30:00 +0200 H.G. Muller : -Make option to draw second engine from first list - - -2011-05-03 00:17:47 +0200 H.G. Muller : -Fix error message on engine load - - -2011-05-04 15:09:33 +0200 H.G. Muller : -Implement Load Engine dialog in WinBoard - -The Load Engine dialog is implemented for WinBoard, and is invoked by -the menu item Engine->Load, which formerly was Install 2nd. Install 1st -is renamed 'Edit Engine List'. Unlike in XBoard, the dialog has separate -fields for the engine executale and its parameters. - The dialog is implemented by converting the Engine Settings popup into -a generic dialog generator. - -2011-05-04 13:43:06 +0200 H.G. Muller : -Load new logo on engine change WinBoard - -Picking the logo for the first engine is made into a subroutine. The -code for picking the logo of the first engine was made into a subrroutne -for this. We use the kludge to recognize the engine by its command line -when starting a new engine process. - -2011-05-04 13:36:27 +0200 H.G. Muller : -Allow switching off match mode through menu - -The Machine Match menu item is now checkmarked, and no longer grayed -during a match, and clicking it while a match is running will terminate -the match after the current game. To not be left with hanging -checkmarks, the checkmark is already removed duringthe last match game -(which is logically equivalent to ordinary Two Machines mode anyway). - -2011-05-03 00:14:22 +0200 H.G. Muller : -Calculate and display tourney result - - -2011-05-04 18:42:13 +0200 H.G. Muller : -Implement Tournament Manager - -New command-line options are added to specify the tourney: -tourneyType -(-tt), -tourneyCycles (-cy), -participants, -syncAfterRound, --syncAfterCycle, -results, to be saved on a -tourneyFile (-tf), but -otherwise volatile. When a tourneyFile is specified during a match, -a new routine NextTourneyGame is called from NextMatchGame before every -game, to decide the pairing, and unload and redefine the engines, when -needed. The XBoard Match Options dialog can be used to set the options -and create the tournament file. - Actual loading of new engines is done by TwoMachinesEvent, which is -now modified to also wait for the feature timeout of the first engine. -Waiting for the matchPause is now also implemented there, after waiting -for the engines (so they can be started during the pause). - Pairings and color assignment is now all done in an absolute -(non-incremental) way, based on a new global game-number variable -nextGame, which takes over the function of matchGame in a tourney. The -latter is now used to count games between the same players, so it can be -still used to derive the load-file indexes (again in absolute fashion). - The next game to play is already picked in GameEnd, so it can be -decided if there is a game to be scheduled, or if we can terminate. - -2011-05-04 15:42:26 +0200 H.G. Muller : -Display note in stead of empty engine-settings dialog XB - - -2011-04-24 18:02:20 +0200 H.G. Muller : -Fix crash on empty Engine Settings dialog - -The generic popup was not foolproof against this. - -2011-04-22 12:47:24 +0200 H.G. Muller : -Refactor code for loading games and positions in match - -The code in NextMatchGame and MatchEvent was nearly the same, -(MatchEvent did a little more error checking, but that is never -harmful), and could be combined. In stead of determining the load index -incrementally, it is now calculated in an absolute way from the game -number, so it can be used more easily in tournament mode. - -2011-04-21 22:37:56 +0200 H.G. Muller : -Add callback possibility to combobox selection - - -2011-04-24 17:15:23 +0200 H.G. Muller : -Lock game an position file during writing - -The use of flock() on the file desctiptor of the opened stream should -guarantee multiple XBoard instances, saving on the same file, will not -interleave their PGN games or FEN positions. - -2011-04-27 17:05:06 +0200 H.G. Muller : -Remove building rule for parser.c from WB makefiles - - -2011-04-29 16:58:49 +0200 H.G. Muller : -Fix Engine Settings buttons in WinBoard - -This was broken by a leftover statement from debugging the -file/-path -patch. - -2011-05-02 13:38:14 +0200 H.G. Muller : -Implement flock in WinBoard - -This system function seems unknown in a MinGW compile, so it is -implemented with the aid of file byte-range locking, using a lock on the -first 1024 bytes of the file as a semaphore. - -2011-04-29 23:06:43 +0200 H.G. Muller : -Fix grayout XB Match Options in ICS mode - - -2011-05-03 00:22:40 +0200 H.G. Muller : -Delay loading of second engine until it is used - - -2011-05-02 15:00:03 +0200 H.G. Muller : -Fix zippy bughouse partner bug - -The patchs to subject Zippy messages to coloriation was faulty, because -there were messages recognized by zippy that were not colorized, and -such messages would then not be 'read away' after zippy recognition -(except for the first character). As a result the messages were -processed over and over again. - -2011-05-04 10:59:43 +0200 H.G. Muller : -Silence more rpm warnings - - -2011-05-01 20:33:50 +0200 H.G. Muller : -Fix warnings XBoard file browser - -All the prototypes have been moved to selfile.h, to force uniformity. -The order of the #include files xstat.h and selfile.h had to be -swapped, to make sure 'struct stat' is a nown type atthe time of -prototype declaration. The event handler SFmotionList is considered -wrong type because of its third argument (XMotionEvent in stead of -XEvent), and had to be casted to (XtEventHandler) when passed to -XtAddEventHandler. - -2011-05-04 10:56:05 +0200 H.G. Muller : -Fix some warnings and header-file improvement - -Ther were lot of 'extern' declarations in the x-files, so called -'imports from xboard.c', (sometimes backend.c) which logically belonged -in xboard.h (backend.h) to ensure their uniform definition. These have -now been moved there. Some prototypes have been added in xboard.h as -well, for functions that needed calling from xoptions.c. - -2011-05-04 10:50:12 +0200 H.G. Muller : -Create conversion tools for language files - -A shell script "lng2po.sh" is provided, to apply the translation given -in a WinBoard .lng file to "xboard.pot", in order to generate a -"language.po" file containing translations for all strings for which -the .lng file had a translation. It makes use of a file "metascript", -which is the ed script used to turn the .lng file in an ed script to -turn the .pot into .po. For example, the command "./lng2po.sh -espa?ol.lng" will create a file "language.po", which can be renamed to -"es.po". -****************************** WARNING ******************************** - Note that the lng2po script does a "recode" that assumes the given -.lng file is encoded in latin-1. This means it canot be used without -modification for the Vietnamese and Chinese translation; you would have -to replace latin-1 by the applicable encoding first (CP1258 / BG2312 / -BIG5). - -2011-04-27 22:04:38 +0200 H.G. Muller : -Put gettext markers in generic dialog creator - -This is done by adding extra XtNstring argumentsto the widget gcreaton, -so the displayed name can be different fromthe widget name. - -2011-05-01 19:56:38 -0700 Tim Mann : -Use getaddrinfo instead of gethostbyname. Hopefully this makes us compatible with IPv6 and with hosts that have more than one IP address. However, I don't know of any chess servers that have either of those properties, so I couldn't test that. I did test that xboard still works with freechess.org and chessclub.com and that it gives an error message for invalid host names. - - -2011-04-24 11:18:28 -0700 Arun Persaud : -updated German translation - - -2011-04-24 11:17:43 -0700 Arun Persaud : -replaced hardcoded email address with generic PACKAGE_BUGREPORT - - -2011-04-23 10:51:57 -0700 Arun Persaud : -updated po-files; updated german translation - - -2011-04-23 10:51:02 -0700 Arun Persaud : -updated list of files that include translation strings; updated pot-file - - -2011-04-22 21:50:58 -0700 Arun Persaud : -marked more strings for gettext that were only marked with N_() - -they need to be marked again with _() when they are used to get the translated string - -2011-04-22 21:39:22 -0700 Arun Persaud : -updated translation files - - -2011-04-22 21:37:22 -0700 Arun Persaud : -added/fixed i18n support via gettext to xboard - -this was already added a long time ago, but now it's added again to -autoconf. Also fixed some compile errors that showed up. - -2011-04-20 10:27:20 +0200 H.G. Muller : -Make engine startup error non-fatal - -When engine startup fails, do not generate a fatal error, but swicth -back to -ncp mode. Write on broken pipe errors had to be suppressed for -this. - -2011-04-20 14:35:50 +0200 H.G. Muller : -Make engine loadable during session - -A "Load Engine ..." menu item is added to the Engine menu, which pops -up a dialog where one can replace the first or second engine by a new -one, without destroying the game state. Switching from -ncp to engine -mode needed activation of some menu items in SetGNUMode, and -re-enabling clockMode. It was also important that noChessProgram is -cleared before re-initializing the ChessProgramState. - The Load-Engine dialog can select from the list of installed -engines, and also add a newly specified engine to this list. In this -case it saves the directory, hasBook, and isUCI info with the engine, -and optionally the current variant. When loading an engine with a -specified variant, it resets the game and switches to the new variant. - -2011-04-18 15:56:47 +0200 H.G. Muller : -Generalize WaitForSecond to WaitForEngine - - -2011-04-18 15:46:12 +0200 H.G. Muller : -Add UnloadEngine routine - - -2011-04-20 13:45:51 +0200 H.G. Muller : -Put engine initialization code in per-engine function - -Initializing of the ChessProgramStates first and second from the -option settings in appData is now done by separate calls to the same -routine. Clearing of options is added to the initialization. This is -needed when reloading an engine. This is done in a separate routine, -which could also be called on -reset options. - -2011-04-18 13:21:44 +0200 H.G. Muller : -Bring structure in appData engine options - -All options in appData that came in pairs for both engines are replaced -by arrays of ENGINES (=2, for now) elements. The use of the named -appData field that are replaced in the source is replaced by use of the -corresponding array element, by #define directives in common.h, awaiting -their replacement. - -2011-04-19 15:15:48 +0200 H.G. Muller : -Fix gettext macros in option dialogs - -The strings in the tables were using _() in stead of N_(). - -2011-04-18 20:58:01 +0200 H.G. Muller : -Fix crash on using Engine #1 Settings in ICS non-zippy mode - -If XBoard is compiled with zippy the Engine #1 Settings menu was not -grayed out even when you don't run in zippy mode, and using it would -then crash XBoard. - -2011-04-19 15:07:31 +0200 H.G. Muller : -Fix shogipixmaps - -Some pixmaps forptomoted pieces had wrong background color, others had a -wrong name (so the one with the correct name was missing). - -2011-04-17 19:12:00 +0200 H.G. Muller : -Change texture-install directory to pixmaps/textures - - -2011-04-17 17:36:32 +0200 H.G. Muller : -Limit install of sound files to those in menu - -The sounds directory is set to .../xboard/sounds, and only ten -sounds are kept (all non-spoken). - -2011-04-17 17:27:57 +0200 H.G. Muller : -Remove some bitmaps from install - -Some files in the bitmaps source directory need not be installed, -because they are there only to be linked to the binary in a build -without LIBXPM, are README files or conversion programs. I left only the -stuff that is in a Debian binary package in .../xboard/bitmaps.xchess. - -2011-04-17 16:34:03 +0200 H.G. Muller : -Configure some default sounds - -The move sound is set to Wood Thunk; the sounds for tell and challenge -events to Phone and Gong, respectively. - -2011-04-17 16:17:30 +0200 H.G. Muller : -Change default sounds in Xboard menu - -All spoken sounds are removed now. Thud, Click and Ching are replaced by -Wood Thunk, Slap and Cymbal; Car Horn and Pop are added. - -2011-04-17 12:46:47 +0200 H.G. Muller : -Make user wav file available for try-out in sound dialog - -The GenericReadout was adapted to be able to read a single selected -value, so that the callback to the 'play' button in the sounds dialog -could get the name of the 'user WAV file' without accepting all settings -for the other sounds (which should only happen on 'OK', and might still -be cancelled in stead). - -2011-04-16 10:36:31 -0700 Arun Persaud : -configure: enable silent rules by default - - -2011-04-16 10:28:16 -0700 Arun Persaud : -configure: added install directory for bitmaps files: .../games/xboard/bitmaps/default/ - - -2011-04-16 10:25:33 -0700 Arun Persaud : -configure: added install of sounds in .../games/xboard/sounds/default - - -2011-04-16 09:54:26 -0700 Arun Persaud : -configure: renamed bitmapdir to pixmapsdir, since it installed only pixmaps. also changed name of default dir - -pixmaps will now be installed under .../games/xboard/pixmaps/default/ - -2011-04-16 13:40:16 +0200 H.G. Muller : -Fix gamelist highlight - -Reopening the gamelist should highlight the current game. - -2011-04-16 10:25:53 +0200 H.G. Muller : -Fix size limit on 'save as diagram' - -In stead of a fixed-size buffer the diagram-save code now uses an -allocated buffer with size calculated from the bitmap parameters to -retreive the bitmap data, so it should work for all sizes. - -2011-04-15 22:04:03 +0200 H.G. Muller : -Fix chaining of bottom-row dialog buttons - -The OK & cancel buttons are chained to the bottom. This patch makes sure -that other buttons appearing in the same row (as in the tags and -comment dialogs) will be chained that way too, so that they will behave -the same on vertical sizing. The bottom of a full-width text-edit above -it will be chained to bottom too. To make this work in the tags dialog, -the (optional) cmail-message field had to be put above the tags memo. - -2011-04-15 19:18:46 +0200 H.G. Muller : -Fix switching between pixmap and bitmap pieces - -There were still several flags that had to be reset when redoing the -graphics initialization. The Debian patch to use a default bitmap -directory when none is given but monoMode is selected or forced, is -moved to a more sensible place, so that it does not disturb matters when -compiled without LIBXPM (when we do have built-in bitmaps). - -2011-04-15 15:47:09 +0200 H.G. Muller : -Remove outline-pieces option from board-options dialog - -This option does not exist in XBoard (yet). - -2011-04-15 15:41:38 +0200 H.G. Muller : -Fix running of clock during hash allocation engine - -In TwoMachinesEvent we now wait for the second engine to acknowledge the -'ping' after 'new', to make sure it is done allocating hash in reaction -to the preceding 'memory' command, before the clock for the game is -started. - -2011-04-14 21:42:50 +0200 H.G. Muller : -Describe move type-in in texi file - - -2011-04-14 20:34:42 +0200 H.G. Muller : -Describe Copy Game List menu item in texi file - - -2011-04-14 20:30:16 +0200 H.G. Muller : -Describe -sweepPromotions in texi file - -The new method for selection promotion piece, and the -sweepPromotions -option are described in the texi file. - -2011-04-14 20:14:44 +0200 H.G. Muller : -Describe -pieceMenu option in texi file - -The sweep method for selecting a piece in Edit-Position mode is -explained, as well as the -pieceMenu option. - -2011-04-14 15:59:57 +0200 H.G. Muller : -Update texi file - -Descriptions of the new XBoard menu dialogs are included in the docs. - -2011-04-14 21:06:49 +0200 H.G. Muller : -Reorganize texi description - - -2011-04-14 12:31:15 +0200 H.G. Muller : -Fix sweep-promotions patch - -Setting of the from square was moved to before OKtoStartUserMove in the -LeftClick handler, to make sure we could test the promotion possiblity -when OnlyMove() would have altered (x,y) to be no longer the from -square. But this setting of fromX, fromY hung on also if the move was -not OK, so you could effectively select opponent pieces and empty -squares. The from-square is now set back to undefined when it is not OK -to move the piece you clicked. - -2011-04-14 11:56:59 +0200 H.G. Muller : -Alter treatment of moves with empty squares - -In Edit Position mode one can move empty squares, and use them to -'capture' pieces as a means to clear their square. But this often leads -to unintended disappearence of pieces one wants to grab for dragging, if -a previous click had inadvertantly left an empty square selected: the -click on the piece is then seen as the to-click of a click-click move. - This patch treats to-clicks of moves with an empty-square differently -from other to-clicks: Rather than performing the move (in this case -clearing of the to-square) on the down-click, it defers that to the -up-click, and only does it if that up-click is in the same square. This -allows the user to grab the piece on the down-click, and drag it to -another square, if that is what he wanted to do, without being disturbed -by sudden implosion of the piece he tried to grab. - If the to-square is in the holdings, grabbing the piece is the only -action, as moves of empty squares into the holdings are forbidden anyway. - -2011-04-13 13:14:00 +0200 H.G. Muller : -Block selection of a directory when file is needed - -When we are not browsing merely to obtain a name to put in a text edit, -but really must return an open file pointer, selection of a directory -(ending in '/') can no longer be OK'ed in the file browser. (XBoard -tends to segfault when offered garbage for game or position file...) - -2011-04-13 12:23:00 +0200 H.G. Muller : -Let double-click select file in file browser - -A second click on the already selected entry now has the same effect as -pressing the OK button. - -2011-04-12 17:06:28 +0200 H.G. Muller : -Couple mouse wheel to v-scrolls in file browser - -A newly added mouse-wheel event handler was made to call the v-scroll -callback routines with parameters to step one entry. The button-press -handler for the lists themselves was also made to intercept the wheel -events (buttons 4 and 5), to prevent they would select an entry, and -make them scroll in stead as well. - -2011-04-13 11:41:54 +0200 H.G. Muller : -Fix crash copying game list when there is none - - -2011-04-13 11:15:14 +0200 H.G. Muller : -Fix changing of float setting by generic popup - -Changing a float setting (so far the only one is in the Load Options -dalog) did not always work, because the old value was clipped to (int), -so that changing it back to an integer value might erroneously conclude -there was no change. - -2011-04-13 16:15:22 +0200 H.G. Muller : -Fix crash on closing dialogs in wrong order - -When a menu dialog was closed when it still had an open file-browse -daughter, which could be done through the system menu X on the title -bar, later closing of the file browser caused a crash. This is solved by -keeping track of the fact that there is such a daughter through a global -flag, and ignoring the pop-down command if there is one. - -2011-04-13 16:33:16 +0200 H.G. Muller : -Fix startup focus of board window - -When there were open auxiliary windows, these would have focus on -starting up XBoard. The XtSetKeyboardFocus call added in XBoard main() -was ineffective in curing that. It has now been replaced by a call to -XSetInputFocus, which does do the job. By giving input focus to the form -widget, rather than the board widget, XBoard will be immediately -sensitive to all key bindings. - -2011-04-13 15:48:35 +0200 H.G. Muller : -Fix game-list highight error when filtered (WB) - -When the gamelist was filtered, the game that was highlingted was the -n-th game in the list rather than the n-th game in the file, when the -latter was loaded (and n did not exceed the number of filtered games). -This is fixed now by searching for the line in the listbox that starts -with the game number n, rather than taking the n-th line. - -2011-04-12 19:20:46 +0200 H.G. Muller : -Refactor move type-in code - -Common code between XBoard and WinBoard was moved to the back-end -creating TypeInEvent() and TypeInDoneEvent() routines. - -2011-04-12 10:13:40 +0200 H.G. Muller : -Fix saving of XBoard fonts with spaces in name - -SaveFontArg now prints quotes around the saved font string, so that the -general option-argument parser doesnot stop at the first space it sees. - -2011-04-11 20:48:24 +0200 H.G. Muller : -Implement move type-in for XBoard - -By adding an event handler to the main window for key presses, users can -now type moves when the board has focus, like in WinBoard. The typed -character appears as first character in the type-in box that willpop up. -Enter and Escape close the box; finishing the typing of the move enters -it. Like in WinBoard it is also possible to type a move number (to go -there) or (in Edit Position mode) a FEN. - -2011-04-11 20:59:44 -0700 Arun Persaud : -new developer release - -tried to keep the v4.5.x branch developed already separated in the NEWS file, as well as DIFFSTAT and SHORTLOG. -The Changelog is just the one from master. - -2011-04-10 22:47:59 -0700 Arun Persaud : -updated Changelog, NEWS, etc. - - -2011-04-10 20:32:57 +0200 H.G. Muller : -Fix use of game/position file in first match game - -When a match was started from the menu, it was not paying attention to -game and position files. (Later games were.) The code that handled this -in the initialization when a match is started through the command line -was made into a routine MatchEvent, which can be called from the menu -proc too. - -2011-04-09 20:55:47 +0200 H.G. Muller : -Fix crash on opening ICS Text Menu - -The patch for the color defaults had broken the ICS Text Menu. - -2011-04-09 19:22:00 +0200 H.G. Muller : -Implement Copy Game List menu item for XBoard - -Some WinBoard code was cloned for this. - -2011-04-09 11:42:21 +0200 H.G. Muller : -Third method of sweep selection - -This method sweeps through the possible promotion choices for the piece -that is being dragged, as long as you drag a 7th-rank Pawn backwards. On -draggin such a Pawn forwards, it immediately shows it as the piece you -are going to promote to. - -2011-04-08 23:39:10 +0200 H.G. Muller : -Alternative sweep promotions - -The sweep takes place on the from-square here. - -2011-04-07 23:21:02 +0200 H.G. Muller : -Make sweep-select promotions work in WinBoard - -The mouse-move handler had to be connected to the PromoScroll back-end -routine. - -2011-04-07 23:19:10 +0200 H.G. Muller : -Fix path browsing in WinBoard - -The routine BrowseForFolder was still declared as static in woptions.c, -while it was used from wsettings.c. - -2011-04-07 11:14:45 +0200 H.G. Muller : -Fixes to sweep selection - - -2011-04-06 23:47:58 +0200 H.G. Muller : -Implement sweep selection of promotion piece - -When the option -sweepPromotions is true, a click-click promotion move -will first display the default choice (usually Queen) on the promotion -square. While you have the mouse button still down, you can change the -piece by moving the mouse vertically. - -2011-04-06 21:20:30 +0200 H.G. Muller : -Implement sweep selection as alternative for the piece menu - -When the option -pieceMenu is off, the piece menu will no longer appear -on right-clicks in Edit Position mode. In stead a Pawn of the chosen -color will appear immediately in the clicked square, and vertical -movement of the mouse with the right button down will cycle through -all other pieces defined in the pieceToCharTable of the current variant. - Setting the side to move is acheived by clicking the correspondig -clock. Clear board can be effected by clicking the clock of the side -that already has the move. - -2011-03-30 18:17:58 +0200 H.G. Muller : -Remember Tags and Comment dialog coordinates - -The save-settings code now uses the shell and shellUp arrays from the -GenericPopUp to read out the window coordinates for Tags and Comment -window. Pointers used by GenericPopUp are set topoint to the -corresponding WindowPlacement structs. - -2011-03-10 19:21:59 +0100 H.G. Muller : -Redo Tags dialog - -The generic popup is used for generating the Tags / EditTags popups. -The tags popup use a 'label' field to display the cmail message - -2011-04-01 13:43:52 +0200 H.G. Muller : -Implement Edit-Comment window through generic popup - -The Edit Comment and Comment popups are combined into one, that can -always be edited (similar to WinBoard). It uses shell number 1. -(Number 0 is for all transient dialogs.) A save-changes button is added. -The positioning is not implemented yet. - -2011-04-06 10:56:57 +0200 H.G. Muller : -Refinements to generic popup and color picker - -*) The text part of a checkbox can now be clicked to toggle the option. -*) Typing in single-line text edits is ignored -*) Using a spin button now sets focus to the affected text edit, with -the insert position at the end. -*) Using the sample field or an RGB button sets focus to the -corresponding text edit, with the insert position at the end. -*) The adjust buttons now work in reverse, with a D button for "darker". -*) Editing a color field causes the sample field to update to the new -color when you type . -*) The color pickers now define a default color, which can be instated -by clicking on the sample field. -*) Fix some 64-bit pointer warnings - -2011-04-05 17:05:39 +0200 H.G. Muller : -Let file browser filter on extension - -A new text field is added in the file-browse dialog, to hold (space- -separated) extensions, on which the filenames are then filtered. This -field is initialized by the caller, depending on what we need the file -for, but can be changed by the user. (Directories are always displayed!) - Changes in the extension field become effective after typing a return -in it. Escape typed in the extension field gives focus to the filename -field, and restores the contents. Escape in the filename field cancels -the dialog, return ther OKs it. The extension filter of the browser is -initialized to the extension (if any) of the file currently in the text -edit you are browsing for. - When re-opening the file browser from the XBoard File menu, and there -is no suggested filename, it will now start with the last succesfully -opened name as suggestion. Calling the browser with a NULL argument -for the suggested filename requests that (unlike calling with an empty -string, which will start it in the current directory). To make this -work smoothly, the filebrowser saves the last used name on entry, so it -can be restored on cancel, so that a cancelled browse session really -erases all memory of it. - -2011-04-04 19:26:53 +0200 H.G. Muller : -Fix animation masks on changing piece pixmaps - -The animation masks were not remade when new pieces were loaded -interactively through the board-options dialog. - -2011-04-04 19:09:21 +0200 H.G. Muller : -Fix linegap option in board dialog - -The lineGC was not recalculated, so the grid lines stayed the same -thickness. In addition, setting the line-gap override to -1 now -retrieves the original line gap that belongs to the current board size. - -2011-03-05 23:27:48 +0100 H.G. Muller : -Make a kind of ICS text menu in XBoard as a dialog - -The dialog with buttons can be opened from the View menu. It is -configured by the option -icsMenu; a default setting for this is -included in the master settings file. - The commands specified by the -icsMenu can now contain $name and $input -keywords, which will be replaced by the current primary selection, or -text the user types, respectively. Commands that contain $name will not -be sent when the current selection is empty. Commands that do not -contain $input will be sent to the ICS immediately; otherwise they will -be placed in the ICS Input Box, with the cursor at the point of the -$input, and input focus given to the Input Box, so the user can start -typing. When a command is prefixed by "$add " it will be appended to the -existing ICS Input Box contents, rather than replace it. - The items now have to be separated by ";\n", and button text from -command by ';' (with optional linefeed). This allows configuring of -multi-line commands, as a single linefeed no longer has special -sigificance. - -2011-03-31 13:36:05 +0200 H.G. Muller : -Redo ICS input box with generic popup - -This box is just a single text edit, but the complexity is in the added -callbacks. These callbacks remain in xboard.c, and were altered to -access the edit through the option.handle field. - -2011-04-03 12:54:51 +0200 H.G. Muller : -Activate -path and -file options - -In XBoard the generic popup was prepared for this. In WinBoard, for --path options the BrowseFolder routine is used, and had to be made -global (prototype in winboard.h). - -2011-04-02 18:40:33 +0200 H.G. Muller : -Let generic popup generate Engine Settings dialog - - -2011-04-02 18:36:09 +0200 H.G. Muller : -Merge SettingsPopUp into GenericPopUp - -Based on currentCps the values read from the dialog are sent to the -engine, or stored into the option.target in the callback, and fetched -from the option.target in the PopUp. The currentCps is cleared in the -generic popdown of a transient dialog. - -2011-03-06 10:11:06 +0100 H.G. Muller : -Make generic dialog popup reentrant - -To allow persistent dialogs to be implemented through the generic popup, -it must be possible to have several dialogs open at the same time, and -thus make sure the popdowns under the cacel or close-window button know -which one to pop down. To this end an array shells[] is created that -takes over the function of settingsShell, and GenericPopUp gets an extra -parameter telling it which element to use for storing the dialog shell. -This number is then also passed to the callbacks that trigger popdown. -This was a bit nasty for the CatchDeleteWindow stuff, which passes user -data to the callback as text strings. -Keep a separate up/down indicator, so that shell widgets can be kept -for persistent dialogs. Also keep a currentOption per dialog type. - The coordinates and size of the window is read out and stored in a -WindowPlacement structure, (if one is specified for that dialog), when -the dialog is popped down. When initialized the structure is also used -to set the window parameters when the dialog is created. (The idea being -that the structure was saved in the settings file.) - The routine MarkMenu checkmarks a given menu item, and logs it for the -given dialog type, so that a later popdown automatically unchecks is. - -2011-02-25 12:14:25 +0100 H.G. Muller : -Implement Machine Match menu item and options dialog - -An item to start a match from the menu is added, similar to what -WinBoard has. (The code is duplicated, so I guess it should be moved to -the back-end now, as MachineMatchEvent(), but it was tiny.) A dialog in -the Options menu was added with the aid of the generic popup, and allows -the user to set the load Game / Position File and Index. - -2011-04-01 14:54:26 +0200 H.G. Muller : -Create General-Options dialog - -The generic popup is used to implement a General-Options dialog, which -contains all Boolaen options that used to be set directly from the main -Options menu, plus a spin option for the flash count and flash rate. -The corresponing options are removed from the main Options menu, but the -whole thing is made conditional on a compiler switch OPTIONSDIALOG. -The dialog needs an OK callback for sending an altered ponder-state to -the engine. (Why isn't this option disabled in -ncp mode, btw?) -A spin control is added to adjust -animateSpeed between 5 and 100. -Add dropMenu and showTargetSquares item as well. - -2011-04-01 18:16:47 +0200 H.G. Muller : -Redo new-variant dialog with generic popup - -Some special code was added in GenericPopUp() to force buttons of the -type needed in the New Variant dialog (wide, colored, greyed-out on -variant type). The dialog was implemented with these, and callbacks for -the buttons directly exit the dialog, without the need for OK. New spin -controls are added to the dialog for adjusting the board format. - -2011-04-01 14:48:48 +0200 H.G. Muller : -Redo common-engine dialog with generic popup - -The ponder option was removed, as it is already in the main Options -menu, and would require nastiness in the OK callback. Added book options -in common-engine dialog. - -2011-02-24 13:32:01 +0100 H.G. Muller : -Redo adjudications dialog through generic popup - -We dropped the periodic-updates option, as it is already in the main -Option menu. - -2011-04-01 21:56:07 +0200 H.G. Muller : -Make sounds dialog for XBoard - -This uses the combo boxes. A 'play' button isimplemented for a test -sound. A sound directory is introduced, and can be set through the -dialog. A default setting for -soundDirectory is added to xboard.conf. - -2011-04-01 23:11:29 +0200 H.G. Muller : -Add ICS options dialog - - -2011-04-01 21:52:48 +0200 H.G. Muller : -Add board dialog XBoard - -The GenericPopUp() is used to implement a dialog for board options. The -board dialog needs to trigger redraw and redefinition of the -colors, through an OK callback. Color-pickers are used for the 6 basic -color settings. - To allow changing board settings during the session (i.e. from a menu -dialog), the routines to allocate resources have to free the resources -for the previous settings first. This patch take care of XtCreateGCs(), -preventing re-creation of resources that are unchangeable (such as the -grid color), and calling XtReleastGC() on GCs that can be changed. -To prevent resource leaks the old pixmaps are deleted before making new -ones on second or later calls of CreateXPMPieces(). - -2011-04-03 11:39:26 +0200 H.G. Muller : -Add browse button to generic popup - -Options of type FileName and PathName cause a browse button to be added -behind the text field. The SpinCallback is used to handle the -button presses, and invokes the file browser dialog to obtain a -filename, which is then copied to the text field. - -2011-04-01 21:49:26 +0200 H.G. Muller : -Make generic XBoard popup, and implement 2 dialogs - -The Engine-Settings dialog of XBoard was cloned to work on predefined -lists of (XBoard) options, rather than engine options. An extra field -was added to the Option struct, to hold a pointer to the XBoard variable -that should hold the option setting, so on OK'ing the dialog the altered -values can be copied there. Not usable for options which should trigger -an action (like redraw, or sending something to the engine). -A Load Game, Save Game and ICS Options dialog were then defined by -tables fed to GenericPopUp(). Options set from these dialogs were removed -from the main Option menu, which removes a lot of code from xboard.c -(for checkmarking, disabling the menu items). - A button defined in the GenericPopUp can attain the color indicated -by a previous text field, and add a callback to change the color in a -spin-like manner (but using R G B W in stead of + - butons). -The EndMark option can specify a callback, to be used on OK. -A non-zero max field in the Option descriptor will be used to set the -width of ComboBox, TextBox and Button optons. -The elements are chained such that extra space goes fully into the input -fields. A label type is added for clarifying texts that would not fit in -the option names. A break-type (pseudo-)option is added. Make OK and -cancel button suppressable in generic popup (by 2 bit of the option.min -field). - -2011-04-03 11:34:21 +0200 H.G. Muller : -Add file-browser option to just return name - -By passing mode "f" the file browser dialog will not open the selected -file at all, so it can be used to retreive the name for the benefit of a -file-browser button to a -file option. A mode "p" will limit the -selection to directories only, to browse for a path. - -2011-04-03 13:15:17 +0200 H.G. Muller : -Put insertion point at end of text on SetFocus - - -2011-04-05 23:47:34 -0700 Arun Persaud : -fixed 64 bit warnings by casting integers to intptr_t before casting to int - - -2011-04-05 23:24:24 -0700 Arun Persaud : -removed check and #includes for malloc.h, since it's not needed - -hopefully this doesn't break things on non-linux systems. OS X seems to be ok, not sure about others ;) - -2011-04-03 20:23:49 -0700 Arun Persaud : -check if malloc.h is present before including it - -OS X 10.6 doesn't have malloc.h, so it complained. - -2011-04-03 20:01:36 -0700 Arun Persaud : -Fix bug introduced in commit 89b4744: removed a "/" and forgot to add it in the config file - -removed a "/" to make OS X happy, but forgot to add the "/" again in the xboard.conf.in file - -2011-03-12 14:08:50 +0100 H.G. Muller : -Fix display of promotion piece in ICS superchess - -In Great Shatranj and Superchess promoted Pawns were displayed as shadow -piece because these variants had holdings, while captured pieces should -go back into the holdings unchanged, rather than reverted to Pawns. - -2011-03-13 14:09:14 +0100 H.G. Muller : -Fix o-o castling in new parser - -The non-compliant notation of castling with lower-case 'o' should be -preferred over the non-compliant interpretation of moving a Pawn along -the o-file. Not doing so breaks ICS play, as ICS use o-o and o-o-o for -castling! So an exception is now made for the o-file in the 'fxg' -case. - -2011-03-10 19:27:41 +0100 H.G. Muller : -Implement yynewstr entry point in new parser - -This entry point, used for parsing an ICS move list, was forgotten, and -was still an empty routine. This made XBoard crash when observing an ICS -game. - -2011-03-07 23:11:00 -0800 Arun Persaud : -fixed wrong default for polyglotDir mentioned in docs. - -Thanks to Hans Aberg for reporting it. - -2011-03-05 12:39:01 -0800 Arun Persaud : -Fix "make install" on Os X10.6.6 (removed a "/") - -seems like an extra "/" made "make install" unhappy - -2011-03-03 21:19:05 -0800 Arun Persaud : -removed parser.l from build process, also removed flex dependency from configure - - -2011-03-02 22:14:57 +0100 H.G. Muller : -New parser, written in C - -A new parser was written to replace the flex-generated one. Immediate -improvements are that it understand double-digit rank numbers, and Shogi -coordinates. No changes were made in the Makefile yet to reflect the -new, flexless building procedure. - -2011-03-02 22:23:21 +0100 H.G. Muller : -Fix bugs in FRC castling rights - -When parsing a castling move in FRC when no rights existed, the parser -returned 0 (= EndOfFile) rather than ImpossibleMove. The recognition of -the absence of rights was not adapted to the new encoding NoRights in -stead of -1. - -2011-03-01 23:42:34 +0100 H.G. Muller : -Fix parsing bug of FRC castling - -The code that was supposed to intercept castling when no rights existed -in FRC was not adapted to the new encoding for this by NoRights, rather -than -1, and furthermore returned 0 (= EndOfFile) rather than -ImpossibleMove. Not sure if the former would manifest itself in any -way, but the latter seems bad. - -2011-03-01 23:32:25 +0100 H.G. Muller : -Fix two bugs in reading position diagram - -When reading a game without FEN tag, a position diagram is used to set -the initial position. This calls CharToPiece() with a '.' as argument, -because that is the position-diagram way to indicate empty squares. -altered CharToPiece() over time this would be recognized as the first -undefined piece or, more recently, the first piece without nickName, -which is a white Pawn. Now it returns EmptySquare again in that case. -A second problem was that for position diagrams in braces the brace was -not in the list of ignored characters, and would cause the reading to -get out of phase, so that the side to move was not recognized. - -2011-02-26 21:12:08 +0100 H.G. Muller : -Fix flipBlack option XBoard with board texture - -In XBoard -flipBlack is implemented by swapping white and black pieces, -because the Shogi bitmaps from XShogi are made that way. But the mask -used to cut out the whole in the board texture to fit the piece was not -swapped, both when drawing static pieces, as well as during animation. - -2011-02-25 14:38:21 +0100 H.G. Muller : -Improve repairing damage of arrow highlight XBoard - -With line gap the highlight arrow necessitated redrawing of the entire -board, to repair damage on the grid. This interfered with flashing of -pieces, which was only done on selective redraws. In stead of forcing a -total repaint we now just redraw the grid lines. - -2011-02-23 16:41:36 +0100 H.G. Muller : -Fix unintended translation in debug file - -The words "first" and "second" (cps->which) were sometimes used in -context that should definitely not be translated. (e.g. the indicator -for which engine printed/got the line in the debug file.) So translation -is now deferred to all uses in popups. - -2011-02-23 16:29:12 +0100 H.G. Muller : -Fix nps bug - -The nps settingwas tested for being > 0 in stead of >=0, so that the -case of CPU time was not properly handled. - -2011-02-24 19:06:27 +0100 Kamil Blank : -Added missing fclose() - -(tiny change) -Signed-off-by: Arun Persaud - -2011-02-20 16:12:19 -0800 Arun Persaud : -release of version 4.5.1 - -2011-02-20 16:10:16 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - -2011-02-20 20:36:28 +0100 H.G. Muller : -Fix two typos in option names in texi file - -Polyglot was capitalyzed - -2011-02-20 00:03:19 +0100 H.G. Muller : -Fix some resource leaks - -Some files were opened not closed in XBoard, when loading XIM images -(which I doubt anyone ever does) but also when copying the clipboard -(which has the potential of being done very often). There was also some -code that would not work if conditional code which is permanently -disabled would be enabled. - -2011-02-17 20:17:04 -0800 Arun Persaud : -new developer release - -2011-02-17 20:14:38 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - -2011-02-17 15:40:02 +0100 H.G. Muller : -Fix MSVC snprintf problem - -In MSVC snprintf has to be redefined as _snprintf, and this happens -conditionally in config.c. But the latter was not #included in help.c. - -2011-02-16 19:41:27 -0800 Arun Persaud : -updated configure.ac to check for Xaw header files - -check for Xaw header files when --without-Xaw3d was given. Before the test was -only done when Xaw3d was specified, but could not be found. - -If Xaw3d or Xaw can't be found, print a hopefully useful error message and exit the configure script. - -2011-02-16 12:03:22 +0100 H.G. Muller : -Fix ICS channel 0 - -Channel 0 messages were not displayed in the console, because the test -for channel number considered every non-numeric or non-existent handle -in a chatbox to be zero. So the messages were diverted to a non-exsting -chatbox. Now it test first for the handle to start with a digit. - -2011-02-15 19:13:33 +0100 H.G. Muller : -Make language choice from menu persistent - -Set appData.language to the chosen language file, or empty if English is -chosen, so that the choice is saved with the settings. Increase the -number of possible language choices from 5 to 20. (After all, we already -have 7 now!) - -2011-02-14 11:09:24 +0100 H.G. Muller : -Fix showing of user move after adjudication - -The correction of the fishy patch (removing ShowMove() from Adjudicate()) -had broken the adjudication of user moves (that actually did work before -the fishy patch, because there the gobal fromX/Y and toX/Y do contain -the correct values for the move to be shown). An entered move that led -to adjudication (like a checkmate) now was not displayed at all. Adding -an extra ShowMove() after (successful) return of Adudicate() solves it. - -2011-02-13 23:49:44 +0100 H.G. Muller : -Fix Xiangqi King facing - -The Spartan patch had broken the CheckTest for Xiangqi, because cl.check -was cleared after the King-facing test, rather than before it. - -2011-02-13 22:30:59 +0100 H.G. Muller : -Fix variant janus size prefix - -The default board size of Janus Chess was not consistently taken to be -10x8, which resulted the name to be sent as 10x8+0_janus to the engine. - -2011-02-13 12:18:52 +0100 H.G. Muller : -Fix Alfil bug - -The test for Alfil (suppressing single steps on the Elephant) contained -a wrong logical operator, so that it could never be active. It also -failed to include Xiangqi as variant with traditional Alfil. This led to -one-step moves of the Elephant in these variants, and false check or -unreliable mate detections. - -Fix move of Xiangqi Elephant - -2011-02-09 23:19:09 -0800 Arun Persaud : -fixed configure script to correctly detect Xaw3d library - - -2011-02-06 22:07:17 +0100 H.G. Muller : -Fix unmarked translation - -The file-browser wndowtitle in WB was not marked for translation. - -2011-02-04 10:27:49 +0100 H.G. Muller : -Put warning in HTML help - -A warning is added that the help file is not yet updated for the new -menu organzation. - -2011-02-04 10:22:29 +0100 H.G. Muller : -Fix 64-bit Windows compilability - -The API interface for Set/GetWindowLong has been changed for 64-bit -Windows, both in the name of the call as in the arguments. - -2011-02-04 10:21:06 +0100 H.G. Muller : -Fix MSVC compilability - -Both the makefile and the project file had to be adapted for the new -source file history.c, and the new location of parser.c. - -2011-02-05 10:11:58 -0800 Arun Persaud : -added missing #includes and missing prototypes to filebrowser - -thanks to Max Funk for reporting. Now using HAVE_DIRENT_H. - -Also cleaned up missing prototypes and some casts. - -2011-02-05 09:21:48 -0800 Arun Persaud : -added missing header file for sprintf - - -2011-02-03 08:50:50 -0800 Arun Persaud : -added history.c to the tar-ball. Needed for Winboard - - -2011-01-31 23:03:05 +0100 H.G. Muller : -Fix deselection of greyed-out variant button (WB) - -In Windows a disabled radiobutton refuses to deselect when you select -another (enabled) button from the group. There are then 2 buttons -checked, and the code to readout the buttons took the first one. Now it -is changed to take the first enabled one. - -2011-02-03 08:28:15 -0800 Arun Persaud : -Revert "Implement -reset option feature in WinBoard" - -This reverts commit efecf86cd9b54072c6a2f38d62f1d775e69c545b. - -picked the wrong commit from HGM's git tree. - -2011-02-01 22:01:12 -0800 Arun Persaud : -add DIFFSTAT and SHORTLOG to tar-ball - -was only in the v4.4.x branch and not in master - -2011-01-30 09:52:15 -0800 Arun Persaud : -release of version 4.5.0 - -2011-02-01 07:41:04 -0800 Arun Persaud : -changed size of borders around squares from 0 to 1 as a default - -this way highlights show up again. - -2011-01-29 20:11:30 +0100 H.G. Muller : -Implement -reset option feature in WinBoard - -2011-01-30 10:12:08 -0800 Arun Persaud : -updated Changelog, NEWS, etc. - -2011-01-30 09:56:39 -0800 Arun Persaud : -updated parser.c form parser.l - -2011-01-29 19:59:11 +0100 H.G. Muller : -Clean up fishy patch - -None of the ShowMove() calls in Adjudicate() was working, because when -this code was taken out of HandleMachineMove() it was taken outside the -scope of the local fromX, fromY etc. there, so that it started using the -global variables from the mouse driver. As these usually contain -1, -this suppressed move animation and highlighting. All these calls have -now been removed, and ShowMove() is called after a positive return (from -HandleMachineMove(), so within the correct scope). -This improves the previous fix, which led to some flicker, because the -erroneous ShowMove() calls did draw the new board (instantly), wich in -the fishy patch was then immediately overwritten by the old position, to -start animation. This drawing of the old position is now no longer -needed either. - -2011-01-29 13:36:30 +0100 H.G. Muller : -Update RTF file - -The RTF file is adapted to the new menu organization. - -2011-01-29 13:31:48 +0100 H.G. Muller : -Update texi file - -The highlight-with-arrow and one-click-move menu items are described. -The highlightMoveWithArrow and variations option are described. -Load Next /Previous Position descriptions are moved to File menu. -The description for entering variations is updated (using Shift key). -The remark that editing holdings is impossible is removed. -Spartan Chess is added to the list of supported variants. - -2011-01-28 18:35:48 -0800 Arun Persaud : -Updated copyright notice to 2011 - - -2011-01-24 15:01:25 +0100 H.G. Muller : -Greyout unavailable variants in New Variant dialog - -The WB radio-button code is refactored to be driven from a list (which -must be kept in phase with the variant definitions in common.h!). It now -also checks if the first engine supports the variant, and greys out the -item if it isn't. XB now also makes this check. Slight re-ordering of -10x8 variants there, to have the more common on top. -If no radio button is selected, keep old variant even on OK. - -2011-01-19 11:10:59 +0100 H.G. Muller : -Move clock-click code to back-end - -Some duplicated (or should-be-duplicated) code for handling clicks on -the clocks from the XBoard and WinBoard front-ends was merged and -relocated to the back-end, so it can be shared. Noticeable was that -XBoard allowed turn change in ICS examine mode by clock clicking, -while WinBoard did not. WB, on the other hand, allowed clock adjustment. - -2011-01-16 23:15:17 +0100 H.G. Muller : -Fix legality testing of drop moves - -Drops of noexistent pieces (i.e. with a piece indicator letter that is -not corresponding to any defined piece) are now parsed as -ImpossibleMove, rather than IllegalMove, so they are also rejected with -legality testing off. - -2011-01-17 00:28:32 +0100 H.G. Muller : -Fix WB Sound Options greyout and remove some grossness - -The sound and ICS Options menu items in WB were accessed 'by position', -with fixed defined positions (always messing up any reorganization of -the menus when you forgot to redefine the position constants in -winboard.h). And not only that, but for completely mysterious reasons, -the greying of the sound item greyed out the game-list options (above -it) in stead when it was defined as 9, and the ICS options (below it) -when it was 10 !!!. Now they are addressed 'by command' (and the -position definitions are removed), which fixes things. - -2011-01-25 21:35:10 +0100 H.G. Muller : -Re-instate load next/prev position menu items - -As positions do not use something similar to the game list, these are -still useful. For some reason I could not get Alt+Shift+PgUp/Dn to work, -so I settled for Shift+PgUp/Dn. - -2011-01-16 21:56:14 +0100 H.G. Muller : -Remove superfluous copying of machine move - -There was explicit code in HandleMachineMove() and FinishMove() to put -the move in the moveList, while MakeMove() already does this later in a -more reliable way by calling CoordsToComputerAlgebraic(). This -superfluous code is removed now. - -2011-01-16 21:44:26 +0100 H.G. Muller : -Fix spurious mate test in Edit Game mode - -When entering a game, it was terminated by the mate test even when -legality checking was switched off (so that mates might not be reliably -recognized). The mate test is now made dependent on legality testing. - -2011-01-16 21:37:16 +0100 H.G. Muller : -Fix type-in of drop moves - -Drop moves entered through the move type-in already come in the (piece, -DROP_RANK, x, y) format, rather than having a holdings from square. This -caused UserMoveEvent to consider them illegal when testing if the -piecewas of the side to move, and when this was fixed, to recognize -Knight drops as coming from between board and holdings (and thus -illegal). - -2011-01-16 21:31:42 +0100 H.G. Muller : -Fix move type-in truncating game - -Starting a new variation by keeping Shift pressed did not work when -OK'ing the move type-in, because there was some code ther that truncated -the game. While this could be safely left to UserMoveEvent, which it -calls, as the situation is not different from entering moves through the -mouse. - -2011-01-11 16:12:02 +0100 H.G. Muller : -Fix legality testing for promotions - -Turns out WB has never tested for the legality of the chosen promotion -piece, and would allow promotion to King innorml chess even with -legality testing on (when entered through the keyboard)! Now strict -testing is done, outlawing Pawns and Kings (or Unicorns in -Knightmate). Only in suicide / giveaway Kings are stillallowed, and in -spartan a black King if you do not have two yet.(And promotion -toLnce,representing Hoplite Pawn,is forbidden there.) - -2011-01-11 11:34:07 +0100 H.G. Muller : -Reset 50-move counter on all pawn-like Lance moves - -Now the Lance represents a Pawn-like piece not only in variant fairy, -but anywhere outside Shogi / Superchess, its moves should also reset the -50-move counter in those cases. Especially important for Spartan Chess, -where the Lance actually participates. - -2011-01-11 11:18:15 +0100 H.G. Muller : -Fix logo repainting - -The logos were not repainted when the main window was moved out of the -display area, and then back into view. The reason for this is -unknown, as the PaintProc calls HDCDrawPosition, which was calling -DrawLogoOnDC. But the logos were not drawn, (or on an expose event -sometimes half drawn!) despite the fact that the rest of the board was. -The drawing of logos now has been decoupled from drawing the board, -and has been moved to a separate routine DisplayLogos() (in analogy to -DisplayBothClocks()). This is cleaner anyway, as the logos usually do -not change when the board does. So apart from in PaintProc, it has only -to be called when the mode changes (ModeHighlight()) or on swap clocks. -This seems to fix the problem. - -2011-01-10 20:36:48 +0100 H.G. Muller : -Fix time in PGN info - -Saving of the thinking time in the PGN was broken by the patch that -removed the race condition in the clock switching, because that moved -the incrementing of forwardMostMove to behind the code that used fmm to -index pvInfoList. As a result the time was stored in the slot for the -opponent's previous move. The value is corrected now. - -2011-01-09 00:24:17 +0100 H.G. Muller : -Fishy fix - -The move that delivers checkmate in two-machines mode is not animated -when adjudication is on. There then also is no highlighting of this move -Redrawing the board and calling ShowMove fixes it. Which is rather -strange, because ShowMove was already called in Adjudicate (when it -adjudicates), before GameEnds. For reasons that are not understood this -call to ShowMove() (which calls AnimateMove()) is not effective. - -2011-01-09 00:21:41 +0100 H.G. Muller : -Reset machine colors after match - -The colors each engine playse are set to the originals after the last -match game, so that a new match or two-machines game will not have -swapped colors. - -2011-01-09 00:15:18 +0100 H.G. Muller : -Reset win/loss counters before match - -The win/loss counters were not reset, because the code counted on them -being initialized to zero. But with matches startable from the menu, -this is no longer true after the first match. - -2011-01-09 00:08:52 +0100 H.G. Muller : -Show move that causes false illegal-move claim - -Without claim testing XBoard takes back moves that an engine objects to. -But when the engine is forfeited for a false claim, the move should of -course stay. So the claim test is moved to before the take-back. - -2011-01-09 00:05:38 +0100 H.G. Muller : -Fix Spartan promotion to King - -Promotions toKing were refused when in check, because XBoard thought -they would not resolve the check. Now the promotion is actually -performed before doing the check test. - -2011-01-05 17:31:37 +0100 H.G. Muller : -Fix WB font-based piece rendering on variant switch - -The piece bitmaps were only created from the font characters when the -number of ranks or files changed, because it was done in -InitDrawingSizes(). This caused missing pieces when changing to a -variant on the same board that used other pieces. Now InitDrawingSizes() -is called for any variant switch. - -2011-01-05 17:25:11 +0100 H.G. Muller : -Fix right-alignment pproblem in WB ICS window - -Use of Ctrl-R to summon the context menu still trickled through to the -default text-edit window routine, and caused right-alignment. This was -because the text-edit reacts on keyDown rather than the character event. -KeyDown of R with Ctrl pressed is now also intercepted and ignored. - -2011-01-03 13:04:56 +0100 H.G. Muller : -Fix chat window title - -The title was using the engine name, rather than the ICS handle, which -did not work outside zippy mode. Now it only uses the engine name when -no ICS handle is known. The titleis now also subjected to translation. - -2011-01-03 12:50:54 +0100 H.G. Muller : -Fix spurious reading of old game title by JAWS - -Because focus was switched to the board window before loading the -selected game from the game list, the titlebar still contained the -name of the previously loaded game, which would spontaneously be read by -JAWS. Now the focus switch is done after loading the new game (which -updates the window title.) - -2011-01-03 12:37:17 +0100 H.G. Muller : -Add variant Spartan Chess - -In the WB menu it takes the place of the defunct Twilight Chess item. -The setup routine needed patching for setting up Lances in stead of -Pawns for black, the check test had to be adapted to handle duple check, -Alfil and Dragon moves were fine tuned in this variant to make the exact -moves, and the promotion popup was adapted to show King and interpret -Rook and Bishop as Dragon and Alfil for black. The Alfil now always -moves as Modern Elephant except in Shatranj and Courier. - -2011-01-03 12:23:39 +0100 H.G. Muller : -Fix mate test - -Due to a bug in logical operators drops were tried for mate evasions -even in non-drop games, which broke it in Superchess and Great Shatranj, -and wasted CPU time in other variants. - -2011-01-05 17:19:35 +0100 H.G. Muller : -Fix promotion suffixon disambiguated piece moves - -The promotion suffixon piecemoves that needed disambiguation was not -passedon to the back-end in most variants. Now it is passed on in any -variant. - -2011-01-03 12:08:19 +0100 H.G. Muller : -Fix promotion of Pawn-like Lance - -In variants where the Lance is used to represent an unorthodox Pawn, it -must promote when it reaches last rank. With legality testing on, -however, the promoChar was ignored in ApplyMove in this case. The -promotion suffix also was not appended in SAN moves. - -2011-01-03 11:57:23 +0100 H.G. Muller : -Fix WB promotion popup - -The promotion popup did not work properly in variants where black did -not use the pieces that white wanted to promote to. Now the character -for the selected piece is taken from the piece encodings of the side to -move. In addition, selection of undefined pieces is ignored. - -2011-01-02 14:17:32 +0100 H.G. Muller : -Fix bug in parsing variations - -The moves parsed from a variation were stored in the moveList without -appended linefeed. This caused errors if the variation extended to -beyond the end of the main line,into a hitherto unused part of the move -list, as the linefeed was then not there from the overwritten move. As a -result moves sent to the engine were concatenated, triggering -illegal-move messages and bringing the engine out of phase. - -2011-01-02 14:11:45 +0100 H.G. Muller : -Define Ctrl-R as right-click in WB Comment dialog - -To allow JAWS users to load a variation through the keyboard, Ctrl-R is -equated to a right click at the position of the caret or selection. - -2011-01-02 14:10:02 +0100 H.G. Muller : -Allow starting a variation from keyboard entry in WB-JAWS - -The status of the shift key is remembered when space is pressed to -select a board square. - -2011-01-02 14:06:14 +0100 H.G. Muller : -Disable some accelerators in JAWS version - -Single-key accelerators that could result in irreversible data loss are -undesirable, because the risk of accidentally pushing them is too large. -So the non-Alt duplicates of next/previous game/position are disabled, -as are Home and End for Revert and Truncate Game. JAWS users will have -to rely on the menus for those functions. - -2011-01-02 13:59:01 +0100 H.G. Muller : -Group engine-output memos with engine names - -The engine names are now defined just before the text edits, so that -JAWS 11 will read the engine name when the memo for the output of that -engine is selected. (JAWS 10 will still read the NPS, as it reads in -geometrical order.) - -2011-01-02 13:55:19 +0100 H.G. Muller : -Put nr CPU earlier in tab cycle of WB Common Engine dialog - -By defining the max CPU control after hash size, the tabbing steps -through the controls in geometrical (and logical) order, rather than -having the max CPU in between the book controls. - -2010-12-29 23:47:14 +0100 H.G. Muller : -Update WB language template file - - -2010-12-29 23:41:27 +0100 H.G. Muller : -Subject JAWS menu and spoken strings to translation - - -2010-12-29 23:37:39 +0100 H.G. Muller : -Let JAWS SayString buffer full sentence - -The meaning of the flag parameter of SayString was changed to indicate -buffering of flushing. On flushing a message of a single space is used -as a kludge to indicate interruptability. Calls to force flushing where -added everywhere. - -2010-12-29 23:32:54 +0100 H.G. Muller : -Adapt JAWS menu to new menu organization - -The menus did not correspondto the texts after translation of the main -menu bar. - -2010-12-29 23:18:30 +0100 H.G. Muller : -Translate menus after creation of JAWS menu - - -2010-12-29 23:07:05 +0100 H.G. Muller : -Fix ICS context menu for JAWS - -The Ctrl+R key did select text at the mouse pointer in stead of at the -curser, now that up and down-click were combined. - -2010-12-29 23:04:08 +0100 H.G. Muller : -Reorganize order of WB New Variant dialog controls - -The definitions are re-ordered so that at least JAWS 11 will speak the -board-size elements properly. - -2010-12-29 22:57:55 +0100 H.G. Muller : -Fix order of elements in WB time-control dialog - -Someleading texts were defined after the text edit they referred to,so -that JAWS 11 associated them to the wrong one. A tab stop was added to -the time-odds label, to make JAWS speak it. - -2010-12-29 22:51:17 +0100 H.G. Muller : -Change tabbing order in WB sounds dialog - -The 'Play' button now gets focus immediately after the controls for -selecting the sound, rather than at the end of the dialog (after OK). - -2010-12-29 22:47:26 +0100 H.G. Muller : -Remove tab stops on first radio button of WB dialogs - -The New Variant and Board dialogs had a tab stop on the first radio -button,so that tabbing toit would automatically select variant -normal or size tiny. Now it tabs straight to the current size, without -changing anything. (Important for JAWS users.) - -2010-12-29 22:45:23 +0100 H.G. Muller : -Put OK/Cancel last in tab cycle of some WB dialogs - - -2010-12-29 22:29:37 +0100 H.G. Muller : -Fix duplicate menu character for Edit Comment - -Edit Comment did have the same shortcut character as Copy Game. Changed -to m now. - -2010-12-11 11:18:56 -0800 Arun Persaud : -fixed automake process: xboard.conf couldn't be generated if $srcdir was not the current directory - - -2010-12-11 09:50:48 -0800 Arun Persaud : -new developer release - - -2010-12-05 18:01:21 +0100 H.G. Muller : -Subject WB context menus to translation - -The innerloopof the menu translation has been made into a separate -routine. This now uses GetMenuItemInfo() in stead of ModifyMenu() to -better preserve menu breaks. Menu #10 is used for context menus (from -the routine that pops them up), and for this number the orignal texts -are not saved in menuText. (This is not needed, because the menu is -created everytime anew from the resource data.) - -2010-12-05 15:00:28 +0100 H.G. Muller : -Update translation template - -Add the new menu items; add some notes. - -2010-12-05 14:04:46 +0100 H.G. Muller : -Resize buttons in WB engine-settings dialog - -The OK and cancel buttons were to narrow for most translations, and were -a non-standard order as well. - -2010-12-05 13:56:52 +0100 H.G. Muller : -Add one-click move control to WB general-options dialog - -This is a duplicate of the one in the ICS options dialog, but the latter -is inaccessible in non-ICS modes, and one-click move is now -alsoavailable in engine mode. - -2010-12-05 13:51:20 +0100 H.G. Muller : -Create space in dialogs for translation - -The translated texts often did not fit, because controls were defined -needlessly small (when there was empty space between them). In these -cases they have been enlarged to consume all available space. Some -dialogs are made wider. - -2010-12-05 13:47:26 +0100 H.G. Muller : -Add handle for translator acknowledgement - -An empty string is printed in the about box, which can be 'translated' -to a message acknowledging the translator. - -2010-12-05 13:43:26 +0100 H.G. Muller : -Use default logo for user - -When no logo with the name of the current user is found, use dummy.bmp. - -2010-12-05 15:46:34 -0800 Arun Persaud : -added rlwrap tip to FAQ - - -2010-12-03 23:24:06 -0800 Arun Persaud : -replace hard coded paths with path from configure script - -use $datadir and subdirectories to store some data files. Also make files in xboard.conf use correct path. - -2010-12-03 23:02:09 -0800 Arun Persaud : -fixed a typo in the configure script output - - -2010-12-03 21:46:00 -0800 Arun Persaud : -added a desktop file - -taken from the openSUSE project - -2010-12-03 22:44:02 +0100 H.G. Muller : -Fix Edit Game/Position checkmarking in WinBoard - -Because the entries in Edit and Mode menu were pure duplicats, the -entries in the wrong menu (Edit) were checkmarked while active. By -defining different IDs for those in the Edit menu, those in the Mode -menu are checkmarked again. - -2010-12-03 10:07:34 +0100 H.G. Muller : -Add XBoard menu items for arrow highlight and one-click move - -These items are put in the options menu; the 'Old Save Style' item is -removed. - -2010-12-03 09:27:58 +0100 H.G. Muller : -Provide menus for editing WinBoard engine and server lists - -The Edit Tags dialog in the WB front-end is adapted to act as a general -edit for string variables, by giving it an extra parameter to indicate -where to store the edited result. Menu items are added to invoke this -dialog for editing the /first, /secondChessProgramNames and /icsNames -options. This solves the problem that people would have to edit an ini -file that they can no longer locate (because the %APPDATA% folder has -different names and locations in the various Windows versions, and is -often a hidden folder on top of that). -There is a slight memory leak here, as the memory for the previous -value of the altered string option is not freed. - -2010-12-02 16:18:53 +0100 H.G. Muller : -Configure arrow highlighting as default in XBoard - -Set -highlightMoveWithArrow true in the xboard.conf file, and specify a -lineGap of 0 to make that efficient (and the wood theme even nicer). - -2010-12-02 15:56:46 +0100 H.G. Muller : -Port highlighting with arrow to XBoard - -Unfortuntely this duplicates a fair amount of code in the front end. -Removing the arrow is done by a total repaint if there is a non-zero -lineGap, because the clever algorithm for selective redrawing (based -on damage) that XBoard uses does not repair damage to the grid lines. -For lineGap=0, however, (for which the arrow is mainly intended) the -damage mechanism is used, and the damaged squares are determined by -tracing out the arrow in 64 steps, and marking all squares in the -neighborhood as damaged. - -2010-12-02 15:55:25 +0100 H.G. Muller : -Strip CR from xboard.c - - -2010-12-02 14:21:24 +0100 H.G. Muller : -Let user decide if he wants highlights in blindfold mode - -Remove the automaticsuppression ofhighlighting. - -2010-12-02 00:24:43 +0100 H.G. Muller : -Fix fag-fell marker with logos on - -The flag-fell marker "(!)" that is displayed in the clock in WinBoard in -two-machines mode was printed twice when the clock was split over two -lines (as with logos on). - -2010-12-01 18:57:57 +0100 H.G. Muller : -Also exempt variant seirawan from eval-scale doubling - -It is not really a drop game, so a scale from -7 to 7 in the eval graph -is good enough (like variants great and super). - -2010-12-01 10:33:13 +0100 H.G. Muller : -Configure EGTB cache size in adapterCommand - -The hash size, nr of CPUs and EGTB path are transferred through the WB -protocol interface commands memory, cores and egtpath. But there is no -WB command for detailing the EGTB cache size. So the value of the -command-line option -defaultCacheSizeEGTB has to be sent to Polyglot -through its startup command to make it known to UCI engines. - -2010-11-30 22:46:16 +0100 H.G. Muller : -Move Hint and Book items to Engine menu in XBoard - - -2010-11-30 22:17:24 +0100 H.G. Muller : -Correct the key bindings fo view menu in texi file - -The mentioned bindings for Game List and Eval Graph were wrong. - -2010-11-30 21:25:07 +0100 H.G. Muller : -Fix sub-variation display with negative score - -The test if the displayed score was the pvInfo score failed for negative -scores, because floats are truncated towards zero. So the previous fix -of spurious score/depth info was not working when the score was -negative. - -2010-11-30 18:27:52 +0100 H.G. Muller : -Peel PV out of comment - -Arena stores engine PVs not in variation format, but within both braces -and parentheses, before the score/depth info. This caused XBoard to -overlook the score/depth info, (frustrating, e.g., the eval graph), -while the PV would not be accessible for walking it as a variation. -The routine that extracts the score/depth from a comment now has -been made more clever, to recognize a leadin PV in the comment, and then -place it in front of the comment as variation (by moving the opening -brace to behind it). For some reason it does not work if the PV and -score/depth were separated by a newline, but this happens quite rarely. - -2010-11-30 18:23:12 +0100 H.G. Muller : -Allow line-straddling result comments - -Some GUIs (in particular Arena) do not have the decency to keep the -result comment on a single line. In this case the parser rules would not -recognize it, and treat it as a normal comment, plus an undetailed PGN -result. The rules are now fixed to allow linefeeds in the comment, and -between comment and PGN result. To correctly process the comment further -(e.g. in game-list lines) the linefeeds are replaced by spaces in the -back-end routines that do use the result comment. - -2010-11-30 12:22:32 +0100 H.G. Muller : -Write key bindings in XBoard menus - -Unfortunately tabs are not understood in menu texts, so fine-tuning -through spaces is necessary to get some sort of ragged alignment. - -2010-11-29 18:01:38 +0100 H.G. Muller : -Configure XBoard to use wood board texture by default - -The texture pixmaps are sought in /usr/share/games/xboard, with names -wood_l.pm and wood_d.xpm. I guess the " make install" should be adapted -to put them there. XBoard is resitent to non-existence of the files, -btw. It simply ignores the arguments in that case. - -2010-11-29 17:48:48 +0100 H.G. Muller : -Configure -inc as volatile option in XBoard - -XBoard users are not used to options being persistent, and thus have -many scripts assuming the timeIncrement is -1 when they don't specify it -on the command line, and want to specify -mps. But a persistent -inc of -0 fom a preious session would then force their -mps to zero, causing -big-time confusion. - -2010-11-29 17:36:33 +0100 H.G. Muller : -Make WinBoard clocks translation-proof - -With logos on, the splitting of the clock over two lines assumed the -lengths of the words "white" and "black" would always be 5. Used strlen. - -2010-11-29 14:57:00 +0100 H.G. Muller : -Improve drawing of highlight arrow - -A diagonal arrow sometimes had a notch in the shaft because of -independent rounding of the starting and ending point coordinates. -Furthermore the width of the shaft was unnecessary variable(as a -function of direction) because half the width was rounded and then used -twice. Now rounding of end-points is always done towards a fixed grid -of square centers, which keeps diagonals purely diagonal, and one side -of the shaft is drawn relative to the other side, after the -position of the latter has been rounded, so any rounding error affects -the shaft width only once. - -2010-11-29 10:25:50 +0100 H.G. Muller : -Alter descriptionof Analyze File menu item - -This menu item has been given a new function, so a new description was -needed. - -2010-11-29 10:15:39 +0100 H.G. Muller : -Add description of Game List Options in texi file - - -2010-11-29 09:58:00 +0100 H.G. Muller : -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. - -2010-11-29 09:06:14 +0100 H.G. Muller : -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. - -2010-11-29 09:04:53 +0100 H.G. Muller : -Add XBoard key bindings for Revert and Truncate - -Use Home key as accelerator for Revert, End for Truncate, as in WinBoard. - -2010-11-28 23:12:14 +0100 H.G. Muller : -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. - -2010-11-28 23:08:26 +0100 H.G. Muller : -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. - -2010-11-28 20:24:46 +0100 H.G. Muller : -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. - -2010-11-27 14:38:14 +0100 H.G. Muller : -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. - -2010-11-26 11:22:06 +0100 H.G. Muller : -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.) - -2010-11-26 11:12:58 +0100 H.G. Muller : -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.) - -2010-11-26 11:03:35 +0100 H.G. Muller : -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. - -2010-11-26 10:48:54 +0100 H.G. Muller : -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. - -2010-11-26 10:10:55 +0100 H.G. Muller : -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. - -2010-11-25 19:44:37 +0100 H.G. Muller : -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. - -2010-11-25 19:41:05 +0100 H.G. Muller : -Revive Analyze File menu item in WB - -We will keep this menu after all, becase it can be given a new meaning. - -2010-11-25 19:31:52 +0100 H.G. Muller : -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. - -2010-11-25 19:26:34 +0100 H.G. Muller : -Display error for wrong use of Machine Match - - -2010-11-24 13:30:08 +0100 H.G. Muller : -Reorganize XBoard menus - - -2010-11-24 11:02:19 +0100 H.G. Muller : -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). - -2010-11-20 20:20:27 -0800 Arun Persaud : -removed trailing whitespaces from NEWS - - -2010-11-20 20:19:30 -0800 Arun Persaud : -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. - -2010-11-20 18:24:19 -0800 Arun Persaud : -typo in date of developer release - -but will leave the tagged version as it is, since it's still a unique version number - -2010-11-20 18:11:01 -0800 Arun Persaud : -new developer release - - -2010-11-20 18:12:41 -0800 Arun Persaud : -added latest version of parser.c - - -2010-11-20 18:05:56 -0800 Arun Persaud : -updated Changelog, etc for developer release - - -2010-11-20 16:22:00 -0800 Arun Persaud : -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. - -2010-11-20 16:19:32 -0800 Arun Persaud : -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. - -2010-11-19 23:10:35 +0100 H.G. Muller : -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. - -2010-11-19 21:09:24 +0100 H.G. Muller : -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. - -2010-11-19 18:32:16 +0100 H.G. Muller : -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. - -2010-11-19 18:28:19 +0100 H.G. Muller : -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. - -2010-11-19 18:23:05 +0100 H.G. Muller : -Define moves for Dragon Horse outside Shogi - -Let it move like Bishop + Wazir + Dababba. - -2010-11-17 13:40:20 +0100 H.G. Muller : -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'. - -2010-11-17 13:38:00 +0100 H.G. Muller : -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. - -2010-11-16 12:40:31 +0100 H.G. Muller : -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_". - -2010-11-15 11:36:21 +0100 H.G. Muller : -Fix home-dir crash - -When confronted with a path name starting with ~ and not containing a / -XBoard would segfault. - -2010-11-14 21:45:55 +0100 H.G. Muller : -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. - -2010-11-15 18:15:40 -0800 Arun Persaud : -fixed buffer size for snprintf - - -2010-11-13 23:04:14 +0100 H.G. Muller : -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). - -2010-11-13 22:55:32 +0100 H.G. Muller : -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. - -2010-11-13 20:02:31 +0100 H.G. Muller : -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. - -2010-11-13 18:56:15 +0100 H.G. Muller : -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(). - -2010-11-13 18:42:27 +0100 H.G. Muller : -Add -variant seirawan to menu - - -2010-11-13 22:52:09 +0100 H.G. Muller : -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. - -2010-11-13 22:49:43 +0100 H.G. Muller : -Fix one-click bug - -Disambiguate was imagining captures, so an only capture by double -clicking your own piece did not always work. - -2010-11-13 20:08:32 +0100 H.G. Muller : -Fix mouse-driver buglet - -The highlights were not cleared on moves that went vertically off board. - -2010-11-12 17:17:41 +0100 H.G. Muller : -List some undocumented commands as compliant - -The engine->GUI commands setboard and setup are now always printed in -the debug file as well. - -2010-11-12 17:05:22 +0100 H.G. Muller : -List Hint with compliant commands - -This command was omitted, so that in some -engineDebugOutput modes it -would not appear in the debug file. - -2010-11-12 17:02:53 +0100 H.G. Muller : -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. - -2010-11-12 13:56:33 +0100 H.G. Muller : -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. - -2010-11-07 21:37:10 +0100 H.G. Muller : -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. - -2010-11-07 21:33:19 +0100 H.G. Muller : -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(). - -2010-11-01 19:40:26 +0100 H.G. Muller : -Newly lexed parser.c - - -2010-11-06 19:55:31 +0100 H.G. Muller : -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. - -2010-11-06 19:49:45 +0100 H.G. Muller : -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. - -2010-11-06 19:45:18 +0100 H.G. Muller : -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.) - -2010-11-06 19:42:16 +0100 H.G. Muller : -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. - -2010-11-06 19:34:53 +0100 H.G. Muller : -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). - -2010-11-06 14:52:12 +0100 H.G. Muller : -Fix some warnings - -Unused variables were removed from parser.l - -2010-11-06 14:43:54 +0100 H.G. Muller : -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. - -2010-11-06 21:48:47 +0100 H.G. Muller : -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. - -2010-11-06 14:19:56 +0100 H.G. Muller : -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. - -2010-11-02 13:06:58 +0100 H.G. Muller : -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. - -2010-11-01 19:26:19 +0100 H.G. Muller : -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. - -2010-11-01 19:23:43 +0100 H.G. Muller : -Remove validity test on promochar from parser - -The backend routines Disambiguate() and LegalityTest() will catch -invalid promotions, so no need to do it here. - -2010-10-31 23:37:06 +0100 H.G. Muller : -Add the actual size-33 Shogi bitmaps - -These were forgotten in the original commit that fixed the .rc file. - -2010-10-31 13:20:08 +0100 H.G. Muller : -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. - -2010-10-31 13:08:52 +0100 H.G. Muller : -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...) - -2010-11-08 22:57:56 +0100 H.G. Muller : -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. - -2010-11-08 23:03:13 +0100 H.G. Muller : -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. - -2010-10-31 13:16:01 +0100 H.G. Muller : -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. - -2010-10-29 22:54:18 +0200 H.G. Muller : -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 '+'. - -2010-10-28 17:51:34 +0200 H.G. Muller : -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. - -2010-10-28 13:53:51 +0200 H.G. Muller : -Suppress promotion popup if piece will explode - -In atomic, a Pawn capture to last rank is not really a promotion. -Fix choice to Queen. - -2010-10-28 18:42:25 +0200 H.G. Muller : -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. - -2010-10-27 20:04:01 +0200 H.G. Muller : -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. - -2010-10-27 19:40:22 +0200 H.G. Muller : -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. - -2010-10-27 19:33:44 +0200 H.G. Muller : -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. - -2010-10-27 19:25:56 +0200 H.G. Muller : -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. - -2010-10-27 19:18:41 +0200 H.G. Muller : -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). - -2010-10-27 12:11:02 +0200 H.G. Muller : -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. - -2010-10-22 20:30:06 +0200 H.G. Muller : -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. - -2010-10-22 20:25:06 +0200 H.G. Muller : -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. - -2010-10-18 19:50:09 +0200 H.G. Muller : -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? - -2010-10-18 19:46:33 +0200 H.G. Muller : -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. - -2010-10-11 21:06:41 +0200 H.G. Muller : -Disable some very verbose debug printing - -The internationalization seems debugged enough to do without them. - -2010-10-11 20:52:10 +0200 H.G. Muller : -Add option -variations to control variation-tree walking - -Just so that users can switch it off if the find it annoying. - -2010-10-11 21:01:00 +0200 H.G. Muller : -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. - -2010-10-11 14:07:02 +0200 H.G. Muller : -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. - -2010-10-10 21:26:11 +0200 H.G. Muller : -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. - -2010-10-10 21:23:09 +0200 H.G. Muller : -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. - -2010-10-10 21:15:06 +0200 H.G. Muller : -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. - -2010-10-10 21:07:18 +0200 H.G. Muller : -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. - -2010-10-10 21:03:29 +0200 H.G. Muller : -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. - -2010-10-08 11:47:34 +0200 H.G. Muller : -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). - -2010-10-13 23:05:05 -0700 Arun Persaud : -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. - -2010-10-07 20:35:26 -0700 Arun Persaud : -fixed some typos that were introduced during the sprintf->snprintf changes - - -2010-10-07 11:59:33 +0200 H.G. Muller : -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. - -2010-10-06 14:20:03 +0200 H.G. Muller : -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. - -2010-10-05 21:14:08 +0200 H.G. Muller : -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. - -2010-03-30 20:24:49 -0700 Arun Persaud : -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. - -2010-09-24 21:17:50 -0700 Arun Persaud : -added warning if icsLogon file couldn't be opened - - -2010-09-24 21:10:28 -0700 Arun Persaud : -security fix: replaced some strcat with strncat - -there is still more to do - -2010-09-19 20:55:01 -0700 Arun Persaud : -add option for silent builds - -this can be enabled for automake versions >1.11 by calling ./configure --enable-silent-rules. -It should still work for older automake versions too - -2010-09-19 13:16:40 -0700 Arun Persaud : -bugfix: missing array index - - -2010-09-19 12:19:44 -0700 Arun Persaud : -added new case for (Chessmove) 0 in common.h - -this cleans up a few more -Wall messages - -2010-09-17 21:47:22 -0700 Arun Persaud : -cleaned up -Wall warnings (apart from settings some parentheses) - -removed unsused variables, etc mostly everything from -Wall -Wno-parenthesis - -2010-09-17 20:36:54 -0700 Arun Persaud : -sizedefaults has 9 members, the last line of the array (NULL) only set 7. - - -2010-09-12 20:04:03 -0700 Arun Persaud : -security fix: replaced sprintf with snprintf - -replaced most sprintf with snprintf. There are still some left where for example a pointer is used and is allocated in the line before, which should be fine... and some others. - -2010-09-10 23:36:23 -0700 Arun Persaud : -security fix: replaced strcpy with safeStrCpy from backend.c - -see comment in backend.c on how to use safeStrCpy. This was already added by AS, but only used in 3 places. - -2010-10-04 11:50:38 +0200 H.G. Muller : -Enhance multi-session TC clock handling - -Some new TC types are introduced: Bronstein and free sessions. The -former is implemented by letting an exclamation point '!' in front of an -increment (in the -tc string) indicate that the increment is limited to -the time actually used on the previous move. The latter is an interval -of given duraton in which you can do any number of moves (even zero), -before the next session starts. This is needed for implementing Shogi -byoyomi-type TC, as a first session, followed by a session of fixed-time -per move. The latter can now be specified with the -tc argument as a -degenerate case of Bronstein, where the time on the clock is <= the -increment (so that it is never possible to think longer than the -increment). A TC of 5 min + 10 sec byoyomi can then be indicated as -300:10+!10. - -The sessions are now separated by ':' in stead of '+', and all times in -the TC string are converted to seconds first (in ParseTimeControl), so -the fullTCstring can now be directly used in a PGN tag. - -Note that this patch only addresses clock handling; the engine will not -be informed yet if the TC type or parameters change at the start of new -session! - -2010-10-04 09:32:18 +0200 H.G. Muller : -Remove promotion-piece encoding from ChessMove type - -The shizophrenic way to indcate promotion pieces in the XBoard code -(sometimes using a promoChar, at other times relying on moveType) was -cured by combining all promotion move types (such as WhitePromotionRook) -into a single one (WhitePromotion), and relying on promoChar to specify -the piece. This solves the problem of promoting to new piece types in -variants, which formerly also required addition of new move types. - -In Shogi the '+' character is now consistently used to indicate -promotions (and recognized in ApplyMove), rather than 'q' or -PieeToChar(BlackQueen), as the latter did not work in minivariants where -the Queen (representng the Lance) did not partcipate. - -2010-10-03 20:50:01 +0200 H.G. Muller : -Pass promoChar to SendMoveToICS - -SendMoveToICS was the only place where the promotion piece was derived -from moveType, rather than an explicity passed promoChar. - -2010-10-04 09:41:11 +0200 H.G. Muller : -Suppress spurious use of SAN castling in mini variants - -King moves from a central file to the king-side-castled position (1 -square away from the right corner) were intercepted and printed as O-O -in CoordsToAlgebraic. But on a 5x5 board (mini-Shogi!) this caught the -normal King move Kc1-d1 as well. The castling notation is now reserved -for King moves larger than one step. - -2010-10-04 08:21:19 +0200 H.G. Muller : -Make Shogi promotion zone board-size dependent - -In stead of using a fixed size of 3 ranks, we use BOARD_HEIGHT/3, which -would translate to 1 rank for mini-Shogi (5x5) and 2 ranks for Judgkin's -Shogi (6x6), which are indeed what these variants need. - -2010-10-03 19:58:00 +0200 H.G. Muller : -Make board-size overrule options volatile - -The options -boardWidth, -boardHeight and -holdingSize were legacies -from the day choosing a variant would not automatically set a board -size. As a result they are seldomly used anymore. The first real -application is mini-Shogi (on 5x5 board), and it turned out very -annoying if the 5x5 settings persisted to the next session, where you -almost certainly want to play another variant. - -2010-10-04 09:16:47 +0200 H.G. Muller : -Strip DOS line endings from parser.l - - -2010-09-16 18:58:37 +0200 H.G. Muller : -Extend mate test to drop games - -MateTest() in case of no legal moves now also looks if there are legal -drops that can resolve the check. This provides reliable mate testing in -Crazyhouse and Shogi, so these are now made subject to adjudications too. - -2010-09-16 18:48:29 +0200 H.G. Muller : -Extend legality testing to drop moves - -LegalityTest() can nowbe called with (internal-format) drop moves, and -delegates their testing to a new routine LegalDrop(). This routine -performs the 'no-pawn-on-back-rank' test that used to be in -UserMoveTest (which now calls LegalityTest also for drop moves). -The more complex Shogi case is also handled (except for Pawn mate -drops) in LegalDrop(). - -2010-09-16 18:25:21 +0200 H.G. Muller : -Revert splitting of UserMoveEvent - -This splitting into UserMoveTest and FinishMove was no longer needed, -now that the new mouse driver no longer calls UserMoveTest to figure out -if a move is a promotion, and XBoard and WinBoard are unified in this -respect. It was counter-productive, because UserMoveTest was not able to -change the fromX, fromY (call-by-value) parameters for passing them to -FinishMove, so it had to defer the conversion of drop moves to internal -format to the latter, while it did not belong there. (Because -DropMenuEvent already delivers the moves in internal format.) This -whole kludgy construction was therefore abandoned, by going back -to the original 4.2.7 calling scheme, where UserMoveEvent completely -pre-processes the move, and when it is valid, calls FinishMove directly. - -2010-09-16 18:02:40 +0200 H.G. Muller : -Fix silent bug in drop moves - -In ApplyMove() the piece on the from square was accessed and used before -we tested for drop moves. As drop moves have off-board from-squares this -led to out-of-bound array access, which apparently was usually harmless. - -2010-09-16 17:43:59 +0200 H.G. Muller : -Allow parsing of upper-case machine moves - -Dubious patch, as it caters to non-compliancy. Some variant engines are -very non-compliant, though. - -2010-09-16 17:38:35 +0200 H.G. Muller : -Prevent transmission of spurious promo char to other engine - -The parser now strps off spurious promotion characters. -New move types "White/BlackNonPromotion" had to be introduced for this, -to indicate NormalMoves that could have been a promotion, to make sure -the '=' suffix of Shogi deferred promotions survives. - -2010-09-16 20:44:37 -0700 Arun Persaud : -fixed internationalization for winboard - -in the original commit some files were forgotten. This should fix it. - -2010-08-29 21:07:12 +0200 H.G. Muller : -Fix JAWS bug saying side to move in ICS play - -This was done the wrong way around. - -2010-08-27 14:08:39 +0200 H.G. Muller : -Make WB run-time language switch possible from menu - -This is a rather involved patch that might not be worth it. It is -difficult, because translation of things that live forever is not easy -to invert (menus, the auxiliary windows). We hae to remember all -original, English texts there to be able to put them back,or -re-translate. Still does not fully work, although the menus and -temporary dialogs now are all OK. - -2010-08-27 14:35:46 +0200 H.G. Muller : -Update WB translation template - -The language.txt file now also contains all translatable strings from -the C source files, rather than jsut the resource. - -2010-08-27 14:14:51 +0200 H.G. Muller : -Update docs - -Add descriptions for machine-match menu support and enhanced book -control, nick-name options and language. - -2010-08-27 13:59:09 +0200 H.G. Muller : -Add some forgotten translation hooks - -The general-options, file-browse dialogs and the about box did not call -Translate() yet. Also translate contents of combo boxes. Some small bug -fixes. - -2010-08-27 13:28:33 +0200 H.G. Muller : -Do not translate game-end messages in PGN - -The messages themselves are not subjected to _(), but in stead their -displaying in DisplayMove is subjected to T_(). - -2010-08-23 13:23:22 +0200 H.G. Muller : -Internationalization for WinBoard - -A function Translate() was added, which uses a list of item dialogs, -reads their value, and replaces it by a translation (if available). It -also reads the window title and sets a translation. Calls to this -routine are added in the initialization code of every dialog callback. -In addition all translatable strings in the WnBoard front end are marked -by the gettext macro _(). Because WB is not gettexted yet, a hard -re-definition of this macro is added in each file using it, to the -string-translation routine T_() supplied in winboard.c. -Code to read the translation file, and translate the menu texts is added -in winboard.c. In backend.c the meaning of the gettet macros is -redefined for the WIN32 case. - -2010-08-23 13:07:40 +0200 H.G. Muller : -Make the ID of all WB dialog items unique - -Mnany static dialog texts did share the ID -1 (IDC_STATIC). But to -replace tet at run-time for translation purposes, they need to be -addressed individually. So they were given new IDs, with symbols defined -for those. - -2010-08-23 12:48:07 +0200 H.G. Muller : -Mark XBoard result messages for internationalization - -The GNU gettext macro _() is used with the game-end messages. This might -be controversial, as they will appear in the PGN as well. But only as a -comment. We can always decide not to supply a translation. - -2010-08-23 12:43:27 +0200 H.G. Muller : -Do not exit after match when match started from menu - -The codelooks weird, but matchMode == 2 in this case. We then use -DisplayNote() to report the match result. - -2010-08-23 12:39:07 +0200 H.G. Muller : -Trivial-draws recognition improved in Xiangqi - -Now based on a routine "SufficientDefence". If both have it, it is draw. - -2010-08-20 17:46:45 +0200 H.G. Muller : -Update .dev files - -The relocation of parser.c and the addition of history.c was not yet -incorporated in the devcpp proect files. - -2010-08-19 13:45:04 +0200 H.G. Muller : -Fix some MSVC compile errors - -Some statements has moved up stream of declaratons, which is an error -that gcc is forgiving about, but where MSVC is strict. - -2010-08-14 14:01:44 +0200 H.G. Muller : -Improved patch for expansion of WB settings-file name - -The expansion of environment variables now allows multiple environment -variables in the path name. Tested on %HOMEDRIVE%%HOMEPATH%\winboard.ini -and %APPDATA%\winboard.ini. - -2010-08-07 16:53:50 +0200 H.G. Muller : -Add -colorNickNames option - -This option allows non-standard designation of side to move in FENs. -(Useful for Xiangqi, where white is indicated often as r(ed), and Shogi, -where white is s(ente) or b(lack), and black is g(ote) or w(hite).) -Can also be used for FENs in a local language. A match of theinput -character with the nick name translates it to the standard; this means -the standard will continue to be recognized, unless it was defined as a -nick name. - -2010-08-07 16:39:16 +0200 H.G. Muller : -Tricked by the grossnes - -Some WB menu items were referenced by a hard number. As items had been -added over the years, the wrong menu items were grayed. In particular -the Options -> Adjudication menu was grayed out, in -ncp mode, where -this was intended for the Sounds dialog. This accidentally proved -useful, until we started to apply adjudictions also to the Human moves. -Then it was suddenly undesirable, and a small mystery why it happened at -all, when I tried to change it. The numbers are now corrected to the new -locatons of the items in the menus. - -2010-08-07 16:35:23 +0200 H.G. Muller : -Allow match to be started from WB menu - -A menu item Machine Match was added in the Mode menu to switch to -matchMode. A persistent option /defaultMatchGames determines the number -of games. A control was added to the Options -> Common Engine dialog to -set this option. - -2010-08-07 16:26:35 +0200 H.G. Muller : -Add some book-control options - -Options /bookDepth and /bookVariation have been added to control the use -of the GUI book. In WinBoard the Optons -> Common Engine dialog now -contains fields to set them. - -2010-08-07 00:15:57 -0700 Arun Persaud : -new developer release - - -2010-08-06 11:18:34 +0200 H.G. Muller : -Repair exit-popup deadlock patch - -Relocating the exit popup call had made it lose access to the message it -should print, because it was declared only in an inner code block, by -the same name: buf[]. Deleting the inner declaration fixes it. - -2010-08-04 11:00:28 +0200 H.G. Muller : -Fix erors when compiling with --disable-zippy - -The file args.h contained a codeblock in #ifdef ZIPPY, in stead of -fields. - -2010-08-01 13:27:23 +0200 H.G. Muller : -Fix zippy handling of draw offers from ICS - -The patch by DM to fix the problem introduced by the coloration of -zippy-matched commands (namely that the coloration code beat the zippy -draw recognition to it, and ate the draw offer away) was only targeting -ICC. The new fix should work on any ICS (by using the same pattern in -zippy as in the colorization code). - -2010-08-01 13:15:27 +0200 H.G. Muller : -Fix regression in colorization of zippy-matched commands - -The patch by Daniel Mehrman from 4.2.pre8 was not properly merged, so -that in XBoard no coloration would take place of ICS commands that were -matched by zippy. (It was using &i as input pointer, rather than &backup. -The XBoard-specific code now has been deleted completely, to remove a -seemingly needless dependence on _WIN32_ of the back-end. Both WB and XB -now use the XBoard method, to only match zippy commands when logged in. - -2010-07-31 22:48:45 +0200 H.G. Muller : -Suggest default file name in browser dialog - -The argument 'def' to FileNamePopUp() was not passed through to the new -file-browser routine, which got NULL in stead, and thus started with an -empty input field. - -2010-07-30 23:28:57 +0200 H.G. Muller : -Define /firstUCI and /secondUCI as synonyms for /fUCI, /sUCI - -Because the %s expansion of WB options in the /fcp and /scp lines only -works for options that contain 'first' or 'second', and /fUCI thus did -not work, PSWBTM had to rely on the cumbersome /firstIsUCI=true to -install UCI engines. (The latter option should be deprecated really; -the UCI-ness of the engines is a volatile option, so it makes no sense -to supply a way to set them both to false or true. One only needs to be -able to set it to the non-default state.) - -2010-07-30 23:21:50 +0200 H.G. Muller : -Add string option /pieceNickNames - -This (volatile) option allows definition of alternate letters for the -pieces, which will be recognized next to the standard symbols as given -in the /pieceToCharTable on input. (Output always uses the standard.) -This can be useful for reading PGN from another language, or -non-compliant FENs (e.g. using B and N for E and H in Xiangqi). - The format of the argument is the same as for /pieceToCharTable. -Because the nickNames are consulted before the standard table, it is -possible to redefine a standard name as a nick for another piece. - -2010-07-30 23:10:42 +0200 H.G. Muller : -Fix deadlock in match-result display - -At the end of a match, GameEnds() was recursively calling itself, -through DisplayFatalError() and ExitEvent(), and the latter was then -delaying until the calling GameEnds() terminated. (Which it would of -course never do before ExitEvent returned; fortunately there was a tim -limit to this delay, but in XBoard it was 10 sec in stead of 10 msec.) - Now the calling of DisplayFatalError() (to show the result popup) is -delayed until after GameEnds completes (and resets the anti-recursion -flag 'endingGame'), so that it is simply executed a second time, unaware -of the earlier call. But this second time it does not do anything, -because the gameMode ws set to EndOfGame the first time, and the writing -of the PGN is blocked by the checksum being still the same. - -2010-07-12 11:10:17 +0200 H.G. Muller : -Fix WinBoard game-list title - -Number of displayed games and WDL stats were always appended to the -existing title, leading to an ever-growing title in the game-list -window. Now the old actual title is ignored, and the starts is appended -to the original title "Game List". (In the future we could use the -filename here?) - -In addition, the title was not updated when re-opening the game-list -window, while the stats could change if filtering was active when the -window was closed. (In that case the filter is cleared on re-opening, so -the number of displayed games changes.) Now a title-update (after -recalculating the stats) is done every time the game-list window is -opened. - -2010-07-11 11:06:27 +0200 H.G. Muller : -Refactoring of material-draws adjudication code - -Insufficient mating material is now determined per side individually, by -testing for MatingPotential of each side. If both lack mating potential -the game is adjudicated as draw (if the -materialDraws option is set). - -This way MatingPotential() can later also be used to correct losses by -forfeit to draws (which currently is only done when the opponent has a -bare King). - -The accuracy of this type of adjudication in Xiangqi has been highly -improved. - -2010-07-11 10:54:59 +0200 H.G. Muller : -Fix bug in sending cores command to engine - -The cores command was alwas sent to the engine(s) when the user changed -it through the menu, even when the engine had sent feature smp=0 (which -is default anyway). NewSettingEvent() was patched to send the new -setting conditionally, based on the engine properties as recorded in -ChessProgramStates first, second; In this particular case it now -consults cps->maxCores. (Note the code for testing the second engine -contains some dirty pointer arithmetic.) - -2010-07-11 10:42:00 +0200 H.G. Muller : -Fix oneClickMove bug - -When checking for unique captures, no attention was payed to the option -setting, so the capture was also made when the option was off. - -2010-07-11 10:39:28 +0200 H.G. Muller : -Remove duplicate testing for cores feature - -The testing for this BooleanFeature occurred twice. - -2010-07-11 10:35:13 +0200 H.G. Muller : -Remove misspelled prototype - -NewSettingEvent occurred, next to the correct one, in misspelled form. - -2010-07-05 10:00:01 +0200 H.G. Muller : -Fix parsing of SAN shogi promotions - -A missing promotion character defaults to promotion in the move type, -but the promotion character was not set when this happened in variant -shogi. And it is especially important there, as the promotion character -'+' will always be missing, as the parser will take it to be a 'check' -symbol, and strip it from the move. - -2010-07-05 09:55:14 +0200 H.G. Muller : -Fix variant switch on PGN loading - -When the PGN specified an essentially different variant, the -piece bitmaps were not properly adapted, because the switch was done by -calling InitPosition(), rather than Reset(). (The latter would destroy -the PGN tags info.) We now added an explicit call to ResetFrontEnd(), -(which is normally done from Reset()). - -2010-07-05 09:51:53 +0200 H.G. Muller : -Adjudicate Xiangqi material draws with Advisor-less Cannons - -Used the Queen counter for counting Cannons. Note that material draws -with stale Pawns (i.e. on the back rank) are not yet adjudicated. - -2010-07-05 09:34:21 +0200 H.G. Muller : -Remove font settings from master settings file - -xboard.conf should not contain general font settings (not specific to -one board size) with specified point size. In fact it should not even -specify sizable fonts, as the new system would make specification of a -general font overrule the size-specific settings in the .xboardrc file, -so the persistence of fonts would be completely broken. - -2010-06-30 10:52:27 +0200 H.G. Muller : -Cut board squares out of texture bitmap more cleverly - -When the bitmap is larger than the entire board, the squares are now cut -out of the center of the virtual squares from subdividing the bitmap, so -that they stay centered on the grid of a Xiangqi board bitmap. If the -board size exceeds that of the bitmap, the old algorithm is still used, -as the centering would make the edge squares exceed the bitmap, and -cause a black rim around the board. - -2010-06-30 10:49:12 +0200 H.G. Muller : -Allow -flipBlack to work with font-based piece rendering - -In addition the font-based pieces will also be flipped vertically in -flipView for variant shogi when -flipBlack is off. - -2010-06-30 10:46:43 +0200 H.G. Muller : -Allow font-based piece rendering in board sizes below petite - -At least for variants that use unorthodox pieces, so that switching back -to using bitmaps is not really an option anyway. - -2010-06-30 10:41:25 +0200 H.G. Muller : -Ignore checks in 50-move count for Xiangqi - -Both checks and evasions are discounted; this is only done after the -naive counting exceeds the maximum, so during most of the game it causes -no CPU load. - -2010-06-05 14:38:47 -0700 Arun Persaud : -removed some garbage from configure.ac that got added a while ago - - -2010-05-25 21:20:27 -0400 Clint Adams : -Remove unnecessary double equals from configure.ac. - - -2010-05-28 11:07:06 +0200 H.G. Muller : -Fix e.p. bug in xiangqi with -serverMoves option - -Sideway Pawn moves were written as e.p. captures in the file with moves, -which led to disappearence of pieces in the viewer. - -2010-05-28 11:05:00 +0200 H.G. Muller : -Repair score printing with -serverMoves option - -A previous patch had moved MakeMove to before the update of pvInfoList, -so that the score/depth info would not appear in the file with moves. - -2010-05-28 11:02:54 +0200 H.G. Muller : -Repair animate dragging - -The previous patch had left a stray semicolon in the mouse handler. - -2010-05-10 10:32:19 +0200 H.G. Muller : -Fix game end during dragging - -The stale-first-click fix interfered with proper handling of a piece -being dragged when a game suddenly ended (because of opponent resign, -or caling the flag), because up-clicks when the from-square was reset -were completely ignored. Now such an 'unmatched' upclick calls -DragPieceEnd() and redraws the board. - -2010-05-10 10:09:36 +0200 H.G. Muller : -Pop down old tags on loadng new game in WinBoard - -ResetFrontEnd(), called from Reset(), did not do this in WinBoard -(unlike XBoard), so that the tags from the previous game were left on -display when -autoDisplayTags was off. - -2010-05-09 22:15:27 +0200 H.G. Muller : -Reverse mousewheel action - -Apparently WinBoard was stepping in the opposite direction through the -game in reaction to the mousewheel as every other GUI in existence. - -2010-05-09 22:07:30 +0200 H.G. Muller : -Fix bug in sending "usermove" when forcing book moves - -The keyword "usermove" was copied to the buffer, but not sent before it -was overwritten by the actual book move. - -2010-05-06 17:23:24 +0200 H.G. Muller : -Fix engine stall on perpetual-check evasion - -The adjudication code had already put the engine in force mode after -postponing the actual adjudication to the next move. Now first determine -if we want to adjudicate now, and with which result, before stopping the -engine and ending the game. - -2010-05-06 16:37:04 +0200 H.G. Muller : -Let move parser return ImpossibleMove for off-board moves - -It used to return 0, which interfered with buiding a game list. This -broke reading of multi-game PGN files containing games in a variant with -a board size larger than that of the currenty active variant. - -2010-04-06 15:05:10 +0200 H.G. Muller : -Alter XBoard key bindings to mimic WinBoard - -A lot of new bindings were added, and four menuProcs had to be registered -to be able to add bindings to them. The use of the control key as -temporary take-back for the last move conflicted with the use of Ctrl -keystrokes, and this function was migrated to '.'. The iconify function -had no shortcut in WinBoard, but to get rid of letter bindings it was -migrated to '-'. - -2010-04-05 20:45:45 +0200 H.G. Muller : -Update README file - - -2010-04-03 14:00:40 +0200 H.G. Muller : -Fix typos in html help file - - -2010-04-01 15:22:41 +0200 H.G. Muller : -Fix JAWS piece drop cursor, and streamline some sentences - -The cursor square was reset to a1 after every use of the piece menu, -which was very inconvenient. Some of the spoken sentences have been -improved; the square is read before the piece now, when using the arrow -keys on the board. - -2010-03-31 22:31:44 +0200 H.G. Muller : -Allow escape sequences in telluser(error) messages - -The routine EscapeExpand was moved to backend.c, and applied to the -message received from the engine. - -2010-03-31 21:29:39 +0200 H.G. Muller : -Allow lower-case promochar in moves of type h8=Q - -Updated the parser rules. Other move formats already allowed this. - -2010-03-31 21:36:14 +0200 H.G. Muller : -Fix Alt+M JAWS command in Two-Machines mode - -The command refused to read the ast move because it contained thinking -output of the other engine. Let it pay attention to evenIfDuplicate. - -2010-03-29 09:57:48 +0200 H.G. Muller : -Fix rep-draw recognition - -The refactoring had broken the rep-draw recognition, by adding and extra -condition in a conditional with side effects. The testing of this extra -condition is now moved to after the side effect. - -2010-03-28 12:32:07 +0200 H.G. Muller : -Allow any %ENVIRONMENTVAR% in WB settings file name rather than ~ - -Only a single variable at the beginning of the file name is recognized, -and the matching is not fool proof (it matches across backslashes). - -2010-03-28 11:24:44 +0200 H.G. Muller : -Fix info lines being used as normal thinking output - -The new standard of using thinking output with time = nodes = score = 0 -as info messages for printing in the Engine-Output window was not -understood everywhere, and led to such info lines being used for -autoKibitzing and PGN annotation. The programStats are now only updated -from thinking output received from an engine when it is not an info line. - -2010-03-27 11:54:41 -0700 Arun Persaud : -new developer release - - -2010-03-26 21:16:52 +0100 H.G. Muller : -Suppress background observe for boards with own game number - -This is really a work-around for an ICS bug. The Variant-ICS sent the -initial board of a game in a move list with relation = 0, which means -'observed'. So XBoard was thinking it was observing its own game, and -switched to dual board. It seems harmless to suppress such a switch for -all boards of your own game, however, which is now done. - -2010-03-26 21:12:19 +0100 H.G. Muller : -Fix crash on switching to ICS xiangqi game - -The oldBoard was a local variable, and only squares of the old board -were initialized. This led to a crash if the copied board was enlarged, -and then displayed. The variable is now declared static, so the -uninitialized squares contain harmless zeros. - -2010-03-26 18:32:36 +0100 H.G. Muller : -Let Chat Boxes pop up above console, rather than on top of it - -Use EnsureOnScreen() to have them overlap if there was no room. - -2010-03-26 18:26:04 +0100 H.G. Muller : -Fix disabling of Chat Box navigation buttons - -The buttons for non-open boxes were enabed, rather than disabled. - -2010-03-26 18:17:44 +0100 H.G. Muller : -Prevent closing chat box - -Let it in stead switch focus back to the console window. - -2010-03-26 15:28:54 +0100 H.G. Muller : -Let WinBoard recognize ~ in settings file name as HOMEPATH - -Fetch the appropriate environment variable to build the mathname in -MySearchPath() whenever the file name starts with "~\". - -2010-03-26 13:59:28 +0100 H.G. Muller : -Change name of Global Settings menu item to Common Engine Settings - -The old name confused ICS users, as this is an engine-only dialog. - -2010-03-26 13:58:46 +0100 H.G. Muller : -Update WinBoard RTF docs - - -2010-03-26 13:57:59 +0100 H.G. Muller : -Update WinBoard html help - - -2010-03-24 18:00:08 +0100 H.G. Muller : -Allow adjustment of clocks in any mode with shift+click - -In practice changing to edit-game mode during a game was very -cumbersome. In WinBoard shift+click is now offered as an alternative. -Make sure a right-click in the clock area is not also counted for other -purposes. - -2010-03-24 17:21:47 +0100 H.G. Muller : -Allow loading of PGN variations in XBoard - -Right-clicking variation comments in the comment-window was implemented -through a translation. The right button is now bound to routines that -set both the end and start of the selection, as setting a new start does -not seem to work if the previous select-start was not completed by a -select-end or extend-end. Finally the main handler uses the selection -cursors to know what was clicked. - -2010-03-24 17:16:59 +0100 H.G. Muller : -Update XBoard docs - -Added a descripton of the new ICS options (seek graph, back-ground -observe) and menus (Upload) to the texi file. Also added a description -of the variation (Annotate menu item and PGN variation comments) and PV -walking (clicking engine-output). Describe the -shuffleOpenings option. - -2010-03-24 13:30:59 +0100 H.G. Muller : -Paint highlights on dual board (WB) - -The highlight info is hidden in the partner board to pass it to the -front-end. - -2010-03-24 13:14:54 +0100 H.G. Muller : -Fix handling username change during game - -The title bar and gameInfo (going into the PGN) were not adapted when -the username was changed through the menu, so that the change became -only effective on the next game. Requires SetGameInfo to be called from -the front-end, and thus a prototype for it in backend.c. - -2010-03-24 11:04:00 +0100 H.G. Muller : -Fix window-position upset on failing engine start in WinBoard - -The main window was only positoned according to the settings-file data -after the engine was started up from InitBackend2(), so that if the -latter gave a fatal error, and Save Settings on Exit was on, a wrong -position for the main window would be saved. The call to InitBackend2() -is now moved until after setting the main-window position. - -2010-03-23 23:22:46 +0100 H.G. Muller : -Display PV from Engine-Output window (XBoard) - -Translations are added to bind button 3 to the PV walk for the memo -widgets, and the corresponding handlers are ported from wengineoutput.c. - -2010-03-10 18:54:28 +0100 H.G. Muller : -Set keyboard focus at startup to board window - -This makes XBoard sensitive to the keybindings also when the cursor is -outside the board window. This focus seems to persist indefinitely: each -time the board window gets selected, the key bindings become activem -wherever the mouse pointer is. Downside: the mouse pointer is no longer -an arrow outside the board window, but becomes a text-insert tool there. - -2010-02-27 20:49:21 -0800 Arun Persaud : -added logo files for xboard - -logos are installed in the hicolor theme [1] using $datadir as the basedir. -Added both png and svg logo. - -[1] http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html - -2010-02-27 17:36:10 +0100 H.G. Muller : -Remake programVersion string after receiving engine features - -The engine could have sent a more accurate version of its own name -than the one derived from the exe filename in a myname feature, and we -better use that in the programVersion string, which will be sent as -interface name to the ICS. - -2010-02-25 19:22:00 -0800 Arun Persaud : -Revert "Repair settings-file name" - -This reverts commit a02042ef83ce1f3632f0cf3e0a2a4ce9a3ac5d85. - -2010-02-25 20:32:23 +0100 H.G. Muller : -Add -autokibitz checkbox to UCI-options menu dialog - - -2010-02-25 20:29:45 +0100 H.G. Muller : -Also capture (numeric) whispers of players for -autoKibitz - - -2010-02-25 20:25:32 +0100 H.G. Muller : -Add kibitzes and c-shouts Chat Box - -A box dedicated to c-shouts will snatch any c-shout before it is -diverted to a normal shouts box. The kibitzes box can capture the -left-overs of -autoKibitz, if the latter is active. - -2010-02-25 15:45:16 +0100 H.G. Muller : -Mark non-compliant lines of engine in debug file - -The option -engineDebugOutput is extended to accept value 3 for printing -a cear indication of non-compliancy in the debug file. - -2010-02-25 12:02:58 +0100 H.G. Muller : -Redraw second board on expose events - -The -dualBoard option now does refresh the second board after another -window uncovers it. To acheive this, some data structures remembering -what is displayed had to be duplicated. (lastBoard and damage for XB, -lastReq, lastDrawn, lastReqValid and lastDrawnValid for WB.) -WinBoard now uses clipping also for second board. This required the -clips for the destination to be translated horizontally! - -2010-02-25 15:13:00 +0100 H.G. Muller : -Print seconds with 2 digits in backgroundObserve status line - - -2010-02-24 17:01:23 +0100 H.G. Muller : -Do not recognize non-ICS variants from PGN event tag - -These variants were introduced after supporting the variant tag, so if -the variant tag is missing, their recognition from the event tag will be -a false match. (Mainly to prevent events with 'super' in the name being -recognized as Superchess.) - -2010-02-23 13:52:51 +0100 H.G. Muller : -Fix display of uninitialized boards in background observe - -A variable partnerBoardValid is cleared on starting our own game, and -set when a board from the background game comes in during it. At the end -of our own game, a valid partner board now is put in the display. - -2010-02-23 13:46:25 +0100 H.G. Muller : -Add option Display Logo in WB general-options menu - -Changing the option requires InitDrawingSizes to be called for -re-formatting the board window. Switching it off requires clearing of -the cps->programLogo fields to take effect immediately. Switching it on -only takes effect the next session, as we will need some refactoring to -redo the figuring out what logos to display. - -2010-02-22 12:02:59 +0100 H.G. Muller : -Group Chat Boxes with console in stead of board window - -They now open and close with the console, which seems more natural, and -prevents the console from covering them. - -2010-02-22 11:50:59 +0100 H.G. Muller : -Put new options in WB ICS-options dialog - -The Seek-Graph, background-observe and Chat-Box options are added to the -ICS options dialog. They only control the appData settings, there are no -special actions yet on switching the settings. - -2010-02-22 11:46:33 +0100 H.G. Muller : -Create space in WinBoard ICS-options dialog - - -2010-02-20 12:42:09 +0100 H.G. Muller : -Use side-by-side boards to display background game - -A game observed in the background (i.e. if -backgroundObserve true) will -be displayed right of the normal board in the same window if the new -(persistent) Boolean option -dualBoard is also set. -Very flakey hack, especially in XBoard, where clocks and messsage -field all get the wrong width (and resist adjustment in the strangest -ways). The clocks of the partner game are not yet displayed, and -disaster happens when the background and foreground games do not have -the same board format. - -2010-02-23 14:57:01 +0100 H.G. Muller : -Repair background-observe patch - -Apparently a commit was lost that I collapsed with 3018a6 while the -latter was already pushed to savannah. Here I recreated this commit from -a diff between the respective commits in the savannah & nubati gits. - -2010-01-31 11:07:33 +0100 H.G. Muller : -Repair settings-file name - -The default name is put back to /etc/xboard/xboard.conf, so that XBoard -can again find its settings file. "make install" will still install it -in the wrong place. - -2010-02-21 18:43:59 -0800 Arun Persaud : -new developer release - - -2010-02-21 19:45:58 -0800 Arun Persaud : -fixed compiler warning for file-browser code - -missing "void"s in the function declaration and missing returns showed up when trying to build on the opensuse build server. fixed now. - -2010-02-21 23:09:24 +0100 H.G. Muller : -Put newly opened Chat Box on top - -Dialogs always pop up in front, so set the onTop variable that prevents -highighting the button to navigate to it from other Chat Boxes -to reflect that a newly opened Chat Box is in view. - -2010-02-21 18:55:03 +0100 H.G. Muller : -Fix copying of kibitzed info in Engine-Output window - -Make sure all lines end with "\r\n" to not lose line breaks on -copy-paste from the memo. (XBoard would strip those again.) - -2010-02-21 18:25:45 +0100 H.G. Muller : -Allow walking a kibitzed PV - -If no tabs are found in te 'thinking output' we assume it is a captured -kibitz message, and look for "PV=" to locate the start of a PV in it. -Also try to include any continuation lines below the selected line. - -2010-02-21 17:45:37 +0100 H.G. Muller : -Insert autoKibitz continuation lines at end of line - -In the engine-output window lines that start with the ICS continuation -sequence "\ " are inserted behind the line they belong to, in stead of -at the top. This required keeping thrack of the length of the currently -active line in OutputKibitz(). - -2010-02-20 15:39:29 +0100 H.G. Muller : -Don't disturb background observe when receiving new piece - -When new holdings are sent when the background game is displayed, we now -ignore this, as presumably we are peeking at our partners game, and thus -should be well aware of what is captured there. - -2010-02-19 21:52:06 +0100 H.G. Muller : -Newly lexed parser in XBoard directory - - -2010-02-19 11:18:21 +0100 H.G. Muller : -Let yy_text determine progress of PV parsing - -The parsed unit yy_text was not available after ParseOneMove(), because -the buffer switch in yylexstr() apparently destroys it. To solve that, -yylexstr() now is equiped with an extra buffer argument, where it copies -yy_text before the switch, so the caller, ParsePV(), can see what was -parsed in yy_textstr. This is used to update the PV pointer, but also to -save any parsed comments (when ParsePV is used for parsing a PGN variation). - -2010-02-18 17:42:48 +0100 H.G. Muller : -Support playing through PGN variation comments - -Right-clicking a variation line in the comment dialog will shelve the -current variation, and parse the comment to replace it. This uses -ParsePV() in an alternative way, for which the latter had to be -enhanced: it was made resistent to move numbers and comments inside -the PV. It now has an argument to indicate if such comments should be -stored with the moves. The Comment Popup is closed on revert, to -make sure no comments to moves that are destroyed, containing -variations on a non-valid line, can keep hanging around. - -2010-02-18 16:05:35 +0100 H.G. Muller : -Add Annotate item in Step menu - -This does the same as Revert, except that it adds the destroyed -variation as comment to the original movem in PGN variation format. -RevertEvent now has an argument to indicate if it should add the -comment, or not. Comments in the abandoned variation are included in the -varriation command to the main line. (The exact layout of the variation -comment that results leaves still to be desired.) - -2010-02-15 19:07:12 +0100 H.G. Muller : -Add option -shuffleOpenings - -This volatile option is added just to make the existing variable -available from the command line, not only from the menus. - -2010-02-19 11:48:49 +0100 H.G. Muller : -Let the sounds sound on receiving a message in a Chat Box - -Use Colorize() to the applicable color to trigger the sound, and then -restore the original color as 'continuation', to do it silently. - -2010-02-10 10:55:51 +0100 H.G. Muller : -Allow WB Chat Box to be dedicated to shouts and 'it' - -By putting 'shouts' in the handle field, a chat window will capture all -shouts and c-shouts, and send messages typed into it as shouts. -The bracketing of the shouter name now indicates the type of shout. -The handle for WHISPER Chat Boxes has been changed to 'whispers', to -make it easier to pop them up by clicking the console. - -2010-02-16 22:34:23 +0100 H.G. Muller : -Add -chatBoxes option to open Chat Boxes at startup - -This string option contains a semicolon-separated list of handles for -which Chat Boxes should be opened at startup. The value saved in the ini -file is the value that was read, not the actual chat boxes that were -open at the time of saving. - -2010-02-16 19:44:46 +0100 H.G. Muller : -Make Chat Windows pseudo-tabbed - -By adding buttons in every Chat Box to navigate directly to every other -Chat Box, a stacked set of Chat Windows behaves like a single tabbed -window, but can still be unstacked. The buttons turn grey to warn that -new text appeared in hidden boxes (i.e. not the one last brought to top). - -2010-02-19 21:46:05 +0100 H.G. Muller : -Allow arrow keys in WB Chat Box to access command history - -The history is shared between al boxes and the ICS console. - -2010-02-12 22:35:11 +0100 H.G. Muller : -Make WB Chat Boxes wrap and handle URLs - -Cloned the code for the console text field to hande URL. (Initialization -to recogize the link, and notifiction to open it when clicked.) -Removed the ES_AUTOHSCROLL style from the RichEdit in the resource. - -2010-02-10 10:58:29 +0100 H.G. Muller : -Fix copying of WB Chat Window contents - -All line breks were lost on copy-pasting the contents of a chat window. -Adding CR to each outputted line in the front-end (wchat.c) solves this. -(Tell messages sent to a handle (which are not echoed by the ICS, and -thus have to copied to the chat box directly) also need CR!) - -2010-02-19 22:34:30 +0100 H.G. Muller : -Add upload of game to ICS for examining - -New item "Upload to Examin" in Action menu, calls UploadGameEvent(). -Use SAN moves to upload game to ICS, rather than long algebraic -(The ICS did not understand long-algebraic promotion moves) -Use bsetup within examine to set position onFICS, and also variant. -Castling rights do not work yet for FRC. Totally different set of -commands are needed on FICS and ICC. - FICS does not understand w23 or wild/23, but needs 'crazyhouse' in the -besetup command that specifies the variant. XBoard variant names are -used, except for fischerandom, which is 'fr'. Things like nocastle will -probably still not work. - -2010-02-18 17:41:10 +0100 H.G. Muller : -Handle display of PV that starts with other move than played - -Insert the retraction of the played move, without premove highlighting. - -2010-02-16 19:36:18 +0100 H.G. Muller : -Bugfix smart capture - -Disambiguate was changed to make sure that for ambiguous moves, a -capture would always prevail in the closure, rather than the last move -that happened to be generated. Before, double-clicking a piece would -sometimes plsy a non-capture. - -2010-02-13 15:34:04 +0100 H.G. Muller : -Fix XB crash on giving keyboard focus to non-text widget - -In the Engine-Settings dialog SetFocus() could be called for non-text -widgets, and this made XawTextSetInsertionPoint() croak. Setting the -insertion point to the end in SetFocus() was a bad ide anyway, as it -interfered with copying from the engine-output window, which would -uncontrollably scroll on getting focus. It is solved now by setting the -insertion point already on creation of the text widgets. - -2010-02-19 22:32:35 +0100 H.G. Muller : -Seek-Graph bugfix: disappearing output in ICS console - -Suppression of output to the cosole was handled fundamentally wrong: it -was not enough to set next_out to after the unit that should be -suppressed, as there can be a backlog in printing of previous units that -came in the same packet. So this has to be flushed first, or it will be -lost. -autoKibitz probably got away with that, because it comes in a -separate packet. But seek ads are often suffixed to other output, and -then that output disappeared! Now we flush everywhere before suppressing. -We now totally rely on the prompt to restart the printing, so that -acknowledgements following the echo of the sent message are also -suppressed. Also suppress LF before diverted chat messages. - Also fixed is the 'mamer bug' in Chat Boxes, due to false parsing of -a "* (*): " pattern in tell messages, because of a missing continue. - -2010-02-12 18:08:29 +0100 H.G. Muller : -Pop up ICS text menu with default item under mouse pointer - -The menu popup is migrated to the down-click (was up-click), so the -up-click can select the item. Some trickery is needed to fool the menu -into thinking that the mouse moved, so that a moveless up-down click in -the ICS text field selects the default item (the upper-right one). -Also allow dummy item in ICS text menu: The command "none" in the ICS -text menu will now be treated as a grayed-out (disabled) entry, so it -can be defined in the position underthe mouse pointer to prevent the -up-click from doing anything, while keeping the menu open. Recommended -for use with an entry of spaces. - -2010-02-10 14:42:49 +0100 H.G. Muller : -Allow ICS context menu to pop up a Chat Box on clicking handle - -A command "chat" defined in the WinBoard icsMenu string will cause -ChatPopUp() to be called when it is clicked, with the clicked handle -(name) in the ChatPartner field, and focus on the input field. -ChatPopUp() had to get a parameter (the handle) to make this possible. -If that parameter is NULL (as when it is called from the Mode menu), -focus will still start on the (empty) ChatPartner field of the box. - -2010-02-10 10:50:11 +0100 H.G. Muller : -Fix right-edge spillover of Seek-Graph dots in WinBoard - -Rescale the X-axis to allow margin for dot size and color offset. - -2010-01-30 11:05:52 +0100 H.G. Muller : -Interface XBoard to GhostView file-browser dialog - -Note: The Ghostview dialog was using some deprecated variables for error -printing, and conditionally used getwd() on some systems that presumably -do not have getcwd(), but it did not assess the latter properly. - -2010-02-09 14:38:09 +0100 H.G. Muller : -Allow recalling history in ICS input box with arrow keys - -By adding translations for the Up and Down keys, and stealing some code -from winboard.c. Still needs some refactoring to move the duplicate code -to the back-end. - -2010-02-09 14:34:33 +0100 H.G. Muller : -Start insertion point at end of text edits in XB dialogs - -The function SetFocus now uses XawTextSetInsertionPoint to position the -end of the string it aready contains, rather than at the beginning. - -2010-02-08 17:55:44 +0100 H.G. Muller : -Capture holdings of background observed game - - -2010-02-08 11:57:57 +0100 H.G. Muller : -Match handles with multiple titles for channel Chat Boxes - -Only handles with at most one suffixed 'title', such as (U), (C), (IM) -or (TD), followed by the parenthesized channel number, were recognized, -so tells by people with more titles always went to the ICS console window. -Patterns are added to recognize handles with upto three such qualifiers. - -2010-02-08 11:54:55 +0100 H.G. Muller : -Do not pop down Seek Graph on on-dot click - -Leave the graph up, and let the incoming board of a started game cause -the pop-down. This in case the clicked ad is no longer vailable, or -manuay refused, and fails to start a game. - -2010-02-07 21:26:39 +0100 H.G. Muller : -Observe a game in the background while playing - -A new (persistent) option -backgroundObserve true|false is added. When -set, observed boards received while playing a game will not trigger a -game switch, but will be ignored except for storing in a dedicated board -buffer. Pressing the right mouse button will cause the board to be -displayed, until we release it. Time, strength and stm are always -displayed in the message window. - -2010-02-07 16:43:36 +0100 H.G. Muller : -Remove race condition in clock switching - -The move number is now incremented inside SwitchClock, when no timer -interrupt is scheduled, so the interrupt cannot occur at the wrong side -of the increment, and decrement the wrong clock. - -2010-02-07 11:53:03 +0100 H.G. Muller : -Let second click on piece make only capture, with -oneClickMove - -Normally this would clear the highlighting of that piece. -Required new field in DisambiguateClosure to count nr of captures. - -2010-02-07 11:18:56 +0100 H.G. Muller : -Bugfix stale first-click - -When the opponent resigned after the user had cicked a from-square, -clicking the from-square for the first move in the next game would -produce an "illegal move" message, because it was considered a to-click! -We now set fromX and fromY to invalid in GameEnds(). -Should we also reset them on mode changes? - -2010-02-07 11:08:05 +0100 H.G. Muller : -Add promotions and e.p. to oneClickMove - -For e.p. the to-Square of the Pawn has to be clicked. Promotions are -always to Queen when you click the to-square, but use the promotion -pop-up when you click the from-square. - -2010-02-07 10:38:38 +0100 H.G. Muller : -Fix error that compiler does not notice - -Boolean GLT_GetFromList did not return a value. But no error on Ubuntu! - -2010-02-06 18:55:38 -0800 Arun Persaud : -new developer release - - -2010-02-06 18:30:42 -0800 Arun Persaud : -updated year in copyright info - - -2010-02-05 22:27:51 +0100 H.G. Muller : -One-click moves - -Playing on ICS or against engine, clicking a square from or to which -only a single move can be made causes the move to be done, when the new -option -oneClickMove is set to true. - -2010-02-04 16:09:25 +0100 H.G. Muller : -Use squares for computer seek ads - -Shape indication passed in sign bit of color (char) variable. - -2010-02-04 22:46:41 +0100 H.G. Muller : -Use right mouse button to view seek ads - -Right down-click does the same as left down-click, right up-click -simulates a left up-click off board (so it misses all dots). - -Use right-click miss to refresh Seek Graph - -The 'moving' parameter had to be made into an int for this, to indicate -right clicks with code 2. Right press now already pushes the clicked ad -to the back, so that the up-click will display an underlying one. - -Bugfix pushing back seek ads on right-click - -On a right button press the previous in stead of currently hit ad was -receiving the penalty. - -Indicate seek-ad multiplicity - -If more than one seek ad is inside the capture range of the mouse -pointer, an exclamation point is printed before the seek-ad text. - -Some fixes to make seek-ad suppression work in WinBoard - -In WinBoard the z-depth was immediately erased by redrawing the graph; -the clearing of zlist had to be moved from PlotSeekAd() to AddAd() -(where it really belongs). Also aging of z-depth is now suppressed on -mere pointer motion. - -2010-02-04 22:45:01 +0100 H.G. Muller : -Dynamic Seek Graph - -The new option -autoRefresh sets FICS and ICC to report removal of seek -ads, and then removes those from the Seek Graph. New seek ads are added -to the graph, as soon as the ICS reports them. - -2010-02-04 22:42:15 +0100 H.G. Muller : -Implement SeekGraph in XBoard - -For now only controlled by left mouse clicks on board. New options --seekGraph true|false and -sg to switch this feature on. - -Facilitate selection of coinciding seek ads - -Seek-ads that are viewed but not answered get a distance penalty on the -up-click that makes their selection more difficult next time, so that -the ad they covered gets a (better) change. The penalty ages away in the -course of 5 clicks. - -Slightly offset Seek-Graph dots of different color - -Dots of different color are now displaced horizontally be 3 pixels, to -prevent them from completely covering each other. (Required the axis -labels to be moved a little too, to not be covered by the 1-min ads.) - -Auto-show seek-ad texts in WinBoard - -Hovering the mouse above a Seek-Graph dot will make the text belonging -to it appear in the message field without the need to press a button. -Required SeekGraphClick() to be called from the WB mouse event handler, -with an extra argument 'moving' to make the distinction with a real -click. - -Show seek-ad text on mouse hovering (XBoard) - -The Eventproc is also set to trigger on PointerMotion, and this event -then calls SeekGraphClick with motion=true to handle it. - -Put poetic name of wilds in seek-ad text - -Use XBoard variant names, except for 'loadable' and 'fischerandom' -(becomes 'setup' and 'chess960'), but leave number (to distinguish wilds -that transate to same XBoard variant). - -2010-02-05 20:36:50 +0100 H.G. Muller : -Fix highlighting bug in XBoard - -The from-square was drawn before the to-square was erased, which led to -a missing highlight line if they shared an edge or corner. - -2010-02-05 15:49:59 +0100 H.G. Muller : -Shorten autoKibitz confirmation on FICS - -Strip off the "players)", but leave the separatng space. - -2010-02-05 14:39:55 +0100 H.G. Muller : -Repair damage to -autoKibitz done by FICS atomic zippy claim - -The sending of -autoKibitz info was also moved back in that patch, but -unfortunately to after clearing of the programStats info. Now the -clearing has been moved also, to remain after it. - -2010-02-04 23:33:50 +0100 H.G. Muller : -Send continuation lines to chat box they belong to - -The variable savingComment is used as a kludge to remember where the -comment should go (i.e. which chatbox, or elsewhere), so that when a -continuation line is matched, chatPartner (which was reset at EOL) can -be restored to its original value. Also put space after handle of talker -in channel Chat Windows - -2010-02-02 19:08:42 +0100 H.G. Muller : -Fix u64 format for cygwin - -With a -mno-cygwin compile %llu and %lld are definitely not understood -by scanf and printf, although they are by the compiler. In stead, %I64u -seems to work. Put it in under control of a switch USE_I64, which is -defined only in the gcc makefile when MINGW is used. - -2010-02-02 19:02:28 +0100 H.G. Muller : -Remove stray dot from WinBoard makefiles - -There was a period suffixed to config.h in the wgamelist.o dependency. - -2010-02-01 14:50:01 +0100 H.G. Muller : -Fix bug in display of logos - -The logo continued to be drawn after a boardSize change to a tinyLayout -size, although there was no space reserved for it. Fixed by explicitly -resetting logoHeight when no logo space is reserved in InitDrawingSizes(). - -2010-01-19 20:15:49 +0100 H.G. Muller : -Right-click refactoring: step III - -Let WinBoard call RightClick in back-end, and delete the duplicate code -it had for this, after rescuing the front-end bits, and let the letter -act depending on the result returned by RightClick. - -2010-01-19 19:07:15 +0100 H.G. Muller : -Right-click refactoring: step II - -Migrate the Right-click routine to the back-end. Let it communicate back -square coordinates through pointer arguments, to accomodate their -different naming in XBoard and WinBoard. Template added in frontend.h. - -2010-01-19 17:55:05 +0100 H.G. Muller : -Right-click refactoring, step I - -Divorce front-end part from back-end part of PieceMenuPopup in XBoard -front-end, and forge the back-end part into a new routine RightClick. -The right up-click in XBoard, which called unLoadPV() directly, now -calls RightClick through PieceMenuPopUp(). - -2010-02-04 23:09:47 +0100 H.G. Muller : -Merge gamelistopt sources into gamelist source files - -The files xgamelistopt.c and gamelistopt.c are merged with xgamelist.c -and gamelist.c, respectively. The WB front-end for the dialog already -resided in winboard.c, so there was little need to move it to wgameist.c -file. Makefiles adapted accordingly. Unsuitable key bindings were -removed. The low-level front-end prototypes are now defined in in -frontend.h. - -2010-01-29 21:47:47 +0100 H.G. Muller : -Game-List options dialog for XBoard - -A dialog similar to that of WinBoard was cloned from the game-list -window. The XBoard front-end is in a separate file xgamelistopt.c, -which in fact implements most of the low-level front-end as back-end. - -2010-01-29 12:48:50 +0100 H.G. Muller : -Refactoring of game-list-options dialog - -The back-end part is separated off, and moved to a file gamelistopt.c. -Front-end for now stays in winboard.c. No prototypes in frontend.h yet. - -2010-01-26 19:28:43 +0100 H.G. Muller : -Fix of ancient WB bug: test integer option values for validity - -Only a string of digits preceded by an optional sign is accepted now. -Before, any string was accepted, and leaving out a value could lead to -the next option being ignored (if it did not need a value) because it -was considered the value for the previous one! - -2010-01-26 19:00:54 +0100 H.G. Muller : -Fix bug in edit-position of holdings - -The holdings were effectivelly taken one too large, so that a promoted -shogi Pawn moved to, or created in the holdings was not demoted to Pawn, -but put in the dark (which you could see by the holding count if you did -it twice). The overflow tests in these two cases now have been corrected. - -2010-01-25 13:54:40 +0100 H.G. Muller : -Save fonts in XBoard settings file per boardSize - -Each -boardSize now can have its own font specified in the settings file -(and thus by a command-line option, although it would in general not be -very useful to specify a font for a size other than the selected). E.g. -a prefix "size33:" to the font name will apply it only to -size 33. -An unspecified-size font option (not normally in the settings file) will -always prevail over a font option specific for the current size. -A font of some size must have been used or specified in order to be -saved. - -2010-01-25 08:56:35 +0100 H.G. Muller : -Fix width of filter field in XBoard GameList - -An empirical dependence of the width of this text edit on the square -size now makes for an acceptable layout at any board size. - -2010-01-24 19:09:45 +0100 H.G. Muller : -Use FICS atomic draw claim for sending move in zippy mode - -For this the relaying of the move had to be moved until after the -adjudication, which again has to be done after MakeMove(), which is a -bit dubious, as MakeMove might take significant time when animating. - -2010-01-24 18:51:38 +0100 H.G. Muller : -Send FICS atomic claim to ICS if move creates draw after offer - -The FICS format "draw MOVE" is used to send the move to the ICS when -the user enters a move that adjudicates as a claimable draw, and he -offered a draw before the move. For the benefit of ICS that do not -understand this format, the plain move is sent afterwards. - -2010-01-24 18:16:14 +0100 H.G. Muller : -Also allow user to claim by offering draw before his move - -Use the existing userOfferedDraw variable to test for such offers in -Adjudicate(). - -2010-01-24 17:29:42 +0100 H.G. Muller : -Also adjudicate after user move - -Call Adjudicate() in FinishMove(). - -2010-01-24 15:56:56 +0100 H.G. Muller : -Refactoring of adjudication code - -Put all the rule-based (as opposed to score-based) adjudications in a -separate routine, so they can also be called on user moves. This -requires sending the drawing move to the opponent engine to be made -conditional on existence of the latter. Execution of the code is no -longer dependent on the condition TwoMachinesPlay, but actual game -terminations are now all restricted by an alternative condition (no ICS -mode). - -2010-01-24 11:46:30 +0100 H.G. Muller : -Use -keepAlive option to determine connection health - -When there has been no ICS response since the previous 'ping', assume we -are disconnected and do a fatal-error exit. Also auto-start the ping -process in InitBackend3(). - -2010-01-23 23:00:10 +0100 H.G. Muller : -Use arrow keys in XBoard GameList for entry selection - -Add translations for arrows and home/end, to call LoadSelectedProc with -argument to indicate the step, and let the latter perform the action. - -2010-01-23 22:24:20 +0100 H.G. Muller : -Allow to apply filter in XB GameList filter edit - -Apply a translation to intercept the key. Set focus back to the -list display afterwards. - -2010-01-23 21:44:36 +0100 H.G. Muller : -Accept for changing chat partner - -A kludge stolen from Alessandro's GameList filter allowed to let the -typing of while updating the chat-partner field of the WinBoard -chat windows to act as pressing the Change button. Gives focus to the -input field of the window afterwards. - -2010-01-23 21:42:38 +0100 H.G. Muller : -Move duplicat gamelist code to backend - -The filtering routines are moved from xgamelist.c and wgamelist.c to -gamelist.c, and a prototype for them is placed in backend.h. - -2010-01-23 19:29:18 +0100 H.G. Muller : -Port game-list filtering to XBoard - -Added a text edit and apply button to the XBoard game-list dialog, and -only have it print those lines that match the filter. Translate index in -list to index of game in file when a game is selected, and index in file -to index in list when a line is highlighted. Duplicates some code -between xgamelist.c and wgamelist.c, which should be moved to back-end. - -2010-01-21 19:24:49 +0100 H.G. Muller : -Convert to DOS line endings - -For easier understanding of upcoming diffs of winboard.c - -2010-01-21 14:32:46 +0100 H.G. Muller : -Refactoring of move-history code - -The WinBoard code in whistory.c was split in a front-end part (remaining -in whistory.c) and a back-end part (now in history.c in the xboard -directory). This to allow easy porting to other platforms. - -2010-01-20 12:48:30 +0100 H.G. Muller : -Add fixed-time/move button in XBoard time-control dialog - -Put the TC-type buttons in a radio-group, and highlight the selected mode. - -2010-01-19 18:27:14 +0100 H.G. Muller : -Fix bug in XBoard PV display - -The PV was unloaded on anything but a button release, in stead of the -other way around. - -2010-01-23 11:04:11 -0800 Arun Persaud : -fixed hardcoded location of config file for xboard - -the location should now follow sysconfdir during the configuration process. -Also added some more output to the configure script. - -2010-01-18 12:18:32 -0800 Arun Persaud : -new developer release - - -2010-01-18 12:15:06 -0800 Arun Persaud : -fixed Makefile.am to handle config file correctly - - -2010-01-15 21:55:29 +0100 H.G. Muller : -Change opening array -variant fairy - -We now use the position of "Chess with Different Armies", FIDE army vs. -a fantasy army (inspired on the Color-bound Clobberers) as opening -position. - -2010-01-13 19:08:45 +0100 H.G. Muller : -Add variant Makruk - -Thai Chess, played by 2 million world-wide. Required pawn promotion to -happen in a zone, and the Alfil to move as Shogi Silver, a new opening -array, and unusual Pawn placement. Because of the latter, I consider it -a setup position, so a FEN will always be sent to the engine. - -2010-01-17 14:17:10 +0100 H.G. Muller : -Fix parsing of O-O and O-O-O after FEN pasting in FRC - -Because the initial rights were not set in the FEN reader, the -initial rights of the previous game remained in force, so that the -parser did not understand OO-castling (although it would allow KxR -castling). - -2010-01-15 14:40:43 +0100 H.G. Muller : -Fix reading FEN castling rights for knightmate and twokings - -Scanning the back-rank for a King did not work in these variants, -because either the Unicorn castles, or there might be two Kings. - -2010-01-13 11:42:52 +0100 H.G. Muller : -Fix omission in castling refactoring for ICS received boards - -A default of -1 was still used, in stead of NoRights, when no Rook was -found. In theory this could have had effect in a setup board 0 in FRC, -when there were no Rooks on the back rank. - -2010-01-13 11:35:34 +0100 H.G. Muller : -Fix TwoKings ICS castling-rights bug - -Scanning the rank (as is done because of FRC) assigned castling rights -to the rightmost King. Even scanning the opposite direction would not -work, as it is not always the eftmost King that can castle. So we now -explicitly test for a King on e1/e8 in TwoKings and assign it rights, -relying on the Rook rights received from the ICS to control castling. - -2009-11-18 19:12:25 -0800 H.G. Muller : -fix double start of zippy engine after switch to gothic - -In ICS mode we now switch to the proper variant as soon as we receive -the generic game-start message, to prevent a mismatch when the first -board is received (which would trigger fetching of a move list). - -2010-01-11 16:44:40 +0100 H.G. Muller : -Extensive bugfix of -autoKibitz - -Suppression of printing of diverted kibitz messages failed when they -extended over more than one read. This could even lead to such -messages being erroneously saved as comments, which then lead to -crashes. The suppression mechanism now waits for a prompt, in stead of -the end of buffer. This required the printing of any leftover in the -buffer to be deferred until the next read completes it. -The number of people kibitzed to is now printed. - -2010-01-11 16:30:59 +0100 H.G. Muller : -Fix piece-to-char table -variant fairy - -The letters for Lance and Snake where swapped. - -2010-01-09 11:54:20 +0100 H.G. Muller : -Make WinBoard makefiles use parser.c in XBoard directory - - -2010-01-08 18:23:39 +0100 H.G. Muller : -Docs update for new features - - -2010-01-08 15:18:37 +0100 H.G. Muller : -Fix new args parsing of -lowTimeWarningColor - -This did not occur in the XBoard color translation table yet. - -2010-01-08 14:16:59 +0100 H.G. Muller : -Allow editing of holdings in EditPosition mode - -Dragging pieces to and from the holdings now consistently keep track of -the home square of pieces and the piece counts, as does creation of -pieces in the holdings through the piece menu. - -2010-01-08 13:59:57 +0100 H.G. Muller : -Indicate squares a lifted piece can legally move to - -Under control of the new option -showTargetSquares when --highlightDragging and -testLegality are on, the squares a piece can -move to are marked by fat dots in the highlightColor (non-captures) and -premoveHighlightColor (captures), as soon as you grab it for dragging. -In variants with mandatory capture, the capture target of other pieces -is marked with the highlightColor (as non-captures are then not allowed). - -2010-01-08 12:35:10 +0100 H.G. Muller : -Fix bug for incommensurate time odds - -After normalization (-timeOddsMode 1) the time odds factors can be -non-integer, and thus must be stored as float. - -2010-01-08 11:41:26 +0100 H.G. Muller : -Display PV right-clicked from EngineOutput window - -The clicked PV is selected and the memo gets focus, so that it is -highlighted. This selection is restored in the proper place after -insetrtion of a new line in the memo. - -2010-01-08 10:19:32 +0100 H.G. Muller : -Display PV on right-clicking board - - -2010-01-08 09:21:04 +0100 H.G. Muller : -Bugfix legality null move in parsing with -testLegality off - -The pointers were compared, in stead of the values. -Furthermore, instead of null moves, it rejected moves on the main diagonal when legality checking was off. - -Also exclude moves with empty squares and enemy pieces. - -2010-01-07 19:10:39 +0100 H.G. Muller : -Newly lexed winboard/parser.c - - -2010-01-07 19:05:17 +0100 H.G. Muller : -Harmonize declarations of XBoard and WinBoard - -The engine-exit and settings patches make some stuff common to WinBoard -and XBoard, which needed to be harmonized, and is moved to frontend.h. - -2010-01-07 13:07:57 +0100 H.G. Muller : -Allow Ctrl-C copying from EngineOutput window text to clipboard - - -2010-01-07 12:52:17 +0100 H.G. Muller : -Allow popup-less (fatal) exit of engine after tellusererror - - -2010-01-07 12:40:12 +0100 H.G. Muller : -Improve layout of Engine #N Settings dialog - -An attempt is made to align the input fields of spins and text-edits - -2010-01-07 00:31:11 +0100 H.G. Muller : -Let XBoard print version with argument --version or -v - - -2010-01-07 00:25:57 +0100 H.G. Muller : -Fix castling rule assignment in shuffle games - -The conversion to in-board storage for rights copied directly to boards[0] in steadof -initialPosition, and was then overwritten when the latter was copied with uninitialized -rights to boards[0]. This affected FRC and CRC, where rights are non-standard. - -2010-01-07 00:17:25 +0100 H.G. Muller : -Implement castling in -variant caparandom - -CRC should be treated as FRC, but until now it never was. We now test for FRC_TYPE_CASTLING. - -2010-01-07 00:09:18 +0100 H.G. Muller : -Fix default castling rights on reading incomplete FEN - -This was overlooked in the conversion to the in-board storage of rights. - -2010-01-07 00:03:09 +0100 H.G. Muller : -Fix NoncompliantFEN defaults. - -This must be NULL to get compliant FENs, not "", which would suppress castling and e.p. fields. - -2010-01-06 23:54:49 +0100 H.G. Muller : -Change format of -adapterCommand. - -first or f at the start of an option name are now automatically changed into second or s, -rather than needing %% to be recognized. The values of -ec and -ed in the default --adapterCommand are now quoted (now XBoard understands quoting in the engine command line). - -2010-01-06 23:51:16 +0100 H.G. Muller : -Make WinBoard defaults for -fd and -sd equal to "." rather than empty strings. - - -2010-01-06 23:28:47 +0100 H.G. Muller : -Delete old indirection settings-file code - - -2010-01-06 21:45:14 +0100 H.G. Muller : -Correct XBoard default debug file name - - -2010-01-06 21:34:48 +0100 H.G. Muller : -Suppress saving font settings. - -The fonts are size dependent, and might thus not be reusable in the next -session. For now we therefore suppress the saving of them in the -settings file, until we diversify the fonts per boardSize. - -2009-12-12 23:38:20 -0800 Arun Persaud : -added missing sounds files to be able to compile on windows - - -2009-12-09 17:29:37 -0700 Eric Mullins : -Changes needed to compile master branch. - - -2009-12-06 12:11:46 -0800 H.G. Muller : -implements the eval-graph window for XBoard - - -2009-12-06 11:58:34 -0800 H.G. Muller : -improves the XBoard handling of the engine command line - -it now understands limited forms of quoting, so engine binaries with spaces in their file name can be handled. - -2009-12-06 11:56:40 -0800 H.G. Muller : -A better and more flexible way of invoking Polyglot - -rewrote uci.c. No more use of temporary files, all data passed through the engine command line. Adds a new command-line option -adapterCommand for this. - -2009-12-06 11:34:50 -0800 H.G. Muller : -remove trailing \r in xboard output - -there is an annoying carriage return (displayed as ^M) at the end of the PV in the engine-output window, not -only with Fairy-Max, but also with UCI engine running under Polyglot. This patch replaces the trailing CR that Linux programs send after the PV line y a space. - -2009-11-29 11:56:32 -0800 H.G. Muller : -double buffer size to prevent overflow - -This patch doubles the size of the ICS input buffer to 16KB, to prevent -the suspected overflow with -keepLineBreaksICS false when using -"inchannel 1" on FICS and over 500 people are tuned in. - -2009-11-28 13:33:52 -0800 H.G. Muller : -fix problem with empty string in -firstNeedsNoncompliantFEN - -This fixes a bug in the use of the -firstNeedsNoncompliantFEN option with -an empty string as argument. (Which led to truncation of the FEN.) - -2009-11-28 13:32:12 -0800 H.G. Muller : -updates makefiles to include dependency on config.h - -adds the dependency of wbres.o on config.c introduced by having the VersionInfo in the resource - -2009-11-28 13:28:00 -0800 H.G. Muller : -correctly apply some check boxes from the option menu - -Usng the check-boxes in the Option->Adjudications menu to indicate the -engine reports absolute scores is now copied directly to the ChessProgramState, -from where it is used, in stead of only to appData. This makes the change take -effect immediately, in stead of after restarting. - -2009-11-28 13:27:43 -0800 H.G. Muller : -score sign in analysis mode - -this does not alter any of the current behavior with compliant engines, -but does extend the correction for non-compliant score reporting under -control of the -first(second)ScoreIsAbs option to cases where the engine -is analyzing or playing on an ICS. - -2009-11-24 21:09:30 -0800 Arun Persaud : -fix for bug #28077: xboard needs to link against x11 - -hopefully fixed automake to take care of this - -2009-11-23 20:37:20 -0800 H.G. Muller : -Fix castling rights when copying FEN to clipboard (again) - -missed a spot last time - -2009-11-23 20:22:58 -0800 H.G. Muller : -restoring windows (EngineOutput and MoveHistory) on startup - -restoring the open / closed status of the -auxiliary windows (EngineOutput and MoveHistory) on startup -in XBoard like they do in WinBoard, which makes sense now that -we aso remember their coordinates between sessions. - -2009-11-23 20:21:14 -0800 H.G. Muller : -fixed some outstanding pixmaps - -fixed transparency issues - -2009-11-23 20:17:25 -0800 H.G. Muller : -use linux style options for config file and add a system config file for XBoard - -This patch makes XBoard write the options to its conf file in -Linux style, "-option value" rather than Windows style "/option=value". - -The WinBoard option parsing code has always understood both formats -(including any hybrids), but the format it preferred for writing might -look quite strange to Linux users. I also attached a file to be installed -as /etc/xboard/xboard.conf on "make install". - -2009-11-23 19:58:55 -0800 H.G. Muller : -fix window positioning - -This patch adds stuff in the header files that allow the various front-end files -to share information on which windows exist, are up, and how they are positioned. -The EngineOutput, MoveHistory and GameList windows now all remember their -position and size, even when they are closed when XBoard exits. - -2009-11-23 19:51:19 -0800 H.G. Muller : -same argDescriptor parsing for Xboard and Winbaord - -This patch makes XBoard and WinBoard use the same argDescriptor -list of options, and (largely) use the same code for parsing and saving them. -This is acheived by moving this code to a new file args.h, and #including this -in both winboard.c and xboard.c (so that tiny differences, e.g. in default -values in the table, are decided by the context). XBoard has new menu items -"Save Settings Now" and "Save Settings on Exit" in the "Option" menu. -XBoard uses /etc/xboard/xboard.conf as default settings file. -A new option, -saveSettingsFile, can specify where settings should be saved, -without parsing the file. (So that it also works if the file does not yet exist.) - -2009-11-22 13:00:31 -0800 Arun Persaud : -new developer release - -changed release name to - - -2009-11-22 12:34:13 -0800 H.G. Muller : -fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. - - -2009-11-22 12:29:47 -0800 H.G. Muller : -use xtell for talking to handles, but tell for talking into a channel. - -by changing the chatboxes to use xtell in stead of tell, we broke -the possibility to use the chat-box for chatting into a channel (which is -apparently not possible with xtell). - -2009-11-22 12:15:15 -0800 H.G. Muller : -fix bug in bughouse drop menu - -This patch fixes the bughouse drop menu, which was broken by the -new mouse driver, and could no longer drop white Pawns. - -2009-11-18 19:29:57 -0800 H.G. Muller : -2nd step for moving option parsing from winboard to the backend - -This is the next step in option-setting refactoring: All options that are -defined in XBoard are now included in the WinBoard ArgDescriptor list. -The handling of sound option has been harmonized: the sound names -now all initially go to the appData array, (as in XB) in stead of directly to the -WB-specific variables, and LoadAllSounds now takes care of the copying. -A new routine ExportSounds copies them back before saving settings -(which, in XBoard, could be a no-op). - -The definition of defaults for the XB-only options has been moved to common.h. - -2009-11-18 19:24:35 -0800 H.G. Muller : -1st step for moving option parsing from winboard to the backend - -This is a preparatory step in moving option parsing of WinBoard to the back-end. -The table of command-line options now contains a fifth field, holding the compiled-in default. -This obviates most of the front-end routine InitAppData, which now is replaced by a table-driven -initialization routine SetDefaultsFromList(), which could be back-end. - -2009-11-18 12:33:39 -0800 H.G. Muller : -refactoring evalgraph code - -This is the refactored EvalGraph code: the back-end part is separated off, -and put in a file evalgraph.c, which in the future can also be used with XBoard. -Only the WinBoard front-end code is left in the file wevalgraph.c. A new -header file defines the variables and routines they share. - -2009-11-18 12:29:06 -0800 Arun Persaud : -clean-up - -some file permissions where set up wrong -(e.g. execute permissions for text files) - -2009-11-18 11:34:22 -0800 H.G. Muller : -refactoring of engineoutput - -This refactoring patch separates the back-end part out of -xengineoutput.c, and puts it in a separate file engineoutput.c. -A new header engineoutput.h included by both defines the routines -for cross calling. Similarly wengineo.c will be stripped from its -back-end code, (and renamed to wengineoutput.c), so WinBoard and -XBoard now both use engineoutput.c rather than maintaining duplicate -code in their front-end part. - -I also let the back-end now call EngineOutputUpdate directly, rather then -through a relay in the front-end, by renaming it to SetProgramStats -(the former name of the relay in winboard.c / xboard.c). - -Moved some templates of functions in engineoutput.c from winboard.h -to frontend.h - -2009-11-14 22:13:10 -0800 Arun Persaud : -fixed build on openbsd - -added missing header file - -2009-11-14 22:06:58 -0800 H.G. Muller : -improve thinking-output for mulit-variant - -Improve multi-variant support by sorting the Thinking-Output lines of the most recent depth by score in the Engine-Output window. - -2009-11-14 22:05:12 -0800 H.G. Muller : -fix castling rights when copying FEN to clipboard - -This patch forces leaving of Edit-Position mode before copying a FEN to the clipboard, to make sure castling rights are faked in a consistent way. Before you could get FENs that had castling rights for non-existent Rooks. - -2009-11-14 22:03:47 -0800 H.G. Muller : -This patch gives a better handling of comments in PGN files, and adds the variation as comment to the main line on using Revert in local mode. - - -2009-11-06 18:53:19 -0800 Arun Persaud : -fixed prototype for AppendComment - - -2009-11-06 09:06:44 -0800 H.G. Muller : -cleaned up some debug messages and typos - - -2009-11-06 09:05:09 -0800 H.G. Muller : -variation-support patch - -It allows you to Revert to the main line (or previous variation) when -playing variations on an existing game in EditGame or Analyze mode. - -2009-11-06 08:48:09 -0800 H.G. Muller : -fix for new way of saving castling and e.p. information - -I forgot to make some conversions to the new-style encoding of castling there -(using the enum constant NoRights instead of -1 to indicate -the absence of rights, which was the price of storing the -rights in the board, which is an unsigned enum type.) - -I also was a bit worried about portability, because I casted the enum type ChessSquare -to (int) before comparing it with (possibly negative) constants EP_NONE etc. -Now on my system enum types are (unsigned int), and this works, but I could -imagine there are systems where this would be an unsigned char. (Not sure -if there are rules for this). So to be safe I cast ChessSquare to (signed char), -which should always work to make small negative ints assigned to it read -back as themselves. - -2009-11-06 08:44:59 -0800 Arun Persaud : -removed files that should only be in the windboard directory - - -2009-11-05 19:32:35 -0800 Arun Persaud : -add Winboard source files into tar-ball - -forgot to add them when rewriting the Makefile.am - -2009-11-05 19:23:44 -0800 H.G. Muller : -Integrate castling and e.p. rights into board array; bugfix for EditPosition - -A large-scale operation that I have been postponing since the very first 4.4.0: -The castling and e.p. rights are now integrated into the board array, as -boards[moveNr][CASTLING][i] replacing castlingRights[moveNr][i] and -boards[moveNr][EP_STATUS] replacing epStatus[moveNr] -These quantities are now automatically copied with the position by CopyBoards -(allowing the removal of lots of dedicated copying code), and passed as -function arguments with the position (so that the moves.c functions like -TestLegality, MateTest, CoordsToAlgebraic, Disambiguate, GenLegal -no longer need explicit e.p. and castling parameters. - -Also fixed a bug introduced by a recent previous fix: by adding fake castling -rights to a position set up through the EditPosition menu, I destroyed the -castling rights of a pasted FEN. Faking castling rights is now made conditional -in EditPositionDone(), depending on the caller. (I had not realized it was also -called after FEN pasting, to send the position to the engine.) - -2009-11-05 19:03:17 -0800 Arun Persaud : -added missing library for build on OS X - -Xmu seems to be missing - -2009-11-04 22:57:30 -0800 H.G. Muller : -Some code refactoring and cleanup; one small bug fix - -Some code refactoring, mainly to bring definitions of routines and variables -shared between winboard.c and one of the auxiliary-windows files -whistory.c, wevalgraph.c, wgamelist.c, wengineo.c somewere in a header file -(winboard.h). Unfortunately this made winboard.h dependent on data types -defined in frontend.h, so that the #include order had to be changed in many -other .c files. - -The operation revealed one potentially bad bug: engineOutputDialogUp was -written as int in engineo.c, but declared as char in winboard.c. - -I also changed the storage mechanism of the the comment and tags window -positions to use WindowPlacement structs rather than simple variables, -so that in the future they can be docked, like the others. - -I also removed some remnants of the Analysis window. - -The wgamelist.h and wedittags.h header files contained only 3 lines, and -I absorbed them in winboard.h, rather than creating other such nearly empty -headers engineo.h, whistory.h and wevalgraph.h. This affects the make files. - -2009-11-03 18:26:06 -0800 H.G. Muller : -let the clocks run in -searchTime mode - - -2009-11-02 17:41:12 -0800 H.G. Muller : -add fixed time per move to the WinBoard time-control menu dialog - - -2009-10-31 10:42:50 -0700 Arun Persaud : -updated version number to unstable - - -2009-10-31 10:25:37 -0700 Arun Persaud : -release of version 4.4.1 - - -2009-10-30 19:59:23 -0700 H.G. Muller : -cleaned up ChangeLog and NEWS - -2009-10-30 20:02:40 -0700 H.G. Muller : -use xtell instead of tell in wchat - -2009-10-28 20:35:06 -0700 H.G. Muller : -prevent buffer overflow - -This is a buffer-size adjustments to prevent the JAWS version from -crashing when it has to read out loud very long comments. - -2009-10-28 02:17:16 -0700 Tim Mann : -Further copy/paste fixes - -We needed to implement the XA_TARGETS target in order for more -sophisticated apps to really believe we put anything on the clipboard -they can use. - -2009-10-27 23:57:25 -0700 Tim Mann : -Make copy/paste position and game use clipboard, bug #27810 - -Copy actually sets both the clipboard and the selection for -convenience and compatibility with the old way of doing things. -Paste pastes from the clipboard by default, but the new -pasteSelection -option lets you get back the old behavior of pasting from the -selection. - -2009-10-27 15:44:28 -0700 H.G. Muller : -switch focus to the board after loading a game - -2009-10-27 15:32:07 -0700 H.G. Muller : -fix for bug #27826: fixed autoDisplayComment - -apparently the -autoDisplayComment option was not working, -not even in WinBoard. This patch should fix it,both for WB and XB. -(Unfortunately xboard.c and winboard.c were using a different name -for the same front-end variable I needed, so I had to change one of them.) - -2009-10-27 12:24:56 -0700 H.G. Muller : -fix for bug #27826: ported two options to xboard - -also updated the documentation - -2009-10-27 12:22:36 -0700 H.G. Muller : -fixed jaws version - -turns out the new mouse handler broke the JAWS patch, as I discarded -the function IsPromotion. I adapted it to call HasPromotionChoice instead. -Also fixed two arnings by removing a no-longer needed debug print. - -2009-10-27 12:03:02 -0700 Arun Persaud : -reformated html to be correctly validated - -2009-10-27 10:33:42 -0700 H.G. Muller : -quick fix for "White Mates" in parser.l - -2009-10-27 10:32:24 -0700 Arun Persaud : -fixed a regression - -2009-10-26 20:45:15 -0700 H.G. Muller : -changed stderr to debug output, since stderr is closed in winboard - -2009-10-26 20:42:24 -0700 H.G. Muller : -removing empty lines from ICS play - -this patch causes removal of spurious prompts during ICS play -also if the prompt is preceeded by a number of empty lines -(as the board for the opponent move is on FICS). - -2009-10-26 20:40:00 -0700 H.G. Muller : -another bug in VariantSwitch: an unitialized board was printed. - -Must have been there a long time, but this time it crashed WinBoard. - -2009-10-26 20:38:37 -0700 H.G. Muller : -more work on variant switch - -the previous solution to the cosmetic problem of displaying a wrong shuffle -in an ICS game that was observed from the very start unfortunately turned -out to cause a real error in diplaying a stored game through the smoves -command, for variants not using the FIDE setup as standard. - -This patch displays the position from before setting up the start position -of the new variant, but does setup boards[0] to the initial position of that -variant. (If this is a wrong shuffle, it is thus ot displayed, and a new board -will immediately be sent from the ICS to correct the shuffle.) - -2009-10-26 20:34:04 -0700 H.G. Muller : -force full redraw in winboard - -Full redraw is now always forced when highlightMovesWithArrow is on, -rather than only when highlight info is available. (As in drop moves the -latter is invalid, but we must still erase the arrow from the previous move.) - -2009-10-26 20:25:55 -0700 H.G. Muller : -fix for bug #27790 and #277772. Suppressing the display of a wrong shuffle -when observing shuffle games from the first move (#27790 bis), -and the sounding of the FICS bell on crazyhouse captures (#27772 bis). - -2009-10-26 20:22:13 -0700 H.G. Muller : -fixed bug related to unsigned char in convert.c - -I also fixed the unsigned-char bug in the convert.c for bitmaps that caused the -129x129 XBoard bitmaps to be defective, and a bug that required fixup with sed -afterwards (so I could use it to create a new m33s.bm) - -2009-10-25 23:37:48 -0700 Arun Persaud : -unguarded debug printf. added the appropiate if statement - -2009-10-25 23:31:13 -0700 H.G. Muller : -fix for two compiler warnings - -2009-10-25 23:29:43 -0700 H.G. Muller : -fix for bug #27799: fix for nested-nested-nested variations - -2009-10-25 23:21:07 -0700 H.G. Muller : -The book-probe code forgot to close the book file after opening it. - -fixed by adding an fclose at two points. - -2009-10-25 23:18:18 -0700 H.G. Muller : -removed unused v54?.bm bitmaps from resource file - -it seems the v54?.bmp bitmaps were actually included in the WinBoard build -(in the resource file), although they were never actually used. So I have -removed their inclusion in the resource file now. - -2009-10-25 23:05:30 -0700 H.G. Muller : -replaced defective bitmaps with copies from 4.2.7 - -2009-10-25 23:02:08 -0700 H.G. Muller : -removed bitmaps files that are not needed any more - -2009-10-25 22:58:34 -0700 H.G. Muller : -fixed some bitmaps - -2009-10-24 09:41:39 -0700 Tim Mann : -Drop an obsolete script that was only used to update my personal web site - -2009-10-24 01:23:29 -0700 Tim Mann : -Silence warnings when compiling 64-bit xboard - -Some harmless warnings were caused by 64-bit mode having 32-bit -int but 64-bit long and pointer. Add casts (etc.) to silence them. -This might require adding a definition of intptr_t (a signed int -type that is the same width as a pointer) on old systems that don't -have it. - -2009-10-24 00:56:37 -0700 Tim Mann : -Fix up man page some more - -Sigh, the project history was still partly in reverse chronological -order and partly in forward order. Swapped the order of some -sentences to help straighten it out. I don't really care about this, -so other project members should feel free to do what they like here, -but the messed-up order was bugging me. - -2009-10-24 00:46:20 -0700 Tim Mann : -Fix some issues in the XBoard man page - -Correct places where the XBoard man page was calling XBoard -"WinBoard". Change references to "WinBoard engines" and "WinBoard -protocol" to "XBoard/WinBoard ...". Update bug reporting guidelines. -Reorganize project history to something more like chronological order --- it had gotten pretty randomly ordered. - -2009-10-22 21:45:32 -0700 Arun Persaud : -new pre-release version; updated version numbers - -2009-10-22 21:33:07 -0700 H.G. Muller : -This patch adds to the characters that cause an automatic -switch to the ICS console when typed to the board window. - -2009-10-22 21:31:16 -0700 H.G. Muller : -fix to the minor graphics issue contained some typos, -as was remarked in the bugs reports - -2009-10-22 21:30:08 -0700 H.G. Muller : -improved mouse handler - -The improved mouse handler still needed an extra call to DrawPosition to -work in XBoard. - -2009-10-22 21:28:38 -0700 H.G. Muller : -NPS plays and pondering - -Clock updating did not work correctly in node-based time controls when the -engine was pondering. (It was not really meant for use with pondering. Oh well...) -This patch checks if the engine reporting the node count is indeed thinking -(as opposed to pondering). - -2009-10-22 21:25:36 -0700 H.G. Muller : -holdings update and regression fix - -The holdings-update patch was not yet satisfactory, because FICS seems to send -holdings both before and after the board! And those received before did overwrite -the holdings received after the previous board. I know tried to fix that in a kludgey -way, by hiding a flag in the board that tells if the holdings have already been written -by the ICS or not, and ignore new holdings when they are. (Except in bughouse, -where holdings updates cannot be tied to a particular board and multiple updates -between boards are normal. (I hope?).) - -I also undid a regression in my previous fix for the minor graphics problem, -and solved it in a slightly different way to prevent flicker. - -2009-10-22 21:23:39 -0700 H.G. Muller : -improved mouse handler - -I improved the mouse handler in a way which will preclude disappearence of pieces -on off-board or ambiguous (in-between squares) drag & drop moves. (As was reported -in the "premove bug?" thread. Also the command-line premove problem reported there -is now fixed, by removing the prefixing. - -2009-10-22 21:18:05 -0700 H.G. Muller : -fix for bug #8847: moving backward while examining on FICS not reported to engine - -I moved Daniel's code that backs up the engine when a bord with a -lower number is received to a place where it is always done in zippy mode, -rather than only when the engine is analyzing. - -Apart from taking back moves, there was also the case where the -user moves forward by more than one move (usually immediately to -end-of-game). In this case a new movelist is fetched from the ICS -to recover the moves that were skipped. But this assumes that the -engine is at the start of the game and feeds all these moves to the -engine. So the engine had to be reset in this case to stay in sync. - -2009-10-22 21:16:56 -0700 H.G. Muller : -better init for random number generator - -2009-10-21 23:01:09 -0700 H.G. Muller : -fix for bug #27772: holdings not updated - -holdings lines from the ICS nor update the holdings -of boards[forwardMostMove] in stead of boards[currentMove]. - -2009-10-21 21:32:14 -0700 H.G. Muller : -allowe parsing / disambiguation of SAN moves like Xe4 in certain situations - -This patch allows parsing / disambiguation of SAN moves like Xe4, if there -is only one wild-card piece X on the board. Moves with wild-card pieces -are now considered illegal if they leave the King in check by a piece of -known gait. - -2009-10-20 19:09:46 -0700 H.G. Muller : -fixed bug when switching to variantsuper - -2009-10-20 19:06:43 -0700 H.G. Muller : -fix for bug #27715: 2 (minor) graphic issues - -I forced a total redraw when Reset is called from the ICS code in case a -new game is encountered, in the hope it will make the reported -(irreproducible) problem go away. As game switches are not frequent, I -guess there is hardly any downside to this. - -2009-10-20 18:57:17 -0700 H.G. Muller : -fix for bug #27667: PV line missing in analysis window, part 3 - -"3. Wish for Engine state string (right to the icon): -Can you add the actual search depth in analyzing mode? A change like " - -I also added the requested display of depth of the analysis move in the -EngineOutput window. I guess a similar change could be made to wengineo.c -(as this is in the code they share in common), but no one ever requested -that in the 5 years since Alessandro wrote it. So for now I leave it alone. - -2009-10-20 18:52:14 -0700 H.G. Muller : -fix for bug #27760: debug printf in backend.c and additional check for variant - -2009-10-19 23:17:46 -0700 Arun Persaud : -fix for bug #10990: cmail does not seem to support .cmailgames or .cmailaliases - -this is correct, deleted the text out of the documentation that claims we support it - -2009-10-19 18:40:40 -0700 Arun Persaud : -new alpha version; first one with new naming scheme - -2009-10-19 18:07:21 -0700 H.G. Muller : -smarter analysis of the boards that XBoard receives from an ICS - -I added smarter analysis of the boards that XBoard receves from an ICS, -based on board size and piece types in the position, to recognize cases -where the board does not match the current variant, and switch to an -appropriate variant. - -2009-10-19 18:04:08 -0700 H.G. Muller : -fix for bug #27667: window should be reference to toplevel - -The remaining objections of #27667 should be fixed by bringing the -EngineOutput window under control of the TOPLEVEL compile-time switch. - -2009-10-19 18:02:42 -0700 H.G. Muller : -partly fix for bug #27715: scaling of menu bar - -the menu bar to the left edge of the window. - -2009-10-19 17:59:43 -0700 H.G. Muller : -fixed bug reported in WB forum: second game of a match would -not start when using the GUI book - -2009-10-19 17:57:14 -0700 H.G. Muller : -fix for bug #27751: negative holding counts displayed - -I put code in the back-end to prevent holdings counts from -becoming negative when a drop move is made from empty holdings. -(This can happen when re-loading ICS bughouse games, -as the smoves command fails to fill the holdings.) - -2009-10-18 20:54:53 -0600 Eric Mullins : -Updated compiling instructions. - -2009-10-18 11:32:55 -0600 Eric Mullins : -Changes to allow fonts with any charset (such as terminal) - -Affects winboard only. - -2009-10-16 23:02:41 -0600 Eric Mullins : -Moved SIGWINCH signal so it can be used... - -I goofed putting this in StartChildProcess() originally. - -2009-10-16 22:54:12 -0600 Eric Mullins : -Added internal wrapping ability. - -New options: - -wrapContinuationSequence "foo" (default: "\\ " - -useInternalWrap (Winboard default: false, XBoard default: true) - -Note: -keepLineBreaksICS if set, prevents wrapping, usurping the - useInternalWrap setting. The idea is if you want to keep ICS line - breaks, then you don't want internal wrapping. Because of this, - the new default for keepLineBreaksICS is now false for XBoard. - -2009-10-16 19:14:34 -0700 H.G. Muller : -fixed segfaul in convert.c used to convert pixmaps - -2009-10-15 19:46:07 -0700 H.G. Muller : -new mousehandler to correct for premove and promotion popup - -this is the new mouse handler for XBoard, which should fully implement -premove, including promotion popup, and yet suppress the promotion popup -on illegal moves that are not premoves. It is almost completely moved to -the back-end now, so that WinBoard will be able to use it as well. I just -must hook it up to winboard.c, in particular harmonize the call-backs of -the mouse driver into the front-end for grabbing and releasing pieces for -dragging, to make sure they have the same names and arguments. - -2009-10-15 19:32:55 -0700 H.G. Muller : -updated black fairy pieces - -here is a set of black fairy pieces with opaque white details, -so they have the same style as the orthodox XBoard pieces. - -2009-10-15 16:54:51 -0600 Eric Mullins : -Adjustment to joining to work around server not always including space. - -This patch implements commit 98aa02bda540f17f1f50be00e494efafe439b004 -into the updated joining routine. This issue seems not to be server -variance, but instead the server electing to omit the space between -words when it occurs at exactly your width setting (-1 actually). - -This patch makes the joiner add back the space just like the referenced -commit. Note: this is just a workaround to a server issue-- the joiner -actually joins correctly before this patch. - -2009-10-15 07:18:42 -0600 Eric Mullins : -Fixed joiner detection, allowing it to work with timeseal - -When timeseal's buffer fills in the middle of the continuation -sequence, detection fails, and the lines aren't joined. - -As a result of this fix, measures intended to bypass joining are -no longer needed, so I removed them. These utilize server vars -when available to prevent splitting. - -2009-10-14 14:42:37 -0700 H.G. Muller : -fixed engingeoutput routine - -removed outdated code regarding analysis window - -2009-10-14 14:39:06 -0700 H.G. Muller : -moved bitmap to correct location - -was misplaced in a previous commit - -2009-10-14 14:26:09 -0700 H.G. Muller : -fixed wrong number of arguments for EngineOutputPopUp - -2009-10-13 21:00:27 -0700 H.G. Muller : -new bitmap converter (including fill option) and new pixmaps - -2009-10-13 20:52:40 -0700 Arun Persaud : -forgot to add these two lines to the last commit - -2009-10-13 20:51:17 -0700 Arun Persaud : -removed AnalysisPopUp. Use EngineOutputPopUp instead - -this was already in Winboard, copied it to xboard and removed unused code. - -2009-10-13 20:32:32 -0700 H.G. Muller : -Proper board and holdings size when switching to variants -gothic, capablanca, great and super within an ICS game. - -2009-10-13 20:25:13 -0700 Arun Persaud : -cleaned up an old #ifdef in zippy - -2009-10-12 19:25:17 -0600 Eric Mullins : -neglected this for the auto-width updating in xboard - -2009-10-12 19:19:59 -0600 Eric Mullins : -Added server width adjustment based on client width changes - -2009-10-12 19:14:53 -0600 Eric Mullins : -silence some compiler warnings - -2009-10-11 18:39:24 -0600 Eric Mullins : -Maintainence to support all compilers. - -2009-10-11 17:07:27 -0600 Eric Mullins : -Adjusted alternative joining method to obey keepLineBreaksICS - -2009-10-11 14:48:55 -0700 H.G. Muller : -fix for bug #27668: e.p. field still not passed to engine - -PositionToFEN now takes the e.p. rights from epStatus[moveNr], -rather than calculating it on the spot from moveList[moveNr-1] -(which failed on the first move). - -2009-10-11 14:46:14 -0700 H.G. Muller : -fix for bug #27666: naming of variants - -Variant names "misc/xxx" are recognized as "normal", rather than "xxx" -to not get confused by the board "misc shogi" run by FICS. - -2009-10-11 10:14:09 -0700 H.G. Muller : -changed enable menus - -Put the "Open Chat Window", "Machine Both", and "Engine #N Settings" menu items -in the appropriate enable lists for graying them out wen not applicable. - -2009-10-11 10:13:14 -0700 H.G. Muller : -Added a command-line option -keepLineBreaksICS true/false to control line joining. - -2009-10-10 19:30:23 -0600 Eric Mullins : -Added code to prevent unnecessary width updates. - -2009-10-10 18:34:37 -0600 Eric Mullins : -Turned off wrap when possible on ICS servers. - -Turning off line wrap prevents splitting lines up using the -continuation sequence "\\ ". This is desirable when using -timeseal because timeseal's buffer is sometimes too small, -causing it to break lines itself. These lines can't be joined. - -2009-10-10 16:30:56 -0600 Eric Mullins : -vsnprintf() must be _vsnprintf() for MSVC - -2009-10-10 16:16:45 -0600 Eric Mullins : -added code to handle initial width update - -2009-10-10 14:21:12 -0600 Eric Mullins : -Added width updates to ICS client on font and window size changes - -What still needs to be done is placing an update call after login -to initialize with the correct width. I didn't see where to put -that. - -2009-10-10 14:19:30 -0600 Eric Mullins : -added ics_printf() and ics_update_width() and utility functions - -2009-10-10 11:15:50 -0600 Eric Mullins : -Cleaned up ConsoleWndProc (not complete, see below) - -Using static variables this way is not appropriate. I only addressed -hInput and hText in this commit though. But imagine the WndProc being -used by multiple windows instead of just one, and you can see why -using static variables in this way is wrong. - -2009-10-10 11:12:10 -0600 Eric Mullins : -Restructured URL code so it fits better with how winboard is set up. - -2009-10-10 08:57:39 -0700 Arun Persaud : -cleanup: removed "#if 1" statements - -2009-10-10 08:55:21 -0700 Arun Persaud : -cleanup: removed "#if 0" from source - -a bit of cleanup of the source code - -2009-10-10 08:34:10 -0700 H.G. Muller : -fix joining of lines split by ICS - -This patch fixes the joining of lines that were split by an ICS, so that adding -a space at the break point is done only when there was not a space already. -(Some ICS leave a space at the end of the broken line, others do not.) -An extra space would interefere with board12 in Gothic Chess, which is so -long that the ICS breaks it, and the WB parser could not handle a double -space within the board. - -2009-10-10 08:27:55 -0700 H.G. Muller : -fix for bug #27642: Clock jumps strangely in engine mode - -This moves SwitchClocks() back to after incrementing forwardMostMove, -so that it knows again who has the move (which was broken by the "bare" patch), -and will take the appropriate tick length. - -2009-10-10 08:26:13 -0700 H.G. Muller : -removed test for premove - -this was added while looking for the premove bug, but is not needed - -2009-10-10 02:03:45 -0600 Eric Mullins : -added URL detection and provided hotlinks in the ICS client - -2009-10-10 02:00:52 -0600 Eric Mullins : -reverted winboard.c beofre URL commit to correct whitespace conversion - -2009-10-09 02:14:22 -0600 Eric Mullins : -Added URL detection into the console text window for ICS. - -2009-10-08 23:51:06 -0700 Arun Persaud : -added some comments and formated code - -2009-10-08 23:46:52 -0700 Chris Rorvick <>: -fix printing out help message (list of command line options) (tiny change) - -The postfix increment always resulted in an attempt to print out an -option on the right side regardless of one actually existing. Use -prefix increment to prevent a crash when printing an odd number of -options. - -2009-10-09 00:04:51 -0600 Eric Mullins : -Updated navigation accelerators, fixing ICS problems. - -Recent changes to the navigation accelerators were in the wrong -accelerator table. Since the goal was to correct non-JAWS versions -back to 4.2.7 behavior, I updated it to how 4.2.7 did it, but still -retained the #ifdef JAWS conditional compilation. - -On an ICS, the navigation keys took control away from the ics -client to navigate the game. The update requires the ALT key to -be pressed, but it works identical to 4.2.7, not causing an -unexpected focus back to the board window when you're just editing -text. - -2009-10-08 20:33:39 -0700 H.G. Muller : -fixed premove recapture problem;promotion popup appearing on -obviously illegal moves; promotions in Superchess and Great Shatranj - -1) the premove recapture problem -2) the promotion popup appearing on obviously illegal moves (the 1. e2a8 -problem) -3) promotions in Superchess and Great Shatranj, where the piece can now be -selected from the holdings - -2009-10-08 20:28:50 -0700 H.G. Muller : -added forceIllegalMove to xboard - -2009-10-05 21:01:32 -0700 Arun Persaud : -bugfix: segfault when invalid option argument was given (bug #27427) - -when given a wrong argument to an option (e.g. -tc 0) xboard aborts -before setting up the window, but tried to write a message to the -messageWidget which doesn't exist at that point. - -2009-10-05 20:05:00 -0700 H.G. Muller : -small improvement for JAWS version - -This is a patch to make JAWS read out any comments when /autoDiplaycomment=true. -As focus does not stay on the Comment window, the comment was not spoken otherwise. - -2009-10-05 20:02:50 -0700 H.G. Muller : -updated to winboard internationalization scripts - -Also a slight improvement of the internationalization scripting, -to prevent it from crashing on messages containing a slash. - -2009-10-05 20:01:53 -0700 H.G. Muller : -new forceIllegalMoves option - -The -forceIllegalMoves option uses setboard or edit to force a position -when an engine refuses the move leading to it by an "Illegal Move" message. -Especially for engines using the edit command this was a bit tricky, -because of the a2a3 kludge to avoid using the white and black commands. - -2009-10-05 01:01:54 -0600 Eric Mullins : -removed _winmajor if not defined so that VC 2008 can compile the project - -The oldDialog variable should just be set to 0 in all cases now, and -as such, legacy code supporting the old dialog ought to be removed. -The test for _winmajor is against < 4, which is always false at present, -causing oldDialog to be 0 in every conceviable circumstance. - -2009-10-04 09:58:29 -0700 Arun Persaud : -getting ready for 4.4.1 release - -2009-10-02 20:47:01 -0600 Eric Mullins : -Simplified future version changes. - -Added a numeric version to config.h that is now used in winboard.rc -instead of being hard-coded there. Just be sure to preserve the -proper format (4 comma-separated 16 bit integers) or else it won't -compile. - -2009-10-02 16:56:01 -0700 Arun Persaud : -updated version number to 4.4.1.pre - -should have done this straight after the last release, but forgot... - -2009-10-02 16:48:03 -0700 H.G. Muller : -worked on premove bug - -I made an attempt to make premove unsensitive to a race condition, -just in case the premove problem was caused by that (which seems unlikely, -but in any case I added some debug printout to test this). - -2009-10-02 16:41:12 -0700 H.G. Muller : -fixed loading of saved games via command line - -the variables forwardMostMove and backwardMostMove where set to zero -at the wrong place. - -2009-10-02 16:39:20 -0700 H.G. Muller : -small fixes for the JAWS version - -* I moved saying 'check' by the JAWS version to where castling also benefits from it. -* I made sure the check symbols are also recognized on promotion moves -* In the non-JAWS version, define the plain arrows as shortcut keys for the button bar - -2009-10-01 16:50:28 -0600 Eric Mullins : -Fixed bug dereferencing garbage, causing crash. - -Commit fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10 included code to free the -resultDetails of the gameInfo structure. That exact code exists a few lines -above where it was added. None of these free() calls finish by setting the -member to NULL afterword, therefore repeated attempts to test/free() the -members result in an attempt to free() memory winboard no longer owns, and -an eventual crash. - -link to problematic commit: http://git.savannah.gnu.org/cgit/xboard.git/commit/?id=fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10 - -2009-10-01 16:49:57 -0600 Eric Mullins : -Added wchat.c to the project files we maintain. - -2009-10-01 15:52:50 -0600 Eric Mullins : -Previous fix for VC++/strcasecmp() was wrong-- use StrCaseCmp(). - -2009-10-01 14:49:58 -0600 Eric Mullins : -Add resource ID for new Mute menu item. - -I know this was probably done by HG, and simply left out of -his commit. Anyway, the project can be built now after this change. - -2009-10-01 14:49:09 -0600 Eric Mullins : -Use of strcasecmp() broke Visual C++. - -2009-09-30 20:47:00 -0700 Arun Persaud : -wrong default value for engineDebugOutput - -the new default is now 1 - -2009-09-29 22:55:41 -0700 Arun Persaud : -updated cmail.in to adapt the CVS->git change - -don't reference $Revision:$ anymore. -Instead use reference xboard-version via autoconf. - -2009-09-29 22:04:25 -0700 H.G. Muller : -bugfix for protocol extensions: egtbpath -> egtpath - -A new and very bad bug was discovered in the implementation of -the protocol extensions: XBoard sends a command "egtbpath" to the -engine in stead of "egtpath" from the protocol specs. -After discussion on WB forum it was decided that egtpath was better -than the egtbpath I originally had proposed, and I changed it accordingly, -but I had not realized that this string occurred TWICE in backend.c, -depending on if matched the -defaultPathEGTB of -egtFormats option. -I only changed the first occurence. - -2009-09-27 12:27:44 -0700 H.G. Muller : -fix for edit-position "moves" being sent by XBoard to the engine - -2009-09-27 12:25:25 -0700 H.G. Muller : -Engine did not start playing when out of GUI book on second move with white - -2009-09-27 12:24:30 -0700 H.G. Muller : -Opening Engine #1 Settings crashed XBoard when there were no -text-edit options in the dialog (to which to set keyboard focus) - - -2009-09-27 12:18:35 -0700 H.G. Muller : -added a "Mute All Sounds" item in the WinBoard Options menu, on Eric's request - -2009-09-27 12:15:20 -0700 H.G. Muller : -Updated the RTF docs for the chat windows, engine-settings dialog, -/keepAlive option and new game-list tag - -2009-09-27 12:14:25 -0700 H.G. Muller : -Made the beep sounds for JAWS board navigation configurable through -command-line options - -2009-09-27 12:11:49 -0700 H.G. Muller : -Prepared a system to internationalize the WinBoard menus - -2009-09-27 12:10:38 -0700 H.G. Muller : -added the result comment to the game-list tags when the game list is -exported to the clipboard - -2009-09-27 12:05:32 -0700 H.G. Muller : -rewrote wevalgraph for better frontend/backend separation - -I have finished re-writing the eval-graph code to have some -front-end / backe-end separation, something I had already started on my -holiday in Norway (when I had no internet :-) ). -The new code now appears to work exactly like the old code, -and I guess it could be ported to gtk comparatively easily. - -2009-09-27 12:00:51 -0700 H.G. Muller : -fix for keepalive and chat window - -I made a fix to the keepAlive option so it does not send the date command -to the ICS after every move. This required changing ScheduleDelayedEvent() -so that it does not execute the event if a new identical one gets scheduled. -I also added the option to XBoard. Affects xboard.c (DOS!) and winboard.c - -(This also cures the regression of the winboard.c copyright patch) - -I extended the chatbox patch to also listen to channel tells, and divert -them to a chatbox for that channel number. Affects -backend.c and wchat.c - -That should make those patches fully operational. No docs for either of them -yet, though. - -2009-09-27 10:36:23 -0700 H.G. Muller : -fixed parse bug for pgn files - -fixed the existing bug that the time-control tag was displayed as "?" -in the game list; turns out it was never parsed on reading PGN files - -2009-09-27 10:35:58 -0700 H.G. Muller : -allow the result comment as a display item in the game list - -2009-09-27 10:35:13 -0700 H.G. Muller : -fixed the HAVE_LIBXPM-dependent compile errors - -2009-09-27 10:24:47 -0700 H.G. Muller : -added a chat window to keep track of multiple conversations - -The chat-window patch affects: -winboard.c, backend.c, winboard.rc, resource.h, backend.h, and adds -the file winboard/wchat.c, which also affects makefile.gcc and makefile.ms. - -In addition I added a new option -keepAlive, which affects -common.h (in addition to winboard.c and backend.c). - -As I had to modify backend.h, I also defined the -reset option type there, -which we are going to add later. This required some changes -to suppress warnings in wsettings.c. - -2009-09-27 10:22:16 -0700 Arun Persaud : -more files for git to ignore - -most of these are generated by make distcheck - -2009-09-08 09:33:53 -0700 Arun Persaud : -another bug fix found by Stanislav Brabec - -returned -1 in some case although the variable was a char... -changed to signed char - -2009-09-20 23:13:13 -0600 Eric Mullins : -Swapped 'tell' and 'message' parsing order for colorization. -Sometimes messages are relayed as tells and should be colorized as tells. - -2009-09-08 09:10:34 -0700 Arun Persaud : -added some more files to be distributed via make dist - -as suggested by Stanislav Brabec - -2009-09-08 09:01:07 -0700 Arun Persaud : -fixed some implicit declarations reported by Stanislav Brabec - -2009-09-07 22:04:39 -0700 Arun Persaud : -fixed a few more small bugs reported by Stanislav Brabec - -- A function uses a 'return;' statement, but has actually a value to -return, like an integer ('return 42;') or similar: xboard voidreturn -xengineoutput.c:766, 782 - -- Program returns random data in a function at xengineoutput.c:602 - -- With a new toolchain, AM_LDFLAGS cannot contain libraries. Linker -ignores them. Fix is attached. - -- ToDo: Convenient name in most projects is TODO (autotools package it -automatically). - -2009-09-06 19:11:22 -0700 Arun Persaud : -reverted .texi file and fixed Makefile.am - -the problem was actually not in the texi-file, but the Makefile.am. -Reverted changes in the .texi and fixed it (hopefully) correctly now. - -2009-09-06 18:23:01 -0700 Arun Persaud : -get "make distcheck" to work - -needed to add all *.h files to Makefile.am and also the bitmaps that -are needed and some other files. Also had modified copyright.texi. - -2009-09-05 09:54:37 -0700 Arun Persaud : -changed to version 4.4.0 - -2009-09-05 09:44:21 -0700 Arun Persaud : -updated AUTHORS, README and ChangeLog files for release - -2009-09-05 08:52:09 -0700 H.G. Muller : -fixed some typos - -2009-09-04 22:39:45 -0700 H.G. Muller : -set castling rights after setting up a position - -I was going through old WB forum posts, and I encountered a -bug report for a bug that I never fixed: The castling rights should -be properly set (actually: cleared) after setting up a position -in Edit Position mode (as opposed to pasting a FEN). - -2009-09-03 23:11:18 -0700 Arun Persaud : -removed install files from master - -they now live in their own branch - -2009-09-03 22:30:18 -0700 H.G. Muller : -updated polyglot protocol - -I added a new option type "-reset" to the protocol for the new option feature. -4.4.0 does not implement it yet, but Michel wants it for future Polyglots, -and I think it is best to update the protocol in one big swoop. -So I want to already include it in the specs now. (engine-intf.html) -I made xboard's response to an unknown option type compliant -with the new protocol specs. - -2009-09-03 22:28:50 -0700 H.G. Muller : -fixed some typos - -2009-09-03 20:47:13 -0600 Eric Mullins : -Updated project files for DevCpp and Visual Studio to add wsettings.c - -2009-09-03 20:46:33 -0600 Eric Mullins : -Added newline at end of file to silence warning. - -2009-08-31 20:29:49 -0700 H.G. Muller : -workaround for error message for missing pieces used in variants -and initstring bugfix: error messages showed for non-existing pieces -showed up for old user supplied pixmaps. -Loading a pixmap of the king for the missing pieces now. - -Another bad bug surfaced: the -initString argument does not work in any -XBoard version! (Including 4.2.7b) The escape sequences for linefeed in -the string are not understood: -initString "new\nrandom\n" actually sends -the \ and n to the engine (which then does not recognize the line as a -valid command)! - -So I also added a patch to expand escape sequences in the InitString and -ComputerString command-line options. - -2009-08-31 20:27:24 -0700 H.G. Muller : -updated installe script - -I re-organized the doc files in the install, so they now all go in the -WinBoard\doc folder (and none in the root). I so included the COPYING -and COPYRIGHT files there. This required some updates of the links in -some html files, and of the menu link to README.html in the install script. -I also fixed an error with the current directory -in the menu short-cuts of some engines (which started in the fonts folder, -and could not find the opening book there...). - -2009-08-31 20:25:17 -0700 H.G. Muller : -updated documentation - -2009-08-31 20:20:55 -0700 H.G. Muller : -updated installer script - -2009-08-31 19:51:48 -0700 H.G. Muller : -new help files for windows - -2009-08-25 20:41:29 -0700 H.G. Muller : -updated installer - -2009-08-25 20:36:53 -0700 H.G. Muller : -undid some previous changes - -some files got mixed up - -2009-08-25 20:32:22 -0700 H.G. Muller : -fixed small bug in wsetting - -2009-08-25 20:29:06 -0700 H.G. Muller : -trigger a focus switch to ICS input field when typing - -old behavior was that "." or "," triggered this, -now every printable character except 1-9 will trigger the focus switch - -2009-08-25 20:26:20 -0700 H.G. Muller : -bug in backend.c when receiving lines from ICS - -A space was appended to every character received from an ICS -in stead of just at line breaks. - -2009-08-24 23:47:48 -0700 H.G. Muller : -fixed warning messages from compiler - -2009-08-23 14:24:38 -0700 Arun Persaud : -fixed build on OS X - -this seems to fix it. Bug reported by Louis Zulli who also did the testing. - -2009-08-23 11:54:28 -0700 H.G. Muller : -OK, this is the beefed up version of the Polyglot info-string kludge, -for WB and XB. - -2009-08-23 10:22:48 -0700 Arun Persaud : -added missing X_LIBS references to Makefile.am - -2009-08-22 23:33:44 -0700 Arun Persaud : -made the install script and executable - -2009-08-22 23:19:07 -0700 Arun Persaud : -changed beta1 to beta2 - -2009-08-22 23:14:11 -0700 Arun Persaud : -fixed enable zippy in configure script and added some checks for OS X - -make tried to compile zippy even when --disable-zippy was given. -Also fixed a bug in xboard.c where #ifdef instead of #if was used -to test for ZIPPY (it's either 0 or 1, so we need #if). Also added -some special checks for OS X, not sure if these will do it, but it's a start;) - -2009-08-22 19:09:54 -0700 Arun Persaud : -added configure summary to configure output, also cleaned up configure.ac a bit - -used AS_HELP_STRING where possible - -2009-08-22 18:10:57 -0700 Arun Persaud : -added check for malloc.h - -this should fix a build error on OS X - -2009-08-22 17:47:44 -0700 H.G. Muller : -A small cosmetic change in the size of buttons -inside a groupbox of the Engine-Setup dialog. - -2009-08-22 17:32:14 -0700 H.G. Muller : -make xboard usable with UCI engines - -I made a small patch in xoptions.c (where the corresponding Engine Settings -dialog was for XBoard), to make it at least usable for UCI engines: I now -divide the options over upto 4 columns, if there are too many to fit into -a single column. This seems to work. Still looks very ugly, but it is -functional. - -2009-08-22 17:30:05 -0700 H.G. Muller : -fix premove for winboard - -This might fix the illusive premove problem. In 4.2.7 the code was not properly -indented, and this led to an unbalanced braces error that I then fixed the -wrong way. Click-click premoves did only work after clicking the toSquare twice. -It might be that they actually did work after clicking it once, -but that the highlights were not displayed (although set) -for lack of a display refresh. - -2009-08-22 17:28:11 -0700 H.G. Muller : -fixed bug for double saved games - -This patch should solve the problem with doubly saved games when XBoard is -closed. I calculate a cecksum of each saved game now (including move comments), -and suppress saving if the checksum is not changed. - -2009-08-22 17:25:58 -0700 H.G. Muller : -fixed xengineoutput.c, to keep the duplicated code identical to that of wengineo.c. - -2009-08-22 17:24:08 -0700 H.G. Muller : -updated xboard.texi: added warning that pixmaps are not build for all variants - -2009-08-22 17:19:11 -0700 H.G. Muller : -added a dialog for engine-specific option settings - -2009-08-22 17:09:58 -0700 H.G. Muller : -updated some documentation - -2009-08-22 17:07:10 -0700 H.G. Muller : -fixed several bugs in the backend and added some more polyglot support - -* I added recognition for the new UCI3 option types that are recognized in the WB -option features, to make sure this version is compatible with future Polyglots. -Also fixed a bug that failed to strip an asterisk prefix from the first -combo-box item. - -* I fixed the ICS-time-in-PGN bug. - -* I fixed a bug which caused a space to be missing when long lines broken up by -an ICS were joined. - -2009-08-22 17:02:58 -0700 H.G. Muller : -better polyglot support for engine ouput - -I fixed the algorithm for clearing the Engine Output window to work better with -the latest Polyglot, whight outputs UCI "info strings" amongst the thinking -output. - -2009-08-22 16:23:32 -0600 Eric Mullins : -Beginnings of installer for 4.4.0. HGM asked me to forward the nsi file, -but it seemed best to just add the installer tree to git even though -it's not finished. You must install NSIS then FontName-0.7.exe -(included in installer folder) then run build.bat in the same directory. - -2009-08-05 22:18:29 -0700 H.G. Muller : -patch backend.c to make the -noGUI option also work in ICS mode. - -2009-08-01 13:09:49 -0700 H.G. Muller : -temporary fix for pre-select - -As a temporary kludge I replaced looking into the holdings for the piece type -by figuring out which piece would belong on the clicked holdings square. -This is a non-trivial process, as it depends on which pieces participate -in a certain variant. - -2009-07-30 00:19:37 -0700 H.G. Muller : -changed click-click moves - -I got complaints about the way XBoard 4.4.0 handles click-click moves, -in particular changing the selected piece after selecting King -(for which I suppressed interference with FRC castling in a rather brutal way). -People tell me it is very annoying that clicks sometimes don't work to select a piece. -WinBoard uses refined logic in the back-end to handle this, but the XBoard -front-end is not interfaced with that yet. -(This would require a major rewrite of the mouse handler.) -This temporary patch suppresses this behavior in all variants that do not support -Fischer castling, and even there only exhibit it for Rook-after-King selection -(which will be interpreted as an attempt to enter a castling move as K x own R). - -2009-07-26 08:43:35 -0700 H.G. Muller : -option -adjudicateDrawMoves is not included in the XBoard list. - -added it to the option list - -2009-07-21 20:23:23 -0700 Arun Persaud : -converted files from dos to unix format - -run dos2unix over a bunch of files - -2009-07-16 07:43:38 -0600 Eric Mullins : -Stripped out unused VersionInfo - -2009-07-15 23:16:19 -0700 Arun Persaud : -changed version to 4.4.0.beta1 - -2009-07-15 23:12:37 -0700 Arun Persaud : -updated INSTALL file to add ./autogen.sh - -2009-07-15 22:44:05 -0700 H.G. Muller : -higher number of engine options possible now - -I upped the number of options per engine from -50 to 100, and the average number of characters per option from 10 to 20. - -2009-07-15 12:30:37 -0600 H.G. Muller : -Fix of bad bug - -2009-07-14 23:41:36 -0600 Eric Mullins : -Added version information to resources. - -2009-07-14 23:40:50 -0600 Eric Mullins : -Added Jaws targets to IDE projects. - -2009-07-14 23:39:12 -0600 Eric Mullins : -Final makefile adjustments and compiling instructions. - -2009-07-13 22:35:17 -0600 Eric Mullins : -Cleaned up garbage left behind from my makefile update. - -2009-07-13 22:26:56 -0600 Eric Mullins : -Updated cmdline makefiles to be able to produce JAWS binaries. - -This breaks support for MSVC 4.x. It may still be possible to -use that compiler if you obtain the latest SDK from Microsoft. -MSVC 6.0 still works, but I had to change the target windows -version to 0x500 which causes warnings about building beta -applications. This is all due to the use of MENUBARINFO data -type in the jaws binary. You can reduce the WINVER to 0x0400 -safely if you are not building a JAWS binary, and MSVC 4.x -will work fine. - -2009-07-13 22:26:10 -0600 Eric Mullins : -Removed dependency on jfwapi.h - -Allows anyone to compile a jaws compatible binary. - -2009-07-13 22:23:31 -0600 Eric Mullins : -Fixed duplicate resource in winboard.rc - -PLEASE remember to pull before commiting. This is the 2nd -time I've fixed this. It's a waste of time to keep fixing -the same problems. - -2009-07-13 19:36:58 -0700 Arun Persaud : -resolved conflict between Xt and Xaw libraries - -seems like we don't need to link against Xt. - -2009-07-13 19:33:57 -0700 H.G. Muller : -help-menu was not un-grayed in the JAWS version, when it played with engines - -2009-07-13 19:29:53 -0700 H.G. Muller : -integrated jaws into winboard - -I integrated the JAWS patch now into WinBoard in such a way that the -JAWS and standard version can use the same resource file. This new -winboard.c contains the improved dialog layot of the JAWS version, -but none of the menus and JAWS-specific acclerator keys. The latter -are now generated at run time by code in jaw.s. As a result jaws.h -could be cancelled, as there the JAWS-specific defines are no -longer needed outside jaws.c (now the .rc does not use them), and -is incorporated in it. - -2009-07-12 15:37:26 -0700 Arun Persaud : -fixed problem in autoconf using Xaw3d - -rewrote the section for Xaw3d in the autoconf file - -2009-07-12 15:29:28 -0600 Eric Mullins : -Added Jaws support to GCC makefile - -2009-07-12 15:28:20 -0600 Eric Mullins : -added help support: MSVC IDE and DevCpp IDE project files - -2009-07-12 15:26:49 -0600 Eric Mullins : -Removed obsolete makefiles and support files. - -2009-07-12 12:33:26 -0700 Arun Persaud : -updated AUTHORS with the help of git. use - -git log --pretty=oneline --name-only --author=AUTHORNAME v4.2.7..HEAD |sort |uniq - -a bit of hand editing and a quick emacs macro later and you have a nice -comma seperated list of all files changes by one author between two commits. - -2009-07-12 12:31:47 -0700 Arun Persaud : -updated Changelog using git log --no-merges --pretty="* %ai: %s%n %b" HEAD v4.2.7 - -2009-07-12 11:34:28 -0700 Arun Persaud : -cleaned up some more copyright notices - -2009-07-12 11:22:30 -0700 Arun Persaud : -updated copyright to reflect A. Scotte as copyright holder - -need to mention him, since the paperwork won't be finished before the next release - -2009-07-12 10:56:29 -0700 Arun Persaud : -updated patchlevel to "k" - -2009-07-12 10:53:50 -0700 Arun Persaud : -fixed autoconf problem with VERSION/PATCHLEVEL variables - -xboard used it's own version of PRODUCT, VERSION and PATCHLEVEL variables. -Switched to PACKAGE_STRING provided by autoconf - -2009-07-12 10:29:46 -0700 Arun Persaud : -cleaned up old CVS left overs - -removed $Id tags from all files - -2009-07-12 10:10:17 -0700 Arun Persaud : -converted xhistory via dos2unix - -2009-07-12 10:09:24 -0700 H.G. Muller : -fixed crash in history window - -someone discovered that opening the move-history window in XBoard leads to -an immediate crash. Turns out that renaming the menu item broke it! (The -name of the item was apprently used elsewhere in the code to access it, -for putting a check mark there.) - -2009-07-12 10:04:30 -0700 H.G. Muller : -fix for Animation of castling moves in Chess960 - -Animation of castling moves in Chess960 turned out to sometimes make the -king disappear from the display. For the time being I patched this in -xboard.c to suppress animation of FRC castling moves altogether. As FRC -castlings internally are represented as KxR, the to-square does not make -sense anyway, which made the animation look very weird even when it led -not to a king disappearance act. And the Rook move of a castling is never -animated. - -2009-07-11 22:44:53 -0600 Eric Mullins : -Update GCC makefile to remove .obj targets. - -Dunno how they got in there, but they should be .o - -2009-07-11 22:42:41 -0600 Eric Mullins : -Update makefile dependencies on help.c and help.h. - -2009-07-11 22:36:59 -0600 Eric Mullins : -Allow compiling with MSVC6.0 and 4.1 - -Move prototypes into help.h, after making sure that DWORD_PTR is -defined. Include help.h from winboard.c and help.c so both files -benefit from the definition. - -2009-07-11 18:26:16 -0700 H.G. Muller : - lists these accelerator keys in the menus for JAWS - -2009-07-11 18:24:19 -0700 H.G. Muller : -added shortcuts - -This patch allows the use of Ctrl+C and Ctrl+V for Copy Game -and Paste even in I C S mode when the board has focus. - -2009-07-11 18:22:17 -0700 H.G. Muller : -better handling of pasting a game without PGN tags - -patch in wclipbrd.h to make it smarter to decide between pasting -a game or a position so it can handle games without PGN tags. -If it doesn't parse as a FEN it is assumed to be a game. - -2009-07-11 18:20:56 -0700 H.G. Muller : -fixed parser error for knight move - -The parser had a strange quirk: it recognized bd2 as a valid Knight move -(Nb1-d2) while this SAN format should be reserved for Pawn moves only. - -2009-07-11 18:19:30 -0700 H.G. Muller : - fixed a few warnings in connection with the help patch (now warning free) - -2009-07-11 18:13:50 -0700 H.G. Muller : -some major re-assignment of accelerator keys in the JAWS - -2009-07-11 16:54:53 -0600 Eric Mullins : -several small fixes - -uptracked winboard.ini - -* Cleanup: moved "Some definitions required..." from winboard.c to config.h, -and combined some definitions from borland w/ MS. - -* Changed internal HtmlHelp return type and 4th argument to facilitate various -compilers. These changes, while not strictly adhering to HtmlHelp() conventions, -won't impact anything since the function modified is internal only. - -* Modified HtmlHelp return values to integer to silence warnings. -* Added help.c to the project in makefile.gcc & makefile.ms. -* Fixed duplicate resource in winboard.rc. - -2009-07-09 22:08:15 -0700 H.G. Muller : -added JAWS support; help files for Vista; bugfixes for winboard.c - -* JAWS support -* help files should now work under Vista (the user has to have either - a program to view old windows help files or to view html-files installed) -* I fixed the tabbing between all windows that were added according to Tim's sugestions. -* I added typing in of a move number in the move type-in dialog as a shortcut - to going to that position by use of the < and > buttons. Mainly intended to - ease life for the blind, but I think it can be generally useful. - (Although the move-history dialog provides that functionality too, - this is quicker if you don't happen to have it open.) -* I added typing of a FEN in the move type-in dialog in Edit Position mode. - (Which could not be used without mouse at all, and is defective - in crazyhouse even with mouse, as there was no way to populate holdings.) - -2009-07-09 22:03:00 -0700 H.G. Muller : -some bugfixes: ICS error handling - -* play a different sound for takebacks in ICS mode -* pop up error messages for illegal moves for typed-in moves - -2009-07-09 21:50:41 -0700 H.G. Muller : -removed no longer needed debug message - -2009-07-09 21:48:23 -0700 H.G. Muller : -fixed compile error from a previous change - -2009-07-09 21:44:54 -0700 H.G. Muller : -user selectable font in game list - -This makes the game list use the same (user selectable) font -as the the move-history window. - -2009-06-30 21:27:34 -0700 H.G. Muller : -fixed typos in xboard.texi documentation. - -2009-06-30 21:16:59 -0700 H.G. Muller : -updated the FAQ - -2009-06-27 17:06:26 -0700 H.G. Muller : -changed font in engine output window - -The engine-output window now uses the same font as the move-history window -(which was selectable in the "Options -> Fonts..." menu, while the other -wasn't). - -2009-06-27 17:03:19 -0700 H.G. Muller : -fixed some characters in xboard.texi - -It seems that copying manual sections from the RTF to th texi file did -somehow mess up the double-quote characters, and changed them into some -strange (unicode?) symbols. - -2009-06-27 16:56:36 -0700 H.G. Muller : -two shogi related bugfixes - -I discovered a bug in the move generator for the Shogi Dragon King. I -guess it went unnoticed so far because this is a promoted version of the -Rook, which hardly occurs in games. (moves.c) - -There was also a problem with the piecesfix I sent you before; Shogi -chosen as initial variant did use wrong piece symbols. (I had tested this -on gothic, but there it happened to work for a different reason, unique to -gothic.) This affects xboard.c. - -2009-06-27 16:54:04 -0700 Arun Persaud : -small cleanup - -2009-06-27 16:51:02 -0700 H.G. Muller : -adds bitmaps for shogi promotions, and selects the bitmaps or -pixmaps for the more rarely used piece types on a per-variant basis. - -2009-06-27 16:44:36 -0700 H.G. Muller : -adds new piece types in the promotion dialog and edit-position piece menu - -2009-06-27 16:13:15 -0700 H.G. Muller : -updated bitmaps files: files for fairy pieces where missing, -others had names that didn't work with autoloading. - -2009-06-27 16:06:35 -0700 H.G. Muller : -fixed a bug concerning bitmaps - -2009-06-27 15:53:45 -0700 Arun Persaud : -give a default directory for bitmaps files (tiny change) - -this is also one of the debian patches, should be rewritten to use -the correct install directory. No Author was given. - -2009-06-27 15:47:52 -0700 Brian May <>: -verbose_error_message_about_recognized_options (tiny change from Debian patches) - -2009-06-27 15:45:14 -0700 Matt Zimmerman <>: -add a visual low time warning (tiny change from Debian patches) - -2009-06-24 23:31:52 -0700 Arun Persaud : -dos 2 unix conversion of backend.c - -2009-06-24 23:30:07 -0700 Arun Persaud : -exchanged some sprintf with snprintf found in a patch for the debian system, -extended it a bit to other sprintf's original patch included only 11 lines -by Florian Ernst - -2009-06-24 23:07:23 -0700 Mark Ioli : -enabled a patch for default settings in winboard - -2009-06-24 22:53:11 -0700 H.G. Muller : -updated copyright notice - - -2009-06-24 22:52:20 -0700 H.G. Muller : -patches a bug in chosing the initial board size on a virgin startup -I introduced recently - -2009-06-24 22:49:33 -0700 H.G. Muller : -I put in testing for the winning condition in 3checks - -on a check it just goes through the entire game to subject -every position on a check test, to see if there were two more. - -2009-06-24 22:47:01 -0700 H.G. Muller : -updated copyright notice in docs - -2009-06-24 22:41:40 -0700 Florian Ernst : -added small patch from debian (tiny change) - -according to the debian patch tracker, this patch is by -Florian Ernst . -It fixes whitespace issues in filename called from cmail. - -2009-06-24 22:33:13 -0700 Arun Persaud : -converted dos2unix format for xboard.texi - -2009-06-24 22:31:57 -0700 Arun Persaud : -deleted two more files that don't need to be in git - -these files can be generated by autogen.sh - -2009-06-21 12:10:31 -0700 H.G. Muller : -major overhaul of the -stickyWindows feature - -I did a major overhaul of the -stickyWindows feature. -The game-list and ICS-interaction windows are now also sticky. -I also added a form of stickiness when the main window is resized; -edges of auxiliary windows sticking to the right or bottom side of -the main window stay attached when the window resizes -(due to nr of board squares or their size). The way the window -coordinates are saved in the .ini file is now relative to the -main window, and some dummy options are added to be able to -recognize right- and bottom-edge sticking, and reconstruct that -when WB starts up with another board size. Also added are -volatile options to ensure there will be space for auxiliary windows -above and left of the main window. - -2009-06-21 12:07:01 -0700 H.G. Muller : -fixed long-algebraic form of drops - -The WB parser turned out not to understand the long-algebraic form -of drops send by an ICS. (like B/@@-e4), so even with -legality testing off I now use the SAN move for drops. - -2009-06-18 18:35:31 -0700 H.G. Muller : -Refined stalemate adjudication in Suicide, some cleanup - -Refined stalemate adjudication in Suicide, which seems to be not always won -for the stalemated side, but for the side with the smallest number of pieces. -Cleaned up the adjudication code in the process. (backend.c moves.c, moves.h) -Also includes a tiny change in the -autoKibitz format, as requested on -Talkchess. - -2009-06-18 18:32:57 -0700 H.G. Muller : -Enhancement of the way -autoLogo decides which logos to display - -2009-06-16 00:06:59 -0700 H.G. Muller : -bugfix and enhancement in autoKibitz mode - -changed the format of the autoKibitz: score/depth in stead of depth/score, -as in PGN. I also supress the ICS time for the move now in the PGN -if extended info is available. When enhancing the functionality of -the autoKibitz command (using the opponent engine kibitz for the saved PGN) -I discovered that the xengineoutput.c in our tree was obsolete, -and contained a routine of which the arguments were no longer compatble -with the call from backend.c, and caused segfaulting. I copied in -the corresponding routine in wengineo.c, which was compatible. That the -compiler did not flag this is a sign of badly organized code, I suppose... - -The enhancement itself affected backend.c. - -2009-06-16 00:04:13 -0700 H.G. Muller : -modified clock layout - -I altered the display of the clocks in the presence of engine logos; I used to -stack them, but some inquiry on Talkchess sowed that people disliked the -stacking. So now I display them next to each other again, but as 2-line-high -fields to make room for te logos. - -2009-06-15 23:59:32 -0700 H.G. Muller : -new zippy option zippyShortGame - -On request of Mike Adams I added a new zippy option, -zippyShortGame, -to make life more difficult for abusers of abort and disconnect for cheating. - -2009-06-15 23:56:40 -0700 H.G. Muller : -fixed some bugs in the animation of atomic captures - -2009-06-13 15:27:26 -0700 H.G. Muller : -some small bugfixes - -I had overlooked one place from which the FEN writer -(of whicf I changed the argument types), which made WB crash -if you copied a FEN (or PGN that cotained FEN) to the clipboard. -I must have overlooked a warning during compile, or some depedency -is not correct in the makefile. Anyway, wclipboard.c had to be changed. -I also moved adjudication of some losing conditions to before tetsing -for stalemate, (e.g. in atomic, if your king get destroyd you lose, -even if you have no moves after that because it was your only piece.). -this affects backend.c. -I had used the same bits in the rule-modifier flags for indicating -mandatory capture as was already used for indicating FRC-style castling. -This led to frequent illegal move calls in FRC... (moves.h) - -2009-06-13 10:45:17 -0700 Arun Persaud : -cleaned up HTML in FAQ.html -- still need to work on content - -2009-06-13 09:36:26 -0700 H.G. Muller : -added option for work-around for some FRC engines in regards to FRCFENs - -It suddenly occurred to me that I had promised on CCC to include an option -to provide a work-around for the problem that some FRC engines do not -understand FRC FENs (and thus do not play at all under WinBoard, -as FRC always has to begin with sending the initial position). -So I added the options -firstNeedsNoncompliantFEN, -secondNeedsNoncompliantFEN. -This affects winboard.c and xboard.c, (for defining the option), -common.h, backend.h, backend.c, (for implementing it), -xboard.texi and winboard.rtf (decribing it). -This option provides users with a means to always force the FEN castling field -to KQkq (but can be used for many other work-arounds as well). - -2009-06-13 09:30:31 -0700 H.G. Muller : -fixed bug with random calls - -There also seemed to be a bug with the shuffling of opening positions; -I had changed the declaration of the position number from -long long int to u64 to comply with MSVC, but this suppressed shuffling -completely. I now changed it to int. I recently noted a problem with true -randomizing anyway: this was based on srand(time()), but time() apparently -did not change fast enough, so that starting several games in rapid succession -(because the book line contained a 3-fold repetition) produced identical games. -So I now seed the random once and for all during startup, based on the msec of -the time mark, and removed the other calls to srand(). - -2009-06-13 09:26:14 -0700 H.G. Muller : -changed name for fairymax program in xboard.h - -2009-06-13 09:25:07 -0700 H.G. Muller : -removed my name from copyright message in help->about menu - -2009-06-13 09:22:02 -0700 H.G. Muller : -fixed -stickyWindows option - -I figured out why -stickyWindows was not working in XP and Vista -(while it always worked under Win2K), and I think I found a fix for -it that works under all Windows versions. (I tried XP and Win2K.) - -2009-06-13 09:20:38 -0700 H.G. Muller : -Updated docs for Engine-Settings menu - -2009-06-13 09:19:05 -0700 H.G. Muller : -Awareness of winning conditions for atomic and giveaway variants; two bugfixes - -fixed bug in claim verification -Bugfix on initial position of Great Shatranj - -2009-06-13 09:16:47 -0700 H.G. Muller : -Legality testing (mandatory capture) in giveaway variants - -2009-06-13 09:16:17 -0700 Arun Persaud : -don't ignore winboard/parser.c - -2009-06-13 09:12:15 -0700 H.G. Muller : -Added new variant Twilight Chess - -2009-06-13 09:08:57 -0700 H.G. Muller : -some renaming and restructuring of WB menu items, to conform more to XBoard - -2009-06-13 09:07:07 -0700 H.G. Muller : -Fixed bug in atomic patch that interfered with non-atomic variants - -2009-06-10 21:46:11 -0700 H.G. Muller : -fixed different use of engine option compared to Polyglot - -it turns out the new Polyglot uses a sightly different version -of the GUI->engine option command than the one I proposed -(and implemented in XBoard; Michel sneaked in an '=' sign -between the NAME and VALUE of the option, to allow for -more unambiguous parsing. I guess in principle this is a good idea, -so I adapted XBoard to Polyglot rather than the other way around. -The result is that there are canges in xboard.c, and the documentation. -I noticed that I unjustly had internationalized the option strings -to be send to the engine in xoptions.c; this was of course nonsense, -as this was WB protocol. So I undid that too. - -2009-06-10 21:37:47 -0700 H.G. Muller : -add the already supported variants 3check and great (=Great Shatranj) -to the New Variant... menu. - -2009-06-10 21:32:22 -0700 H.G. Muller : -animate explosions in variant atomic (if animate moves is on). - -2009-06-10 21:30:19 -0700 H.G. Muller : -fixed castling bug in variant twokings. - -2009-06-10 21:22:36 -0700 H.G. Muller : -fixed forteitary wins for special game variations - -feature that corrects forfeitary wins (e.g. on time) -of a bare King to draws of course breaks proper operation -in losers, suicide and giveaway - -2009-06-09 21:02:51 -0700 H.G. Muller : -automatically test ini file extension for files from commandline option @filename - -The winboard.c is a patch that automatically tries indirection files on the -command line (@filename type arguments) also with an extension .ini if the name itself -did not match any existing file and contained no period. This saves the user typing the -.ini all the time (which I started to find pretty annoying while working on the installer -package). - -2009-06-08 15:23:58 -0700 H.G. Muller : -added gamelisttag option to xboard - -also updated documentation. - -2009-06-08 15:20:00 -0700 H.G. Muller : -updated RTF file for winboard - -2009-06-06 09:12:48 -0700 Arun Persaud : -fixed syntax error in texi file - -2009-06-06 08:57:52 -0700 Arun Persaud : -updated to patchlevel "j" - -2009-06-06 09:00:25 -0700 H.G. Muller : -fixed adjudicating probelm in Shantranj - -Refrain from adjudicating a draw based on insufficient mating material -(except bare King vs bare King) in Shatranj (where in this case you can -still win by baring the opponent's King). - -2009-06-06 08:55:17 -0700 H.G. Muller : -updated documentation and FAQ - -2009-06-04 22:52:31 -0700 H.G. Muller : -source clean up. Fix compiler warning, removed unused variables, etc. - -2009-06-04 20:43:29 -0700 Eric Mullins : -adding support for different windows compiler - -Eric kindly provided us with some makefiles for different windows -compiler and also fixed some issues that came up while using those compilers. - -2009-06-04 18:27:26 -0700 Arun Persaud : -cleanup: got rid of a lot of files that are not needed for a new release - -lots of documentation was available in several places, -old unused source files and not used graphics file were floating around -in the tree. This should clean up most of it. No need to keep these files -around, especially since we are using version control. - -2009-05-29 18:56:06 -0700 H.G. Muller : -Added the Action-menu items that allow the user to adjudicate -ongoing games in Two-Machines mode. This was an already existing -backend function from Winboard_x; I only had to create a menu item for it -to be called. Due to an oversight I had forgotten to do that so far. -(Logically, I should have done it in the 4.3.5 release, -where I updated the XBoard menus to conform to the WinBoard menus.) - -I tested them, and they seem to work. (As expected.) - -2009-05-28 22:23:00 -0700 Arun Persaud : -updated patchlevel to "i" - -2009-05-28 22:19:08 -0700 H.G. Muller : -small change to mousewheel support; two changes in window behaviour - -* Visible effects during resizing suppressed, bug in chosing new size fixed. -* No longer reserves left and top margins next to main window on first popup. -* built in some hysteresis into mousewheel support, ignorng the first event in any new -direction to suppress effects from accidential mouse movement. - -2009-05-28 22:11:11 -0700 H.G. Muller : -corrected 'animate dragging' - -I finally figured out how the 'animate dragging' works in XBoard, -so that I could add code to do the unstacking of multiple pieces -in the holdings, rather than always leaving an empty square while -you drag them. (And then suddenly re-growing the remaining pieces -as you make the drop.) It does not look as fancy as in WinBoard -yet, because the counts still only decrease when you release the -piece, rather than when you lift it. But this is not nearly as -disturbing as leaving empty holdings (if only temporarily) when -you still have pieces there. - -2009-05-28 22:06:15 -0700 H.G. Muller : -Added comand-line options -debugFile (as synonym for -nameOfDebugFile, -as WinBoard also has these synonyms), and -engineDebugOutput -(wich already existed in the backend). - -2009-05-28 21:57:53 -0700 H.G. Muller : -updated documentation for new release - -2009-05-28 21:55:51 -0700 H.G. Muller : -added Xiangqi perpetual-chase detection - -2009-05-28 00:06:53 -0700 Arun Persaud : -Updated all files to GPL version 3. - -2009-05-28 00:03:32 -0700 Arun Persaud : -converted two files from dos to unix format - -2009-05-27 23:12:24 -0700 Arun Persaud : -updated INSTALL, NEWS and other files for new release - -cleaned up a bit and updated some information in the text files. - -2009-05-07 21:48:23 -0700 Arun Persaud : -winboard/config.h shouldn't be in .gitignore, only ./config.h - -2009-05-07 21:47:37 -0700 H.G. Muller : -bumped patchlevel to 0g - -2009-05-07 21:46:02 -0700 H.G. Muller : -corrected path in makefile - -2009-05-07 21:45:48 -0700 H.G. Muller : -updated rtf - -2009-05-07 21:45:25 -0700 H.G. Muller : -added firstOptions, secondOptions, noGUI, firstXBook, secondXBook - -2009-05-07 21:44:03 -0700 H.G. Muller : -handle promotion case for Shogi - -2009-05-07 21:43:34 -0700 H.G. Muller : -add note about RESULT command for GUI programmers - -2009-05-07 21:42:37 -0700 H.G. Muller : -small changes to book.c - - added code for different board sizes - added some debuginfo - handle promotion of pieces - -2009-05-05 23:07:18 -0700 Arun Persaud : -added a .gitignore file - -2009-05-03 12:41:06 -0700 Arun Persaud : -wrong line ending for Unix... ran dos2unix on both files - -2009-05-02 13:51:50 -0700 Arun Persaud : -fixed texinfo files, added windows help file, removed config.h from git - -texinfo.in is not needed anymore, since it only provided a -version string, but this can be created automatically using autotools - -deleted config.h from version control, since it is automatically created. -added winboard.hlp file (not sure if needed) - -2009-04-26 23:34:34 -0700 Arun Persaud : -updated autoconf init file - -* renamed autoconf init file from configure.in to configure.ac -* added bug-report email address to ac_init -* replaced ac_output(...) with ac_config_files, ac_config_commands and ac_output - -2009-04-26 14:49:03 -0700 Arun Persaud : -parser.c is generated by lex, so it shouldn't be tracked -and also parcer.c shouldn't be in Makefile.am - -2009-04-26 14:44:51 -0700 Arun Persaud : -added book.c to Makefile.am - -2009-04-26 13:49:15 -0700 Arun Persaud : -use autoheader to create config.h.in - -no need to track this in git anymore - -2009-04-26 11:13:26 -0700 Arun Persaud : -fixed autoheader warings, remove depreciated acconfig.h - -2009-04-26 10:30:23 -0700 Arun Persaud : -added a autogen.sh - -2009-05-02 10:55:39 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.16 - -2009-05-02 10:50:10 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.15 - -2009-05-02 10:38:39 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.14 - -2009-05-02 10:13:41 -0700 H.G. Muller : -HGM fixed cygwin compile for winboard - -2009-04-24 16:11:57 -0700 Arun Persaud : -cross compilier working - -2009-04-19 10:00:52 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.13 - -2009-04-19 09:52:47 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.12 - -2009-04-19 09:48:59 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.8 - -2009-04-19 09:44:15 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.7 - -2009-04-19 09:39:19 -0700 H.G. Muller : -changes by H.G. Muller; version 4.3.4 - -2009-04-19 09:34:31 -0700 H.G. Muller : -changes from H.G. Muller; version 4.3.2 - -2009-04-19 10:26:24 -0700 H.G. Muller : -changes from H.G. Muller - -2009-04-16 23:06:13 -0700 Arun Persaud : -cleaned up the directory a bit. Removed winboard-dm-beta, -merged the two Changelogs together - -2009-04-16 14:12:48 -0700 A. Scotti : -changes from Alessandro Scotti from 20060129 - -2009-04-16 14:09:33 -0700 A. Scotti : -changes from Alessandro Scotti from 20060112 - -2009-04-16 14:04:02 -0700 A. Scotti : -changes from Alessandro Scotti from 20051231 - -2009-04-16 13:59:12 -0700 A. Scotti : -changes from Alessandro Scotti from 20051129 - -2009-04-16 13:53:41 -0700 A. Scotti : -changes from Alessandro Scotti from 20050322 - -2009-04-10 04:18:59 +0000 Arun Persaud : -translated a handfull of strings and set the codeset to UTF-8 -for the translations. - -2009-03-18 03:20:50 +0000 Arun Persaud : -Translation: added German po file (roughly 50% translated) - -2009-03-01 04:23:54 +0000 Arun Persaud : -fixed bug #22853: changed all .Xdefaults to .Xresources in xboard.texi - -2009-03-01 02:43:43 +0000 Arun Persaud : -fixed bug #25672, patch #6182 by adding DESTDIR support to Makefile.in - -2009-03-01 02:33:26 +0000 Arun Persaud : -fixed a warning message in the configure script - -2009-02-28 22:58:57 +0000 Arun Persaud : -fixed parser.l. Should fix bug #22812 - -2009-02-28 22:58:14 +0000 Arun Persaud : -fixed parser.l. Should fix bug #22812 - -2009-02-28 22:55:30 +0000 Arun Persaud : -added myself to the AUTHOR file - -2007-06-15 04:26:57 +0000 Mark Loli : -Initial check-in of NSIS Winboard installer files. - -* 06/12/2005: bugfix some more possible buffer overflows. - -* 06/27/2004: added simple icsEngineAnalyze for xboard - -* 06/26/2004: added icsEngineAnalyze for winboard: Analyze observe games -with a chessprogram on a Internet Chess Server (ICS) - -* 02/12/2004: Bugfix ICS interaction console crashed while chess -engine starting and user type in some stuff. We wait now to finish -the engine boot. - -* 02/11/2004: Winboard: Added color lines for the ics interaction -console if zippy used - -* 02/09/2004: Added mousewheel support for winboard. Play moves -backward and forward with the mousewheel. - -xboard/WinBoard 4.2.7 -- Fri Nov 28 13:36:00 PST 2003 -- Tim Mann - -* 11/26/2003: In WinBoard, setting the -debug flag now logs ICS output -to WinBoard.debug too. (This isn't needed in xboard because ICS -output already goes to stdout, so it's easy to capture along with the -debug output on stderr.) This was issue #280 in the ToDo file. - -* 11/23/2003: Cleaned up some minor problems in cygwin.mak. Thanks to -Hans Werner Strube for the problem report. - -* 11/23/2003: Updated the default list of chess servers in -winboard/defaults.h. Deleted two that appear to be dead and added a -new one that is active. - -* 11/19/2003: Swapped icon_white.bm and icon_black.bm in XBoard. -Hopefully this will get them the right way around by default on more X -window managers. I wish I understood this better. - -* 11/18/2003: Implemented a simple 32-bit random number generator for -WinBoard, replacing the Windows rand(), which ranges only up to -0x7fff. Formerly on Windows, only zippy.lines sayings that started in -the first 32767 bytes of the file could ever be used. This was issue -#505 from the ToDo file. - -* 11/16/2003: The xboard man page and info files are now built from a -common set of texinfo source files, and the xboard man page now covers -cmail as well. Formerly, ever since the texinfo file was first -contributed to the project, it was separate from the man page and the -two files had to be updated in parallel, making for a maintenance -nightmare. To make combining the files possible, I took the Perl -script "texi2man" from the GNU Units project and added support for a -larger subset of the texinfo markup language. I then carefully -compared the old man page and old texinfo file to make sure the latest -and clearest words survived into the new combined texinfo file. It -would be great to merge in WinBoard's help file too, but that's a -larger project. It would have to be heavily conditionalized to -deal with differences in features between XBoard and WinBoard. - -* 11/15/2003: Cleaned up and applied a small patch from Daniel -Mehrmann, to stop overly long PVs in thinking output from causing a -buffer overflow crash in backend.c. - -* 11/5/2003: When a chess engine sends a "telluser" command (including -the cases where "tellall" or "tellopponent" acts like telluser), the -information now goes into a nonmodel popup that is automatically -dismissed when the user clicks anywhere on the board. This fix is -more significant on WinBoard, where formerly you got a fully modal -dialog that had to be dismissed by clicking on OK before anything else -could happen. The bug was issue #406 in the ToDo file. - -* 11/1/2003: Removed email addresses from this file to reduce spam -load, as it gets linked to from the Web. - -* 11/1/2003: Updated READ_ME and winboard/READ_ME.txt. - -* Modified xboard and winboard makefiles to be able to build the -project in the new combined directory structure. - -* Applied a small security fix to pxboard, from Martin Maeok. - -* Fixed a bug in the game list dialog. The change in 4.2.6 to opening -games in text mode (meant to avoid getting extra \r's into comments) -caused a new bug in determining seek offsets when parsing a game file -to form the game list. Also, the change was incomplete; on some code -paths games were still being opened in binary mode. Thanks to Lenik -Terenin for reporting the offset bug. I've now gone back to always -using binary mode when reading game files, and I've fixed the comment -bug by adding code to remove \r's from parsed comments explicitly. I -still use text mode for writing game files so that games written by -WinBoard will have Windows-style line endings. - -* Fix for minor bug in WinBoard installer. If you chose a non-default -destination directory, the default directory was still used for a -couple of unimportant things, namely setting the App Paths registry -keys (unused by WinBoard) and trying to copy the existing WinBoard.ini -file to WinBoard.old. I inherited this bug from the InstallShield 5 -sample template. Thanks to "l.d." for noticing the incorrect keys. - -* Patch from Chris Priest: when two engines are being run through rsh, -avoid reusing the same stderr port for both. I'm not sure why this -should be needed, but it's harmless, at least. - -* Bugfix: The kludge to deal with old engines that give an error -message because they don't know the "st" command was too sloppy; it -could hit on an "st" substring anywhere in an error message. GNU -Chess 4 is the only engine I know of where the kludge was needed, so I -changed the kludge to match a longer, more GNU-specific string. - -* Changed the WinBoard self-extracting installer to choose a unique -temporary subdirectory name within the Windows temp directory instead -of always putting wb-setup directly in temp. Besides being better -practice, this avoids the need to deltree wb-setup first, which -occasionally alarms someone who thinks that deltree is only used by -trojans to delete all your files. (Yes, I'm serious.) - -* Fixed a bug where FICS-style "wild/0" strings were not parsed as the -proper wild type. The "/" was not being skipped. - -* Fixed a WinBoard bug where temporary files created by game -copy/paste were being created in the root directory of the current -drive instead of the TMP directory and were not always deleted on exit. - -* Fixed a small bug in winboard.c's ErrorDialog() function. Thanks to -"Ron" (no last name given). The bug might have caused a problem when -pressing OK or Cancel in an error dialog when more than one error -dialog was being displayed, but I'm not really sure. - -* Removed a hack that worked around a bug in very old versions of -Crafty, where it would sometimes reply "illegal move" to a "." -command. The hack kept us from recognizing real illegal move messages -in analyze mode from engines that don't respond to the "." command. -Thanks to Fabien Letouzey for the report. - -* Fixed a bug in the xboard version of GetDelayedEvent. It would -return the most recently scheduled event even if it had already fired. -This caused at least one visible error: in -ics -xreuse mode, starting -the engine again and seeing another "feature done=1" would re-run the -initialization code in InitBackEnd3, including the code that opens the -connection to ICS. The WinBoard version didn't have this bug. Thanks -to Bob Hyatt for the bug report. - -* The promotion popup for ICC wild 26 (giveaway) now includes King. -Thanks to Fredrik Josefsson for the bug report. - -* The first game in a file (or being pasted from the clipboard) can -now start with a bare move -- no PGN tags, no move number "1", etc. -Suggested by Shane Harrelson. One could imagine taking this farther -and accepting something like "e4 e5 1/2-1/2 d4 d5" as two games, but -I haven't done that. - -* Bug fix: xboard didn't really accept a paste of multiple games, -contrary to what I wrote when adding the feature to WinBoard in -4.2.4. Now it works in both. - -* Fixed generic start/end of game messages to work on chess.net, where -they put ratings in parens after the player names. - -* Updated config.sub and config.guess to newer versions from -automake-1.4p5-2. This makes configure work with MacOS X + X11. - -* Bugfix: when examining a game fragment on FICS where black plays -first, don't show two "(0:00.000)" times on the initial "none" move. - -* If TestLegality is on and one of the engines makes an illegal move -in TwoMachines mode, it forfeits immediately. Formerly the game would -get stuck at that point and the engine that made the illegal move -would eventually lose on time. - -xboard/WinBoard 4.2.6 -- Fri Feb 1 22:26:31 PST 2002 -Tim Mann - -Another small bugfix release. - -* Put in a small change from Alexander Mai to allow xboard to build in -an OS/2 EMX environment. - -* Fix WinBoard-only bug where editing a PGN file with comments would -insert more \r characters before the \n after every Load/Save cycle. -For some unknown reason we were reading the files in "rb" mode but -writing them in "a" mode, so we kept the \r characters on reading and -added an extra one on writing. Fix: change the "rb" to "r". Thanks -to Joel (last name not given) for the bug report. - -* Put the arguments to rsh/remsh in the right order for better -portability. Thanks to Michael Kalisz. - -* FreezeUI is now implemented in WinBoard; it was previously only -implemented in xboard. This function prevents the user from entering -moves or other commands while we are waiting for an engine to -initialize itself. Implementing it fixes a bug where the user could -start a game (etc.) during feature negotiation. One of the symptoms -of this bug was that we could send "new" one or move moves *after* the -first game started! - -* Fixed some handle leaks (WinBoard only), including a nasty one that -leaked one handle per command sent to ICS. Thanks to several folks -who helped characterize the bug and tried to look for leaks. - -* We now install and look for the info file in ${prefix}/share/info -instead of ${prefix}/info. The latter is still the default in -autoconf, but the former is currently used in Red Hat Linux and -probably elsewhere. - -xboard/WinBoard 4.2.5 -- Sat Dec 15 11:42:51 PST 2001 -Tim Mann - -* Changed the bundled GNU Chess 5.02 in the WinBoard package to -include a much smaller book and to use much less hash table space by -default (8 MB transposition table, 0.5 MB pawn evaluation table). The -large book included with 4.2.4 made the WinBoard download too big for -some people, and the default hash tables were larger than the -available physical memory on some people's computers. I built the -small book by running Crafty's "small.zip" book line collection -through a Perl script that makes it look enough like real PGN games -that the GNU Chess book builder will accept it. The script and some -minor patches to GNU Chess 5 are available in the WinBoard source -distribution and at http://www.tim-mann.org/gnuchess.html. - -* Fixed a bug in the code that deals with engines that complain that -"time" and "otim" are illegal moves. This was a new bug in 4.2.4. - -* Revamped the implementation of ToStart in analysis mode. Formerly -there was some ill-conceived code that would try to get back to the -start of the game by doing a "new" command (and all the followup -commands that requires) while remaining in analysis mode. This is -problematic for engine authors to support, though it works with -Crafty. This code was trying to solve the problem of ToStart being -slow because the engine would try to start an analysis after every -"undo" command all the way back to the start. But ToEnd already had a -much better solution to this problem, and now ToStart does the same -thing: we exit from analysis mode and enter force mode instead, -make/unmake moves to get to the end/start of the game, and then -reenter analysis mode. - -* Formerly, Zippy could try to start playing a game before the engine -was initialized; that is, during the initial timeout for protover 1 -engines, or before "feature done=1" for protover 2 engines. We now -wait until the engine is initialized before connecting to ICS, which -fixes this in the common case. If you turn off engine reuse for -multiple games (that is, if you give the -xreuse option), there could -still be problems; see item 503 in the ToDo file. Thanks to Dieter -Buerssner for the bug report. - -* Bugfix: All WinBoard versions since the merge with WinBoard Plus -(but not xboard) have had a bug in changing the PeriodicUpdates, -PonderNextMove, and ShowThinking options from the menu. The bug -mostly just caused changing these options during a game to not take -effect until after the next reset. For TwoMachines games, though, -changing PonderNextMove just before the game would take effect -immediately for the second engine but not until the next game for the -first engine. Thanks to Koundinya Veluri for the bug report. - -* Bugfix: In 4.2.4, we sometimes got confused when trying to leave and -reenter analyze mode. One symptom was that Analyze File did not work. -Thanks to Igor Syry for the bug report. - -xboard/WinBoard 4.2.4 -- Sun Dec 9 14:56:30 PST 2001 -Tim Mann - -* WinBoard now includes GNU Chess 5.02 in place of GNU Chess 5.00. - -* WinBoard's PasteGameFromClipboard will now handle a paste with -multiple games in it, popping up the game list dialog. xboard -already did this. Suggested by Robert Gerstman. - -* We now use the "clearboard" command on ICC where appropriate. - -* Bugfix: don't generate a bogus "variant normal" command to an engine -for the loadable ICC wild types that we internally flag as -VariantLoadable. Also clarified the message that Zippy sends when -declining such wild games -- it can't deal with the possibility of -loading an arbitrary position into the game. Thanks to Dieter -Buerssner for reporting the problem. It would be nice to be able to -actually play these wild types some day; presumably there would have -to be an option to either send "loadgame" with a specified position, -or to deal with an opponent sending it. - -* If we get a holdings message from ICS when we thought we were -playing normal chess, we now try asking for a move list so that we can -find out from the header what's really happening. Formerly we guessed -bughouse in this case. Response to a comment from Gian-Carlo -Pascutto. - -* Fixed two longstanding bugs in the clock code. These affected only -play between a user and a local engine, or between two local engines, -not ICS play. (1) The last fractional second used by a player before -moving and virtually pushing his clock was being charged to his -opponent instead of to him. (2) The time and otim commands were being -sent to an engine before the (buggy) fractional second update was -done. The second bug was pretty harmless in itself, but the first one -was serious. Many thanks to Peter Rosendahl for carefully diagnosing -and reporting these bugs! - -* Changed WinBoard timestamp key. Nothing is changed other than the -key and a recompilation. ICC may phase out the old key soon; if they -do, you'll need to use the timestamp.exe from WinBoard 4.2.4 or later -to connect to chessclub.com. - -* Fixed an xboard-only bug where most dialogs would not take keyboard -input unless the mouse was actually over the dialog, even if the -dialog window had focus. Thanks to Jason Varsoke for the bug report. - -* Bugfix; Remember to send time and otim commands to engine before -sending playother. Thanks to Bob Hyatt for the bug report. Also -fixed a bug where time and otim were sometimes sent even with feature -time=0. - -* Added small patches from Wilkin Ng that are meant to fix a crash in -CopyGameToClipboard and a "can't unlock clipboard memory" error in -PasteTextFromClipboard, under Windows 2000. - -* Changed cygwin.mak to not use -mno-cygwin. In other words, it now -uses cygwin1.dll instead of the mingw libraries. This works around -bugs in fileno() and stat() that I encountered in mingw. (fileno -seems to always return 0. stat fails because the library routine uses -a different definition of struct stat than the header files provide.) -Thanks to Robert Gerstman for reporting the symptoms these bugs caused -when WinBoard was compiled with Cygwin. - -* Added -showButtonBar option. This lets you delete the << < P > >> -buttons and thus widen the message widget a bit. - -* Added code to address a very obscure bug. If an engine dies and -needs to be restarted while in one of the analyze modes, it was not -getting put back into analyze mode. This bug should not really ever -have gotten tickled unless reuse was turned off and the engine sends -game end commands (such as 1-0) when a game ends by rule while in -analyze mode. The next version of the protocol spec will say that -engines should not do that, but version 2 and earlier didn't address -the issue. - -* We now use the FICS "iset ms 1" feature to get times in ms instead -of seconds. Thanks to DAV for email telling me about this feature. - -* Changed clock display to show tenths of seconds for 9.9 seconds and -less, instead of 0.9 seconds and less as before. - -* It has been discovered that Zippy can play simuls on ICC (but not on -FICS). If you arrange for Zippy to send the ICC command "simulize" in -the -zippyGameStart string, it will accept additional games while -playing. Zippy will use the same engine for every game, so whenever -it switches opponents, the engine's state will be reset with the "new" -command. This will of course weaken its play, so don't enable simuls -if you want your engine to have the highest possible rating. Zippy -was never designed to work with simuls; it just works by accident, and -it hasn't been tested much. So please report any bugs you notice, but -don't expect them to be fixed rapidly. Thanks to Paul McGuire for -noticing that this works. - -* Bugfix: Suppress the direct command to engine popup if there is no -engine. In WinBoard this case used to cause a crash. Thanks to -"Dargon" for the bug report. - -* Bugfix: formerly we did part of the engine initialization for the -very first game too soon, before feature negotiation. One result of -this is that engines would never get the "ics" command for the first -game. - -* Lengthened timeout to detect protocol version 1 chess engines to 10 -seconds. This should reduce problems with protocol version 2 engines -that are slow to initialize missing the timeout and not getting a -chance to send their feature commands before the first game starts. - -* Klaus Friedel says that adding a short sleep to WinBoard after -starting a new chess engine solves a problem that occurs under Windows -2000, in which engines sometimes don't see the initial command(s) from -WinBoard and hang. I don't understand how that can happen, but the -sleep is harmless, so I've put it in. Others have also reported what -may be the same problem, so hopefully this will fix it for them too. - -* Bugfix: editing the Result field in EditTags will no longer cause a -later crash. Thanks to DAV for a clear bug report that let me -reproduce the problem. - -* ICC wild 28 is now recognized as shatranj, but it is not supported. -You might be able to play it by turning off Test Legality. - -* Formerly we would always turn off "feature time" if the engine -printed an error message with the string "time" or "otim" in it; now -we do that only if the message comes before the engine makes its first -move. This change is useful because some engines spew a lot of bogus -error messages about commands they don't fully parse, so something -like "result 0-1 {White lost on time}" could generate such a message. -Engines shouldn't do that, but if they do, mysteriously turning off -"feature time" is not a good way to react. - -* Fixed an infrequently occurring Zippy bug: formerly, resuming from -adjournment by position (that is, with GetMoveList turned off) or -starting/resuming a wild game (nonstandard starting position) would -try to set up the position without putting the engine into force mode -first. That was probably tolerated by most engines, but if the -position was black-to-play and the engine hadn't set feature -setboard=1, then the fake "a2a3" move (which we use as a kludge to get -black to be on move before sending the edit command) would appear to -be a real move, and the engine might reply to it! This bug could also -be seen when trying to use Zippy to play a simul -- something that -Zippy was never designed to support, but which seems to mostly work -anyway. Thanks to Paul McGuire for sending a WinBoard.debug file that -showed the bug occurring. Some other cases of resuming adjournments -or starting games from nonstandard positions may have been broken too; -I think I've straightened out the problems. - -* Agreeing to a draw in the human vs. local engine case formerly did -not work if the human offered first; now it does. A human's -unsolicited offer is considered valid until he makes another move. -Thanks to Bruce Moreland for the bug report. - -* Bugfix: We used to look for just "fr" in Event tags or strings from -ICSes to recognize Fischer Random games. This caused a lot of false -matches. Now we look for "wild/fr" instead, which is what FICS uses. - -* Bugfix: Clicking on a move in the MoveList window only updated the -displayed position; if a chess engine was active, its state was not -updated. Thanks to Alejandro Dubrovsky for the bug report. - -* Bugfix: The "resign" command from engine to xboard formerly did not -work in ICS (Zippy) mode. - -* Bugfix: Formerly we would register a garbage premove if the user -clicked on a piece, then clicked on an edge or outside the board. Now -such an errant click is ignored. - -* Bugfix: GameEnds would send "exit" to an engine in analyze mode even -if we did not actually want to leave analyze mode. - -* Bugfix: "feature pause" was being rejected. We don't currently use -it, but that is no reason to reject it. Thanks to Gian-Carlo Pascutto -for the bug report. - -* Bugfix: when "partner" needed to be sent both to ICS and the engine, -Zippy was erroneously sending the ICS prefix character to the engine -too. Thanks to Gian-Carlo Pascutto for the bug report. - -* Zippy now declines challenges when the engine is not yet ready to -play again, instead of ignoring them. This is needed so that the -server will let the opponent repeat the challenge. It might be better -to remember such challenges and accept them when the engine is ready, -but that would be a bit more complicated to implement. - -* Bugfix: Zippy's emotes didn't work on FICS because there, "i" is a -built-in alias for "it", not a real command. So sending "$i foo" gave -an error message instead of doing "it foo". We now leave out the -alias-suppressing prefix for emotes. - -xboard/WinBoard 4.2.3 -- Mon Feb 19 19:55:05 PST 2001 -Tim Mann - -* Bugfix: The error message "Variant X not supported by gnuchessx" -formerly could pop up even in -ncp mode. - -* Fixed an xboard bug in premove highlighting. If you had -HighlightLastMove turned on, premoves got highlighted in -highlightSquareColor (yellow) instead of premoveHighlightColor (red). - -* Modified premove again. Now we are back to displaying the move -locally immediately after sending it to the server, as in versions -prior to 4.2.1. This is good because it lets you register your next -premove sooner. As a better fix to the problem that the change in -4.2.1 had been trying to address, we now suppress animating the -opponent's move if you have a premove reply pending. However, it's -probably still a good idea for you to turn off AnimateMoves entirely -if you are trying to play extremely fast games. - -* Removed an erroneous patch that left zombie chess engines around -when both sigterm and reuse were turned off. (Bug was in xboard only, -not winboard.) - -* Bugfix: loading a game with autostepping did not work for games with -PGN result "*" (unfinished). This bug was introduced in 4.1.0, caused -by some outdated code that was supposed to leave you in EditGame mode -after loading an unfinished game. I fixed this, and also changed it -to leave you in EditGame mode after loading *any* game, but without -changing the tags to say it's an edited game. It's not really clear -whether that is the best thing is to do here -- ideally, perhaps, the -tags should change to say "edited game" if you actually make any -changes, but that is harder to make work. - -xboard/WinBoard 4.2.2 -- Tue Feb 6 20:00:00 PST 2001 -Tim Mann - -* Fixed a problem introduced in 4.2.1. In -zippyPlay mode, 4.2.1 -started sending the initString immediately after the old game ended, -but then when the next game started, it would still send "force" and -another initString. Another problem was that the first initString put -the engine out of sync with the displayed board position, though that -might not usually have been noticeable. This is now changed to do a -full Reset at the end of the previous game, and avoid doing a Reset at -the start of a new game if we are still in BeginningOfGame mode. - -* Fixed some limitations in -zippyPlay mode. The engine was not being -fed the moves or history of games that were displayed but not being -played, so it would get confused if you tried to do something like -examine a game, then enter EditGame mode from somewhere in the middle -of the game. - -* Made a small change so that cygwin can compile xboard for Windows -(an X server is required to run it). Thanks to Volker Zell. Most -people would probably prefer to run WinBoard on Windows, however; note -that cygwin could already compile WinBoard. - -* Added some missing documentation to engine-intf.html: It is okay to -send "feature done=0" even before you receive the xboard and protover -commands, if this is needed to give your engine enough time to -initialize. See engine-intf.html for more discussion. - -* Bugfix: "feature done=0" did not work for the second engine; now it does. - -xboard/WinBoard 4.2.1 -- Sat Feb 3 19:52:26 PST 2001 -Tim Mann - -* Bugfix: in Zippy mode with feature san=1, the elapsed time was being -sent to the engine after the SAN move; for example, "e4 (0:01)" was -sent instead of just "e4". - -* It seems that scroll wheel mice with incompletely installed software -(under Windows 95, at least) can send repeated middle button up events -when the wheel is turned. Moved QuickPaste from middle button up to -middle button down to avoid problems with this. - -* A premove is now sent *before* the opponent's move that it replies -to is animated. The premove itself is no longer displayed (or -animated) when sent; instead, it is displayed when the chess server -echoes it back as a board update. - -* Bug fix: in -xreuse mode, xboard was only sending command line -arguments to the engine the first time it was started. (WinBoard -didn't have this bug.) - -* In -zippyPlay mode, we now initialize the chess engine for a new -game immediately after the old game ends. (In -xreuse mode, this -means starting a new engine process; in the default -reuse mode, it -just means sending "new".) If the engine supports ping, we don't -accept challenges until the "new" has finished. This should help -avoid losing time (re)initializing the engine after the game starts. - -* We now handle the new FICS field in style 12 that says whether the -clocks are ticking. - -* whiteFlag and blackFlag are now reset whenever an ICS board image -arrives, giving autoflag a fresh chance to work. - -* Suppressed "geometry error" debug messages unless -debug flag is given. - -* Bugfix: avoid core dump on Solaris with -debug flag, caused by -passing NULL to a %s format in GameEnds. - -* Added -firstProtocolVersion and -secondProtocolVersion. This will -allow use of extremely broken engines that hang or die when given the -"protover 2" command. It should be rarely if ever needed. - -* Zippy now strips highlights from player names in the Creating -message; previously the ratings would not be extracted from this -message properly if you had set the highlight variable. - -* Bug fix: Zippy with -zp but not -zt used to be fooled by false -partner tells inside channel tells; e.g.: -Garf(24): Garf (your partner) tells you: sit - -* Bug fix: when an engine reported its name with the new "feature -myname=" command, we had been putting just that name into the window -title even when in TwoMachines mode. - -* By default, WinBoard no longer uses the new feature introduced in -4.2.0beta of keeping the ICS menu, ICS server list, and lists of chess -engine command lines in separate files; instead, the lists are back in -the winboard.ini file. This gets rid of some problems where the -separate files could not be opened because the working directory was -not set to WinBoard's installation directory. - -* WinBoard command lines and ini files now have another optional -syntax for quoting an option value. All characters within { } curly -braces are interpreted literally except for '}' itself. SaveSettings -now uses this syntax for string values that contain a backslash or -newline and do not contain a '}'. This should address the problem -that the separate .ini files had been meant to fix; engine command -line lists can now be written without \-escapes. - -* Fixed three bugs in relaying moves between engines in TwoMachines -mode: an engine would be sent SAN if the *other* engine had set -feature san=1, a relayed SAN move did not end with a newline, and -feature usermove was not implemented for relayed moves. - -* Fixed several bugs in exiting: File/Exit would sometimes hang; -timestamp/timeseal would not get killed off; an engine crash would -cause error messages to be printed recursively until stack overflow. - -* Fixed a bug in the code to detect which ICS is in use and adapt to -it; the chess.net case was broken. - -* Removed the leading alias-suppression character when sending a move -to ICS, because it seemed to break accuclock on chess.net. - -* Fixed a bug where a FICS prompt like "10:01_fics%" would be matched -as finger note number 10, causing a problem detecting when the user is -logged in. - -* Added tellicsnoalias command to protocol. - -* Changed st command in protocol back to old behavior. - -* Added done=0 feature to protocol, to lengthen initial timeout. - -* Added missing -colorSeek command line option to xboard. (Was -present in WinBoard.) - -* Bug fix: setting feature reuse=0 was not working. - -xboard/WinBoard 4.2.0beta -- Sat Dec 16 16:34:56 PST 2000 -Tim Mann - -* Setting -searchTime no longer turns off -clockMode. Note that when --searchTime is set, some engines may search for the lesser of -searchTime and the amount of time their normal clock management would -dictate, while others will disable their normal clock management and -always search for exactly searchTime. - -* Fixed WinBoard bug where on Windows 2000 (and maybe Windows 98) the -ICS Interaction window would scroll back to the top whenever it filled -to capacity and WinBoard trimmed some text off the top. - -* Changed xboard dragging so that the center of the dragged piece is -forced to be over the mouse cursor. (WinBoard dragging already worked -that way.) This should avoid confusing cases when you start a drag -with the mouse near the edge of a square -- formerly most or all of -the piece could be over one square but the mouse cursor over another. -Suggested by DAV. - -* Added move list window for xboard. Code contributed by Manuel -Hoelss and re-hacked a bit by me. Performance of this window is poor, -because the implementation regenerates the entire window contents -whenever anything changes. It's hard to avoid this when using the -Athena List widget, though we could be a little smarter and notice -when the current move number has changed but the move list has not. -There are also several drawing problems caused by bugs in the Athena -Form and List widgets. The window should not really allow a -horizontal scroll bar, but the bugs are much worse if I turn it off. -In both Xaw and Xaw3d, the List widget tries to resize itself when -XawListChange is called, even if you tell it not to; and what's worse, -if the widget cannot resize itself to be large enough to avoid -clipping any of the list item, it does not change the list! Arrgh. -On top of that, the Xaw Form widget is very buggy in XFree86 4.0.1 -(X11R6.4.3). - -* The OK button in the WinBoard startup dialog is now simply disabled -if none of the radio buttons is selected, instead of bringing up an -error dialog. Suggested by Ted Milbaugh. - -* Used ping to address the worst of the race conditions in the -protocol. Now if an engine supports ping, we ping it after sending -the "new" command and after trying to place it in force mode at the -end of a game. When a ping has been sent and the corresponding pong -has not yet come back, we (1) ignore or undo any moves the engine -sends, (2) ignore game end messages (such as "offer draw", etc.) from -the engine, (3) ignore thinking output from the engine, (4) delay -starting the next game if in -matchGames mode, (5) in -zippyPlay mode, -respond to challenges with a polite message to try again soon instead -of accepting them. There are a few more things that should be done -(and item 5 might not be quite what we want), but it's hard to fit -them all into the existing code. - -* Patched the version of GNU Chess 5.00 included with WinBoard to -support protover, feature, setboard, and ping, and to fix some minor -bugs. See gnu500+.patch. - -* Changed the GNU Chess 4 kludges for missing "st" and "sd" commands -to be invoked only if the engine gives an error message for "st" or -"sd", and to always use protocol commands instead of engine -command-line options. See "Idioms" in engine-intf.html. - -* Added new protocol command "protover 2" to tell the engine what -version of the protocol is in use. Version 2 is still compatible with -old engines; see engine-intf.html. - -* Add new protocol command "feature ..." The engine can send this in -response to the protover command command, to say what extended -protocol features it would like to enable, etc. xboard responds -"accepted F" or "rejected F" for each feature F that is set. See -engine-intf.html. - -* Added new protocol command "setboard ". This is an alternative -to "edit", used only if the engine says "feature setboard=1". - -* Added new protocol command "ping ". The engine is supposed to -respond "pong ". This gives us a tool to fix some race -conditions in the protocol, but it is not used to the fullest yet. - -* Added new protocol command "tellopponent". This will do a "say" if -you're on a chess server in Zippy mode, or pop up an information -dialog otherwise. - -* Added new protocol command "tellall". This will do a "kibitz" if -you're on a chess server in Zippy mode, or pop up an information -dialog otherwise. - -* Added new protocol command "tellothers". This will do a "whisper" if -you're on a chess server in Zippy mode, or do nothing otherwise. - -* Changed the WinBoard /icsNames, /icsMenu, /firstChessProgramNames, -and /secondChessProgramNames options to accept a filename preceded by -"@", meaning to find the value in the file. Changed the defaults to -use this feature, with filenames icsnames.ini, icsmenu.ini, fcp.ini, -and scp.ini. This should make it easier for users to edit the values, -since one less level of quoting is needed, and each value is in its -own file, not mixed into winboard.ini. Those who upgrade from an -older winboard version and already have a winboard.ini file will not -automatically have these values moved to a file; that has to be done -by hand if desired. - -* We now strip .exe from engine names for "name" command, tags, etc. - -* Allowed WinBoard input widget to hold more than one line. You can get -a newline into the widget with copy/paste or with Ctrl+Enter. - -* Fixed an xboard bug where the [P] button would appear in the -opposite highlight state from what it should be after being pressed. - -* We now use the "/" or "$" alias suppression feature on the chess -servers, to avoid problems if the user inadvertently aliases a -needed command to something else. - -* Changed the method used to deiconize xboard in AutoRaise and cmail. -This may fix bugs under some window managers where after -deiconization, the board window was mapped but nothing was drawn -inside. - -* Preliminary, partial support for playing several chess variants -against a local engine or editing variant games. The -variant option -must be given on the command line or WinBoard startup dialog; there is -no menu. The current variant is not displayed (except in the -Tags/EditTags window). Many variants will not work quite right even -if the engine supports them; see item 326 in the ToDo file for -details. - -* Added a workaround to detect the variant type when examining a -scratch wild game on an ICS. - -* Fixed two cases where "variant" command should be sent to the engine -when necessary but was not: loading a game from a file and restarting -a dead engine. Thanks to Gian-Carlo Pascutto. - -* Added missing support for FICS games that start from a bsetup position -with Black moving first. - -* Fixed a bug in loading a file from the game list window while in -Analysis or AnalyzeFile mode. This now leaves us in AnalyzeFile -mode, analyzing the new file. - -* Fixed a bug in loading games with a comment before the first move. - -* Fixed a bug in handling LoadGame (or -lgf) with -td 0. - -* Added a command line option to select an initial minor mode from the -Mode menu. This should satisfy requests from a couple of users with -special applications. - -* Fixed a problem where some things in WinBoard's General Options -dialog box were grayed out at the wrong time. - -* We look for a few messages from the chess engine pipe that are -intended to catch problems starting an engine via rsh, such as "No -such file". Moved code so that these strings won't match until other -protocol messages have been looked for, and documented the messages in -engine-intf.html. - -* Fixed the WinBoard bug that sometimes made the console input box -white-on-white even when not in password-entry mode. - -* Small changes to WinBoard to be compilable with the latest Cygwin -net release (as of 10-16-2000). Thanks to Mark Schoenberg. - -* Recompiled GNU Chess 5.0 for WinBoard with the latest Cygwin net -release (as of 10-16-2000). Also rebuilt the book just to be sure, -since I had one bug report about it. It came out identical and seems -to work fine. - -* Added messages for some common InstallShield errors instead of just -printing InstallShield's stupid error code numbers. - -* Added -firstComputerString and -secondComputerString, allowing you -to suppress or change the command that is sent to a chess engine when -its opponent is another computer. - -* Added "configure --with-Xaw3d" to allow use of Xaw3d widgets instead -of Xaw widgets in xboard. Thanks to Johnny C. Lam of the NetBSD -project. I've left Xaw as the default because Xaw3d is too ugly. - -* The version of the Xaw Form widget released in XFree86 4.0.1 -(X11R6.4.3) has a bug that causes xboard to display the button bar -on top of the message widget. I've reported the bug and have -installed a kludge workaround into xboard. - -xboard/WinBoard 4.1.0 -- Sun Sep 17 17:30:14 PDT 2000 -Tim Mann - -* Merged Winboard Plus 4.0.8 from Mark Williams into xboard - source pool. Status of Winboard Plus features in xboard: - - - White pieces now have borders, but the implementation is - completely different from WinBoard's; see below. - - - Options menu not changed, probably won't be. - - - Copy&paste support working, using Mark's changes to backend.c, Ben - Nye's changes to xboard.c for FEN positions, and some code of my - own in xboard.c for PGN games. - - - Premove hooked up and working. No pre-first-move, though. - - - ICS Alarm hooked up and working. - - - Auto-flip working. - - - PGN Training mode hooked up and working. - - - Improved menu item enable/disable working. - - - Improved >> button working. - - - Auto activate board working. I changed this to be optional; you - might not always want it, especially in Zippy mode. - - - Blindfold working. - - - Documentation updated. - -* Fixed more colorization bugs. Commands like "message foo tells you: -xxx" and "tell 33 tells you: xxx" will no longer generate bogus -colorization. - -* Added low-tech sound support to xboard, by invoking an external -program on a filename for each sound to be played. - -* ICC wild 27 is now recognized as VariantAtomic, and it sets the -"ignore check" flag, but is not otherwise supported. - -* Converted the piece bitmaps from .bm to .xpm for use with xboard's -xpm support. (An .xim version was not created.) Wrote a shell script -using ImageMagick to do the conversion and to bucket fill from -coordinate 0,0 with the background color. Used xpaint by hand to -clean up a few pieces where background color "leaked" into the inside -or didn't flow all the way around the outside, then a sed script to -fix up color names and bitmap names in the xpaint output. If any more -sizes are added later, they should be straightforward to convert with -reference to the existing scripts. With this conversion, not only do -the white pieces now have dark borders, but (unlike with WinBoard) the -light details on the black pieces are opaque. - -* If the XPM library is found when building xboard, the new xpm pieces -are compiled in as the default. External bitmap (or xpm) pieces can -still be used by giving the -bitmapDirectory (or -xpmDirectory) -option. If the XPM library is not found, the old bitmap pieces are -the default. In this case external bitmap (or xim) pieces can be used -by giving the -bitmapDirectory (or -xpmDirectory) option. There is no -way to compile in xim pieces. - -Winboard Plus 4.0.8 -- Sat Aug 5 15:51 PDT 2000 -Mark Williams - -* Bugfix release. - -* Main menu now visible in Win NT. Thanks to Microsoft for creating a -compiler which auto-mutilates the WinBoard.rc file so that the menu is -displayed under Win 98 but not Win NT. I fixed the problem by hand editing the -.rc file. Sigh. - -* "Reset game" now works properly when invoked from Analysis mode when two -engines are present. Correction of bug introduced in Winboard Plus. Thanks to -Mogens Larsen for reporting the bug. - -* Pasting a FEN position with Black to move now works in all modes. -Thanks to Mogens Larsen for reporting the bug. - -* Added gnuchess.dat to the distribution and a couple of text files that were -missing in 4.0.7. - -*** Merged in the following changes from Tim Mann: - -* Bugfix: Highlights would sometimes not be taken down, at least in -xboard. The problem is that SetHighlight works in chess coordinates, -not view coordinates, so if flipView has been toggled since the -highlight was put up, it gets taken down from the wrong square. Fixed -by being careful to call ClearHighlights before toggling flipView, not -after. Ugh. - -* Bugfix: HighlightLastMove would sometimes highlight square a1 after -a FICS "tomove black" command. - -* Bugfix: a move list with initial position that has black to play was -not being handled correctly. - -* Removed "decline abort" and "decline adjourn" commands from Zippy. -The syntax is changing on FICS, and Zippy really doesn't have to -explicitly decline the requests anyway; it's sufficient to not accept -them. - -* ICC wild 26 is now recognized as VariantSuicide (the FICS name; ICC -calls it "giveaway"). - -* Bugfix: PGN games with black to move in the initial position weren't -being legality checked correctly. I think this was introduced in -4.0.6 when I fixed a different PGN bug. Thanks to Mark Williams for -spotting the bug and suggesting a fix. - -* Bugfix: the initial "name(" of a kibitz wasn't being colorized. - -Winboard Plus 4.0.7 -- Thu May 12 17:57 PDT 2000 -Mark Williams - -* New white pieces with black borders. - -* Major overhaul to Options menu. New dialogs for setting General Options, - Board Options, ICS Options, Sounds, Fonts, Colors. - -* Clipboard support for PGN game scores and FEN positions. - -* Optional ICS Premove with user-specified first moves for White and Black. - -* New sound events: ICS Win, ICS Loss, ICS Draw, ICS Unfinished, ICS Alarm. - -* New auto-flip option when playing against a chess program. - -* Added PGN Training mode. - -* Certain menu options now disabled while program is thinking. - -* ">>" button now always goes to the end of the game. - -* In ICS mode, the board is automatically activated at the start of a -new game. - -4.0.7 -- Sun Mar 5 17:17:49 PST 2000 Tim Mann - -* Fixed a nasty bug in parsing ICS game histories that was introduced -in 4.0.6. - -4.0.6 -- Fri Mar 3 16:20:11 PST 2000 Tim Mann - -* Fixed bugs in Zippy's code for responding to messages sent with the -ICS "message" command. - -* Fixed bugs where xboard could still create dialogs partially off the -top of the screen. Fixed unwanted interactions between initial sizes -and positions of various unrelated xboard dialogs. Deleted -borderXoffset and borderYoffset resources. - -* Fixed restoring the xterm name on exit to work in more cases. - -* Small fix to the WinBoard self-extracting installer: when it starts -up, it now always deletes any old wb-setup directory left over from a -previous installation. Formerly this worked only on Windows 95/98, so -on NT the self-extractor would sometimes stop and ask the user whether -it was OK to overwrite the old wb-setup files. - -* Modified WinBoard to be compilable with the free Cygwin tools -available from http://sourceware.cygnus.com/cygwin/. Based on work by -Mark Schoenberg. (His mods were enough to get WinBoard through the -compiler, but a few things were broken along the way, so I reworked them.) - -* Merged changes from Don Fong to make WinBoard compilable with -Borland C++ 4.5. I do not have Borland C++ and am unable to test with -it, but I did make sure the changes don't stop it working with MSVC++ -5.0 and Cygwin. - -* Forbade entering TwoMachines mode from MachineWhite or MachineBlack -mode when machine is on move. This used to confuse the engine and -cause problems, because when we try to get the engine to stop, it -might make a move first, and it might not do that immediately. - -* Variant classification now deals with new ICC wild 25, classifying -it as "3check". Also, we are now conservative about new wild numbers -we don't know about, classifying them as "unknown" instead of -"normal". - -* Replaced bad GNU Chess 5.00 book in WinBoard distribution with a -correct one. 1.e4 now no longer takes GNU Chess 5.00 out of book! -Thanks to Pete Galati. - -* Made move parser accept and ignore nonstandard ep suffix on PGN moves, -e.g., "exf6ep" or "exf6e.p." - -* Fixed bugs in parsing PGN files starting with no move number, or -with a move number other than "1." (including "1..."). Thanks to -Michael Soulier and Stefan Zipproth for example PGN files -demonstrating the bugs. - -* Changed InitComboStringsFromString to not modify the input string; -this caused an exception when WinBoard was compiled with MSVC++ 6. -Thanks to Bert Tuyt for the report. - -* In WinBoard, dragging a piece off the edge of the board without -releasing the mouse button no longer instantly aborts the move. You -still must release the mouse button inside a square to complete a -move, but you can now drag off the edge and come back inside. - -* WinBoard bugfix: If you went into EditGame or EditPosition mode -while observing or playing an ICS game, and a new move came in -(snapping you back to ICSClient mode) while you were dragging a piece -around, the drag state would not be reset, causing the piece you were -dragging to remain on the board wherever you dropped it. Thanks to -David Brinegar for the bug report. - -* WinBoard bugfix: If you moved or resized the board while your -opponent was moving, and you had AnimateMoving on, his move would not -be displayed until after your next move. Thanks to DAV for reporting -the bug repeatedly until I finally understood it. - -* Added a Zippy "farewell" feature; see zippy.README. - -* Fixed a bug (xboard only) in processing -zippyReplayTimeout on the -command line. Thanks to Steve Beer for the report and patch. - -* Send "computer" command to both sides in TwoMachines matches. - -* Fixed a Y2K bug in Evan's cmail code! Thanks to Brian Mays for the -report and patch. - -* Bugfix: Initialize variant field of GameInfo struct in gameinfo.c. -This could cause crashes in LoadGame. Thanks to Andrzej Nagorko. - -* Fixed several pattern matching problems: Finger notes and formula -vars no longer get replied to by zippyTalk or colorized. Channel -tells by players with many titles are now colorized fully, and -zippyTalk handles channel tells by such players correctly. The shout -"--> foo(99): bar" no longer gets colorized as a channel tell. Code -is cleaned up a bit, and autocomment capture now uses the same -criteria as colorization. - -* xboard fix: Enter key now closes error popups as in WinBoard. -Especially nice for the "Exiting: Connection closed by ICS" popup. - -4.0.5 -- Tue Dec 7 10:30:40 PST 1999 Tim Mann - -* Added missing documentation of SIGTERM usage into engine-intf.html. - -* Bugfix: New -zippyReplayTimeout option was misspelled in WinBoard as --zippyReplyTimeout. Thanks to Francesco Di Tolla. - -* xboard -ics now restores the xterm's original title upon exit, at -least if $WINDOWID is set. - -* Bugfix: -matchGames mode wasn't terminating properly. Final score -popup would come up twice and engines would not be killed off. Thanks -to Frank Quisinsky for the bug report. Bug was introduced in 4.0.4. - -* Bugfix: "tell 50 foo shouts: bar" no longer gets colored as a shout; -similarly for "...s-shouts:" and "...c-shouts:". Thanks to David Lee -for the bug report. - -4.0.4 -- Fri Dec 3 17:51:27 PST 1999 Tim Mann - -* Bug fix: formerly if you invoked SaveGame from EditPosition mode -with black to play, the position was not saved properly. As a quick -fix, SaveGame now takes you out of EditPosition mode before saving. - -* Changed -matchGames to keep track of the score (won-lost-drawn) and -display it in the banner. The final score is displayed in a modal -popup before the program exits. - -* Changed "Connection closed by ICS" to display in a model popup -before the program exits. - -* Added -popupExitMessage option, default on. Setting this to false -suppresses the modal popups that you sometimes get just before -xboard/winboard exits -- both the two new ones listed above and the -existing Fatal Error popup. This is useful when running Zippy -unattended from a shell script (or .bat file) that loops and starts a -new copy after a time delay when there is an error. - -* In xboard, added missing support for WM_DELETE_WINDOW to all -windows. This makes xboard a better citizen, and is much needed with -the newer X window managers that put an [X] button on every window and -bind it to "kill application" if the applicationd does not support -"delete window". We can't allow xboard to be thoughtlessly killed, -since that leaves the chess engine running in the background. - -* We now avoid positioning tops of xboard dialog boxes offscreen. - -* zippy.lines can now use the caret ('^') character as an inter-saying -separator. You no longer need to dig up a text editor that can put NUL -('\000') characters in text files. - -* Bugfix: In traditional chess clock mode, White now gets time added -to its clock as soon as it makes time control. Previously both White -and Black got their time added only when Black made time control, -which would cause some engines to make their 41st move as White too -quickly, thinking they were low on time. - -* The zippyAcceptOnly feature no longer sends a decline command or -a tell. Thus you can use it to put Zippy into a manual accept mode. - -* Bugfix: "tell 50 foo tells you: bar" no longer gets colored as a -personal tell; similarly for "...whispers:" and "...kibitzes:". - -* WinBoard no longer blanks the message line when you start a new -move, unless there was an error message there from the previous move. - -* WinBoard now never puts the white piece drop menu on the middle -mouse button. Both colors are always on the right button. Windows -users often don't think to look for a middle button menu, or don't -really have a working middle button despite what Windows says. - -* Guest login handles on ICC are now parsed again; an ICC wording -change had broken this feature. - -* Autodetect when the engine does not support the "draw" command and -don't relay the command to it in that case. Needed because sending an -unsupported command to GNU Chess makes it move immediately, so people -could make Zippy move without thinking by continually offering a draw. -Thanks to Frank Walker for the problem report. - -* Small changes based on code from Robert Jurjevic: The WinBoard -analysis window can be minimized (though not to the taskbar). The -WinBoard ICS Interaction window will autoscroll if you drag the mouse -above or below the window while selecting, and password entry mode -leaves the entry line as the background color instead of using 75% -gray. Seeks are now colorized with a new color of their own. - -* Added -zippyMaxGames feature. - -* -zippyNoplayCrafty command line option was missing in xboard; fixed. -Thanks to John Perry. - -* Fixed bug in detecting when Zippy loses his bughouse partner. -Thanks to Ben Dean-Kawamura. - -* allobs fix in 4.0.3 didn't work; corrected it. - -* WinBoard will now update the board immediately if a move is made -while the window is being moved or resized. - -4.0.3 -- Sun Aug 15 18:44:39 PDT 1999 Tim Mann - -* Bugfix: moved winboard wizard functions that send a command directly -to the chess engine from Ctrl+Alt+1 and Ctrl+Alt+2 to Alt+1 and Alt+2. -Ctrl+Alt is equivalent to the European AltGr key, so the old assignments -conflicted with typing an @-sign on some keyboards. - -* Bugfix: prevent "If this message stays up, your chess program does -not support analysis" from appearing if AnalysisMode is selected when -already in Analysis or AnalyzeFile mode. Also, deleting analysis window -in WinBoard now switches you to EditGame mode, to avoid the anomaly of -being in an analysis mode with no analysis window present. - -* Change all Zippy environment variables to work as command line -options. For now they still work as environment variables too, but -the environment variables are deprecated. - -* Use unsigned long to hold node counts from engines. - -* Print error instead of crashing on attempts to use xpm or xim pieces -in monochrome mode. Thanks to Jim Torrance for the bug report. - -* Tightened pattern recognition for ICS messages sent to Zippy; should -no longer match ICC allobs output. Fixed recognition of when Zippy is -sent a message; small change to FICS output had broken it. - -* Zippy now exits if the engine dies unexpectedly. - -* Added Zippy "spoofedby" feature; see zippy.README. - -* Narrowed the margins on some older WinBoard dialogs to make their -style uniform with the newer ones. - -* Bugfix: Changing Ponder Next Move from the Options menu did not take -effect until the next game. This bug was in WinBoard only. Thanks to -Stefan Zipproth for the bug report. - -* Got rid of "Internal error: bad move type" message when the engine -makes a move that we can parse but think is illegal. Now the move is -just passed on (which also may be the wrong thing to do). - -4.0.2 -- Thu Feb 25 19:55:32 PST 1999 Tim Mann - -* Added one more built-in sound choice to WinBoard: move.wav from Pete -Galati. - -* Added new larger piece sizes: big, huge, giant, colossal, titanic. - -* Modified the xboard font searcher to be able to use scalable fonts. -The new -fontSizeTolerance flag controls how closely a nonscalable -font must match to be used in preference to a scalable font. - -* Zippy environment variables ZIPPYABORT and ZIPPYADJOURN now control -whether Zippy will accept abort and adjourn requests. - -* We now determine the variant type being played on ICS, send it as a -command "variant VARTYPE" to the chess engine (if in Zippy mode), and -put it in the PGN tags. See engine-intf.txt for variant names. See -ZIPPYVARIANTS in zippy.README to control what variants Zippy will -accept. Note that this now applies to bughouse, too. - -* Zippy now won't do -zippyTalk in a channel unless his handle is -mentioned there. - -* Zippy now ignores bughouse holdings if not actually playing, instead -of stupidly trying to abort the game. Let me know if other strange -things happen when Zippy is observing a game. - -* Set ICS Interaction title bar to "user@server". User name is -determined by parsing message during the login sequence. Zippy now -uses this method to get its name too, so ZIPPYNAME is eliminated. -Problem: with xboard, the title bar gets set to "xterm" upon exit, -since we didn't know what it was to start with. - -* Fixed xboard-only bug in -colorChannel1 command line option. Thanks -to Fredrik Sandstrom for the bug report and fix. - -* Check for overflow of MAX_MOVES. Still not sure this is checked for -everywhere it needs to be. - -* Added .epd to suffixes recognized by WinBoard as position files. -This is a bit of a kludge, as the .fen reading code was not written -with .epd files in mind, but reading them with it is said to work. - -* Added ZIPPYGAMESTART feature, suggested by Jason Hoblit. See -zippy.README. - -* Restored the feature of soaking up the moves from a user-typed "moves", -"oldmoves", or "smoves" ICS command when xboard/WinBoard is idle, but -changed it so that the move list is also echoed to the screen. Some folks -still liked the old feature since it is faster than examine mode, and -printing the moves to the screen should eliminate the confusion it caused -for other people. - -* Bugfix: in WinBoard, starting a click-click move and then clicking on -a black line would cause the source square to be forgotten without taking -the highlight down. Now the errant click is ignored. - -* Corrected shortcut key labels for LoadNext/PrevPosition in WinBoard's -File menu. Thanks to Andreas Stabel for the bug report. - -* Bugfix: if you had a completely full ICS context menu in WinBoard -(90 items), the last one would do nothing if selected. - -* The "computer" engine command added in 4.0.1 was not working; I had -left out part of the code patch. Oops. - -4.0.1 -- Fri Feb 12 21:24:15 PST 1999 Tim Mann - -This is a minor bugfix release. The first item listed below is the -only interesting new feature. - -* You can now type in moves from the keyboard in WinBoard. Either -select TypeInMove from Step menu, or (if you are not in ICS mode), -just start typing. In ICS mode you can type moves into the ICS -interaction window anyway, so I've retained the feature that typing -switches you there. Not implemented in xboard. - -* Removed the "noise 1000" command that used to be sent to the chess -engine when entering analysis modes. - -* Deleted the feature where we soak up the output of a user-typed ICS -"moves" or "oldmoves" command. This ancient feature is not really -useful anymore, now that "examine" exists, and it caused a lot of -complaints. - -* Increased maximum size of ICS text menu to 90 entries and added -overflow checking. - -* The command sent to ICS by Zippy at the end of each game can now be -customized with the ZIPPYGAMEEND environment variable. - -* We treat xboard.info as a pseudo-source since most people don't have -the tools to rebuild it. But "make install" erroneously had a -dependency on it, even though "make all" did not. Fixed. - -* Miscellaneous minor updates and clarifications to engine-intf.txt. -In particular, documented the st and sd commands (support for command -line options -searchTime and -searchDepth), warts and all. - -* Added a small code patch from Bob Hyatt to detect when Zippy's ICS -opponent is a computer and send the command "computer" to the engine. -Added this command to engine-intf.txt. Thanks, Bob. - -* Bugfix: configure was looking for usleep(), but config.h.in didn't -have an entry for it, so HAVE_USLEEP was never defined. Also, in the -non-HAVE_USLEEP case, there was a possible race condition between the -signal handler and the pause() call. Thanks to Ben Dean-Kawamura for -the bug reports. - -* Bugfix: a "1..." preceding Black's first move (usually present if -there is a comment on White's first move) would cause the parser -to think a new game started there and report "End of game" on the -current game. Thanks to Dell Garner for the bug report. - -* Changed the abbreviation for -searchDepth from -sd to -depth to fix -a clash with -secondDirectory. - -* Changed -searchDepth to be orthogonal to the various timing options. -Previously it would search for an unlimited time to the given depth; -now the engine is allowed to choose its search time in the normal way, -but is told to cut off the search early if it reaches the given depth. - -* Bugfix: SaveSettings in WinBoard was saving both the long form -option highlightSquareColor and its abbreviation (hsc). - -* Fixed a redisplay bug in DisplayBothClocks that could cause White's -clock to be highlighted in EditPosition mode when Black's should have been. - -* Fixed Zippy's feature of passing on draw offers from the ICS opponent. -The colorization code was eating the offer before Zippy saw it, so I disabled -colorization of offers while in -zp or -zt mode. (Other types of -colorization are already disabled in Zippy mode for similar reasons.) - -* Added some more commands to the default ICS context menu in WinBoard, -and put "(name)" on the ones that insert a playername (or game number). - -* Added missing documentation to WinBoard help file: PonderNextMove, the --ponder/-xponder argument, and the up/down arrow history feature in the -ICS Interaction window. - -* Fixed ZIPPYNOPLAYCRAFTY feature to fire only if the opponent is Crafty, -not if some other Crafty is observing the game and kibitzes. - -* Fixed bugs in generating "partner" commands when Zippy is playing -bughouse. - -4.0.0 -- Sat Jun 20 16:59:47 PDT 1998 Tim Mann - -* Fixed WinBoard resizing so that the edges you do not drag remain in -place, even when the final size is different from what you dragged to. -(This doesn't work on NT 3.51 or earlier, if anyone cares.) - -* Fixed problems with resizing WinBoard on Windows NT: you no longer get -whitespace around the board, a clipped board, or a lot of flashing during -the drag. - -* Added customization for highlight-square color. - -* Bugfix: backend.c wrote to stderr in a few obscure places, which doesn't -work in WinBoard. - -* Added Index Number field back to LoadGame/LoadPosition dialog boxes in -WinBoard. This required some extra code to work with both the -Explorer-style dialog boxes and the old-style NT 3.51 dialog boxes. Ugh. - -* WinBoard startup dialog now understands -zp mode. The first chess -engine selector is enabled and the value is used. - -* Bugfix: ResetGame would send "exit" to engine twice if it was in an -analysis mode. - -* Bugfix: The response "Illegal move: bk" to the "bk" command, indicating -that it is not implemented, would confuse xboard. - -* Bugfix: Ignore empty hints ("Hint:\n") instead of printing a message -saying that some bogus string (often "Hint:") is illegal. - -* Bugfix: LoadNextGame/LoadPreviousGame/ReloadSameGame were broken. - -3.6.12 -- Sat Jun 13 14:57:10 PDT 1998 Tim Mann - -Beta test release of xboard and WinBoard. - -* Spruced up xboard man page a bit. - -* Added Highlight Last Move to xboard too. - -* The revamped xboard mouse click code had several more bugs than the -previous version, so I revamped it again. All fixed now, I hope. - -* xboard bugfix: crash in CreatePieceMenu. - -* Oops. winboard-3_6_11beta.exe installed 3.6.10beta, not the new version. - -3.6.11 -- Fri Jun 12 20:00:48 PDT 1998 Tim Mann - -Beta test release of xboard and WinBoard. - -* Major reorganization to engine-intf.txt. Some new features added, -many existing features clarified and hints for engine programmers added. -Support for new features added to program. - -* Changed defaults for -scp (etc.) back to being independent of -fcp, as -in 3.6.2. That is, the default is no longer to copy the value from -fcp if --scp is not specified. This will sometimes make command lines longer but -will remove some confusing situations. - -* Split -reuseChessPrograms into two options: -reuseFirst and --reuseSecond. Fixed obscure bugs when reuse is off. - -* Detect ICC and change some command usage slightly there: only ICC has -set-quietly; only FICS has iset and bsetup clear. With this feature, we -can now safely use bsetup clear when appropriate instead of deleting each -piece one by one. - -* Added indent to lines that are wrapped by WinBoard ICS Interaction -window. This seems to tickle a Microsoft bug in the RichEdit control: -occasionally the start of the next line after the wrapped line is indented -too. I think the wrapped indent feature is useful enough that it's worth -having in spite of the bug. - -* WinBoard bugfix: bounding box for the board was computed incorrectly by -mouse code. It would think you moved off the bottom of the board before -you really did, so it was hard to drag pieces along the bottom rank on -smaller board sizes. - -* Fixed obscure parser.l bug: ambiguity between capture using : instead of -x and email header line. Also removed or simplified a lot of complex -patterns for English (as opposed to PGN) end-of-game indications while I -was in there. - -* Added PonderNextMove option. - -* xboard EditPosition piece menus now let you set the side to play by -selecting the "White" or "Black" label at the top of the menu, like -WinBoard. (Both xboard and WinBoard still let you set the side to play by -clicking on the clock.) - -* Merged documentation of Crafty and GNU Chess thinking output in -engine-intf.txt. Corrected code in backend.c to match documentation; it -used to require the PV to start in column 27 (!). - -* Fixed bug that caused crashes in "-reuseChessProgram false" mode. - -* Draw by agreement in Two Machines mode now works as it is supposed to. -Other minor bugs in handling game end messages from machines are also -fixed, and engine-intf.txt is revised in this area. - -* Revamped xboard code for handling mouse clicks on the board. In -particular, it had a bug if a click-click promotion move was made. - -* Fixed and reinstated optimization for << in analysis modes: send -initString and re-send the board if needed. Sending repeated undos -is bad because Crafty prints some analysis after every one. - -* Don't go into a spin loop while pausing between xboard animation frames. -This caused problems, especially when compiling with -O2 on HP-UX. - -* WinBoard Options/Colors/RevertToDefaults now also turns off Monochrome -if it was on, and similarly for Options/ICSInteractionColors/RevertToDefaults. -This seemed to confuse people before. - -* Bugfix: ICS Interaction context menu items with neither of the two -optional flags set did not work. - -* Bugfix: PGN move numbers are optional, but we were insisting on "1" -right after the tags. - -* Bugfix: only the first game of an -mg match was loading -lpf or -lgf. - -* Other minor fixes and code cleanup. - -3.6.10 -- Mon Jun 1 01:32:31 PDT 1998 Tim Mann - -* Added ZIPPYNOPLAYCRAFTY feature; see zippy.README. - -* Added timestamps for chess engine interaction to -debug output. - -* Now allow 10 seconds (was 5) between games in match mode for engines to -respond to "force" command that ended previous game. - -* When a game is picked from the game list and the names of White and -Black are known, display them in the window banner instead of the filename -and game number. - -* Changed default for -scp and -sd to be the values of -fcp and -fd. - -* Added boxes for both engines to WinBoard startup dialog. Changed to -dropdown boxes whose content can be set from winboard.ini, similar to -the box for ICS name. - -* Accept "offer draw" (or "*offer*draw*") from engine to offer a draw. - -* Accept "move mmmm" from engine as well as silly "1. ... mmmm" syntax. - -* Added support for bughouse engines (Zippy mode only). - -* Move bombproofing for engines sending illegal or out of turn moves. - -* Always send "xboard\n" to engine as first command. Eliminates need -to run crafty as "crafty xboard". - -* Rewrote xboard code for input from engines to fix longstanding bugs. -Previously an engine that sent one line in two separate writes with -some time lapse in between (or perhaps that sent several lines in one -write) could make xboard hang. WinBoard did not have this bug. - -* Fixed minor bugs in dealing with illegal moves. - -* Added "iset startpos 1" for FICS. - -* Removed special support to put "GNU Chess" or "Crafty" in the window -banner instead of the engine's base filename. This gives a more level -playing field for other engines. Also fixed bugs in the code that finds the -engine's base filename. - -* Bugfix: Abort or Resign at the very start of a game in chess engine mode -would fail to send "force" to the engine. - -* Fixed some minor bugs in new "result" messages, and changed format to -include a trailing PGN comment giving the reason the game ended. - -* Changed syntax of /font options in WinBoard; old syntax was assuming -that a font name can't contain a digit, which is wrong. Old font names in -WinBoard.ini files are still accepted. - -* Serious further work on getting WinBoard to read/write files in the -"right" directories and documenting exactly what it does. - -* Added LoadPreviousPosition, LoadNextPosition, ReloadSamePosition. - -* Misc. tiny fixes and cleanup. - -3.6.9 -- Sun May 24 20:53:08 PDT 1998 Tim Mann - -xboard and WinBoard beta release. - -* Tightened up illegal move handling. Illegal or meaningless moves from a -file or chess engine should no longer get translated into a1a1 and blindly -applied. Explicit moves to the same square (like a1a1) no longer make the -piece on that square capture itself and vanish. - -* Added AlwaysOnTop feature to winboard. - -* Fixed bug in winboard "@" command line indirection operator. - -* Removed buggy "optimization" code for ToStart in analysis modes. - -* Fixed typo bug in zippy.c that would often cause winboard to crash -right after starting a game in -zp mode. - -3.6.8 -- Sat May 23 22:23:19 PDT 1998 Tim Mann - -xboard and WinBoard beta release. - -* Added -firstDirectory and -secondDirectory so that chess engines can -be started in a different directory from xboard/WinBoard itself. - -* Added -matchGames to allow more than one game in -matchMode. The games -are played with colors alternating between the two chess engines. Had to -add a time delay at the end of each game to catch up with game ending -messages from both chess engines -- yuck. - -* Changed TwoMachines mode to have firstChessProgram play White by -default. Added -firstPlaysBlack to restore old behavior. - -* Major rework of code in backend.c for dealing with first and second -chess engines. Generalized the code and created a struct type with one -instance for each engine. Several small bugs fixed along the way. - -* Fixed bugs in Abort in local chess engine mode. - -* Tightened pattern matching to recognize moves from machine. Should cure -bogus "Illegal move" errors while Crafty is pondering with Show Thinking -on, among other things. - -* WinBoard keeps focus in board window after popping up a comment due to -Forward/Backward/ToStart/ToEnd commands. - -* Finally got rid of warnings on compiling moves.c under Windows. - -* Fixed so WinBoard will compile on machines where WM_MOUSELEAVE is not -defined. - -* Removed various bits of unused code. - -* Parse (and ignore) NAGs in PGN files. - -* Updated engine-intf.txt. - -* Send "result R" to the chess program at the end of each game, where -R is the PGN result 1-0, 0-1, 1/2-1/2, or *. - -* Bugfix: suppress animation when loading a game with timeDelay=0. - -* Bug fix: pondering output from Crafty that contained "..." could be -mistaken for a move, causing bogus error messages and general chaos. - -* xboard "make clean" bug fix: moved things created by configure to be -removed only by "make distclean". - -* Fixed a remaining case where move was being animated before being -relayed to opponent. - -* Backend was reversing time/otim commands to the chess program (new bug), -and was often not sending them on the first move of a game or the first -move after a mode change (old bug). Fixing the latter required a kludge -to work with both GNU Chess and Crafty, because Crafty swaps white and -black clock times when it swaps sides, while GNU Chess does not. The -kludge is that we always make sure the chess engine thinks its opponent is -on move before we set the clock. This will sometimes result in sequences -like "white\ntime xxx\notim yyy\nblack\ngo", or the same with white and -black interchanged. - -* Removed last trace of old -whiteString and -blackString arguments. - -* Fixed so that you can type "bd" into the Direct Command dialog when -debugging gnuchess, without having xboard parse the clock display -(starting with "White") as "White wins" and end the game. - -* Changed moves.c to make a distinction between IllegalMove (where we -could tell what move was intended, but it violates the chess rules) and -MeaninglessMove (where we could not tell). This is a step towards getting -rid of cases where we translate meaningless moves into "a1a1", but some -work is probably needed to track them all down. - -* Fixed bug in WinBoard monoMode dragging. - -* Changed WinBoard to new style file dialogs. In the process, disabled -the feature that let you enter the index number of a game or position within -the file in the dialog. This is no loss in LoadGame, as you can pick your -game from the game list dialog that follows, but it does remove some -functionality from LoadPosition. - -3.6.7 -- Mon May 18 21:25:00 PDT 1998 Tim Mann - -xboard and WinBoard beta test release. I've been unable to reproduce some -reported drawing bugs, so they may still not be fixed. - -* Changed PopUpErrors option to PopupMoveErrors, which is more useful, and -changed default to off. Errors other than move errors should always be in -popups; they are often too big for the message area and too important to -put where they can be easily missed. But it seems good to get rid of the -popups for move errors by default. - -* xboard analysis window no longer forces itself to top whenever there is -new output. Also, now uses built-in Xaw word wrapping instead of trying -to do its own; works better. - -* Bugfix: Reset did not take Crafty out of analyze mode. - -* A chess engine no longer has to claim to be Crafty to be able to use -AnalysisMode and AnalyzeFile; it just has to implement the analyze -command as Crafty does. Put in heuristics to generate more informative -error messages if the engine does not support analyze, and checked that -they work at least with GNU Chess. - -* Added click-click moving, HighlightLastMove, and HighlightDragging to -WinBoard. The highlight features are unlikely to go into xboard unless -the xboard drawing code is cleaned up to do *all* drawing on the board -from DrawPosition, as WinBoard does. This is low priority for me. - -* Eliminated bogus "Error gathering move list: no header" popup. You -could get this by observing two fast games at once without turning off -GetMoveList. - -* Disable WinBoard Sounds menu entirely in -ncp mode, since not even -MoveSound is used in that mode. - -* WinBoard bugfix: Several problems were caused if the user changed -WinBoard's current directory in a Load, Save, or Browse dialog. In -particular, WinBoard.ini would get saved in the wrong directory, and -sound .wav file names would not get saved with a full pathname. I think -all such problems are now fixed. - -* WinBoard bugfix: iconizing the board after an aborted mouse resize would -(partially) resize it to Tiny. - -* WinBoard bugfix: board was not being drawn in color on 256-color -displays. This bug was introduced in 3.6.6. - -3.6.6 -- Tue May 12 17:43:43 PDT 1998 Tim Mann - -xboard and WinBoard beta release. Note: not all reported bugs are fixed. - -* Move animation in WinBoard, programmed by Henrik Gram. Great stuff! - -* Animate backward moves too. - -* xboard bugfix: -font (and friends) can now specify a font alias (such -as "fixed"), not just a full X Consortium name pattern. Previously this -would give a resource conversion error message. - -* Some coding style cleanup in xboard.c. - -* Earlier error check for moving wrong color piece in EditGame mode. - -* Completed fix to pattern matching; see 3.6.5. - -* Fixed some software rot bugs in Zippy. - -* Split AnimateDragging as separate option from AnimateMoves. - -* Added FlashMoves to options menu and -flash/-xflash to command line -options (xboard only). - -* Some preliminary work on visible bughouse holding support. Most of the -code is not present in this release because I have not gotten it working -properly yet; my first approach went down a blind alley and I had to -remove most of the partially working code in preparation for a rewrite. - -3.6.5 -- Fri May 8 14:22:09 PDT 1998 Tim Mann - -Not generally released. - -* Pack bughouse holdings display in banner more tightly when board is one -of the smaller sizes (when smallLayout or tinyLayout is true, that is). -An interim measure, but should help. - -* Completed fix to make move list parsing recognize the end condition and -final comment. - -* Fixed pattern matching for chatter (tells, etc.) to be more reliable. -This should reduce the incidence of colors starting in the wrong place and -of incorrectly matching things that look like other patterns inside -chatter, such as "shout <12>". (These errors were already rare.) - -* WinBoard now lets you customize the list of ICS's in the startup dialog. -For now, at least, requires editing WinBoard.ini with a text editor. - -* Bug fix: WinBoard window sizing and position setting save/restore did -not work right when the taskbar was at the top (or left side) of the -screen and not in autohide mode. - -* Merged xboard click/click mode and drag mode, and deleted -ClickClickMoving option on menu. Now if you click on a piece, it -highlights and a further click on another square will move it. (A second -click on the same square takes down the highlight.) Or if you press down -on a piece and start to drag, you can drag it to a new square. - -* When making click/click style moves, if your second click is on a piece -of the same color, instead of saying "Illegal move", we now cancel the first -starting square, replace it with the second, and wait for another click to -finish the move. - -* Separate -secondInitString. Default: same as -initString. Suggested by -Remi Coulom. - -* Patch from Frank McIngvale to make animation work with XIMs. Yay! - -* Changed move animation to happen after move is passed on to ICS or the -chess engine, where applicable. Fixed problems with updating moveList -that this uncovered. - -* Changed game list to show PGN result token for each game. - -* The usual minor bug fixes. - -3.6.4 -- Thu Apr 30 23:14:43 PDT 1998 Tim Mann - -xboard and WinBoard beta test release. - -* xboard documentation updated, both man page and info file. An attempt -to generate both from the same source with LinuxDocSGML was abandoned, at -least for now. WinBoard doc updated too. - -* Merged updates to animation code from Hugh. Fixed a couple of remaining -bugs, mostly to do with handling Pause mode correctly. - -* Added SaveSettingsOnExit to WinBoard. - -* WinBoard now saves the last screen position of the Comment, Edit Tags, -Game List, and Analysis windows (in addition to the board and ICS -Interaction windows) in WinBoard.ini. - -* WinBoard now provides a way to customize the right-button context menu -in the output area of the ICS Interaction window. For now, requires -editing WinBoard.ini with a text editor. - -* Various minor fixes to ICS message recognition, most affecting only Zippy. - -* Colorize the notification when someone sends you a message while you are -logged in, not the output of the "messages" command. - -* Fixed colorization to turn off at the right place more reliably. - -* Added a new color and WinBoard sound for "requests": abort, adjourn, -draw, pause, and takeback. The same color and sound are used for all of -these. - -* Added GUI to change sounds in WinBoard. - -* Suppressed WinBoard error popup when a sound can't be played. They were -popping up when two separate WinBoards tried to play a sound at the same -time (such as during a bughouse match). - -* Fixed WinBoard crash when a sound file didn't exist. - -* WinBoard ports of timestamp and timeseal now produce decent error -messages if they fail to connect, and WinBoard captures the messages and -puts them into a popup. Previously WinBoard would exit with no message on -such errors. - -* WinBoard resizing with mouse improved; now accurately picks the largest -size that fits in the new area. - -* Added option to turn off error message popups. - -* Added sizes slim, dinky, and teeny. - -* Fixed some minor problems with error message wording. - -3.6.3 -- Mon Feb 23 19:08:57 PST 1998 Tim Mann - -xboard beta test release only. Man page is updated for the changes, but info -file is not. - -* Bug fix: LoadGame could not load a PGN game whose first move was -castling (which is possible from setup positions). - -* Bug fix: we were ignoring illegal move messages from chess engines in -modes where the engine is refereeing but not participating (EditGame, -LoadGame, AnalyzeFile). The problem was in a workaround for a Crafty bug, -where Crafty generates a bogus illegal move message if a "." (used by -the PeriodicUpdates feature) is sent in analysis mode when the current -analysis reveals a forced mate. Installed a different workaround (that -works in most but not all cases) and reported the Crafty bug. Bob Hyatt -replied with a fix, so the Crafty bug should be gone in Crafty 14.12 or so. - -* WinBoard only: enabled resizing board with the mouse. It snaps to the -nearest (but not too much larger) predefined size. - -* The xboard default font is now sized according to piece size, just as -clockFont and coordFont have always been. - -* Added more sizes: bulky, moderate, average, middling, mediocre, petite. - -* xboard only: Added Animate Moves and Click-Click Moving to Options menu. - -* xboard only: Added code to animate piece movement, from Hugh Fisher. - -* New feature: autoflag is implemented in MachineWhite, MachineBlack, and -TwoMachines modes. If it is on and either a chess program or the user -oversteps his time, xboard will automatically call the flag and end the -game. This feature was requested by someone who runs matches between -programs and wants to penalize GNU Chess for its habit of running slightly -over at the end of a time control. I personally think it's pointless. - -* Fixed a bug in Zippy's pattern matching; he can now reply to ICC -messages again. - -* Generate prettier notation for illegal moves. If a move is illegal only -because it leaves the player in check, generate notation as if that were -not illegal. For instance, if two knights are a knight's move away from -f3, one on g1 and one on e5 that is pinned, the notation would be Nf3 to -move the g1 knight, Nef3 to move the e5 knight. (Suggested by Philippe -Schnoebelen.) In addition, if a move is illegal because the type of piece -moved cannot go that way, would be jumping over another piece, etc., we -give fully disambiguated coordinate notation; for example, Ng1g3, Ke1xe8, -d2xd8=Q, etc. An alternative would be to still write Ng3 if there is only -one knight on the board, or Ngg3 if the other knight is not on the g file, -but life is too short to code up all this stuff, and perhaps the way I did -it is better as it emphasizes that this move was really made despite being -illegal. I wonder if the new PGN standard revision will speak to notation -of illegal moves? - -* Fixed gross bug from 3.6.2: if a chess program said "checkmate" and -White was left on move, the PGN outcome was "1-0 {Black mates}" instead -of "0-1 {Black mates}"! The bug occurred only for that specific string. - -3.6.2 -- Wed Jul 23 16:47:29 PDT 1997 Tim Mann - -* There was a bug in backing up from the end of a game against a chess -engine, introduced when -reuse mode was added. Fixed. - -* Recognize "{" as terminating an ICS move list. Previously we needed to -see a prompt (containing %), but occasionally ICC can send more stuff -right after a move list with no prompt in between. - -* In WinBoard, -mm now implies -cp, so you don't get the startup dialog. - -* WinBoard startup dialog no longer sets -scp. People used to get -confused because they would give the -fcp and -scp arguments, but omit --cp. This would bring up the startup dialog, which would set both -fcp -and -scp to the value in the engine name box. Now you can change -scp -only with the command-line argument. That will confuse some people too, -but hopefully fewer. I think overall it's better than putting spaces for -both -fcp and -scp in the dialog, which would puzzle newbies. - -* Bug fix: Analyze File mode now works in WinBoard. - -* Bug fix: WinBoard window no longer cuts off part of the bottom row if -the menu bar wraps to a second line. - -* Accept game end messages of the form "PGN-result {comment}" from the -chess engine, where PGN-result is 0-1, 1-0, or 1/2-1/2. Accept "resign" -or "computer resigns" from the chess engine as a synonym for "0-1 {White -resigns}" or "1-0 {Black resigns}". Accept any message from the chess -engine containing "game is a draw" as a synonym for "1/2-1/2 {Draw}". -Accept "White resigns" or "Black resigns". - -* Enable "Action / Draw" menu item in chess engine mode. It sends the -command "draw" to the engine. Accept any message from the chess engine -containing "offers a draw" as a draw offer. WARNING: Draw offers from the -user and the engine (or from two engines) are not yet matched up by xboard -in chess engine mode. Two engines could get into a loop offering each -other draws. - -* Bug fix: Game end messages from the chess engine are always ignored in -Zippy mode. Previously they could sometimes be processed, which was -sometimes making Zippy hang at the start of a new game that followed -quickly after an old one. - -* Zippy can now respond to titled players in channels. Zippy will avoid -talking to himself in a channel if he knows his own name. - -* Bug fix: in colorization arguments, the bold setting was being ignored -if the background color was defaulted. (xboard only.) - -* Extended ParseFEN to accept Crafty 12.2's interpretation of FEN. -If fewer than 8 squares are given in a row, or fewer than 8 rows are -given, the uncovered squares are empty. Also, there can be a / after the -8th row. - -3.6.1 -- Sat May 17 01:02:33 PDT 1997 Tim Mann - -* Bug fix: Hitting escape while entering a password on WinBoard no longer -sets the font color back to black (which made further typing visible). - -* Bug fix: On Windows NT 4.0, WinBoard /ics /icshelper=timestamp would -often hang if you tried to exit with the Exit menu item, the [X] button, -etc. The same fix may also have corrected the problem where running a -chess program with /xreuse would sometimes crash Windows 95 (but not NT) -when the chess program was killed and quickly restarted. - -* Bug fix: Periodic Updates would not work if turned on after having been -off. Also, the default was needlessly "off" in WinBoard. - -* Zippy bug fix: Continuing an adjourned game was totally broken. The -wrong moves, or no moves at all, were being fed to the chess program. - -* WinBoard change: Giving -ics without -icshost now pops up the startup -dialog with "Use an Internet Chess Server" pre-selected, so that you get a -menu of chess servers instead of going directly to ICC. - -* Bug fix: WinBoard's SaveSettings was saving -icshost, -icsport, and --icshelper in winboard.ini. This causes a problem if you use a different -icshost later that needs the default values for icsport (5000) and -icshelper ("", meaning none). - -* Disabled complaints about unexpected "[Ii]llegal move" messages from -the chess program; we still get them at times. - -* Greatly simplified the code for Move Now and SIGINT (ATTENTION). Fixes -the bug where Move Now did not work with GNU Chess in WinBoard, and -several more obscure bugs as well. Reintroduces a minor bug: GNU Chess might -not think on your time after a Move Now command. Trying to fix this -causes too many other problems. Documented change in engine-intf.txt. - -* Cleaned up code for obtaining ratings from ICS. It was kludgey and may -have had bugs on systems with no "Creating:" message. It should fail -gracefully there, just not finding the ratings. - -3.6.0 -- Thu May 8 19:55:58 PDT 1997 Tim Mann - -* WinBoard now has right-button context menus in the ICS Interaction -window. Some of the items do immediate commands on the player name you -have selected or pointed to. (Suggested by Paolo Casaschi.) Also, the -middle button or shift+right does a immediate Copy and Paste. - -* Fixed a bug in Zippy's wild rejection. The bug was causing Zippy to -reject all forms of wild. Now it rejects only 1, 9, 16, 17, and 24, as -was intended. These variants have different rules, while the other -variants defined so far only have different starting positions. -(Actually, wild 2, 3, and 4 never allow castling, but may sometimes by -chance have king and rook start on squares where castling appears legal. -This could cause a problem later.) - -* Zippy now resumes adjourned games by feeding the chess program -the move list instead of the position. Setting -getMoveList to False -restores the old behavior. Feeding in the move list is better because -it enables the chess program to correctly handle en passant legality, -castling legality, draw by repetition, and draw by the 50 move rule. - -* Added a WinBoard startup dialog for people who run WinBoard.exe without -using the Start menu or reading the help file. Instead of being dumped -directly into GNU Chess mode, you now get a menu of choices. You now have -to give the new WinBoard -cp option to go directly into chess engine mode. -I did not add this feature to xboard. - -* Handling of "illegal move" from Crafty is now back on. (It was turned -off in 3.4.6; see below.) Crafty 12.0 doesn't seem to send bogus ones -anymore. I did have to suppress sending time and otim in analyze mode to -make this work, but there is no harm in that. - -* Zippy now sends "gameend" to ICS at the end of each game. You can alias -this to "seek" or whatever you like. - -* Added Crafty support for Move Now, using the "?" command. We test -whether this command exists by trying it once at the start of the first -game, before it really makes sense. If we don't get a message like -"Illegal move ... ?", we assume it's OK. (We're careful about this -because sending a "?" to GNU Chess on Move Now keeps it from pondering the -next move as it should.) - -* Added support for a tellusererror command from the chess engine. See -engine-intf.txt. - -* Attempted to make engine-intf.txt complete. - -* Minor fixes/cleanup to GameEnds code, to be sure we always interrupt -when needed, and always undo an extra move generated by stopping the chess -program while it is thinking. - -3.5.7 -- Sat May 03 22:37:44 PDT 1997 Tim Mann - -Beta release of both xboard and WinBoard. - -* Updated xboard documentation. I really wish the man page was built from -the info file instead of being separate! It's a pain to update them both. - -* Updated documentation of the interface between XBoard/WinBoard and chess -programs, and renamed it to engine-intf.txt. - -* Added support for tellics, telluser, and askuser commands from the chess -engine. See engine-intf.txt. - -* Various bug fixes. On WinBoard, 256 color displays are finally handled -right; no more color flashing when you switch windows unless the colors -really need to be updated. Also, I think the problem of the console font -failing to change or changing back by itself is finally fixed. - -3.5.6 -- Tue Apr 29 03:08:00 PDT 1997 - -Beta release, WinBoard only. ChangeLog was out of date in release, -updated here. - -* Added ICC timestamp and FICS timeseal to WinBoard distribution. These -are my own ports to Win32, based on and used by permission of the owners -of the proprietary source code (Daniel Sleator for timestamp, Henrik Gram -for timeseal). The owners permit these programs to be distributed only in -binary form (to help prevent cheating), so to avoid running afoul of the -GPL, I have kept them as separate programs, not linked into the WinBoard -address space. Updated Start menu icons to use them. - -* Miscellaneous smaller changes. - -3.5.5 -- Fri Apr 25 03:06:00 PDT 1997 - -Beta release, WinBoard only. ChangeLog was out of date in release; -updated here. - -* Added simple sound support to WinBoard. - -* Updated WinBoard documentation. - -* Internal implementation of the telnet protocol is now more complete. -You can now hop through a VMS host on the way to ICS. For example, do -"xboard -ics -icshost vms.host.edu -icsport 23", then log in. Do not use -the -telnet flag; that says to use an *external* telnet program. To avoid -double echoes, you need to force character mode in VMS telnet after -connecting from VMS to ICS. Do "^]^Mset mode char^M^M". - -* Display opponent names in the title bar for MachineWhite, MachineBlack, -and TwoMachines modes. - -* WinBoard now has an installer, built with InstallShield. The installer -works with a binary-only distribution. Sources are still freely -available, but now separately. - -* Added SaveSettings to WinBoard, which saves current option settings to -winboard.ini. Made sure all options can be saved and loaded, including -fonts and com port settings. - -* If the game ends while you are dragging a piece, we now don't let you -finish the move. Formerly the move was accepted and your opponent's clock -would start running again. - -3.5.4 -- Fri Apr 18 01:15:24 PDT 1997 Tim Mann - -Beta test release of WinBoard and xboard. The documentation remains -out of date. - -* Many fixes and improvements to new WinBoard user interface code. - -* In Zippy mode, avoid sending another copy of the same move to the chess -program if ICS sends us another copy of the board image. Hard to believe -it took me until now to diagnose and fix this problem! - -3.5.3 -- Sat Apr 12 19:49:33 PDT 1997 Tim Mann - -Beta test release of WinBoard and xboard. - -* Fixed fatal bug in WinBoard input handling. - -* Made code to stop chess program for reuse a bit smarter. Removed kludge -of "white" in initString; it didn't work well, and is unneeded -with Crafty 11.21 and later. - -3.5.2 -- Sat Apr 12 15:40:01 PDT 1997 Tim Mann - -Beta test release of WinBoard. - -* Ignore check and permit promotion to King during suicide games; no need -to turn off TestLegality. - -* Renamed CheckLegality to TestLegality to avoid confusion with the chess -term "check". - -* Added Rematch to Action menu. - -* WinBoard now has a custom ICS interaction window with scrollback, a -separate line for input, and colorization. Accelerators that conflict -with normal editing keys were changed (by requiring Alt+) so they can work -in both the console and the main window. - -* WinBoard error popups are now non-modal and disappear when you make a -new move, as in xboard. - -* Configure now defaults to --disable-ptys on all systems. If anyone has -an ancient SysV system where pipes don't work with select, they can still -do "configure --enable-ptys" explicitly. I would appreciate getting a bug -report if this happens to anyone, with complete output from configure and -"uname -a". - -* "make install" now makes the installation directories too. - -* Fixed a bug that would cause an "Illegal move" message for Black from -GNU Chess to be incorrectly considered bogus. - -* Handle name changes during an ICS game (FICS bname and wname commands). - -* You can force both chess programs to be killed at the end of each game -by turning off the reuseChessPrograms option. There are still some -problems with reusing Crafty even in version 11.20. - -* Now the second chess program stays around by default too, if it ever -gets started. - -3.5.1 -- Sat Apr 5 16:47:48 PST 1997 Tim Mann - -Beta test release. - -* Don't kill off and restart the chess program for each game; keep the -same one running, using the "new" command to start a new game. This -change works around the problem in Windows 95 that makes WinBoard crash it -at times, and is generally desirable to make new games start faster. The -second chess program (for TwoMachines) is still killed at the end of the -game, and unfortunately this can still crash Windows 95. Temporarily -added "white" to the initString to make this work with Crafty 11.20, which -has a minor bug in "new". Older versions of Crafty have worse bugs in -"new"; they should not be used with this version of xboard. - -* Support for FICS suicide chess: Parse illegal moves (that leave King in -check) in game history. If CheckLegality is off, allow promotion to King -and illegal moves in game files. We still generate e2e4 style notation -for illegal moves. - -* Handle FICS "has timeseal; checking" message. - -* Changed the coords from white back to black; this was a bug. - -* Fixed problems compiling with K&R compilers. - -* Fixed an old bug in RegisterMove that was crashing cmail on some systems -(notably linux). - -3.5.0 -- Thu Jan 2 16:59:49 PST 1997 Tim Mann - -Thanks to Frank McIngvale for much of the work on versions 3.4.4 and above! - -* Fix Crafty resumed game time bug (frankm) - -* Word wrap text in Analysis window (frankm) - -* More debug info for XPM loading (frankm) - -* Replaced config.sub, config.guess, etc., with up-to-date versions from -autoconf 2.12. Hopefully this will fix problems on Pentium Pro machines. - -* Removed some Makefile gunk that was causing looping for one person. - -3.4.7 -- Thu Dec 19 14:22:41 PST 1996 Tim Mann - -All changes from Frank: - -* Retrieve ratings from ICC (and FICS, etc., when they add the Creating: -message), save them in the PGN tags, and pass them to Crafty in Zippy mode. - -* Add settable time delay between characters in ICS login script. - -* Colorize messages like personal tells. Fix false recognition of channel -tells. - -* Pass "tells" from Crafty through to ICS (in Zippy mode). - -* Implement ~/ filename convention from C shell for game and position file -names. - -* ZIPPYACCEPTONLY feature for testing. - -3.4, patchlevel 6 -- Sat Nov 23 16:58:50 PST 1996 Tim Mann - -* Put recognition of "illegal move" messages from Crafty for -illegal castling, etc., inside an #if that is currently turned off, -because of a bug in Crafty that generates bogus "illegal move" messages -after some moves that are actually legal and accepted by Crafty. - -* Added -checkLegality option; previously this could not be turned off. - -* Fixed an old bug in finding default board size parameters. - -* Differentiated among channel tell, kibitz/whisper, and personal tell/say. - -* Fixed a bug in detecting Xpm in the configure script. - -3.4, patchlevel 5 -- Mon Nov 18 16:22:53 PST 1996 Tim Mann - -* Added zic2xpm to the kit; it had been omitted by mistake. - -* Added some default colors for -colorize - -3.4, patchlevel 4 -- Sat Nov 16 18:10:17 PST 1996 Tim Mann - -This is meant to be a beta release in preparation for version 3.5. - -* Added InfoXBoard and ManXBoard to the Help menu. - -* Made Frank's ICS input box optional, defaulting to off. - -* Merged in Frank McIngvale's XbKit. Many new features, including --clickClick mode, the Analysis modes, piece flashing, ZIICS import, -ICS text colorization, and the ICS input box. Many thanks to Frank for -supplying and documenting this code. - -3.4, patchlevel 3 -- Mon Nov 11 18:23:14 PST 1996 Tim Mann - -Small set of changes made while Frank McIngvale was working on XbKit in -parallel. Unreleased in this form. - -* Updated zippy.README. - -* Removed useless X event handler and removed strange code for copying -form translation table to board that worked around the bug it caused. -This makes changing bindings in .Xdefaults more straightforward. - -* Now pressing the Control key steps back one move, and releasing it steps -forward again. - -* Moved quit from "q" to "Q" for greater safety. - -* Use "unobserve" instead of "observe" to stop observing; needed on FICS. - -* Support for interface variable. - -* Strip titles from people who are talking to us, so (for example) Zippy -won't try things like "tell Darooha(*) hello". Needed on FICS. - -3.4, patchlevel 2 -- Tue Jul 9 19:06:42 PDT 1996 Tim Mann - -This patchlevel is not planned to be an announced release. It's in -preparation for integrating Frank McIngvale's XbKit. It mostly contains -minor fixes I've accumulated since 3.4.pl1. - -* WinBoard /telnet option now fires up an external program, as -with xboard, instead of trying to use a feature of NT 3.1 that does not -exist in later versions of NT or in Windows 95. ChangeLog for 3.4.pl1 -said this had been implemented there, but it really wasn't. - -* Indicating player to move by the icon color now works under Windows 95. - -* WinBoard now kills the chess program when you exit using the system menu -or the [X] button. Thanks to Michael Lowe. - -* Minor changes to Zippy, including: Now understands wild challenges on -FICS; these used to crash it. Removed limit on how fast a game will be -accepted. Use "set formula ..." on the chess server to limit this if you -are using GNU Chess. Now sends correct opponent name to Crafty. - -* Added some missing default values to documentation. Thanks to Stuart -Cracraft. - -* Bugfix: Trying to print "No fonts match pattern" error message would -crash. This can happen to Linux users who don't install Helvetica, for -example. - -* Bugfix: Defaulting feature in -size n,n,n,n,n,n would put us in an -infinite loop. - -* Added more directories to search for Athena widgets on HPUX. - -* New cmail (3.12) from Evan Welsh; includes small fix from Kayvan Sylvan. - -* Recognize "illegal move" messages from Crafty for illegal castling, etc. - -* Bugfix: "name" command added to zippy.c for Crafty was producing error -message if GNU Chess was in use. - -* In bughouse mode, suppress holding messages from console window; show -holdings only in banner. - -* Minor fixes/cleanup to Makefile.in and configure.in. - -3.4, patchlevel 1 -- Mon Dec 11 13:43:12 PST 1995 Tim Mann - -* This patchlevel updates WinBoard to match xboard, and includes a few -fixes and minor improvements. "-size tiny" and "-size n,n,n,n,n,n" -are still not implemented for WinBoard. - -* Installed support for Crafty based on code from Bob Hyatt. -Currently the only documentation for this is in the FAQ, and a few -things don't work with Crafty 8.23. Please do not report these -problems as bugs in either xboard or Crafty. Bob and I know about -them. The worst ones (if not all of them) should be fixed in Crafty -8.24. - -* Changed the kludge command we send when gnuchess wants to print -something that doesn't end with a newline, from "help" to "bogus". -This works because the error message gnuchess prints ends with a -newline. It also improves compatibility with Crafty, which doesn't -need the kludge, but for which sending "help" causes a problem. - -* Don't draw grid at all if lineGap is 0; previously we drew the grid -with X "0-width" lines (usually 1 pixel wide) and then overwrote it. - -* Makefile: Removed xboard.info from "all" target so we won't try to -rebuild it, because this fails on hosts that don't have makeinfo -installed. Other minor fixes to "clean" targets, etc. - -* Fixes and cleanup to Auto Comment code that handles continuation -lines and highlighting. - -* Auto Observe now tries to observe the game from the point of view of -the player who was on your gnotify list. Requested by rng. -Limitations: We can't tell which player it was unless you have ICS -highlighting turned on. Also, currently "observe foo" works as -required (observing from foo's point of view) only on ICC, but FICS -will probably implement this soon. - -* "-size tiny" now makes the default font smaller automatically. This -was implemented by introducing an extra Form widget in the hierarchy -for all xboard windows, named either normalLayout, smallLayout, or -tinyLayout. So you can have resource specifications that apply only -to certain layouts; in particular, XBoard*tinyLayout*font. - -* Bug fix: EditGame or EditPosition while playing or examining still was -not really being permitted. - -* WinBoard bug fix: On the EditPosition menu, King did not work. - -* Added text catalog of WinSock error messages to WinBoard, because -Microsoft still has not put them in the system message catalog. - -* Removed support for older ICS game-ending messages that do not have -a PGN result token (*, 0-1, 1-0, or 1/2-1/2) after the closing '}'. -The code for older messages was sometimes firing on the newer -messages, due to parsing ambiguity. If the current code sees an old -message, it will understand that the game is over, but will always -display * as a result token instead of trying to guess the result by -interpreting the text message. - -3.4, patchlevel 0 -- Tue Nov 21 01:02:50 PST 1995 Tim Mann - -* This patchlevel was released for xboard only. - -* Updated the info file. It should now be as up-to-date as the man page, -with good English except in the parts that pertain only to AmyBoard. - -* Added "-size tiny", requested by Bob Hyatt. Also cleaned up bitmap -support and added "-size n,n,n,n,n,n" to allow arbitrary-sized bitmaps, -if the actual bitmaps are supplied by the user. - -* Updated bughouse support. - -3.3, patchlevel 4 -- Sat Nov 18 02:27:21 PST 1995 Tim Mann - -* Unreleased beta that works with preliminary FICS bughouse code. Will -need changes before release to track FICS message changes. - -* Removed use of .EX macro from man page. It is not supported by some -nroff -man macro packages, notably the one on Slackware Linux. Switched -to boldface for references to xboard and other commands within the man -page, as this seems to be the modern way. - -* Bug fix: If ICS rejected a move, it was correctly undone on the board, -but the message widget still displayed the bad move. Reported by DAV. - -* Normally, xboard in ICS mode fetches the move list whenever the board -display switches to a new game. Doing this is now an option -(getMoveList) that can be turned off, which is useful if you are watching -multiple blitz games. Requested by rng. - -* Move list fetching code is now smarter: it ignores a move list if it is -not for the right game. - -* Added support for bughouse as implemented on FICS. Holdings are shown -in the window title in place of the strength numbers. A menu on mouse -buttons 2 and 3 (same on both) lets you drop pieces. There is no checking -as to whether you actually hold the piece you are trying to drop; we rely -on ICS to check that. Notation of the form P@f7 is generated and parsed. -The mate detector does not understand that non-contact mate is not really -mate in bughouse, but this does no real harm. It results in a "#" -suffix being displayed on the move notation, but xboard does not assume the -game is over. - -* Bug fix: Promotion to a knight was not working with ICC! Thanks to -Wendigo for the report. - -* Bug fix: Special pty code for host types *-*-aix3* and *-*-irix3* -(supplied from configure.in) had a bug that would cause childio.c to -fail to compile, due to a "continue" that was not within a loop. - -* Bug fix: In pgntags.c, memory was being freed while still in use. One -symptom this caused was that on some machines, cmail would fail with a -message that it could not find the BlackNA tag. The error was in some -submitted code that I included in version 3.2.pl3 without reading -carefully enough. Anders Forberg noticed the symptoms, and Evan Welsh -(who had nothing to do with causing the bug) found the bug and submitted a -fix; thanks to them both. - -* Removed restriction against using EditGame while playing, observing, -or examining on ICS. You still get a warning popup. - -3.3, patchlevel 3 -- Sat Sep 16 11:44:05 PDT 1995 Tim Mann - -* Bug fix: Going directly from MachineWhite to TwoMachines mode would kill -off the second chess program after Black's first move. - -* Added -timeIncrement feature. Thanks to Joel Rivat. - -* Deleted code that tries to keep you from observing more than one game, -or observing while playing or examining. There is actually no problem in -doing this, except that every time an update comes in from a different -game than is currently being displayed, xboard fetches the history of the -new game, which may be time-consuming if you are on a slow link. - -* Fixed configure so as not to crash when neither lex nor flex is found. -lex or flex is needed only if the user wants to rebuild parser.c. Thanks -to Phil Humpherys for reporting the crash. - -* Bug fix: config.h.in used #define instead of #undef for some macros used -in the pty code in childio.c. This causes the code to fail to compile on -some architectures, because the symbols are supposed to be undefined, not -defined to empty, when they are not set in configure. Bug originated in -3.3.pl0 when config.h was introduced. Thanks to Phil Humpherys for report. - -* Bug fix: ShowThinking would not show anything when current position had -no move to display in the move window. E.g., if position was created by -LoadPosition or EditPosition. - -3.3, patchlevel 2 -- Mon Aug 28 11:11:11 PDT 1995 Tim Mann - -* Zippy code was omitted from xboard-3.3.pl1 by mistake; now included. - -* For WinBoard, added hint to help file that you may need to turn off -LocalLineEditing while typing dialing commands to your modem. - -3.3, patchlevel 1 -- Sat Aug 19 15:13:30 PDT 1995 Tim Mann - -* Zippy distribution is no longer separate from regular xboard distribution. - -* Deal properly with Show Thinking output from GNU Chess when it is -thinking on its opponent's time. In TwoMachines mode this output is -suppressed to avoid interfering with the output from the machine that is -on move; in other modes it is displayed (including the move that GNU Chess -is predicting the user will make next). GNU Chess produces this output -only if it is built without -DQUIETBACKGROUND defined; this symbol is -defined by default in patchlevels before pl75, but undefined by default in -pl75. - -* Bug fix: Handling of initial board position in move list for wild games -was broken, so wild games could not be observed and adjourned wild games -could not be continued. Thanks to "Maximum Entropy" for the bug report. - -* Added feature: algebraic notation now shows "+" indicator for check -and "#" for checkmate, as called for in PGN standard. Thanks to Kevin -Maher for the suggestion. - -3.3, patchlevel 0 -- Thu Jul 27 22:21:07 PDT 1995 Tim Mann - -* Changed configuration to use a config.h file instead of passing zillions -of -D options on the cc command line. - -* Merged a small fix and some updates to the texinfo file from Jochen -Wiedmann. The texinfo file still needs work. - -3.2, patchlevel 5 -- Tue Jul 18 20:29:39 PDT 1995 Tim Mann - -* Beta test release of xboard only. - -* Updated WinBoard code to include new xboard features. - -* Added texinfo file from Jochen Wiedmann to the release, but not as the -primary documentation. It needs updating, and the English needs work. -I did make a few improvements, mostly to change incorrect uses of @var to -either @samp or @code as appropriate. - -* Merged in code changes to 3.2.pl4beta from Jochen Wiedmann. - -* Fixed EditComment; did not pop up window in previous beta. - -* Added AutoComment feature. - -* Added GameListDestroy to disable the outdated game list popup in cases -where we load a new game file without building a new popup. - -* Added yyskipmoves feature to parser.l to speed up building of gamelist. - -* gamelist.c wouldn't compile with a non-ANSI compiler. Fixed. - -* Change to yy_text handling in patchlevel 3 still had problems. Can't -use AC_DECL_YYTEXT in configure.in, because that defines YYTEXT_POINTER -according to whether the lexer on the current host makes yytext a pointer. -But most people will be using a parser.c that was generated on another -host and shipped with the package. - -3.2, patchlevel 4 -- Sun Jun 25 19:13:43 PDT 1995 Tim Mann - -* Beta test release of xboard only. - -* Added FIREWALLS section to man page. - -* Changed -icsport to be a string. Now with the -telnet option, -specifying -icsport "" suppresses the second argument to telnet. - -* Added EditTags feature. Removed AboutGame from menu, because EditTags -subsumes it. EditTags suggested by Jochen Wiedmann and first implemented by -him in AmyBoard. xboard implementation is my own. - -* Fixed some missing or incorrect prototypes. - -3.2, patchlevel 3 -- Sat Jun 3 18:57:38 1995 Tim Mann - -* Beta test release of xboard only. - -* New version of cmail from Evan Welsh, to fix compatibility problems with -perl 5.0. - -* Added game list feature on Load Game, based on code from Jochen -Wiedmann. Integrated it with cmail. - -* Several bug fixes from Jochen Wiedmann, including one to my yy_text -workaround for the difference in the type of yytext between lex and flex. - -* Handle clock pause on FICS. - -* Suppress clocks in untimed FICS games (time control 0 0). - -* Rebuilt configure script with autoconf 2.3. This fixes a bug in -configuring for X11R6, where -lSM -lICE would not be added when needed. - -* Fixed inconsistent type declarations on IntSigHandler and -CmailSigHandler. Bug report from Josh Daynard. - -* backend.c wouldn't compile with a non-ANSI compiler. Fixed. - -3.2, patchlevel 2 -- Tue Feb 7 14:50:30 1995 Tim Mann - -* Minor release of both xboard and WinBoard. - -* Added recognition of some FICS messages. On the other hand FICS is also -changing some of its messages to match what xboard already recognizes. - -* Temporarily went back to using "promote" command on ICS instead of -"a7a8=Q", because FICS doesn't implement the latter yet. - -* We now avoid using overlapped I/O on pipes in WinBoard, to make Windows -95 beta 2 happy. This lets WinBoard work with GNU Chess on Windows 95! - -* Installed patches from Jochen Wiedmann to coordinate with Amiga XBoard. - -* Installed patch to cmail bug in LoadGame from Evan Welsh. - -* Bugfix: checkmate and stalemate moves entered with EditGame in ICS mode -were not being handled correctly. Bug was in GameEnds(). - -* Implemented EchoOn and EchoOff for xboard, using system("stty echo\n"). -Now passwords won't be echoed when you connect directly to ICS. Also, -telnet negotiation characters aren't displayed (when possible). - -* Implemented more of the telnet protocol. Now connecting to a telnet -server with "-icsport 23" should work even without giving the -telnet -option. The telnet is in "old line-by-line mode". - -3.2, patchlevel 1 -- Sat Dec 10 13:50:46 1994 Tim Mann - -* This patchlevel released for WinBoard only. - -* winboard.c: Fixed ConsoleInputThread(). Needed to change CRLF to LF, -not to CR. This was stopping normal /ics mode from working. Thanks to -Asher Kobin for the bug report. - -* winboard.c: Fixed Raw(), EchoOn(), EchoOff(). Now they take effect -immediately, not on the next console read after the one in progress. - -* winboard.c: Attempted to make WinBoard work with gnuchessx running -directly on Windows (not remotely via rsh). It now works on NT, but only -if gnuchess is told not to think on its opponent's time ("easy\n" removed -from initString). The problem seems to be that GenerateConsoleCtrlEvent -is not doing anything. On Windows 95 beta 2, we get error messages on -both reading and writing to gnuchessx; I didn't investigate why. - -3.2, patchlevel 0 -- Wed Dec 7 13:23:36 1994 Tim Mann - -* Thanks to all the beta testers who gave me feedback: Josef Nelissen, -Steve Booth, Evan Welsh, Dima Dakhnovsky, Chris Petroff, Peter Jansen, -Derek Terveer, Michel van der List, Richard Lloyd, Shelly Mistry, and Mike -Lee. Sorry if I forgot anyone. Thanks to Virendra Kumar Mehta for -information about DYNIX/ptx. - -* Don't exit on keyboard EOF unless we get two in a row. - -* WinBoard only: added -localLineEdit switch to allow turning off local -line editing if you really want to. It is still a bad idea to let the -echoing be done remotely, however; see below. - -* Fixed some configure problems on HP-UX. [Steve Booth] - -* Fixed (I hope) configure problem on SunOS 5.3/Solaris 2.3. [Josef Nelissen] - -* cmail bugfix from Evan Welsh (cmail 3.4). - -3.1, patchlevel 9 -- Fri Dec 2 23:54:56 1994 Tim Mann - -* Beta distribution only - -* Always do local echo/edit of user typing in ICS mode. Doing the echo -downstream may seem nicer in some modes, and it can be hard to turn that -echo off, but the echoed characters can be interleaved with ICS output -and make it impossible to parse correctly. For xboard this involved only -a change to recommendations in the man page, as Raw() isn't implemented. -For WinBoard, removing Raw() made a real difference. Added code in -WinBoard to change /r/n back into /r on keyboard input, as we get the -former when Raw() is not called. - -* Do not issue ICS "refresh" command after we start to observe a game -unless we get to the next prompt without seeing a board image. Newest -version of ICS doesn't require this refresh, but old versions around still -do. - -* cmail bugfix and small code cleanup in LoadGame, from Evan Welsh. - -* Added keyboard accelerators N/P for LoadNextGame/LoadPreviousGame. Evan -Welsh request. - -* Using "-" on the command line as a filename for loading (saving) games -or positions specifies the standard input (standard output). Alain Picard -suggestion. - -* On WinBoard only, a command line option without a leading '-' or '/' is -now taken as the value of -lgf. - -* Changed to not use stdin, stdout, stderr as initializers in backend.c; -needed for GNU libc compatibility. You also must build parser.c with flex -(not lex) if you are using GNU libc, to avoid having the same problem -there. - -* Changed WinBoard to avoid using "overlapped" input on the console. It -now seems to fully work on Windows 95 beta 2. - -* Improved comment popups on WinBoard. Now newlines are handled properly, -and the plain Comment popup window doesn't disappear and reappear when we -step to a new move with a new comment. - -* Fixed bugs in detecting the absence of the time and otim commands. - -* Added built-in implementation of rcmd protocol to WinBoard. Windows NT -does not implement passing signals through rsh, and Windows 95 does not -have rsh at all. - -* Added -remoteUser option. - -3.1, patchlevel 8 -- Mon Nov 28 15:26:07 1994 Tim Mann - -* Beta distribution only - -* Rearranged ChangeLog file into reverse chronological order to be closer -to GNU standards. - -* Integrated new cmail code from Evan Welsh (including cmail RCS rev 3.2). -Includes a bug fix to TruncateGame. - -* Updated ICS address to be chess.lm.com. - -* Bug fixes to handling the aftermath of FatalError. Thanks to Chris -Petroff for the bug report. - -* Test for remsh before rsh, other fixes for HP-UX. Thanks to Richard -Lloyd. I wasn't able to do all the things he suggested, so there may -still be some rough edges in building on HP-UX. See the FAQ file for hints. - -* Bug fix; added missing check for HAVE_SYS_SYSTEMINFO. Thanks to Josef -Nelissen for testing on Solaris 2.x. - -* Updated WinBoard to match xboard. (WinBoard still has a few option -dialogs that don't exist in xboard.) - -* Changed Hint output to a popup. - -* ShowThinking output and move output no longer overwrite each other. -ShowThinking output won't appear if the displayed position is not current. -ShowThinking output in TwoMachines mode made clearer and documented. - -* Implemented --enable-ptys and --disable-ptys arguments to configure. - -* Fixed Book and Hint code to work over a pty with echo enabled and tabs -expanded to spaces. Thanks to Dima Dahknovsky for the bug report. - -* Moved Attention calls from all over xboard to one place, inside -SendToProgram. - -* Added bulletproofing to ShowThinkingEvent. - -* Added code to handle "refresh N" boards that come in from ICS properly, -assuming ICS is changed to mark them with a new relation code (-3). - -3.1, patchlevel 7 -- Sun Nov 13 22:16:01 PST 1994 -- Tim Mann - -* Beta distribution only - -* Changed ShowThinking to just show the current best line in the -DisplayMessage area, instead of dumping everything to stdout. - -* Installed new cmail (RCS rev 3.1) and cmail.man (RCS rev 1.10), and -changes to cmail code in backend.c, from Evan Welsh. - -* Miscellaneous minor fixes. - -3.1, patchlevel 6 -- Fri Nov 4 12:53:53 PST 1994 -- Tim Mann - -* This patchlevel was not actually released to anyone. - -* Updated the pty code to be based on GNU Emacs 19.24, and moved it to a -separate file. It was hard to split out just the pty configuration from -all the stuff emacs does with its custom configure script and .h files, -but I did my best. - -* Converted from imake to GNU autoconf. This was a serious upheaval. - -* Put in code to help trap "error gathering move list" problem reported by -Michel van der List if it recurs. I couldn't reproduce it. - -3.1, patchlevel 5 -- Mon Oct 31 21:12:00 PST 1994 -- Tim Mann - -* Beta distribution only. - -* We now test for checkmate or stalemate in EditGame mode after every user -move, and in LoadGame mode whenever we hit the end of a game without -seeing a PGN end marker. cmail needs an update to deal with this -correctly; Evan promises one. - -* Bugfixes in new move generator. Thanks to Mike Lee for reporting one of -the bugs. - -* Imakefile was omitted from patchlevel 4. - -3.1, patchlevel 4 -- Mon Sep 19 18:19:46 PDT 1994 -- Tim Mann - -* Beta distribution only. - -* The move generator includes a mate tester. Initially this is used only -by cmail, and even that usage needs further work. - -* Wrote a true move generator and used it to replace all the move -disambiguation and legality checking code in parser.l. The move generator -is capable of dealing correctly with en passant and castling availability, -but the rest of the program still does not keep track of this information. - -* Bug fix: xboard did not handle "foo has made you an examiner of game 23" -message. Thus you could not use examine features until the next board -came in, showing your new relation to the game. Thanks to POOKIEWOOKIE on ICS -for the bug report. - -* Added AutoObserve feature. Thanks to Chris Petroff for the idea. - -* Added Book feature to use new gnuchess "bk" command. Mike McGann request. - -* Redid code to handle missing "time" command in gnuchess, because latest -gnuchess no longer sends a response to this command. - -* Eliminated need for -DFLEX. Thanks to Michael Shields (Vladimir?) for -the idea. - -* Added missing code to implement MoveNow in TwoMachines mode. - -* Added ShowThinking feature. Thanks to Richard Lloyd for the idea. - -* Applied patches from Evan Welsh; some fixes and improvements to the -cmail code. - -* Fixed bug in moving from EndOfGame mode to MachineWhite or MachineBlack, -introduced in previous patchlevel. Also fixed related bug in ending a -game in ICS mode; was entering EndOfGame mode instead of IcsIdle. - -* Added patch to implement internetChessServerLogonScript flag, from Kevin -O'Connor. Thanks! - -3.1, patchlevel 3 -- Wed Sep 7 13:22:07 PDT 1994 -- Tim Mann - -* Beta distribution only. - -* Merged in new cmail code from Evan Welsh. He added the ability to have -more than one game per message, needed for official IECG matches. I added -the ability to resign or offer/accept/decline a draw in a cmail game. - -* Bugfix: invalid -tc option caused segmentation fault; DisplayFatalError -was called too early in initialization. Georges Honore reported this bug. - -* Decided to keep EndOfGame mode as an element of the user interface---it -means that a gnuchess game or loaded game has ended, and the user must -explicitly select EditGame to edit it, rather than just being able to -enter more moves freely. But internally there is no longer an invariant -tying this mode to whether the chess program is running. - -* Zippy bugfix: Was saving only the final position in the -sgf file when -the game ended by something other than resignation or flag. Also fixed -the longstanding bug that Zippy would think the final board of such a game -was a new game and restart the chess program. - -* Now does a better job of faking castling availability in FEN. We still -don't really keep track of it, but now at least we don't say that castling -is still available when the king or rook is not on its home square. - -* Bugfix: Initial board of game history for wild games was going through -too much processing, causing us to forget the game length, which is now -needed by ParseGameHistory. This was causing problems with resuming -adjourned wild games. - -* Updated ICS host to ics.onenet.net. - -* Zippy now accepts challenges where the opponent specified his color. - -* Added ZIPPYPASSWORD2 to let operator give commands directly to gnuchess. - -* Bitmap directory can include alternative icons now, too. - -* Handle "Game * (*) has no examiners" message from ICS. - -* Revamped window title and icon name selection. - -3.1, patchlevel 2 -- Sun Jun 12 17:16:28 PDT 1994 -- Tim Mann - -* "Beta" distribution for Zippy users only. - -* Bugfix: common.h was assuming that X11 type Boolean is char, which is -not always true. This might have caused all sorts of obscure bugs! - -* Installed new bitmaps from Elmar Bartel as the default. Many thanks! -The old bitmaps can be used by changing the "bitmaps" symbolic link before -compiling xboard, or by using the -bitmapDirectory option at runtime. - -* Loading a game that ends with the PGN unfinished symbol ("*") now always -leaves you in EditGame mode. - -* Added documentation of -icscomm to man page. Thanks to Maarten Remkes -for the linux script. - -* ^C now kills gnuchess as well as xboard. Thanks to Dima Dakhnovsky for -reminding me how to do this. - -* Bitmap icon color now indicates player to move. Stuart Cracraft -suggestion. - -* Changed piece bitmap flags to have just one flag, which points to a -directory full of bitmaps, instead of a flag for each bitmap. Also -changed bitmap naming convention. - -* "Connection closed by ICS" is no longer a FatalError popup. This was -too annoying in the normal case where the user typed "quit". - -* Changed default font to 14 pixels instead of 10 points. This seems to -make it close to the size I want it to be on more displays. - -* Major mode (GNU Chess, etc.) appears in title bar. Stuart Cracraft -request. - -* Bug fix: EditGameEvent, MachineBlackEvent, MachineWhiteEvent, and -TwoMachinesEvent were calling PauseEvent to get out of pause mode, which -now has undesired side effects, such as advancing the display to the -forwardMostMove. It works fine to just set pausing = FALSE instead. - -* IcsExamining mode now lets you access ICS edit position commands using -the same popup menus as xboard's EditPosition mode. Thanks to DAV on ICS -for inspiring the idea. - -* Corrected test for gcc on HP in Imakefile; thanks to Richard Lloyd. - -3.1, patchlevel 1 -- Wed Jun 1 16:25:11 PDT 1994 -- Tim Mann - -* Added parser.c.lex and parser.c.flex to the distribution. - -* Added HP gcc options to Imakefile, from Mats Nylen. - -* EndOfGame mode no longer highlights EditGame mode indicator, because the -modes really do differ. I would like to get rid of EndOfGame mode in the -future, at least as far as users can see. - -* Larger %a in parser.l, needed for RS/6000 users. - -* Minor improvements to Mail Move error messages. - -* When -debug flag is given to xboard, -v is passed to cmail. - -* Old Save Style uses "1. ..." instead of "1..." when black moves after a -comment; more like xboard 3.0's actual style. - -* New version of cmail from Evan Welsh. Looks for UCB Mail in a more -portable way and has some minor bug fixes. - -* Bug fix: Saving a FEN position while in EditPosition mode with black to -play was showing white to play in the saved position. - -3.1, patchlevel 0 -- Fri May 20 16:36:15 PDT 1994 -- Tim Mann - -* This is the first general release since 3.0, patchlevel 9. Releases -since then have been limited-distribution or beta releases. - -* Thanks to my version 3.1 beta testers: Dmitry Dakhnovsky, Ed Hanway, -Richard Lloyd, Mike McGann, Shelly Mistry, Josef Nelissen, Chris Petroff, -Jack Robertson, Michel van der List, Ky Macpherson, Derek Terveer, and -Evan Welsh. Sorry if I've forgotten anyone who gave me feedback. - -* Updated man page. - -* Minor cleanup on menu sensitivity code. - -* Integrated another even better version of cmail from Evan Welsh, -including some code he supplied in xboard itself. - -* A few more fixes to cmail support. - -* Automatically update clocks after an ICS "moretime" command. - -* Handle ICS automatic examine mode (set examine 1) after a game. - -3.0, patchlevel 14 -- Tue May 17 13:41:44 PDT 1994 -- Tim Mann - -* Beta test release only. - -* Don't suppress prompt on first board of game being examined; otherwise -it looks like nothing happened at all (i.e., like you're lagged). - -* Added StopExamining and StopObserving (Chris Petroff suggestion). - -* Made Reset do a refresh on ICS. John Chanak's original ICS code for -xboard tried to do this; I finally decided it was a good idea after all. - -* Fixed bugs in handling updates that come in while you are pausing in -examine mode. This is pretty tricky to do right. - -* Made un-Pausing immediately pop you to the current position. This is -always necessary in examine mode, since the game may have changed under -you; your remembered moves might no longer be right. So I made it do the -same in all modes. - -* Took Detach Examine mode back out...used Pause mode for this instead! - -* Put in a trap for the GNU Chess bug of printing an Illegal Move message -when its own hint move is illegal. - -* Attempted to fix a Zippy bug; bogus "exited unexpectedly" messages after -it checkmates its opponent. This involved adding an argument to GameEnds -to say who says it ended (ICS, GNU, etc.) and taking different actions in -different cases. Unfortunately, this just restored an older Zippy bug, where -Zippy restarts gnuchess when it gets the board with the final position, -because GameEnds still puts xboard in EndOfGame mode. Sigh. - -* We now capture elapsed time on last move when getting game history. -(Josef Nelissen bug report) - -* Rewrote code to redisplay last file title so it really works. - -* Fixed bug in oldSaveStyle. - -* Larger %a and %o were needed for lex. - -3.0, patchlevel 13 -- Mon May 16 16:26:22 PDT 1994 -- Tim Mann - -* Beta test release only. - -* FatalError popups stay on the screen now. If the error is really fatal, -all functions are disabled, and the program exits when you press OK. - -* Redisplay last file title when using Load (Next/Previous/Same) Game. - -* Zippy understands new match challenge message format on ICS. - -* Added Revert command. - -* When examining a game on ICS, < > buttons do ICS backward/forward -commands, unless you set the Detach Examine option. Thanks to Dima -Dakhnovsky for the idea. - -* Fixed various minor problems in cmail mode. - -* cmail generates the tags now. New version of cmail from Evan Welsh. - -* cmail mode won't let you do MailMove unless the currently displayed -position is exactly one move past the end of the game you loaded. - -* Fixed building of man pages in Imakefile - -* Updates to INSTALL file - -3.0, patchlevel 12 -- Sat May 7 21:10:03 PDT 1994 -- Tim Mann - -* Beta test release only. - -* Brought man page up to date. - -* Added Shift+R to resign from keyboard. - -* Some items on Action menu available in GNU Chess mode now. - -* Revamped Action menu. - -* Reordered functions in backend.c as a small step toward reorganizing -this whole mess. - -* Generate TimeControl PGN tag. - -* Get type of ICS game (e.g., rated blitz) and save in PGN tags. - -* Bug fix: Clocks were not redisplayed when entering EditGame mode. - -* Bug fix: Clocks were not being redisplayed after loading a game file -with -td 0, so they could show the wrong color active. - -* Bug fix: Chess programs would be killed and match mode would exit -prematurely when loading a PGN game fragment ending with "*". - -* ICS command "sposition" no longer confuses xboard. - -* Integrated new version of cmail (with support code in xboard) from Evan -Welsh. - -* Added TruncateGame, MoveNow, RetractMove, and QuietPlay. - -* Bug fix: switching between MachineWhite and MachineBlack was not calling -Attention(). Reported by Dino Dini. - -* More improvements to INSTALL and Imakefile. - -* Pack moves into 79 character lines in PGN output. We don't generate -check indications, and we always break the line before the result, -so this is not quite PGN export format. - -* Use FEN tag in PGN. - -* Improved finding and counting of game starts in save files. - -* Negative position or game numbers in -lpi/-lgi mean to seek to that byte -offset. Hook for possible future features, not in man page. - -* Detect and handle absence of either "time" or "otim" commands in -gnuchess. - -* Don't use "promote" command to ICS anymore. - -* Handle switching sides and taking back moves on FICS. - -* Handle flip state flag in style 12 board. - -* Handle examine mode on ICS. - -* Improved error popups for various kinds of illegal moves. - -* Suppress unasked-for hints from gnuchess (which it generates in post -mode). - -* Load/save position functions use FEN. Old style also supported. - -* Added detailed error messages if loading a bitmap file fails. - -* Small board has 2-pixel lines between squares instead of 3-pixel. - -* Added OldSaveStyle and AboutGame. - -* Renamed ForceMoves to EditGame. - -3.0, patchlevel 11 -- Tue Sep 21 15:25:36 PDT 1993 -- Tim Mann - -* The following changes were present in xboard 3.0, patchlevel 11, but the -first group did not make it into WinBoard 3.0 until later. xboard -3.0.pl11 was a limited-distribution release only, mostly to Zippy users. - -* Man page minor fixes. - -* Added a missing file close. - -* Removed automatic error popdown on Reset, which was destroying some -error messages before they could be read. - -* Fixed char vs. unsigned char warnings on bitmaps. - -* Use ICS board style 12. Some improvements to ICS parsing. - -* Comment window is now labelled with the move the comment is on, and -comments don't pop down when you step to the next move. - -* Save files now in PGN format. - -* Support for loading PGN files. PGN tags pop up when a PGN game file -is loaded. - -* More info in INSTALL and Imakefile about building for Suns (and -other systems). - -* WinBoard 3.0 patchlevel 11 split off from an early version of xboard -3.0 patchlevel 11, so it does not have all the features of that -patchlevel. The following changes made it into both xboard and -WinBoard: - -* Made Comment dialog non-modal in WinBoard. - -* EndOfGame mode is now more transparent. It looks like ForceMoves -mode except that there is no chess program running. - -* Small bug fixes in clock management. Most noticeably, pausing when -it is gnuchess's move now works as documented (again). - -* Add minimal support for -icscomm option. Not documented yet because -I haven't sorted out the issues with setting the tty modes on the comm -port device, or with locking it properly. But it's usable by wizards. - -* Don't restart the chess program upon Backward event from EndOfGame mode. - -* Suppress extra prompt after ICS sends us a board. - -3.0, patchlevel 10 -- Sat Sep 11 18:44:03 PDT 1993 -- Tim Mann - -* Beta test release only. - -* Zippy now plays chess. zippy.c and zippy.h are still not included -in the standard distribution, but are available on request. - -* Switched to using style 12 on ICS. - -* Updated man page, and documented use of XBoard*form.translations to -add more shortcut keys. - -* Added shortcut keys "d" to claim/offer/accept a draw, and "t" to -call flag. Suggested by venu on ICS. - -* More explicit instructions in INSTALL file. - -3.0, patchlevel 9 -- Tue Sep 7 14:02:00 PDT 1993 -- Tim Mann - -* General release, minor update to 3.0.pl8. - -* Loosened checking on whether it's okay to start a move, to satisfy -ICS ultra-blitz players. Now we don't check whether it's your turn -until you let go of the piece. - -* Parser now recognizes "+-+" as meaning the game ended in a draw. - -* Got rid of S_NONE symbol, which seems to conflict with some symbol -Sun defines. - -* Tweaked the man page. Clarified that there is currently no way for -two people running copies of xboard to play each other without going -through the Internet Chess Server. - -* Fixed a bug in color name conversion. Asking for two different -colors whose names were the same in the first four characters would -get you two copies of the first one. Thanks to Volker Zink for the -bug report. - -* Improved confusing Usage() message. - -* Added a bunch of Sun information to the Imakefile and INSTALL file. -Thanks to Ed Hanway, Arik Klingensmith, and others who responded. - -* Test for defined(WIN32) instead of !defined(unix). - -* Avoid using (void *) type with non-ANSI C compilers. Thanks to -James Altucher for the bug report. - -3.0, patchlevel 8 -- Thu Sep 2 12:23:01 PDT 1993 -- Tim Mann - -* Note: Patchlevel 8 was the first non-beta release of xboard 3.0 - -* Added cmail to distribution. Contributed (and still maintained) by -Evan Welsh. - -* Bug fix: -queen option wasn't initializing menu check. Reported by -Pat Surry. - -3.0, patchlevel 7 -- Thu Aug 26 13:23:24 PDT 1993 -- Tim Mann - -* Sent WinBoard 3.0.pl7 to Torre on ICS - -* Added parser.h to hold the interface to parser.l - -* Upgraded COPYING file and copyright notices to GNU GPL version 2. - -3.0, patchlevel 6 -- Tue Aug 24 15:16:13 PDT 1993 -- Tim Mann - -* We no longer display intermediate positions or intermediate comments -while loading a game file with -timeDelay 0 or loading an opening to -start up a -matchMode game. - -* Loading an empty game from an xboard save file now gives a status -message "No moves in game" instead of an error popup saying "Game not -found in file." - -* Added comment.awk to distribution. - -3.0, patchlevel 5 -- Tue Aug 17 16:45:54 PDT 1993 -- Tim Mann - -* Bug fix: xboard would crash if it couldn't get all its colors; now -it switches to monoMode instead. Also, xboard was trying to convert -color resources even when using a b/w display. Reported by Larry -Rogers. - -* Bug fix: Declared fields of TimeMark as signed so that we get signed -instead of unsigned arithmetic. SubtractTimeMarks was breaking on -Alpha AXP (which has 64-bit longs) with old declarations. Reported by -Michel van der List. - -* Bug fixes: Keyboard accelerators now work after EditComment window is -popped down. Iconize keyboard accelerator now works even if xboard -was started with -iconic flag and later deiconized. - -* Bug fix: The routine that tests whether a move is illegal because it -would leave you in check was not handling e.p. captures properly. -Reported by Patrick Surry. - -* Bug (?) fix: Was adding time to clocks at time control even when -loading a game file. Actually it's not entirely clear how time -controls should be dealt with when some moves are loaded from a file -or clicked in with ForceMoves. For now ForceMoves mode does add the -time (because it can be used to change moves during a live game), but -LoadGame mode does not. - -* Updated usage message. - -* Previous attempted fix to matchMode had broken TwoMachines mode and -generally needed more work. Also simplified command line interface to -matchMode. - -3.0, patchlevel 4 -- Thu Aug 5 14:17:18 PDT 1993 -- Tim Mann - -* Thanks again to the beta testers listed for 3.0 patchlevel 3, and also -Desnogues, Steve Cariglia, Niklas Engsner, Mark Silver, and Roger Rowe. - -* Reorganized man page, splitting OPTIONS into subsections. - -* matchMode was very broken; fixed. - -* Changed convention for turning off command line options from --opt -to -xopt, to be less inconsistent with GNU standards. Also changed -the long command line options to take True/False arguments like -resources; seems to make more sense this way. - -* Added AlwaysQueen option -- suppresses promotion dialog and always -promotes to a queen if you move a pawn to the last rank. Has no -effect on gnuchess (or your ICS opponents!) -- they can still -underpromote. - -* Subtracted an extra fudge term when determining how wide message and -title widgets should be. This fixes a problem some beta testers had. -Wish I knew why it's needed. - -* Bugfix in parser; symptom was that you couldn't do LoadGame after -observing a game on ICS. - -* Bugfix in Forward; didn't work after game ended while Pause was turned on. - -* Removed bogus execute bits on .h files. - -* Use REMOTE_SHELL and TELNET_PROGRAM definitions. - -* MachineWhite and MachineBlack now work from TwoMachines mode. - -* Popping down an error message with the [ok] button was not turning off -the errorUp flag, so the next move would cause xboard to try to pop it -down again, resulting in a wild memory reference and sometimes a crash. - -3.0, patchlevel 3 -- Tue Aug 3 17:40:27 1993 -- Tim Mann - -* Thanks to my beta testers: Patrick Surry, Takuya Kojima, Robert J. Luoma, -Chris L. Petroff, Richard K. Lloyd, Michel van der List, Craig Metz, -Antoon Frehe, Simon Clift, Shelly, Eric Peterson, Christopher Mitchell, -Martin Koch, Ed Hanway, Steve Booth, Udo, Ken Hobday, and Joseph Duhamel. - -* Improved error messages for trying to move the wrong color pieces or -to move when it's not your turn. - -* Special code for monoMode on 1-bit displays now understands displays -where 1=white and 0=black. - -* Declare getenv() if not included; avoids a compiler warning. - -* Documented borderXoffset and borderYoffset. - -* Added -titleInWindow option for use with X window managers that -don't let us set the title in the window banner. - -* Fixed error message printing in WinBoard; system error messages no -longer appear as numeric codes. - -* The error message popup is now non-modal; you don't have to press the -[ok] button before you can do something else. In addition, the popup is -positioned so that it doesn't cover up the board (too much), and making a -move or otherwise clicking on the board pops it down. (Not implemented in -WinBoard.) - -* You can now call your opponent's flag in ICS mode by clicking on his -clock. - -* Fixed minor bugs in -flipView option and documented exactly how xboard -decides which way to flip the view. - -3.0, patchlevel 2 -- Fri Jul 30 22:20:23 PDT 1993 -- Tim Mann - -* Added Autosave to Options menu. Would be better to have Save -Options dialog as in WinBoard, but this was quick to do and gives the -most-needed functionality. - -* Changed "Reload Game" on menu to "Reload Same Game". - -3.0, patchlevel 1 -- Thu Jul 8 21:22:59 PDT 1993 -- Tim Mann - -* Sent a copy of patchlevel 1 to Patrick Surry to beta-test. - -* Added -cmail option that sets appData.cmailMode. Currently a no-op. -In the future this may set special modes for use by the cmail script -for playing chess by email. - -* Added LoadNextGame, LoadPreviousGame, and ReloadGame to File menu. -ReloadGame suggested by Patrick Surry. - -* Added -flipView command-line option. Suggested by Patrick Surry. - -* Fixed bugs in parser.l: (1) Pattern for "# xboard game file ..." -needed to match to end of line. (2) Start of a new file was not matching -the ^ start-of-line character. The fix for this is a kludge. - -* Made game counting code in LoadGame more robust, and made LoadGame -able to detect the end of a saved partial game (by noticing the start -of the next game) in game files created by XBoard itself. We don't -try to find the start of the next game that way in other kinds of game -files, because the only way I can think of to do that is to look for -another move #1, and that technique gets too many false hits. - -* Fixed recently introduced bug in LoadGame when game starts with a -position diagram. - -3.0, patchlevel 0 -- Fri Jun 25 14:17:17 PDT 1993 -- Tim Mann - -* Changes in this patchlevel were too numerous to list. Larger ones are -listed below. - -* Added a popup dialog to enter and edit comments. Inspired by some -code from Patrick Surry. Changed the normal read-only comment popup -to the same style. - -* Added ICS init script feature from Karl Schwamb. - -* Added some ESIX fixes and OMIT_SOCKETS ifdef option, from Kayvan Sylvan. - -* Revamped code to allow use of flex instead of lex on parser.l. -Using flex requires adding -DFLEX to defines in Imakefile. - -* Source code is split into front end (xboard.c), which knows about X -and Unix, and back end (backend.c), which knows about chess, gnuchess, -and the ICS. There is also a front end for Windows NT. - -* Boolean command line options now use "-foo" to turn on and "--foo" -to turn off instead of "-foo true" and "-foo false". [Later -xfoo; -see above.] - -* Added menu commands to control autoflag, bell, and coords options. - -* User interface has a new look: (1) Menu bar instead of array of -buttons. A few very commonly used features have small buttons in -addition to being on the menus. (2) Large font for clock. (3) Pop-up -dialogs for errors. - -2.1, patchlevel 11 -- Sat Jun 5 00:01:01 PDT 1993 -- mann@src.dec.com - -* Added code to deal with "wild" games on ICS. This includes allowing -castling with the king on d1 or d8, which is allowed in wild(1) games -if the king started there. Notation is o-o to castle "short"---to -whichever side the king is closer to---and o-o-o to castle "long." -Right now wild castling is always allowed by xboard; we rely on ICS or -gnuchess to reject it when we aren't really in wild mode. - -* memcpy call had arguments in wrong order. - -* Removed April Fool code - -2.1, patchlevel 10 -- Mon Feb 15 10:19:31 PST 1993 -- mann@src.dec.com - -* Avoid trying to select on a pipe when using System V. Needed to -copy some code from InitChessProgram() up into establish(). - -* Bug fix in disambiguating pawn moves like "ed". - -* Fix to error handling in ReceiveFromProgram. - -* Bug fix: entering EditPosition mode with black to play highlighted -White's clock instead of Black's. - -* Added telnetProgram resource in case "telnet" is not the name of the -telnet program. - -2.1, patchlevel 9 -- Fri Jan 22 19:08:27 PST 1993 -- mann@src.dec.com - -* Entering Force Moves mode clears "flag has fallen" messages from display. - -* ICS host name can now be in numeric format; for example 128.2.232.4. - -* Bug fix: LegalityTest was failing to test whether a pawn move was -illegal because the move would discover a check. - -* Handle ICS message "mann asserts a win over manntest, who disconnected." - -* Bug fix: A recent change to PromotionCallBack had broken -underpromotion to a knight. - -* Bug fix: In EditPosition mode, dragging a piece onto a square border -would make it vanish. xboard wasn't distinguishing this case from -dragging the piece off the board. Thanks to Matthew Kidd. - -* Removed "static" declaration from yywrap for compatibility with IRIX -version of lex. Thanks to stiller@blaze.cs.jhu.edu. - -* Added substitutes for bzero, bcopy, and gethostname for Solaris -SVR4. Thanks to Michael Grant. - -* Bug fixes to queen move disambiguation. Bugs showed up only when -promotion resulted in more than one queen on the board. - -2.1, patchlevel 8 -- Fri Dec 11 17:54:18 PST 1992 -- mann@src.dec.com - -* parser bug fix: It now really works to leave off the piece a pawn is -promoting to and let it default to queen. - -* When starting to observe or play an ICS game, don't draw board in -initial position and then immediately redraw it in the current -position. - -* Handle ICS messages when an "abuser" forfeits a game by -disconnecting and when a game is aborted ("removed") by an -administrator. - -* Bug fix: A user move when in LoadGame+Pause mode was resuming the -game load instead of putting us in force mode. - -* It seems that crashes inside sscanf when xboard is compiled with gcc -(as on IBM PS/2 AIX, mentioned below, and also on VAX Ultrix 3.1) are -caused by an incompatibility between gcc and the sscanf implementation -on these platforms. A workaround is to specify -fwritable-strings to -gcc (see the gcc documentation). Added info on how to do this to the -Imakefile. Thanks to Tom McConnell for this information. - -* Clocks are allowed to go negative. This is mostly for ICS -compatibility, but it affects gnuchess mode too. Also, we give the -time bonus when a player hits the time control boundary even if his -flag is already down. This choice is a bit debatable, but it makes -things look better when you are in TwoMachines mode and gnuchess's -time management screws up causing it to exceed its time limit. - -* Implemented move legality checking code. Moves made with the mouse -or parsed from a file are checked for legality before being made. -This is mostly in preparation for future extensions, such as -human-human play. For now it makes -noChessProgram mode more useful. - -* If the user takes back moves, we restore the clocks to the earlier -settings. - -* We now handle the output of the ICS oldmoves command, including -parsing the game end condition. - -* Added autoCallFlag mode. - -* Fixed glitches in the medium size outline king and rook bitmaps, and -touched up the medium size solid king and outline queen. - -* bug fix: DisplayMove would not display backwardMostMove - 1. - -* Added CallFlag button and removed AcceptMatch. CallFlag is more -important with new ICS, and accepting the current match offer is easy -with the new ICS command "accept" (can be abbreviated "ac"). - -* LoadGame and LoadPosition display tail of file name (plus index -number, if any) as title. - -* MachineWhite, MachineBlack, and TwoMachines now work properly from -LoadGame and LoadGame+Pause mode. - -* Use o-o and o-o-o to castle on ICS, not 00 and 000. - -* Stripped out code for old ICS messages; new ICS is now installed. - -* Bug fix: don't offer autosave when paused during LoadGame. - -2.1, patchlevel 7 - Fri Dec 11 17:40:56 PST 1992 - mann@src.dec.com - -* Track change to "Illegal move" message in new ICS. - -2.1, patchlevel 6 -- Tue Dec 8 10:48:44 PST 1992 -- mann@src.dec.com - -* Kludged around bug in keeping comment popup where you put it by -adding borderXoffset and borderYoffset resources that give the width -of the borders added by the window manager. Yucch. - -* Changed searchDepth kludge back to using "help" instead of "bd"; the -latter didn't work because the output contains a line starting with -"White", so we think gnuchess is telling us that White won. Oops. - -* Removed some code that uses an X11R5 feature, XrmGetDatabase. -Without this, the auto font sizing code is harder to make work, so to -keep my sanity I had to change it to affect only the fonts that appear -in the main window and the comment popup, not the other popups. Maybe -this is better anyway. - -* AcceptMatch button now works after a counterchallenge, too. - -* Added code for more variants of messages about games being adjourned -or aborted. These messages need to be unified in new version of ICS. - -* Added workaround for minor bug in ICS; game number on first board -can be wrong. - -* Removed code to say "refresh n" instead of "refresh"; was broken and -wasn't needed anyway. - -* Added missing casts for compilers that distinguish enums from ints -and missing cast in connect call. - -* Added code to recognize "both sides are out of time" draw message -proposed for next version of ICS. - -* Thanks to Danny Sleator and Joe Peterson for bug reports. - -2.1, patchlevel 5 -- Sun Dec 6 19:52:40 PST 1992 -- mann@src.dec.com - -* Removed gcc and CDEBUGFLAGS from Imakefile. - -* Corrected setting of mode to ForceMoves when game file ends or -contains an AmbiguousMove or BadMove. Previous bug was harmless. - -* Added AcceptMatch button and mention of 50-move rule for Draw button -to man page. - -2.1, patchlevel 4 -- Sun Dec 6 02:55:42 PST 1992 -- mann@src.dec.com - -* Now handles revised messages from new version of ICS. New ICS is -not released yet, so this code might change further. Next patchlevel -will remove support for old ICS; both are there now. - -* Initial processing for a new game being watched or played now -happens when we see the first board image. Removes the need to parse -some messages and unifies some code. - -2.1, patchlevel 3 -- Tue Dec 1 19:40:40 PST 1992 -- mann@src.dec.com - -* Handles ICS messages "Draw : neither player has mating -material" and "Draw : White has no material, Black has no time." - -* Added AcceptMatch button for ICS mode. - -* Fixed bug in previous fix to yylexstr(). - -* Fixed bugs in code for loading old position files that don't start -with "#" and for handling case where user asked for nth position in -file but there aren't that many. - -* Handles ICS message "* has restored your old game" - -* ResetProc always clears title line now. - -* Don't issue just "refresh" when watching a game; use game number. -Upcoming new version of ICS may need this. - -* Added code to try to prevent user from watching and/or playing more -than one game at a time. There is a race condition inherent here; if -we get more than one board from the game before our command to stop -watching it takes effect, we'll think the user started it again. Not -clear how to fix this. - -* Redid ParseBoard8 to use sscanf. Code is a good deal cleaner now. -Also, we now parse out the game number too, though we don't make much -use of it yet. - -* (Tried to put in a feature that recognizes the current game in a -game file must have ended when we see the start of a new one, but had -to disable it because we have too many false hits with the current -parser, especially in gnuchess listing files.) - -* Moves read from game files or received from ICS are now translated -into canonical algebraic form just like all other moves. Minor nit: -If you use Reset while playing or observing a game in ICS mode, the -game history (including the current board position) is lost, so the -next move of the current game can't be translated. - -* Default fonts now vary with board size, and are chosen by pixel size -instead of point size (since piece bitmaps have a fixed pixel size). - -* Bug fix: An extra Forward was required to skip over time indications -in game files. - -2.1 patchlevel 2 -- Fri Nov 27 23:30:00 PST 1992 -- mann@src.dec.com - -* If you move the comment popup, the next time it pops up it will come -back where you put it. - -* Fixed yylexstr() so calls to it can be interspersed with calls to -yylex(). - -* Fixed bugs in Forward/Backward while in LoadGame mode. - -* Changed Save{Game,Position} functions to append instead of -overwriting if file exists. Changed Load{Game,Position} functions to -deal with multiple games/positions per file. - -* Changed load{Game,Position}File resources to trigger automatic load -on program startup. Changed save{Game,Position}File resources to -trigger automatic save after every completed game and on program exit. - -* Added autoSaveGames mode. - -* Fixed bug with PromoPiece in call to MakeAlg from MakeMove. - -* Many changes to get rid of picky compiler warnings and generally -clean up the code. - -2.1 patchlevel 1 -- Fri Nov 27 02:45:00 PST 1992 -- mann@src.dec.com - -* A last minute change before patchlevel 0 went out broke -ParseGameHistory(). Immediately fixed in patchlevel 1. - -Version 2.1, patchlevel 0 -- Fri Nov 27 02:00:00 PST 1992 -- mann@src.dec.com - -* Uses "time" command of gnuchess 4.0 and following to keep clocks in -sync. Still works with older versions without this command; we test -whether the command is present the first time each chess program is -started. - -* File name dialog pops up under the mouse cursor, so that it's got the -keyboard focus if the window manager is using pointer focus. - -* Attempts to move the wrong color piece or an empty square are filtered -out in xboard instead of being passed on to GNU Chess or the ICS. - -* The reason a game ended is now remembered even if you move backward -and forward after it ends. It is forgotten only if you make a move -(which is as it should be---this is now a different game, which hasn't -ended yet). The message saying why the game ended no longer wipes out -the last move. - -* Pause, Backward, Forward, ForceMoves, and EditPosition now work from -TwoMachines mode. - -* Forward and Backward now change only the board display unless you -are in ForceMoves mode. Pause mode keeps new moves that are received -from being displayed on your screen until you unpause (or use -Forward). - -* Added option to ring the bell after opponents' moves. - -* Saved games that start from other than the standard initial position -now begin with a postion diagram as in saved position files. The -loader is modified to understand such save files. - -* Improved error checking when trying to read from gnuchess. - -* Parser understands things that look like time indications, e.g., (0:12), -instead of popping them up as comments. - -* Send "quit" to gnuchess before trying to kill it. I needed this -locally because sending a SIGTERM to rsh was not killing the remote -program on some internal field test systems we have. - -* Merged in code from John Chanak to make xboard a front end to the -Internet Chess Server, and added several improvements of my own. -(These include parsing end of game messages, loading the current state -and previous history of a game that's joined in progress via "watch" -or "load", automatic switch from board style 1 to 8 when needed, -removing irrelevant buttons and adding some new ones, adding the -useTelnet and gateway resources, and miscellaneous code cleanup, bug -fixes, and documentation.) Many thanks to John for writing and -contributing the initial version of this code. - -Fri Oct 30 20:16:40 PST 1992 (patchlevel 25) mann@src.dec.com - -* gnuchess now castles by sending us "o-o" or "o-o-o" (starting with a -preliminary version of 4.0.pl60 that I have). Added code to handle -this. The old format ("e1g1", etc.) still works too. - -* Added code to format moves in normal abbreviated algebraic notation -(for example, e4, exd4, f8Q, Nf6, 0-0) instead of coordinate algebraic -(for example, e2e4, e3d4, f7f8q, g1f6, e1g1). Moves entered with the -mouse or received from gnuchess are translated into this canonical -format for display on the message line or in saved game files. Moves -read from game files are not translated, however; they are shown and -saved just as they appear in the file. - -Mon Sep 14 13:19:01 PDT 1992 (patchlevel 24) mann@src.dec.com - -* It's not really correct to write an ep capture of a pawn on e5 as -fxe5; this should be written as fxe6 because e6 is where the capturing -pawn ends up. Nevertheless, the parser now interprets fxe5 as the ep -capture f5xe6 unless there is a pawn on f4, in which case it -interprets fxe5 as f4xe5. By design, the parser does not flag fxe5 as -ambiguous if there are pawns on both f4 and f5; instead it prefers the -more legitimate f4xe5 interpretation. - -* A move like fxe6 or fe6 is now interpreted as an e.p. capture of the -pawn on e5 if there is one there and e6 is empty. - -* A move like fxe5 can no longer be interpreted as an e.p. capture if -there isn't a pawn on e5 to be captured. Previously this could happen -erroneously if there were pawns on both f4 and f5, and the f4 pawn was -capturing a piece on e5. - -* The parser no longer munges the move it is parsing; in the past, for -instance, it would remove the "x" from a move like dxc5 before echoing -it to the screen. - -* The parser now detects when a move is ambiguous and returns an -error, instead of arbitrarily choosing one possibility as it used to. - -Mon Aug 10 18:40:47 PDT 1992 (patchlevel 23) mann@src.dec.com - -* Added code so parser can handle fully qualified algebraic, e.g., -Ng1-f3, N/g1-f3, Ng1f3, or even Pe2-e4. The "P" and "/" work only for -fully qualified moves, not generally. - -* Fixed parser bugs in handling moves with rank or file disambiguator, -e.g. N1f3 or Ngf3. - -Mon Jul 6 17:55:32 PDT 1992 (patchlevel 22) mann@src.dec.com - -* AIXV3 patch from Tom McConnell; thanks! - -* After hitting the Backward button we see the last move made instead of -the word "Pausing" displayed. - -* Fixed a couple of problems compiling on IRIX; thanks to Michel Arsenault -and Alan Walsh for bug reports and help with fixes. - -* Added optional display of algebraic notation coordinates along left and -bottom edges of board. This was inspired by some code from Jean-Christophe -Engel; thanks! - -* Swapped EditPosition and Pause buttons to reduce danger of losing the -game in progress by hitting EditPosition when you wanted Backward. Thanks -to Ove Lundberg for complaining (though it bugged me too). - -* Despite one complaint, I kept the feature of changing both clocks when black -makes time control, rather than changing each individually when the player -involved makes it. This is to avoid having it look like White is way ahead on -time while Black is thinking about the last move of the time control period -(i.e., when White has made time control but Black hasn't yet). - -* Corrected clocks to work as in real tournaments. Time is *added* when you -reach time control; previously the clocks were simply set to the length of the -new time period. Also, when a player's flag falls, he still does not receive a -new time allotment at the next time control, but his opponent does still -receive more time if *his* flag has not fallen; previously, time controls were -ignored for both players if either flag fell. I forget who reported this bug. - -* Added a small ESIX patch from Kayvan Sylvan. - -Mon Jun 22 13:24:38 PDT 1992 (patchlevel 21) - -* Added some SVR4 support code from Ronald Cole. It's Greek to me. - -* Note: Stephen Meatheringham reports a bug causing xboard to crash with an -error from the X server when run on a Sun Sparcstation IPX with Solaris 1.0.1 -and OpenWindows 3.0. This bug has not been tracked down yet. - -* Fixed a problem with ATTENTION code. On some operating systems, you have to -be even more cautious about when you send a SIGINT to gnuchess, because the -signal handler gets deinstalled each time it is used, and gnuchess does not -reinstall it immediately. In particular, if you send a SIGINT and make an -illegal move or ask for a hint, gnuchess does not reinstall the handler until -*after* you make your next move, so you had better not send a SIGINT before -it. I put a workaround for this case into xboard; I hope there are no more. - -* The ATTENTION code is needed when compiling for the ESIX operating system, -because ESIX has a bug in the FIONREAD ioctl, so the code in gnuchess that -lets you interrupt its thinking on your time just by typing in your move does -not work. Perhaps gnuchess will have a workaround for this eventually. - -* Fixed yet another bug in using XtGetValues; code to inhibit shell resizing -was leaving a null pointer as the place to store the current sizes. - -* Man page fixes: corrected -sl to -sd, updated LIMITATIONS. - -* Added include of conditional on HAS_GETTIMEOFDAY. I hope this -works for all systems; on mine, and are the same file, -but with an #ifndef that makes it harmless to include both. - -* Thanks for reports from Mike Pearlman, Stephen Meatheringham, Kayvan Sylvan, -d87-mal@nada.kth.se, Urban Koistinen, and Ronald Cole. - -Mon Jun 8 11:39:18 PDT 1992 (patchlevel 20) - -* Documented default value of initString and explained what it means. This -paragraph also serves to inform the user that xboard by default will tell -gnuchess to think on his time, something one user apparently didn't understand. - -* Redid -searchDepth (formerly -searchLevel) and -searchTime code. They both -work correctly with gnuchess 3.1 now. The -searchDepth option also works -correctly with gnuchess 4.0. The -searchTime option does not work with -gnuchess 4.0.pl50 or earlier because those gnuchess versions do not have a -working searchTime feature. Instead of having xboard do a half-baked emulation -of this feature by using a 1-move time control, I will be submitting a patch to -the gnuchess folks to restore the feature as in 3.1. - -* Improved clock code. It now keeps accurate track of fractional seconds of -clock running time, if your system has gettimeofday(); if not, it is generous -about them---if a clock has been going for n.m seconds when it is stopped, only -n seconds are charged. Previously, xboard would charge one second immediately -when a clock was started, so if n.m had elapsed when it was stopped, n+1 would -be charged. This should stop xboard from thinking gnuchess has let its flag -fall on the last move of a time control, as it often did before. I also -improved the comments and condensed the code a little. I hope there are no -systems that have X11 and don't have gettimeofday(), but if there are, I'd like -to know what to replace it with. - -* "Flag dropped" messages now show up on the top line, beside the clocks, so -that they don't obscure more interesting messages on the second line. - -* Fixed confusion of NULL and '\000'. - -* Include time.h to get ctime() declaration. - -* Fix to "parser bug" messages in parser.l. - -* Changed code to work with old-fashioned tolower() macro that requires its -argument to be an uppercase letter. - -* Minor fix to some usage error messages; was reversing program name and -erroneous argument value. - -* Thanks to Mitch Wright, Ranier Orth, and Henrik Schmiediche for bug reports. - -Fri Jun 5 13:06:08 PDT 1992 (patchlevel 19) - -* Note: xboard does not seem to work when compiled with gcc 1.40 on a -PS/2 running AIX. It crashes at the sscanf in line 768 of xboard.c. -You can work around the problem by specifying the -timeControl option -on the command line instead of defaulting it. This does not seem to -be a bug in xboard itself; it runs okay on PS/2 AIX when compiled with -MetaWare High C. [But see 2.1.pl8 above.] - -* Removed bogus files from distribution. - -* Changed variable name that conflicted with SVR4 ttyname function. - -* Thanks to Christoph Strozyk for another bug report, and to several -of the folks mentioned under patchlevel 18 for testing it. - -Wed Jun 3 17:50:37 PDT 1992 (patchlevel 18) mann@src.dec.com - -* Added an include of sys/fcntl.h to pick up the definition of O_RDWR for -System V users. - -* Fixed a bug in CatchPipeSignal; was testing the wrong variable to determine -which chess program got the signal. - -* Removed the declaration of strrchr, which was causing problems for some -people, and added an include of or instead. - -* Fixed a bunch of type errors uncovered by compilers that check more carefully -than the one I was using. I just patched many of them with casts---typically -cases where a function didn't take the same number and type of arguments as the -X header file prototype said it should---because I didn't see any other way to -fix them. The versions of the X header files that I have don't actually have -full prototypes for these function types; they declare only the return type and -just give the argument types as comments. - -* InitChessProgram returns immediately if chess program died while we were -waiting for it to say "Chess". I think this fixes a bug that could make xboard -crash or go into an infinite loop printing "Warning: Select failed; error code -9" if gnuchess crashed there. - -* Removed code that tries to put the file descriptor used to read messages from -gnuchess into nonblocking mode. I don't see how this kludge could ever have -fixed the problem it was intended to (see below), and it seemed to be causing -a race condition when we were waiting for the initial message from gnuchess -after it started up. - -* Thanks to Richard K. Lloyd, Konstantinos Konstantinides, Mark -Seiden, Erik Schoenfelder, Andreas Stolcke, Rainer Orth, Henry Thomas, -and Kris Van Hees for bug reports and help with fixes. - -Sun May 31 08:00:00 PDT 1992 (patchlevel 17) Bart Massey bart@cs.uoregon.edu - -* 'xboard' suffered from a couple of serious bugs. An initial - size needed to be given to the message label to avoid a race - condition (!) so I gave it some text (otherwise occasionally - xboard would fail because the message widget was 0 width under - MIT X11R4). The sizes needed to be Dimension, not int, because - they were written in by Xt -- on my big-endian box Dimension - is short, causing chaos. Also, I hacked a declaration in for - strrchr() to shut the compiler up -- this is arguably a kludge, - but I couldn't think of anything better; maybe you can. - -Fri May 22 13:40:50 PDT 1992 (patchlevel 16) - -* First real (non-beta) release of version 2.0. - -* Added GNU copyleft notices covering version 2.0 enhancements. - -Thu May 21 12:30:09 PDT 1992 (patchlevel 15) - -* Removed -g from Imakefile. - -* Added casts in parser.l to prevent warning messages from some C compilers. - -* Bugfix: code to exit if chess program couldn't be started had bug in error -message printing. - -Tue May 19 11:58:06 PDT 1992 (patchlevel 14) - -* Fixes one small bug: If LoadGame does not find a game in the file, it resets -xboard to BeginningOfGame mode (as if the Reset button was pressed), instead of -leaving it in LoadGame mode. - -Mon Apr 13 18:32:27 PDT 1992 (patchlevel 13) - -* Improved error handling when gnuchessx crashes. Now displays a message and -enters EndOfGame state without exiting. This should help with diagnosing -gnuchessx problems, since the position and move history are not lost. - -* Debugged man page. - -Version 2.0 -- Thu Apr 2 16:04:54 PST 1992 (patchlevel 12) - -* Added small 40x40 pixel pieces; board size now specified as small, medium, or -large. - -* Improved man page. - -* Saved position files now say "white to play" if it's white's move. - -* SavePosition while in EditPosition mode now gets side to play right. - -* Made "Pawn" the default on edit position menus. - -* Removed "To play" from edit position menus, since it's redundant. Left -support code in so it can be restored if someone wants it. - -* Tightened parser's definition of a move number to help further with skipping -over stuff before the first move. - -* Put back feature of skipping over stuff in game files before a start of game -marker. This helps when loading electronic mail messages that have things -like "00" in the header (looks like castling), or that talk about moves in -running text before the actual game score. Tradeoff is that we can't load -games that don't either have move numbers or say "gnuchess game" just before -the moves. - -* Changed version number to 2.0 because others have used "1.3" for patched -versions of 1.2. Display version number and patchlevel at startup. - -Thu Apr 2 15:30:22 PST 1992 (patchlevel 11) - -* Bugfix: Match started with TwoMachines button now handles the case where -user loaded/edited a position *and* forced some moves. - -* added error message feedback to many cases where the user's button press is -rejected because it isn't allowed in the current mode. - -* added -noChessProgram option to allow use as a passive chessboard without -gnuchess, replacing old buggy scheme that tried to do this automatically when -gnuchess was not found on the search path. - -* parser accepts "=" in front of promotion piece - -* parser accepts ":" notation for captures - -* Removed SwitchSides button to make room for EditPosition. Left code in -place, ifdef'ed out. - -* Added EditPosition mode. - -* Reformatted xboard.c to eliminate long lines. - -* Promotion popup now appears near rank to which pawn is moving. - -* UI improvement: Button representing current program mode is kept highlighted. - -* Bug fix: Hint button is now disabled when machine is on move. - -Sat Mar 21 14:57:37 PST 1992 (patchlevel 10) - -* TwoMachines now works from MachineWhite or MachineBlack mode. - -* ForceMoves and Backward/Forward now work at the end of a game started by -the TwoMachines button. - -* Sends o-o or o-o-o to gnuchess instead of O-O or O-O-O. - -* Bug fix: SwitchSides button is now disabled when machine is on move. - -* Added -searchLevel option and corrected handling of -searchTime to reflect -the way gnuchess really handles command line options instead of what the -documentation used to say. Allowed optional ":seconds" on times. - -Tue Mar 17 21:00:35 PST 1992 (patchlevel 9) - -* Removed non-working code that tried to recover when a remote chess program -could not be started; now exits with a message instead. - -* Now waits for chess program to print its first message (normally "Chess") -before sending it any commands. - -* Matches between two machines can now start from a black-to-play position or -black-to-play opening. - -* Bug fix: The program would sometimes lose track of the board position after -the end of the game, drawing a board full of white pawns next time it got an X -redraw request. Now fixed. - -* Cleaned up handling of illegal moves in game files. Now we just stop reading -and go into ForceMoves mode. - -* Saved games against gnuchess indicate who won (restored and debugged 1.2 -feature). - -* Setting -searchTime turns off -clockMode. - -* My trick for setting up a black-to-play position broke in the transition from -gnuchess 3.1+ to 4.0. Installed a different trick that works with both. - -* Bug fix: Was clobbering memory by mallocing one byte too few for the file -name in SetupPositionFromFileProc. This usually resulted in a crash on the -second attempt to load a position from a file. - -Mon Mar 16 16:49:00 PST 1992 (patchlevel 8) - -* Game and position files are saved in CHESSDIR as well as loaded from there. -We actually chdir there, so gnuchess listing files also wind up there. - -* Underpromotion moves from gnuchess really work now. - -Sat Mar 14 14:55:24 PST 1992 (patchlevel 7) - -* Cleaned up lots of bugs and kruft in parser.l. It's a wonder the old version -worked at all. Improved rejection of random text interspersed with the moves. - -* Relabeled buttons to reduce confusion (Play From File --> Load Game; -Setup From File --> Load Position). - -* Bug fix: Doesn't exit at the end of a game that was started by pressing -the Two Machines button. - -* Bug fix: Doesn't get confused if you hit Machine Black (White) while -the machine is already playing black (white) and is on move. - -* Prints "White to play" or "Black to play" after loading a position file. - -* Bug fix: No longer hangs if no start-of-game is found in a game file. - -* More permissive about game file format. The first line is not assumed -to be a header comment unless it starts with "#". We don't insist on -seeing a "1." before the first move. - -* Added pop-up dialog to allow underpromotion. Moving a pawn to the last rank -pops up a dialog to let you select what piece to promote to. Also added code -to handle underpromotion moves from gnuchess or from a game file correctly. - -* Added code to send SIGINT to gnuchess before trying to move, if gnuchess -might be busy thinking on our time. The code is ifdef'ed out because it's -not necessary; only beta-test versions of gnuchess 4.0 at patchlevel 19 or -below require it. - -Mon Feb 24 20:10:22 PST 1992 - -* Merged fixes received from Stuart Cracraft and Mike McGann, to iconic mode -and to ShutdownChessPrograms. (They both sent the same fixes.) I did not -install the change that removed "easy" from the initialization string, so -xboard will still try to run gnuchessx in "hard" mode (thinking on opponent's -time) by sending this command. - -Version 1.3 -- Thu Dec 19 18:19:00 PST 1991 mann@src.dec.com (Tim Mann) - -* I've fixed a slew of bugs in this version of xboard: - -* You can now back up from the end of a game, even if gnuchess was playing -against you. Since gnuchess exits upon mate or draw (when it's not in force -mode), this feature works by starting up a new copy of gnuchess and feeding it -the saved starting position and moves. Drawback: the new gnuchess starts with -clocks at the beginning of a fresh time control. - -* Note: the "force" command to gnuchess is a toggle. I fixed a couple of -places in xboard where "force" was being issued when gnuchess was already in -force mode, which resulted in chaos. I don't know if they were in 1.2 or if I -added them myself in the course of putting in new features. - -* ForceMoves button is now legal in PlayFromFile mode. It closes the game file -and lets you force moves (or go Backward) from whatever position you've -reached. - -* The parser now recognizes "white resigns" and "black resigns" (in any -combination of upper and lower case, with or without the closing "s"). These -used to be misinterpreted as meaning "white wins" or "black wins" respectively! -Added "1 - 0" and "0 - 1" as equivalents for "1-0" and "0-1". - -* I removed the parser feature of considering "!" as a comment delimiter. -"!" is so common as an annotation in game scores that this feature seems like a -very bad idea. - -* Added a wait() after each successful call to kill() to avoid leaving zombie -processes around. - -* Removed the feature of putting an indication of how the game ended into the -internal move list when playing from a file. The only benefit of this was that -it would get written back out if you saved the game at that point. This -feature doesn't seem too useful, since you are unlikely to save a game you've -read in without making any changes, and it caused a lot of problems in the code -and user interface. The end condition is still displayed as a message when -it's first read in from the file. End conditions when playing against gnuchess -are still saved, too. - -* programName is now the last file name component of argv[0], not all of it. - -* xboard.c got three compiler warnings due to arguments that didn't match the -prototypes on X toolkit functions. I got rid of them by adding some casts, and -adding extra unused arguments to the ReceiveFromProgram function. - -* As I received it, the distribution had an extra period glued on the front -of every line that started with a period. This broke the manpage in an -obvious way. It also broke parser.l in a nonobvious way that stopped -PlayFromFile from working. - -* Fixed one or two bugs where the clock was started when it shouldn't have -been. I think one example was if you tried an illegal move in ForceMoves mode. - -* Now starts the machine's clock if you hit MachineWhite when white is on move -or MachineBlack when black is on move. - -* Now updates the to-move indicator (highlight on clock display) when you use -Forward/Backward or ForceMoves. - -* gnuchess 3.1+ has a bug that makes it try to think on its opponent's time -even when in force mode; this causes problems with xboard's SetupFromFile -command because gnuchess's saved hint move is garbage after the new position is -loaded, so gnuchess prints out an error message when it tries to think about -what it would do if the user made this move. Here is a patch for gnuchess -3.1+: - -*** nondsp.c~ Mon Dec 2 12:37:18 1991 -*-- nondsp.c Thu Dec 19 15:36:06 1991 -*************** -*** 1223,1229 **** - ok = flag.quit = false; - player = opponent; - ft = 0; -! if (hint > 0 && !flag.easy && Book == NULL) - { - fflush (stdout); - time0 = time ((long *) 0); -*-- 1223,1229 ---- - ok = flag.quit = false; - player = opponent; - ft = 0; -! if (hint > 0 && !flag.easy && Book == NULL && !flag.force) - { - fflush (stdout); - time0 = time ((long *) 0); - -* SavePosition/SetupFromFile now handle black-to-play positions. If it's -black's move in a saved position, the line "black to play" is printed -immediately after the board display. Upon loading a position, xboard -looks for "black" at the beginning of this line to determine whether it's -black's move. - -* SetupFromFile now leaves you (effectively) in ForceMoves mode. This -eliminates some cases where the program would get into an inconsistent state, -and hopefully is more intuitive for the user, too. - -* PlayFromFile now leaves xboard in ForceMoves mode after playing through all -the moves in the file. You can use Backward/Forward, make moves, get gnuchess -to join the game with MachineWhite or MachineBlack, etc. The game file can end -with either white or black to play. - -* Backward/Forward now seem to work in all cases. Previously using these -buttons during a game against the machine would get xboard out of sync with -gnuchess's idea of what was going on, resulting in chaos. Now using these -buttons puts xboard in ForceMoves mode; you can bring gnuchess back into the -game using the MachineWhite or MachineBlack buttons. - -Thu Jun 27 15:06:25 PDT 1991 - - * Remove comment popups during a reset. - - * Bug in my forward move fix. Didn't work for playgamefile mode. - -Thu Jun 20 15:04:06 PDT 1991 - - * Can't do a backward move when it isn't your turn because gnuchess - gets confused. Similar bug for forward move. Do a bunch of moves, - back up move and go forward. These get filtered out now. - - * Put easy back into the initString. This DISABLES easy mode which by - default is ON. - - * New-line wasn't always being added to forward move strings sent to gnuchess. - - * Parsed comments as [ ..............text follows ] into d7d5 - - * Long game file comments cause core dumps on HP systems. - - * Multiple uses of the get positition file button got confused - on the second click. - - Minor fixes to the 1.2 release - -Version 1.2 -- Tue Jun 11 17:14:12 PDT 1991 - - * For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D., - Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found - a lot of bugs that we put into xboard just to see if they were paying - attention. They were. - - * Changed the protocol that xboard uses to work with the new version of - gnuchessr. - - * There was an off by one error with the clock resetting code. Also, - the clock display highliting was wrong. Thanks to Bill Shauck for - pointing these out. - - * enumerations are not really integers on some C compilers. I added casting. - The new version of gnuchess expects the "go" command for two machine - and machine plays white cases. The whiteString resource is for - compatibility with previous gnuchess versions which get confused by go. - Thanks to Martin D. for catching these. - - * Fixed a bug where the checkmate message wasn't being parsed and xboard - kept playing. Also, the message was added to game file if saved. - Thanks to Scott Hemhill for pointing this out. - - * Fixed a bug where saving a long game, resetting and saving a short game - resulted in appending the end of the long game to the short one. - If a game is just being played out and there is no reason for gnuchessr - to be used, ignore pipe signals. This allows people to use xboard - as a chess board without need for gnuchess. Also, trivially bad moves - such as e2e2 are not passed on to gnuchessr but instead ignored out of - hand. This allows people using xboard as a chessboard with gnuchessr - to pick a piece up, think and put it back down without making a move. - Thanks to Jeff Kenton for pointing these out. - - * Added the CHESSDIR environment variable. Game and position files are - found in this directory. If this variable is not declared, then the - current directory is used. File names starting with / are treated - specially. - - * The bitmap file names were changed so that none exceeded 14 characters. - This is necessary for R5. - - fcntl(from_prog[0], F_SETFL, O_NDELAY); - - The xboard fix was to set non-blocking i/o on the read pipe for gnuchessr - - printz ("Illegal move (no matching move generated)"); - - * fixed a problem with the new version of gnuchessr where xboard wasn't - getting gnuchessr error messages for illegal moves. The problem seems - to be fixed *without* any gnuchess changes but this is likely to be - highly system dependant. There should be a new line on line 246 of nondsp.c - - * -iconic doesn't work at all now. The Iconify() does work. This was - a tradeoff and it is really an Xt bug. - - * Fixed a compiler warning for gcc and an error for the IBM RT compilers. - This is the VOID_PROC macro in xboard.h. Thanks to David Jensen for this. - - * If the DisplayWidth or DisplayHeight is less than 800, use small size mode. - Also the size of the name widget was reduced from 500 pixels to 400 pixels - because in small size mode there was a gap on the right. - Changed the default font from fixed to helvetica_oblique14 to: - **-helvetica-bold-r-normal--14-*-*-*-*-*-*-* - helvetica_oblique14 is a font alias not on all R4 systems. - Curiously enough, the 17 point is not available on 75dpi systems - and the 18 point font is not available on 100dpi systems. - Thanks to Richard K. Lloyd for pointing these out. - - * Minor hacks to work with R5 alpha. Had to add an event handler to the - boardWidget to get translations to work. This may go away with the real R5. - Added WM_PROTOCOLS: QuitProc() for R5 ICCCM compatibility. - - * If the first character of the file is not `1' then the first line - of a game or position file is displayed as the name in a label widget. - - * Added a PopUp dialog for getting file names. - - * Modified the code to use the R4 routines rather than R3 compatibility. - - * Changed the forwards/backwards/readgamefile code to allow a play to step - back and forth in a game. If he steps all the way to the beginning - he has to restart the game. If he gets into a mated position, same problem. - - * Moved the man page from xboard.1 to xboard.man. This makes imake man page - installs work correctly. Thanks to Richard K. Lloyd for pointing this out. - - * Corrected the queening code. XBoard was sending the wrong syntax. - It was sending for example h8(Q) when it should have been sending h8q. - Thanks to Paul Vaughan and Mike McGann for pointing this out. - - * Added a lex parser for algebraic games. It should be easy to use the parser - for other interfaces such as the Microsoft Windows version. - It parses comments of the form [anything] and ! to the end of a line. - -Version 1.1 -- Mon Jan 7 14:46:03 PST 1991 - - * Roger Dubar, Konstantinos Konstantinides, Wolfgang S. Rupprecht, - Paul Scowen, Mvh Smidt and Kayvan Sylvan all helped immensely during - beta-testing. - - * older non-ANSI versions of Sun compilers complain vociferously. - - * the remoteShell resource was added for HP-UX systems - and other systems where the remoteShell isn't rsh. - - * -iconic doesn't work properly. If XBoard is opened iconic then - iconifying it later with a keystroke doesn't work. I think - this is an Xt bug. - - * For systems with smaller screens, XBoard can use smaller pieces, - and a smaller board. -bigSizeMode False uses a smaller set of pieces. - These are scaled versions of the large pieces. They look ok but could - be improved. - - * getlogin() does not work in all cases. - It was replaced by getpwuid(getuid())->pw_name). - - * Warning messages get displayed in the message box. - - * Any button restarts a paused game. - - * Kayvan Sylvan contributed a patch for ESIX. - It seems that select() on pipes is broken on his system. We declined - to incorporate his patch though, because it was a work-around for - something that was broken on one system, and selfishly, that system - was not my own. Nevertheless, it is likely that other System V users - on PC's may need to use this patch and it is is included as the file - ESIX.patch. To use it, type - - patch xboard.c ESIX.patch - - * Fixed a bug where hint didn't work. The local version of gnuchessr - had been hacked. The fix was to clone stderr and stdout for gnuchessr. - - * Fixed a bug where a player could play after a game had been finished. - - * The bitmaps have been pushed into the bitmaps directory. - - * Substantially rewrote and simplified the Two Machine code. - - * Added StrStr() because many systems don't have this ANSI function. - - * Added keyboard equivalents. Added an iconify keystroke, C or c. - - * Works with gcc now. gcc complained about casting float constants - as XtPointers. - - * Detect if the visual doesn't support color. If so, run in monoMode. - An alternative would be to detect grayscale visual and use a collection - of gray user interface colors. - - XBoard.clockMode: False - - * For people who don't like or use chess clocks a clockMode switch - has been added. It is on by default. It can be turned off in the - .Xdefaults file with - - * Added a declaration, xtVersion, which will quickly break on R3 Intrinsics. - - * Hal Peterson contributed a new Imakefile. - - * Rewrote DisplayClocks(). - - * Rewrote TwoMachinesPlay mode. - - * Konstantinos Konstantinides added the -searchTime option. - - * Substantially rewrote and simplified the clock code. If a game was paused - and then resumed, the clocks were out of sync. - - * Fixed a bug in HandleUserMove() where the user could make a move while the - machine was thinking. The fix detects and ignores these moves. onMove - was not being used and was removed. diff --git a/DIFFSTAT b/DIFFSTAT deleted file mode 100644 index 7b55b44..0000000 --- a/DIFFSTAT +++ /dev/null @@ -1,4864 +0,0 @@ -** Version 4.8.0 ** - -(git diff -b --stat --summary -M v4.7.3 HEAD) - - .gitignore | 20 + - ABOUT-NLS | 1282 -------- - ChangeLog | 1623 +++++++++++ - DIFFSTAT | 439 +++ - Makefile.am | 172 +- - NEWS | 89 + - SHORTLOG | 365 +++ - args.h | 108 +- - autogen.sh | 3 +- - backend.c | 1314 +++++++-- - backend.h | 26 +- - board.c | 15 +- - book.c | 12 + - common.h | 66 +- - conf/chu | 42 + - conf/ics | 10 + - conf/judkins | 19 + - conf/judkins.fen | 2 + - conf/mini | 24 + - conf/mini.fen | 2 + - conf/sho | 28 + - conf/sho.fen | 2 + - conf/shogi | 41 + - conf/xiangqi | 30 + - conf/xq | 36 + - config.rpath | 672 ----- - configure.ac | 173 +- - dialogs.c | 713 ++++- - dialogs.h | 17 +- - draw.c | 136 +- - draw.h | 3 +- - engine-intf.html | 182 +- - engineoutput.c | 148 +- - engineoutput.h | 1 + - evalgraph.c | 15 +- - evalgraph.h | 3 +- - frontend.h | 7 +- - gamelist.c | 10 +- - gtk/xboard.c | 341 ++- - gtk/xboard.h | 39 +- - gtk/xengineoutput.c | 21 +- - gtk/xoptions.c | 179 +- - m4/gettext.m4 | 383 --- - m4/iconv.m4 | 214 -- - m4/lib-ld.m4 | 110 - - m4/lib-link.m4 | 774 ----- - m4/lib-prefix.m4 | 224 -- - m4/nls.m4 | 32 - - m4/po.m4 | 449 --- - m4/progtest.m4 | 92 - - menus.c | 152 +- - menus.h | 3 + - moves.c | 1028 +++++-- - moves.h | 12 +- - nengineoutput.c | 14 +- - nevalgraph.c | 17 +- - ngamelist.c | 13 +- - nhistory.c | 2 +- - osxapp/Info.plist.in | 188 ++ - osxapp/OSX-theme/gtk-2.0/assets/handle.png | Bin 0 -> 186 bytes - .../gtk-2.0/assets/l-checkbox-checked-18.png | Bin 0 -> 814 bytes - .../assets/l-checkbox-checked-insensitive-18.png | Bin 0 -> 639 bytes - .../gtk-2.0/assets/l-checkbox-unchecked-18.png | Bin 0 -> 413 bytes - .../assets/l-checkbox-unchecked-insensitive-18.png | Bin 0 -> 356 bytes - .../gtk-2.0/assets/l-radio-selected-18.png | Bin 0 -> 890 bytes - .../assets/l-radio-selected-insensitive-18.png | Bin 0 -> 643 bytes - .../gtk-2.0/assets/l-radio-unselected-18.png | Bin 0 -> 606 bytes - .../assets/l-radio-unselected-insensitive-18.png | Bin 0 -> 546 bytes - .../gtk-2.0/assets/notebook-gap-bottom.png | Bin 0 -> 159 bytes - .../OSX-theme/gtk-2.0/assets/notebook-gap-left.png | Bin 0 -> 85 bytes - .../gtk-2.0/assets/notebook-gap-right.png | Bin 0 -> 84 bytes - .../OSX-theme/gtk-2.0/assets/notebook-gap-top.png | Bin 0 -> 158 bytes - osxapp/OSX-theme/gtk-2.0/assets/notebook.png | Bin 0 -> 227 bytes - osxapp/OSX-theme/gtk-2.0/assets/null.png | Bin 0 -> 1164 bytes - .../OSX-theme/gtk-2.0/assets/scroll-background.png | Bin 0 -> 155 bytes - .../OSX-theme/gtk-2.0/assets/slider-horizontal.png | Bin 0 -> 828 bytes - .../OSX-theme/gtk-2.0/assets/tab-bottom-active.png | Bin 0 -> 924 bytes - osxapp/OSX-theme/gtk-2.0/assets/tab-bottom.png | Bin 0 -> 888 bytes - .../OSX-theme/gtk-2.0/assets/tab-left-active.png | Bin 0 -> 451 bytes - osxapp/OSX-theme/gtk-2.0/assets/tab-left.png | Bin 0 -> 763 bytes - .../OSX-theme/gtk-2.0/assets/tab-right-active.png | Bin 0 -> 453 bytes - osxapp/OSX-theme/gtk-2.0/assets/tab-right.png | Bin 0 -> 787 bytes - osxapp/OSX-theme/gtk-2.0/assets/tab-top-active.png | Bin 0 -> 920 bytes - osxapp/OSX-theme/gtk-2.0/assets/tab-top.png | Bin 0 -> 897 bytes - osxapp/OSX-theme/gtk-2.0/assets/toolbar.png | Bin 0 -> 214 bytes - osxapp/OSX-theme/gtk-2.0/gtkrc | 798 +++++ - osxapp/PkgInfo | 1 + - osxapp/XBoard.gtklauncher | 74 + - osxapp/default/eo_Analyzing.png | Bin 0 -> 462 bytes - osxapp/default/eo_Black.png | Bin 0 -> 292 bytes - osxapp/default/eo_Clear.png | Bin 0 -> 159 bytes - osxapp/default/eo_Ponder.png | Bin 0 -> 607 bytes - osxapp/default/eo_Thinking.png | Bin 0 -> 492 bytes - osxapp/default/eo_Unknown.png | Bin 0 -> 467 bytes - osxapp/default/eo_White.png | Bin 0 -> 400 bytes - osxapp/default/icon_black.png | Bin 0 -> 36898 bytes - osxapp/default/icon_white.png | Bin 0 -> 36619 bytes - osxapp/gtkrc | 4 + - osxapp/icons/XBoard.icns | Bin 0 -> 200555 bytes - osxapp/icons/fen.icns | Bin 0 -> 160673 bytes - osxapp/icons/pgn.icns | Bin 0 -> 165002 bytes - osxapp/icons/trn.icns | Bin 0 -> 161616 bytes - osxapp/icons/xop.icns | Bin 0 -> 167993 bytes - osxapp/info.command | 2 + - osxapp/launcher_rc | 1 + - osxapp/logos/207.99.83.228.png | Bin 0 -> 16710 bytes - osxapp/logos/69.36.243.188.png | Bin 0 -> 7260 bytes - osxapp/logos/dummy.png | Bin 0 -> 9465 bytes - osxapp/logos/winboard.nl.png | Bin 0 -> 28755 bytes - osxapp/man.command | 2 + - osxapp/osx-localization/.DS_Store | Bin 0 -> 6148 bytes - .../da.lproj/GtkosxApplication.strings | Bin 0 -> 1056 bytes - .../de.lproj/GtkosxApplication.strings | Bin 0 -> 1104 bytes - .../en.lproj/GtkosxApplication.strings | Bin 0 -> 1066 bytes - .../es.lproj/GtkosxApplication.strings | Bin 0 -> 1078 bytes - .../it.lproj/GtkosxApplication.strings | Bin 0 -> 1116 bytes - .../nl.lproj/GtkosxApplication.strings | Bin 0 -> 1100 bytes - .../pl.lproj/GtkosxApplication.strings | Bin 0 -> 1084 bytes - .../ru.lproj/GtkosxApplication.strings | Bin 0 -> 1088 bytes - .../tr.lproj/GtkosxApplication.strings | Bin 0 -> 1038 bytes - .../uk.lproj/GtkosxApplication.strings | Bin 0 -> 610 bytes - .../vi.lproj/GtkosxApplication.strings | Bin 0 -> 1064 bytes - .../zh_CN.lproj/GtkosxApplication.strings | Bin 0 -> 944 bytes - .../zh_HK.lproj/GtkosxApplication.strings | Bin 0 -> 934 bytes - .../zh_TW.lproj/GtkosxApplication.strings | Bin 0 -> 944 bytes - osxapp/pango.modules | 5 + - parser.c | 29 +- - pgntags.c | 8 + - pixmaps/ANALYZING_14.xpm | 23 - - pixmaps/BLACK_14.xpm | 23 - - pixmaps/CLEAR_14.xpm | 23 - - pixmaps/PONDER_14.xpm | 23 - - pixmaps/THINKING_14.xpm | 23 - - pixmaps/UNKNOWN_14.xpm | 23 - - pixmaps/WHITE_14.xpm | 23 - - pixmaps/board32.png | Bin 0 -> 291 bytes - pixmaps/board32.xpm | 42 - - pixmaps/board48.png | Bin 0 -> 306 bytes - pixmaps/board48.xpm | 58 - - pixmaps/cross32.png | Bin 0 -> 370 bytes - pixmaps/cross32.xpm | 42 - - pixmaps/cross48.png | Bin 0 -> 390 bytes - pixmaps/cross48.xpm | 58 - - pixmaps/ini32.png | Bin 0 -> 339 bytes - pixmaps/ini32.xpm | 41 - - pixmaps/ini48.png | Bin 0 -> 388 bytes - pixmaps/ini48.xpm | 57 - - png/xqboard.png | Bin 4423 -> 2534 bytes - po/LINGUAS | 2 +- - po/Makefile.in.in | 446 --- - po/Makevars.template | 41 - - po/Rules-quot | 47 - - po/boldquot.sed | 10 - - po/da.po | 1656 ++++++----- - po/de.po | 1851 ++++++------ - po/en@boldquot.header | 25 - - po/en@quot.header | 22 - - po/es.po | 2783 +++++++++--------- - po/insert-header.sin | 23 - - po/it.po | 1612 +++++----- - po/nl.po | 3014 +++++++++++++++++++ - po/pl.po | 3077 ++++++++++++++++++++ - po/quot.sed | 6 - - po/remove-potcdate.sin | 19 - - po/ru.po | 1607 +++++----- - po/tr.po | 1588 +++++----- - po/uk.po | 1682 ++++++----- - po/vi.po | 1596 +++++----- - po/xboard.pot | 1573 +++++----- - po/zh_CN.po | 1604 +++++----- - po/zh_HK.po | 1605 +++++----- - po/zh_TW.po | 1604 +++++----- - sounds/roar.wav | Bin 0 -> 24664 bytes - svg/BlackClaw.svg | 162 ++ - svg/BlackDolphin.svg | 104 + - svg/BlackHCrown.svg | 129 + - svg/BlackHSword.svg | 115 + - svg/BlackLeopard.svg | 168 ++ - svg/BlackLion.svg | 172 ++ - svg/BlackPromoBishop.svg | 92 + - svg/BlackPromoDragon.svg | 109 + - svg/BlackPromoHSword.svg | 110 + - svg/BlackPromoHorse.svg | 88 + - svg/BlackPromoRook.svg | 104 + - svg/BlackPromoSword.svg | 108 + - svg/BlackSword.svg | 113 + - svg/WhiteClaw.svg | 161 + - svg/WhiteDolphin.svg | 105 + - svg/WhiteHCrown.svg | 129 + - svg/WhiteHSword.svg | 107 + - svg/WhiteLeopard.svg | 169 ++ - svg/WhiteLion.svg | 173 ++ - svg/WhitePromoBishop.svg | 84 + - svg/WhitePromoDragon.svg | 100 + - svg/WhitePromoHSword.svg | 102 + - svg/WhitePromoHorse.svg | 80 + - svg/WhitePromoRook.svg | 94 + - svg/WhitePromoSword.svg | 100 + - svg/WhiteSword.svg | 105 + - themes/shogi/BlackAdvisor.svg | 193 +- - themes/shogi/BlackBishop.svg | 149 +- - themes/shogi/BlackCrownedBishop.svg | 120 +- - themes/shogi/BlackCrownedRook.svg | 159 +- - themes/shogi/BlackElephant.svg | 65 + - themes/shogi/BlackGold.svg | 179 +- - themes/shogi/BlackGoldKnight.svg | 95 +- - themes/shogi/BlackGoldLance.svg | 97 +- - themes/shogi/BlackGoldPawn.svg | 87 +- - themes/shogi/BlackGoldSilver.svg | 109 +- - themes/shogi/BlackJewled.svg | 88 + - themes/shogi/BlackKing.svg | 151 +- - themes/shogi/BlackKnight.svg | 164 +- - themes/shogi/BlackLance.svg | 162 +- - themes/shogi/BlackPawn.svg | 136 +- - themes/shogi/BlackPrince.svg | 70 + - themes/shogi/BlackRook.svg | 160 +- - themes/shogi/WhiteAdvisor.svg | 177 +- - themes/shogi/WhiteBishop.svg | 132 +- - themes/shogi/WhiteCrownedBishop.svg | 98 +- - themes/shogi/WhiteCrownedRook.svg | 125 +- - themes/shogi/WhiteElephant.svg | 65 + - themes/shogi/WhiteGold.svg | 165 +- - themes/shogi/WhiteGoldKnight.svg | 81 +- - themes/shogi/WhiteGoldLance.svg | 83 +- - themes/shogi/WhiteGoldPawn.svg | 73 +- - themes/shogi/WhiteGoldSilver.svg | 87 +- - themes/shogi/WhiteJewled.svg | 82 + - themes/shogi/WhiteKing.svg | 142 +- - themes/shogi/WhiteKnight.svg | 150 +- - themes/shogi/WhiteLance.svg | 148 +- - themes/shogi/WhitePawn.svg | 122 +- - themes/shogi/WhitePrince.svg | 70 + - themes/shogi/WhiteRook.svg | 148 +- - usounds.c | 13 +- - usystem.c | 39 +- - usystem.h | 1 + - winboard/bitmaps/ln33o.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/ln33s.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/ln33w.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/ln49o.bmp | Bin 0 -> 454 bytes - winboard/bitmaps/ln49s.bmp | Bin 0 -> 454 bytes - winboard/bitmaps/ln49w.bmp | Bin 0 -> 454 bytes - winboard/bitmaps/ln72o.bmp | Bin 0 -> 926 bytes - winboard/bitmaps/ln72s.bmp | Bin 0 -> 926 bytes - winboard/bitmaps/ln72w.bmp | Bin 0 -> 926 bytes - winboard/config.h | 8 +- - winboard/defaults.h | 2 +- - winboard/resource.h | 13 +- - winboard/wclipbrd.c | 5 +- - winboard/wedittags.c | 53 +- - winboard/wengineoutput.c | 3 +- - winboard/wevalgraph.c | 11 +- - winboard/wgamelist.c | 38 +- - winboard/winboard.c | 159 +- - winboard/winboard.h | 9 + - winboard/winboard.rc | 97 +- - winboard/woptions.c | 66 +- - winboard/wsettings.c | 13 +- - winboard/wsnap.c | 72 +- - xaw/xboard.c | 249 +- - xaw/xboard.h | 2 +- - xaw/xengineoutput.c | 54 +- - xaw/xoptions.c | 71 +- - xboard.conf.in => xboard.conf | 33 +- - xboard.texi | 185 +- - xboard2.h | 2 +- - zic2xpm.c | 597 ---- - zic2xpm.man | 73 - - 268 files changed, 30688 insertions(+), 19408 deletions(-) - delete mode 100644 ABOUT-NLS - create mode 100644 conf/chu - create mode 100644 conf/ics - create mode 100644 conf/judkins - create mode 100644 conf/judkins.fen - create mode 100644 conf/mini - create mode 100644 conf/mini.fen - create mode 100644 conf/sho - create mode 100644 conf/sho.fen - create mode 100644 conf/shogi - create mode 100644 conf/xiangqi - create mode 100644 conf/xq - delete mode 100755 config.rpath - delete mode 100644 m4/gettext.m4 - delete mode 100644 m4/iconv.m4 - delete mode 100644 m4/lib-ld.m4 - delete mode 100644 m4/lib-link.m4 - delete mode 100644 m4/lib-prefix.m4 - delete mode 100644 m4/nls.m4 - delete mode 100644 m4/po.m4 - delete mode 100644 m4/progtest.m4 - create mode 100644 osxapp/Info.plist.in - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/handle.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/l-checkbox-checked-18.png - create mode 100644 osxapp/OSX-theme/gtk-2.0/assets/l-checkbox-checked-insensitive-18.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/l-checkbox-unchecked-18.png - create mode 100644 osxapp/OSX-theme/gtk-2.0/assets/l-checkbox-unchecked-insensitive-18.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/l-radio-selected-18.png - create mode 100644 osxapp/OSX-theme/gtk-2.0/assets/l-radio-selected-insensitive-18.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/l-radio-unselected-18.png - create mode 100644 osxapp/OSX-theme/gtk-2.0/assets/l-radio-unselected-insensitive-18.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/notebook-gap-bottom.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/notebook-gap-left.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/notebook-gap-right.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/notebook-gap-top.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/notebook.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/null.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/scroll-background.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/slider-horizontal.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-bottom-active.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-bottom.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-left-active.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-left.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-right-active.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-right.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-top-active.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/tab-top.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/assets/toolbar.png - create mode 100755 osxapp/OSX-theme/gtk-2.0/gtkrc - create mode 100644 osxapp/PkgInfo - create mode 100755 osxapp/XBoard.gtklauncher - create mode 100644 osxapp/default/eo_Analyzing.png - create mode 100644 osxapp/default/eo_Black.png - create mode 100644 osxapp/default/eo_Clear.png - create mode 100644 osxapp/default/eo_Ponder.png - create mode 100644 osxapp/default/eo_Thinking.png - create mode 100644 osxapp/default/eo_Unknown.png - create mode 100644 osxapp/default/eo_White.png - create mode 100644 osxapp/default/icon_black.png - create mode 100644 osxapp/default/icon_white.png - create mode 100644 osxapp/gtkrc - create mode 100644 osxapp/icons/XBoard.icns - create mode 100644 osxapp/icons/fen.icns - create mode 100644 osxapp/icons/pgn.icns - create mode 100644 osxapp/icons/trn.icns - create mode 100644 osxapp/icons/xop.icns - create mode 100755 osxapp/info.command - create mode 100644 osxapp/launcher_rc - create mode 100644 osxapp/logos/207.99.83.228.png - create mode 100644 osxapp/logos/69.36.243.188.png - create mode 100644 osxapp/logos/dummy.png - create mode 100644 osxapp/logos/winboard.nl.png - create mode 100755 osxapp/man.command - create mode 100644 osxapp/osx-localization/.DS_Store - create mode 100755 osxapp/osx-localization/da.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/de.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/en.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/es.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/it.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/nl.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/pl.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/ru.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/tr.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/uk.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/vi.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/zh_CN.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/zh_HK.lproj/GtkosxApplication.strings - create mode 100755 osxapp/osx-localization/zh_TW.lproj/GtkosxApplication.strings - create mode 100644 osxapp/pango.modules - delete mode 100644 pixmaps/ANALYZING_14.xpm - delete mode 100644 pixmaps/BLACK_14.xpm - delete mode 100644 pixmaps/CLEAR_14.xpm - delete mode 100644 pixmaps/PONDER_14.xpm - delete mode 100644 pixmaps/THINKING_14.xpm - delete mode 100644 pixmaps/UNKNOWN_14.xpm - delete mode 100644 pixmaps/WHITE_14.xpm - create mode 100644 pixmaps/board32.png - delete mode 100644 pixmaps/board32.xpm - create mode 100644 pixmaps/board48.png - delete mode 100644 pixmaps/board48.xpm - create mode 100644 pixmaps/cross32.png - delete mode 100644 pixmaps/cross32.xpm - create mode 100644 pixmaps/cross48.png - delete mode 100644 pixmaps/cross48.xpm - create mode 100644 pixmaps/ini32.png - delete mode 100644 pixmaps/ini32.xpm - create mode 100644 pixmaps/ini48.png - delete mode 100644 pixmaps/ini48.xpm - delete mode 100644 po/Makefile.in.in - delete mode 100644 po/Makevars.template - delete mode 100644 po/Rules-quot - delete mode 100644 po/boldquot.sed - delete mode 100644 po/en@boldquot.header - delete mode 100644 po/en@quot.header - delete mode 100644 po/insert-header.sin - create mode 100644 po/nl.po - create mode 100644 po/pl.po - delete mode 100644 po/quot.sed - delete mode 100644 po/remove-potcdate.sin - create mode 100644 sounds/roar.wav - create mode 100644 svg/BlackClaw.svg - create mode 100644 svg/BlackDolphin.svg - create mode 100644 svg/BlackHCrown.svg - create mode 100644 svg/BlackHSword.svg - create mode 100644 svg/BlackLeopard.svg - create mode 100644 svg/BlackLion.svg - create mode 100644 svg/BlackPromoBishop.svg - create mode 100644 svg/BlackPromoDragon.svg - create mode 100644 svg/BlackPromoHSword.svg - create mode 100644 svg/BlackPromoHorse.svg - create mode 100644 svg/BlackPromoRook.svg - create mode 100644 svg/BlackPromoSword.svg - create mode 100644 svg/BlackSword.svg - create mode 100644 svg/WhiteClaw.svg - create mode 100644 svg/WhiteDolphin.svg - create mode 100644 svg/WhiteHCrown.svg - create mode 100644 svg/WhiteHSword.svg - create mode 100644 svg/WhiteLeopard.svg - create mode 100644 svg/WhiteLion.svg - create mode 100644 svg/WhitePromoBishop.svg - create mode 100644 svg/WhitePromoDragon.svg - create mode 100644 svg/WhitePromoHSword.svg - create mode 100644 svg/WhitePromoHorse.svg - create mode 100644 svg/WhitePromoRook.svg - create mode 100644 svg/WhitePromoSword.svg - create mode 100644 svg/WhiteSword.svg - create mode 100644 themes/shogi/BlackElephant.svg - create mode 100644 themes/shogi/BlackJewled.svg - create mode 100644 themes/shogi/BlackPrince.svg - create mode 100644 themes/shogi/WhiteElephant.svg - create mode 100644 themes/shogi/WhiteJewled.svg - create mode 100644 themes/shogi/WhitePrince.svg - create mode 100644 winboard/bitmaps/ln33o.bmp - create mode 100644 winboard/bitmaps/ln33s.bmp - create mode 100644 winboard/bitmaps/ln33w.bmp - create mode 100644 winboard/bitmaps/ln49o.bmp - create mode 100644 winboard/bitmaps/ln49s.bmp - create mode 100644 winboard/bitmaps/ln49w.bmp - create mode 100644 winboard/bitmaps/ln72o.bmp - create mode 100644 winboard/bitmaps/ln72s.bmp - create mode 100644 winboard/bitmaps/ln72w.bmp - rename xboard.conf.in => xboard.conf (65%) - delete mode 100644 zic2xpm.c - delete mode 100644 zic2xpm.man - - -** Version 4.7.3 ** - -(git diff -b --stat --summary -M v4.7.2 HEAD) - - COPYRIGHT | 2 +- - README | 1 - - args.h | 10 +- - autogen.sh | 2 +- - backend.c | 27 +++- - backend.h | 42 +----- - backendz.h | 2 +- - board.c | 2 +- - board.h | 2 +- - book.c | 3 + - childio.c | 2 +- - childio.h | 2 +- - cmail.in | 2 +- - common.h | 42 +++++- - configure.ac | 4 +- - copyright.texi | 2 +- - dialogs.c | 14 +- - dialogs.h | 2 +- - doc-maint/release.org | 0 - draw.c | 2 +- - draw.h | 2 +- - engineoutput.c | 4 +- - engineoutput.h | 2 +- - evalgraph.c | 2 +- - evalgraph.h | 2 +- - frontend.h | 4 +- - gamelist.c | 2 +- - gtk/xboard.c | 84 +++++++++--- - gtk/xboard.h | 2 +- - gtk/xengineoutput.c | 2 +- - gtk/xoptions.c | 55 ++++++-- - gtk/xtimer.c | 2 +- - history.c | 2 +- - lists.c | 2 +- - lists.h | 2 +- - menus.c | 4 +- - menus.h | 2 +- - moves.c | 4 +- - moves.h | 2 +- - nengineoutput.c | 2 +- - nevalgraph.c | 2 +- - ngamelist.c | 2 +- - nhistory.c | 2 +- - parser.c | 6 +- - parser.h | 2 +- - pgntags.c | 2 +- - po/da.po | 280 +++++++++++++++++++------------------- - po/de.po | 280 +++++++++++++++++++------------------- - po/es.po | 280 +++++++++++++++++++------------------- - po/it.po | 280 +++++++++++++++++++------------------- - po/lng2po.sh | 2 +- - po/ru.po | 280 +++++++++++++++++++------------------- - po/tr.po | 280 +++++++++++++++++++------------------- - po/uk.po | 282 +++++++++++++++++++-------------------- - po/vi.po | 280 +++++++++++++++++++------------------- - po/xboard.pot | 282 +++++++++++++++++++-------------------- - po/zh_CN.po | 280 +++++++++++++++++++------------------- - po/zh_HK.po | 280 +++++++++++++++++++------------------- - po/zh_TW.po | 280 +++++++++++++++++++------------------- - themes/xiangqi/.DS_Store | Bin 6148 -> 0 bytes - uci.c | 2 +- - usounds.c | 2 +- - usystem.c | 2 +- - usystem.h | 2 +- - winboard/config.h | 6 +- - winboard/defaults.h | 2 +- - winboard/help.c | 2 +- - winboard/help/html/24.htm | 2 +- - winboard/jaws.c | 2 +- - winboard/language.txt | 2 +- - winboard/language/deutsch.lng | 2 +- - winboard/language/italiano.lng | 2 +- - winboard/language/nederlands.lng | 2 +- - winboard/language/romanian.lng | 2 +- - winboard/language/russian.lng | 2 +- - winboard/language/spanish.lng | 2 +- - winboard/language/vietnamese.lng | 2 +- - winboard/makefile.gcc | 5 +- - winboard/wchat.c | 2 +- - winboard/wclipbrd.c | 2 +- - winboard/wclipbrd.h | 2 +- - winboard/wedittags.c | 2 +- - winboard/wengineoutput.c | 2 +- - winboard/wevalgraph.c | 2 + - winboard/wgamelist.c | 2 +- - winboard/whistory.c | 2 + - winboard/winboard.c | 46 +++++-- - winboard/winboard.h | 4 +- - winboard/winboard.rc | 4 +- - winboard/wlayout.c | 14 +- - winboard/woptions.c | 2 +- - winboard/woptions.h | 2 +- - winboard/wsettings.c | 23 ++++ - winboard/wsockerr.c | 2 +- - winboard/wsockerr.h | 2 +- - xaw/xboard.c | 3 +- - xaw/xboard.h | 2 +- - xaw/xengineoutput.c | 3 +- - xaw/xgamelist.c | 2 +- - xaw/xgamelist.h | 2 +- - xaw/xhistory.c | 2 +- - xaw/xhistory.h | 2 +- - xaw/xoptions.c | 14 +- - xboard2.h | 22 +++ - zippy.README | 0 - zippy.c | 2 +- - zippy.h | 2 +- - zippy.lines | 0 - 108 files changed, 2077 insertions(+), 1867 deletions(-) - delete mode 100644 themes/xiangqi/.DS_Store - - -** Version 4.7.2 ** - -(git diff -b --stat --summary -M v4.7.1 HEAD) - - backend.c | 10 ++++++---- - book.c | 4 +++- - parser.c | 4 +++- - winboard/winboard.c | 8 ++++++-- - winboard/wsettings.c | 9 ++++++--- - zippy.c | 2 +- - 6 files changed, 25 insertions(+), 12 deletions(-) - - -** Version 4.7.1 ** - -(git diff -b --stat --summary -M v4.7.0 HEAD) - - args.h | 10 ++- - backend.c | 120 +++++++++++++++++------------ - backend.h | 6 +- - configure.ac | 2 +- - dialogs.c | 19 ++--- - gtk/xboard.c | 40 +++++++--- - gtk/xoptions.c | 16 ++-- - po/da.po | 2 +- - po/de.po | 61 ++++++++++----- - po/es.po | 2 +- - po/it.po | 2 +- - po/ru.po | 2 +- - po/tr.po | 2 +- - po/uk.po | 213 +++++++++++++++++++--------------------------------- - po/vi.po | 2 +- - po/xboard.pot | 4 +- - po/zh_CN.po | 2 +- - po/zh_HK.po | 2 +- - po/zh_TW.po | 2 +- - winboard/config.h | 6 +- - winboard/wchat.c | 11 ++- - xaw/xboard.c | 3 +- - xaw/xengineoutput.c | 4 +- - xaw/xhistory.c | 2 +- - xaw/xoptions.c | 3 +- - xboard.texi | 145 ++++++++++++++++++----------------- - zippy.README | 9 ++- - 27 files changed, 368 insertions(+), 324 deletions(-) - - -** Version 4.7.0 ** - -(git diff -b --stat --summary -M v4.6.2 HEAD) - - AUTHORS | 2117 +---------- - COPYRIGHT | 2 +- - ChangeLog | 2868 +++++++++++++- - DIFFSTAT | 3076 ++++++++++++++- - Makefile.am | 214 +- - NEWS | 90 +- - SHORTLOG | 442 ++- - args.h | 105 +- - autogen.sh | 2 +- - backend.c | 942 ++++- - backend.h | 64 +- - backendz.h | 9 +- - bitmaps/README.bitmaps | 101 - - bitmaps/a33o.bm | 16 - - bitmaps/a33s.bm | 16 - - bitmaps/a37o.bm | 17 - - bitmaps/a37s.bm | 17 - - bitmaps/a40o.bm | 18 - - bitmaps/a40s.bm | 18 - - bitmaps/a45o.bm | 23 - - bitmaps/a45s.bm | 23 - - bitmaps/a49o.bm | 27 - - bitmaps/a49s.bm | 27 - - bitmaps/a54o.bm | 30 - - bitmaps/a54s.bm | 30 - - bitmaps/a58o.bm | 35 - - bitmaps/a58s.bm | 35 - - bitmaps/a64o.bm | 39 - - bitmaps/a64s.bm | 39 - - bitmaps/a72o.bm | 48 - - bitmaps/a72s.bm | 48 - - bitmaps/as45o.bm | 23 - - bitmaps/as45s.bm | 23 - - bitmaps/b108o.bm | 105 - - bitmaps/b108s.bm | 105 - - bitmaps/b116o.bm | 121 - - bitmaps/b116s.bm | 121 - - bitmaps/b129o.bm | 186 - - bitmaps/b129s.bm | 186 - - bitmaps/b21o.bm | 9 - - bitmaps/b21s.bm | 9 - - bitmaps/b25o.bm | 11 - - bitmaps/b25s.bm | 11 - - bitmaps/b29o.bm | 12 - - bitmaps/b29s.bm | 12 - - bitmaps/b33o.bm | 16 - - bitmaps/b33s.bm | 16 - - bitmaps/b37o.bm | 17 - - bitmaps/b37s.bm | 17 - - bitmaps/b40o.bm | 18 - - bitmaps/b40s.bm | 18 - - bitmaps/b45o.bm | 23 - - bitmaps/b45s.bm | 23 - - bitmaps/b49o.bm | 27 - - bitmaps/b49s.bm | 27 - - bitmaps/b54o.bm | 30 - - bitmaps/b54s.bm | 30 - - bitmaps/b58o.bm | 35 - - bitmaps/b58s.bm | 35 - - bitmaps/b64o.bm | 39 - - bitmaps/b64s.bm | 39 - - bitmaps/b72o.bm | 48 - - bitmaps/b72s.bm | 48 - - bitmaps/b80o.bm | 58 - - bitmaps/b80s.bm | 58 - - bitmaps/b87o.bm | 68 - - bitmaps/b87s.bm | 68 - - bitmaps/b95o.bm | 81 - - bitmaps/b95s.bm | 81 - - bitmaps/bitmaps.h | 530 --- - bitmaps/c33o.bm | 16 - - bitmaps/c33s.bm | 16 - - bitmaps/c37o.bm | 17 - - bitmaps/c37s.bm | 17 - - bitmaps/c40o.bm | 18 - - bitmaps/c40s.bm | 18 - - bitmaps/c45o.bm | 23 - - bitmaps/c45s.bm | 23 - - bitmaps/c49o.bm | 27 - - bitmaps/c49s.bm | 27 - - bitmaps/c54o.bm | 30 - - bitmaps/c54s.bm | 30 - - bitmaps/c58o.bm | 35 - - bitmaps/c58s.bm | 35 - - bitmaps/c64o.bm | 39 - - bitmaps/c64s.bm | 39 - - bitmaps/c72o.bm | 48 - - bitmaps/c72s.bm | 48 - - bitmaps/d33o.bm | 16 - - bitmaps/d33s.bm | 16 - - bitmaps/d37o.bm | 17 - - bitmaps/d37s.bm | 17 - - bitmaps/d40o.bm | 18 - - bitmaps/d40s.bm | 18 - - bitmaps/d45o.bm | 23 - - bitmaps/d45s.bm | 23 - - bitmaps/d49o.bm | 27 - - bitmaps/d49s.bm | 27 - - bitmaps/d54o.bm | 30 - - bitmaps/d54s.bm | 30 - - bitmaps/d58o.bm | 35 - - bitmaps/d58s.bm | 35 - - bitmaps/d64o.bm | 39 - - bitmaps/d64s.bm | 39 - - bitmaps/d72o.bm | 48 - - bitmaps/d72s.bm | 48 - - bitmaps/dopkbm.sh | 16 - - bitmaps/dopkbm1.sh | 27 - - bitmaps/e33o.bm | 16 - - bitmaps/e33s.bm | 16 - - bitmaps/e49o.bm | 27 - - bitmaps/e49s.bm | 27 - - bitmaps/e72o.bm | 48 - - bitmaps/e72s.bm | 48 - - bitmaps/f33o.bm | 16 - - bitmaps/f33s.bm | 16 - - bitmaps/f49o.bm | 27 - - bitmaps/f49s.bm | 27 - - bitmaps/f72o.bm | 48 - - bitmaps/f72s.bm | 48 - - bitmaps/g33o.bm | 16 - - bitmaps/g33s.bm | 16 - - bitmaps/g49o.bm | 27 - - bitmaps/g49s.bm | 27 - - bitmaps/g72o.bm | 48 - - bitmaps/g72s.bm | 48 - - bitmaps/h33o.bm | 16 - - bitmaps/h33s.bm | 16 - - bitmaps/h49o.bm | 27 - - bitmaps/h49s.bm | 27 - - bitmaps/h72o.bm | 48 - - bitmaps/h72s.bm | 48 - - bitmaps/i33o.bm | 16 - - bitmaps/i33s.bm | 16 - - bitmaps/i49o.bm | 27 - - bitmaps/i49s.bm | 27 - - bitmaps/i72o.bm | 48 - - bitmaps/i72s.bm | 48 - - bitmaps/icon_b.bm | 13 - - bitmaps/icon_outline.bm | 14 - - bitmaps/j33o.bm | 16 - - bitmaps/j33s.bm | 16 - - bitmaps/j49o.bm | 27 - - bitmaps/j49s.bm | 27 - - bitmaps/j72o.bm | 48 - - bitmaps/j72s.bm | 48 - - bitmaps/k108o.bm | 105 - - bitmaps/k108s.bm | 105 - - bitmaps/k116o.bm | 121 - - bitmaps/k116s.bm | 121 - - bitmaps/k129o.bm | 186 - - bitmaps/k129s.bm | 186 - - bitmaps/k21o.bm | 9 - - bitmaps/k21s.bm | 9 - - bitmaps/k25o.bm | 11 - - bitmaps/k25s.bm | 11 - - bitmaps/k29o.bm | 12 - - bitmaps/k29s.bm | 12 - - bitmaps/k33o.bm | 16 - - bitmaps/k33s.bm | 16 - - bitmaps/k37o.bm | 17 - - bitmaps/k37s.bm | 17 - - bitmaps/k40o.bm | 18 - - bitmaps/k40s.bm | 18 - - bitmaps/k45o.bm | 23 - - bitmaps/k45s.bm | 23 - - bitmaps/k49o.bm | 27 - - bitmaps/k49s.bm | 27 - - bitmaps/k54o.bm | 30 - - bitmaps/k54s.bm | 30 - - bitmaps/k58o.bm | 35 - - bitmaps/k58s.bm | 35 - - bitmaps/k64o.bm | 39 - - bitmaps/k64s.bm | 39 - - bitmaps/k72o.bm | 48 - - bitmaps/k72s.bm | 48 - - bitmaps/k80o.bm | 58 - - bitmaps/k80s.bm | 58 - - bitmaps/k87o.bm | 68 - - bitmaps/k87s.bm | 68 - - bitmaps/k95o.bm | 81 - - bitmaps/k95s.bm | 81 - - bitmaps/l33o.bm | 16 - - bitmaps/l33s.bm | 16 - - bitmaps/l37o.bm | 17 - - bitmaps/l37s.bm | 17 - - bitmaps/l40o.bm | 18 - - bitmaps/l40s.bm | 18 - - bitmaps/l45o.bm | 23 - - bitmaps/l45s.bm | 23 - - bitmaps/l49o.bm | 27 - - bitmaps/l49s.bm | 27 - - bitmaps/l54o.bm | 30 - - bitmaps/l54s.bm | 30 - - bitmaps/l58o.bm | 35 - - bitmaps/l58s.bm | 35 - - bitmaps/l64o.bm | 39 - - bitmaps/l64s.bm | 39 - - bitmaps/l72o.bm | 48 - - bitmaps/l72s.bm | 48 - - bitmaps/m33o.bm | 16 - - bitmaps/m33s.bm | 16 - - bitmaps/m49o.bm | 27 - - bitmaps/m49s.bm | 27 - - bitmaps/m72o.bm | 48 - - bitmaps/m72s.bm | 48 - - bitmaps/n108o.bm | 105 - - bitmaps/n108s.bm | 105 - - bitmaps/n116o.bm | 121 - - bitmaps/n116s.bm | 121 - - bitmaps/n129o.bm | 186 - - bitmaps/n129s.bm | 186 - - bitmaps/n21o.bm | 9 - - bitmaps/n21s.bm | 9 - - bitmaps/n25o.bm | 11 - - bitmaps/n25s.bm | 11 - - bitmaps/n29o.bm | 12 - - bitmaps/n29s.bm | 12 - - bitmaps/n33o.bm | 16 - - bitmaps/n33s.bm | 16 - - bitmaps/n37o.bm | 17 - - bitmaps/n37s.bm | 17 - - bitmaps/n40o.bm | 18 - - bitmaps/n40s.bm | 18 - - bitmaps/n45o.bm | 23 - - bitmaps/n45s.bm | 23 - - bitmaps/n49o.bm | 27 - - bitmaps/n49s.bm | 27 - - bitmaps/n54o.bm | 30 - - bitmaps/n54s.bm | 30 - - bitmaps/n58o.bm | 35 - - bitmaps/n58s.bm | 35 - - bitmaps/n64o.bm | 39 - - bitmaps/n64s.bm | 39 - - bitmaps/n72o.bm | 48 - - bitmaps/n72s.bm | 48 - - bitmaps/n80o.bm | 58 - - bitmaps/n80s.bm | 58 - - bitmaps/n87o.bm | 68 - - bitmaps/n87s.bm | 68 - - bitmaps/n95o.bm | 81 - - bitmaps/n95s.bm | 81 - - bitmaps/o33o.bm | 16 - - bitmaps/o33s.bm | 16 - - bitmaps/o49o.bm | 27 - - bitmaps/o49s.bm | 27 - - bitmaps/o72o.bm | 48 - - bitmaps/o72s.bm | 48 - - bitmaps/p108o.bm | 105 - - bitmaps/p108s.bm | 105 - - bitmaps/p116o.bm | 121 - - bitmaps/p116s.bm | 121 - - bitmaps/p129o.bm | 186 - - bitmaps/p129s.bm | 186 - - bitmaps/p21o.bm | 9 - - bitmaps/p21s.bm | 9 - - bitmaps/p25o.bm | 11 - - bitmaps/p25s.bm | 11 - - bitmaps/p29o.bm | 12 - - bitmaps/p29s.bm | 12 - - bitmaps/p33o.bm | 16 - - bitmaps/p33s.bm | 16 - - bitmaps/p37o.bm | 17 - - bitmaps/p37s.bm | 17 - - bitmaps/p40o.bm | 18 - - bitmaps/p40s.bm | 18 - - bitmaps/p45o.bm | 23 - - bitmaps/p45s.bm | 23 - - bitmaps/p49o.bm | 27 - - bitmaps/p49s.bm | 27 - - bitmaps/p54o.bm | 30 - - bitmaps/p54s.bm | 30 - - bitmaps/p58o.bm | 35 - - bitmaps/p58s.bm | 35 - - bitmaps/p64o.bm | 39 - - bitmaps/p64s.bm | 39 - - bitmaps/p72o.bm | 48 - - bitmaps/p72s.bm | 48 - - bitmaps/p80o.bm | 58 - - bitmaps/p80s.bm | 58 - - bitmaps/p87o.bm | 68 - - bitmaps/p87s.bm | 68 - - bitmaps/p95o.bm | 81 - - bitmaps/p95s.bm | 81 - - bitmaps/q108o.bm | 105 - - bitmaps/q108s.bm | 105 - - bitmaps/q116o.bm | 121 - - bitmaps/q116s.bm | 121 - - bitmaps/q129o.bm | 186 - - bitmaps/q129s.bm | 186 - - bitmaps/q21o.bm | 9 - - bitmaps/q21s.bm | 9 - - bitmaps/q25o.bm | 11 - - bitmaps/q25s.bm | 11 - - bitmaps/q29o.bm | 12 - - bitmaps/q29s.bm | 12 - - bitmaps/q33o.bm | 16 - - bitmaps/q33s.bm | 16 - - bitmaps/q37o.bm | 17 - - bitmaps/q37s.bm | 17 - - bitmaps/q40o.bm | 18 - - bitmaps/q40s.bm | 18 - - bitmaps/q45o.bm | 23 - - bitmaps/q45s.bm | 23 - - bitmaps/q49o.bm | 27 - - bitmaps/q49s.bm | 27 - - bitmaps/q54o.bm | 30 - - bitmaps/q54s.bm | 30 - - bitmaps/q58o.bm | 35 - - bitmaps/q58s.bm | 35 - - bitmaps/q64o.bm | 39 - - bitmaps/q64s.bm | 39 - - bitmaps/q72o.bm | 48 - - bitmaps/q72s.bm | 48 - - bitmaps/q80o.bm | 58 - - bitmaps/q80s.bm | 58 - - bitmaps/q87o.bm | 68 - - bitmaps/q87s.bm | 68 - - bitmaps/q95o.bm | 81 - - bitmaps/q95s.bm | 81 - - bitmaps/r108o.bm | 105 - - bitmaps/r108s.bm | 105 - - bitmaps/r116o.bm | 121 - - bitmaps/r116s.bm | 121 - - bitmaps/r129o.bm | 186 - - bitmaps/r129s.bm | 186 - - bitmaps/r21o.bm | 9 - - bitmaps/r21s.bm | 9 - - bitmaps/r25o.bm | 11 - - bitmaps/r25s.bm | 11 - - bitmaps/r29o.bm | 12 - - bitmaps/r29s.bm | 12 - - bitmaps/r33o.bm | 16 - - bitmaps/r33s.bm | 16 - - bitmaps/r37o.bm | 17 - - bitmaps/r37s.bm | 17 - - bitmaps/r40o.bm | 18 - - bitmaps/r40s.bm | 18 - - bitmaps/r45o.bm | 23 - - bitmaps/r45s.bm | 23 - - bitmaps/r49o.bm | 27 - - bitmaps/r49s.bm | 27 - - bitmaps/r54o.bm | 30 - - bitmaps/r54s.bm | 30 - - bitmaps/r58o.bm | 35 - - bitmaps/r58s.bm | 35 - - bitmaps/r64o.bm | 39 - - bitmaps/r64s.bm | 39 - - bitmaps/r72o.bm | 48 - - bitmaps/r72s.bm | 48 - - bitmaps/r80o.bm | 58 - - bitmaps/r80s.bm | 58 - - bitmaps/r87o.bm | 68 - - bitmaps/r87s.bm | 68 - - bitmaps/r95o.bm | 81 - - bitmaps/r95s.bm | 81 - - bitmaps/s49o.bm | 27 - - bitmaps/s49s.bm | 27 - - bitmaps/s72o.bm | 48 - - bitmaps/s72s.bm | 48 - - bitmaps/test.c | 14 - - bitmaps/u49o.bm | 27 - - bitmaps/u49s.bm | 27 - - bitmaps/u72o.bm | 48 - - bitmaps/u72s.bm | 48 - - bitmaps/v33o.bm | 16 - - bitmaps/v33s.bm | 16 - - bitmaps/v49o.bm | 27 - - bitmaps/v49s.bm | 27 - - bitmaps/v72o.bm | 48 - - bitmaps/v72s.bm | 48 - - bitmaps/w33o.bm | 16 - - bitmaps/w33s.bm | 16 - - bitmaps/w49o.bm | 27 - - bitmaps/w49s.bm | 27 - - bitmaps/w72o.bm | 48 - - bitmaps/w72s.bm | 48 - - bitmaps/wl49o.bm | 27 - - bitmaps/wl49s.bm | 27 - - bitmaps/wl72o.bm | 48 - - bitmaps/wl72s.bm | 48 - - bitmaps/wn49o.bm | 27 - - bitmaps/wn49s.bm | 27 - - bitmaps/wn72o.bm | 48 - - bitmaps/wn72s.bm | 48 - - bitmaps/wp49o.bm | 27 - - bitmaps/wp49s.bm | 27 - - bitmaps/wp72o.bm | 48 - - bitmaps/wp72s.bm | 48 - - bitmaps/ws49o.bm | 27 - - bitmaps/ws49s.bm | 27 - - bitmaps/ws72o.bm | 48 - - bitmaps/ws72s.bm | 48 - - board.c | 1244 ++++++ - board.h | 98 + - book.c | 362 +- - childio.c | 2 +- - childio.h | 2 +- - cmail.in | 2 +- - common.h | 49 +- - configure.ac | 136 +- - copyright.texi | 2 +- - dialogs.c | 2588 +++++++++++++ - dialogs.h | 196 + - doc-maint/coding-standards.org | 6 + - doc-maint/gendocs.sh | 361 ++ - doc-maint/make-xboard-release | 186 + - doc-maint/release.org | 71 + - doc-maint/web-pages.org | 40 + - draw.c | 927 +++++ - draw.h | 76 + - engine-intf.html | 45 + - engineoutput.c | 28 +- - engineoutput.h | 25 +- - evalgraph.c | 4 +- - evalgraph.h | 12 +- - filebrowser/README | 3 - - filebrowser/dir.c | 169 - - filebrowser/draw.c | 981 ----- - filebrowser/path.c | 905 ----- - filebrowser/selfile.c | 902 ----- - filebrowser/selfile.h | 170 - - filebrowser/xstat.h | 23 - - frontend.h | 34 +- - gamelist.c | 5 +- - gettext.h | 6 +- - gtk/.dirstamp | 0 - gtk/xboard.c | 2126 +++++++++++ - gtk/xboard.h | 177 + - gtk/xengineoutput.c | 137 + - gtk/xoptions.c | 1587 ++++++++ - gtk/xtimer.c | 237 ++ - history.c | 3 +- - install-sh | 0 - lists.c | 2 +- - lists.h | 18 +- - menus.c | 1213 ++++++ - menus.h | 197 + - moves.c | 13 +- - moves.h | 2 +- - nengineoutput.c | 194 + - nevalgraph.c | 189 + - ngamelist.c | 377 ++ - nhistory.c | 124 + - parser.c | 6 +- - parser.h | 2 +- - pgntags.c | 2 +- - pixmaps/README.pixmaps | 8 - - pixmaps/add33.xpm | 42 - - pixmaps/add37.xpm | 46 - - pixmaps/add40.xpm | 49 - - pixmaps/add45.xpm | 54 - - pixmaps/add49.xpm | 58 - - pixmaps/add54.xpm | 63 - - pixmaps/add58.xpm | 67 - - pixmaps/add64.xpm | 73 - - pixmaps/add72.xpm | 81 - - pixmaps/adl33.xpm | 42 - - pixmaps/adl37.xpm | 46 - - pixmaps/adl40.xpm | 49 - - pixmaps/adl45.xpm | 54 - - pixmaps/adl49.xpm | 58 - - pixmaps/adl54.xpm | 63 - - pixmaps/adl58.xpm | 67 - - pixmaps/adl64.xpm | 73 - - pixmaps/adl72.xpm | 81 - - pixmaps/ald33.xpm | 42 - - pixmaps/ald37.xpm | 46 - - pixmaps/ald40.xpm | 49 - - pixmaps/ald45.xpm | 54 - - pixmaps/ald49.xpm | 58 - - pixmaps/ald54.xpm | 63 - - pixmaps/ald58.xpm | 67 - - pixmaps/ald64.xpm | 73 - - pixmaps/ald72.xpm | 81 - - pixmaps/all33.xpm | 42 - - pixmaps/all37.xpm | 46 - - pixmaps/all40.xpm | 49 - - pixmaps/all45.xpm | 54 - - pixmaps/all49.xpm | 58 - - pixmaps/all54.xpm | 63 - - pixmaps/all58.xpm | 67 - - pixmaps/all64.xpm | 73 - - pixmaps/all72.xpm | 81 - - pixmaps/asdd33.xpm | 42 - - pixmaps/asdd49.xpm | 58 - - pixmaps/asdd72.xpm | 81 - - pixmaps/asdl33.xpm | 42 - - pixmaps/asdl49.xpm | 58 - - pixmaps/asdl72.xpm | 81 - - pixmaps/asld33.xpm | 42 - - pixmaps/asld49.xpm | 58 - - pixmaps/asld72.xpm | 81 - - pixmaps/asll33.xpm | 42 - - pixmaps/asll49.xpm | 58 - - pixmaps/asll72.xpm | 81 - - pixmaps/bdd108.xpm | 117 - - pixmaps/bdd116.xpm | 125 - - pixmaps/bdd129.xpm | 138 - - pixmaps/bdd21.xpm | 30 - - pixmaps/bdd25.xpm | 34 - - pixmaps/bdd29.xpm | 38 - - pixmaps/bdd33.xpm | 42 - - pixmaps/bdd37.xpm | 46 - - pixmaps/bdd40.xpm | 49 - - pixmaps/bdd45.xpm | 54 - - pixmaps/bdd49.xpm | 58 - - pixmaps/bdd54.xpm | 63 - - pixmaps/bdd58.xpm | 67 - - pixmaps/bdd64.xpm | 73 - - pixmaps/bdd72.xpm | 81 - - pixmaps/bdd80.xpm | 89 - - pixmaps/bdd87.xpm | 96 - - pixmaps/bdd95.xpm | 104 - - pixmaps/bdl108.xpm | 117 - - pixmaps/bdl116.xpm | 125 - - pixmaps/bdl129.xpm | 138 - - pixmaps/bdl21.xpm | 30 - - pixmaps/bdl25.xpm | 34 - - pixmaps/bdl29.xpm | 38 - - pixmaps/bdl33.xpm | 42 - - pixmaps/bdl37.xpm | 46 - - pixmaps/bdl40.xpm | 49 - - pixmaps/bdl45.xpm | 54 - - pixmaps/bdl49.xpm | 58 - - pixmaps/bdl54.xpm | 63 - - pixmaps/bdl58.xpm | 67 - - pixmaps/bdl64.xpm | 73 - - pixmaps/bdl72.xpm | 81 - - pixmaps/bdl80.xpm | 89 - - pixmaps/bdl87.xpm | 96 - - pixmaps/bdl95.xpm | 104 - - pixmaps/bld108.xpm | 117 - - pixmaps/bld116.xpm | 125 - - pixmaps/bld129.xpm | 138 - - pixmaps/bld21.xpm | 30 - - pixmaps/bld25.xpm | 34 - - pixmaps/bld29.xpm | 38 - - pixmaps/bld33.xpm | 42 - - pixmaps/bld37.xpm | 43 - - pixmaps/bld40.xpm | 49 - - pixmaps/bld45.xpm | 54 - - pixmaps/bld49.xpm | 58 - - pixmaps/bld54.xpm | 63 - - pixmaps/bld58.xpm | 67 - - pixmaps/bld64.xpm | 73 - - pixmaps/bld72.xpm | 81 - - pixmaps/bld80.xpm | 89 - - pixmaps/bld87.xpm | 96 - - pixmaps/bld95.xpm | 104 - - pixmaps/bll108.xpm | 117 - - pixmaps/bll116.xpm | 125 - - pixmaps/bll129.xpm | 138 - - pixmaps/bll21.xpm | 30 - - pixmaps/bll25.xpm | 34 - - pixmaps/bll29.xpm | 38 - - pixmaps/bll33.xpm | 42 - - pixmaps/bll37.xpm | 43 - - pixmaps/bll40.xpm | 49 - - pixmaps/bll45.xpm | 54 - - pixmaps/bll49.xpm | 58 - - pixmaps/bll54.xpm | 63 - - pixmaps/bll58.xpm | 67 - - pixmaps/bll64.xpm | 73 - - pixmaps/bll72.xpm | 81 - - pixmaps/bll80.xpm | 89 - - pixmaps/bll87.xpm | 96 - - pixmaps/bll95.xpm | 104 - - pixmaps/cdd33.xpm | 42 - - pixmaps/cdd37.xpm | 46 - - pixmaps/cdd40.xpm | 49 - - pixmaps/cdd45.xpm | 54 - - pixmaps/cdd49.xpm | 58 - - pixmaps/cdd54.xpm | 63 - - pixmaps/cdd58.xpm | 67 - - pixmaps/cdd64.xpm | 73 - - pixmaps/cdd72.xpm | 81 - - pixmaps/cdl33.xpm | 42 - - pixmaps/cdl37.xpm | 46 - - pixmaps/cdl40.xpm | 49 - - pixmaps/cdl45.xpm | 54 - - pixmaps/cdl49.xpm | 58 - - pixmaps/cdl54.xpm | 63 - - pixmaps/cdl58.xpm | 67 - - pixmaps/cdl64.xpm | 73 - - pixmaps/cdl72.xpm | 81 - - pixmaps/cld33.xpm | 42 - - pixmaps/cld37.xpm | 46 - - pixmaps/cld40.xpm | 49 - - pixmaps/cld45.xpm | 54 - - pixmaps/cld49.xpm | 58 - - pixmaps/cld54.xpm | 63 - - pixmaps/cld58.xpm | 67 - - pixmaps/cld64.xpm | 73 - - pixmaps/cld72.xpm | 81 - - pixmaps/cll33.xpm | 42 - - pixmaps/cll37.xpm | 46 - - pixmaps/cll40.xpm | 49 - - pixmaps/cll45.xpm | 54 - - pixmaps/cll49.xpm | 58 - - pixmaps/cll54.xpm | 63 - - pixmaps/cll58.xpm | 67 - - pixmaps/cll64.xpm | 73 - - pixmaps/cll72.xpm | 81 - - pixmaps/convbm | 35 - - pixmaps/convbm.sed | 4 - - pixmaps/convbm2.sed | 5 - - pixmaps/convert.c | 168 - - pixmaps/cvdd33.xpm | 42 - - pixmaps/cvdd37.xpm | 46 - - pixmaps/cvdd40.xpm | 49 - - pixmaps/cvdd45.xpm | 54 - - pixmaps/cvdd49.xpm | 58 - - pixmaps/cvdd54.xpm | 63 - - pixmaps/cvdd58.xpm | 67 - - pixmaps/cvdd64.xpm | 73 - - pixmaps/cvdd72.xpm | 81 - - pixmaps/cvdl33.xpm | 42 - - pixmaps/cvdl37.xpm | 46 - - pixmaps/cvdl40.xpm | 49 - - pixmaps/cvdl45.xpm | 54 - - pixmaps/cvdl49.xpm | 58 - - pixmaps/cvdl54.xpm | 63 - - pixmaps/cvdl58.xpm | 67 - - pixmaps/cvdl64.xpm | 73 - - pixmaps/cvdl72.xpm | 81 - - pixmaps/cvld33.xpm | 42 - - pixmaps/cvld37.xpm | 46 - - pixmaps/cvld40.xpm | 49 - - pixmaps/cvld45.xpm | 54 - - pixmaps/cvld49.xpm | 58 - - pixmaps/cvld54.xpm | 63 - - pixmaps/cvld58.xpm | 67 - - pixmaps/cvld64.xpm | 73 - - pixmaps/cvld72.xpm | 81 - - pixmaps/cvll33.xpm | 42 - - pixmaps/cvll37.xpm | 46 - - pixmaps/cvll40.xpm | 49 - - pixmaps/cvll45.xpm | 54 - - pixmaps/cvll49.xpm | 58 - - pixmaps/cvll54.xpm | 63 - - pixmaps/cvll58.xpm | 67 - - pixmaps/cvll64.xpm | 73 - - pixmaps/cvll72.xpm | 81 - - pixmaps/dkdd33.xpm | 42 - - pixmaps/dkdd49.xpm | 58 - - pixmaps/dkdd72.xpm | 81 - - pixmaps/dkdl33.xpm | 42 - - pixmaps/dkdl49.xpm | 58 - - pixmaps/dkdl72.xpm | 81 - - pixmaps/dkld33.xpm | 42 - - pixmaps/dkld49.xpm | 58 - - pixmaps/dkld72.xpm | 81 - - pixmaps/dkll33.xpm | 42 - - pixmaps/dkll49.xpm | 58 - - pixmaps/dkll72.xpm | 81 - - pixmaps/edd33.xpm | 42 - - pixmaps/edd49.xpm | 58 - - pixmaps/edd72.xpm | 81 - - pixmaps/edl33.xpm | 42 - - pixmaps/edl49.xpm | 58 - - pixmaps/edl72.xpm | 81 - - pixmaps/eld33.xpm | 42 - - pixmaps/eld49.xpm | 58 - - pixmaps/eld72.xpm | 81 - - pixmaps/ell33.xpm | 42 - - pixmaps/ell49.xpm | 58 - - pixmaps/ell72.xpm | 81 - - pixmaps/fdd33.xpm | 42 - - pixmaps/fdd49.xpm | 58 - - pixmaps/fdd72.xpm | 81 - - pixmaps/fdl33.xpm | 42 - - pixmaps/fdl49.xpm | 58 - - pixmaps/fdl72.xpm | 81 - - pixmaps/fld33.xpm | 42 - - pixmaps/fld49.xpm | 58 - - pixmaps/fld72.xpm | 81 - - pixmaps/fll33.xpm | 42 - - pixmaps/fll49.xpm | 58 - - pixmaps/fll72.xpm | 81 - - pixmaps/gdd33.xpm | 42 - - pixmaps/gdd49.xpm | 58 - - pixmaps/gdd72.xpm | 81 - - pixmaps/gdl33.xpm | 42 - - pixmaps/gdl49.xpm | 58 - - pixmaps/gdl72.xpm | 81 - - pixmaps/gld33.xpm | 42 - - pixmaps/gld49.xpm | 58 - - pixmaps/gld72.xpm | 81 - - pixmaps/gll33.xpm | 42 - - pixmaps/gll49.xpm | 58 - - pixmaps/gll72.xpm | 81 - - pixmaps/hdd33.xpm | 42 - - pixmaps/hdd49.xpm | 58 - - pixmaps/hdd72.xpm | 81 - - pixmaps/hdl33.xpm | 42 - - pixmaps/hdl49.xpm | 58 - - pixmaps/hdl72.xpm | 81 - - pixmaps/hld33.xpm | 42 - - pixmaps/hld49.xpm | 58 - - pixmaps/hld72.xpm | 81 - - pixmaps/hll33.xpm | 42 - - pixmaps/hll49.xpm | 58 - - pixmaps/hll72.xpm | 81 - - pixmaps/ini32.xpm | 41 + - pixmaps/ini48.xpm | 57 + - pixmaps/kdd108.xpm | 117 - - pixmaps/kdd116.xpm | 125 - - pixmaps/kdd129.xpm | 138 - - pixmaps/kdd21.xpm | 30 - - pixmaps/kdd25.xpm | 34 - - pixmaps/kdd29.xpm | 38 - - pixmaps/kdd33.xpm | 42 - - pixmaps/kdd37.xpm | 46 - - pixmaps/kdd40.xpm | 46 - - pixmaps/kdd45.xpm | 54 - - pixmaps/kdd49.xpm | 58 - - pixmaps/kdd54.xpm | 63 - - pixmaps/kdd58.xpm | 67 - - pixmaps/kdd64.xpm | 73 - - pixmaps/kdd72.xpm | 81 - - pixmaps/kdd80.xpm | 89 - - pixmaps/kdd87.xpm | 96 - - pixmaps/kdd95.xpm | 104 - - pixmaps/kdl108.xpm | 117 - - pixmaps/kdl116.xpm | 125 - - pixmaps/kdl129.xpm | 138 - - pixmaps/kdl21.xpm | 30 - - pixmaps/kdl25.xpm | 34 - - pixmaps/kdl29.xpm | 38 - - pixmaps/kdl33.xpm | 42 - - pixmaps/kdl37.xpm | 46 - - pixmaps/kdl40.xpm | 46 - - pixmaps/kdl45.xpm | 54 - - pixmaps/kdl49.xpm | 58 - - pixmaps/kdl54.xpm | 63 - - pixmaps/kdl58.xpm | 67 - - pixmaps/kdl64.xpm | 73 - - pixmaps/kdl72.xpm | 81 - - pixmaps/kdl80.xpm | 89 - - pixmaps/kdl87.xpm | 96 - - pixmaps/kdl95.xpm | 104 - - pixmaps/kld108.xpm | 117 - - pixmaps/kld116.xpm | 125 - - pixmaps/kld129.xpm | 138 - - pixmaps/kld21.xpm | 30 - - pixmaps/kld25.xpm | 34 - - pixmaps/kld29.xpm | 38 - - pixmaps/kld33.xpm | 42 - - pixmaps/kld37.xpm | 46 - - pixmaps/kld40.xpm | 46 - - pixmaps/kld45.xpm | 54 - - pixmaps/kld49.xpm | 58 - - pixmaps/kld54.xpm | 63 - - pixmaps/kld58.xpm | 67 - - pixmaps/kld64.xpm | 73 - - pixmaps/kld72.xpm | 81 - - pixmaps/kld80.xpm | 89 - - pixmaps/kld87.xpm | 96 - - pixmaps/kld95.xpm | 104 - - pixmaps/kll108.xpm | 117 - - pixmaps/kll116.xpm | 125 - - pixmaps/kll129.xpm | 138 - - pixmaps/kll21.xpm | 30 - - pixmaps/kll25.xpm | 34 - - pixmaps/kll29.xpm | 38 - - pixmaps/kll33.xpm | 42 - - pixmaps/kll37.xpm | 46 - - pixmaps/kll40.xpm | 46 - - pixmaps/kll45.xpm | 54 - - pixmaps/kll49.xpm | 58 - - pixmaps/kll54.xpm | 63 - - pixmaps/kll58.xpm | 67 - - pixmaps/kll64.xpm | 73 - - pixmaps/kll72.xpm | 81 - - pixmaps/kll80.xpm | 89 - - pixmaps/kll87.xpm | 96 - - pixmaps/kll95.xpm | 104 - - pixmaps/ldd33.xpm | 42 - - pixmaps/ldd37.xpm | 46 - - pixmaps/ldd40.xpm | 49 - - pixmaps/ldd45.xpm | 54 - - pixmaps/ldd49.xpm | 58 - - pixmaps/ldd54.xpm | 63 - - pixmaps/ldd58.xpm | 67 - - pixmaps/ldd64.xpm | 73 - - pixmaps/ldd72.xpm | 81 - - pixmaps/ldl33.xpm | 42 - - pixmaps/ldl37.xpm | 46 - - pixmaps/ldl40.xpm | 49 - - pixmaps/ldl45.xpm | 54 - - pixmaps/ldl49.xpm | 58 - - pixmaps/ldl54.xpm | 63 - - pixmaps/ldl58.xpm | 67 - - pixmaps/ldl64.xpm | 73 - - pixmaps/ldl72.xpm | 81 - - pixmaps/lld33.xpm | 42 - - pixmaps/lld37.xpm | 46 - - pixmaps/lld40.xpm | 49 - - pixmaps/lld45.xpm | 54 - - pixmaps/lld49.xpm | 58 - - pixmaps/lld54.xpm | 63 - - pixmaps/lld58.xpm | 67 - - pixmaps/lld64.xpm | 73 - - pixmaps/lld72.xpm | 81 - - pixmaps/lll33.xpm | 42 - - pixmaps/lll37.xpm | 46 - - pixmaps/lll40.xpm | 49 - - pixmaps/lll45.xpm | 54 - - pixmaps/lll49.xpm | 58 - - pixmaps/lll54.xpm | 63 - - pixmaps/lll58.xpm | 67 - - pixmaps/lll64.xpm | 73 - - pixmaps/lll72.xpm | 81 - - pixmaps/marble_d.xpm | 238 -- - pixmaps/marble_l.xpm | 359 -- - pixmaps/mdd33.xpm | 42 - - pixmaps/mdd49.xpm | 58 - - pixmaps/mdd72.xpm | 81 - - pixmaps/mdl33.xpm | 42 - - pixmaps/mdl49.xpm | 58 - - pixmaps/mdl72.xpm | 81 - - pixmaps/mld33.xpm | 42 - - pixmaps/mld49.xpm | 58 - - pixmaps/mld72.xpm | 81 - - pixmaps/mll33.xpm | 42 - - pixmaps/mll49.xpm | 58 - - pixmaps/mll72.xpm | 81 - - pixmaps/ndd108.xpm | 117 - - pixmaps/ndd116.xpm | 125 - - pixmaps/ndd129.xpm | 138 - - pixmaps/ndd21.xpm | 30 - - pixmaps/ndd25.xpm | 34 - - pixmaps/ndd29.xpm | 35 - - pixmaps/ndd33.xpm | 42 - - pixmaps/ndd37.xpm | 43 - - pixmaps/ndd40.xpm | 46 - - pixmaps/ndd45.xpm | 51 - - pixmaps/ndd49.xpm | 55 - - pixmaps/ndd54.xpm | 63 - - pixmaps/ndd58.xpm | 67 - - pixmaps/ndd64.xpm | 73 - - pixmaps/ndd72.xpm | 81 - - pixmaps/ndd80.xpm | 89 - - pixmaps/ndd87.xpm | 96 - - pixmaps/ndd95.xpm | 104 - - pixmaps/ndl108.xpm | 117 - - pixmaps/ndl116.xpm | 125 - - pixmaps/ndl129.xpm | 138 - - pixmaps/ndl21.xpm | 30 - - pixmaps/ndl25.xpm | 34 - - pixmaps/ndl29.xpm | 35 - - pixmaps/ndl33.xpm | 42 - - pixmaps/ndl37.xpm | 43 - - pixmaps/ndl40.xpm | 46 - - pixmaps/ndl45.xpm | 51 - - pixmaps/ndl49.xpm | 55 - - pixmaps/ndl54.xpm | 63 - - pixmaps/ndl58.xpm | 67 - - pixmaps/ndl64.xpm | 73 - - pixmaps/ndl72.xpm | 81 - - pixmaps/ndl80.xpm | 89 - - pixmaps/ndl87.xpm | 96 - - pixmaps/ndl95.xpm | 104 - - pixmaps/nld108.xpm | 117 - - pixmaps/nld116.xpm | 125 - - pixmaps/nld129.xpm | 138 - - pixmaps/nld21.xpm | 30 - - pixmaps/nld25.xpm | 34 - - pixmaps/nld29.xpm | 38 - - pixmaps/nld33.xpm | 42 - - pixmaps/nld37.xpm | 46 - - pixmaps/nld40.xpm | 46 - - pixmaps/nld45.xpm | 51 - - pixmaps/nld49.xpm | 58 - - pixmaps/nld54.xpm | 63 - - pixmaps/nld58.xpm | 67 - - pixmaps/nld64.xpm | 73 - - pixmaps/nld72.xpm | 81 - - pixmaps/nld80.xpm | 89 - - pixmaps/nld87.xpm | 96 - - pixmaps/nld95.xpm | 104 - - pixmaps/nll108.xpm | 117 - - pixmaps/nll116.xpm | 125 - - pixmaps/nll129.xpm | 138 - - pixmaps/nll21.xpm | 30 - - pixmaps/nll25.xpm | 34 - - pixmaps/nll29.xpm | 38 - - pixmaps/nll33.xpm | 42 - - pixmaps/nll37.xpm | 46 - - pixmaps/nll40.xpm | 46 - - pixmaps/nll45.xpm | 51 - - pixmaps/nll49.xpm | 58 - - pixmaps/nll54.xpm | 63 - - pixmaps/nll58.xpm | 67 - - pixmaps/nll64.xpm | 73 - - pixmaps/nll72.xpm | 81 - - pixmaps/nll80.xpm | 89 - - pixmaps/nll87.xpm | 96 - - pixmaps/nll95.xpm | 104 - - pixmaps/odd33.xpm | 42 - - pixmaps/odd49.xpm | 58 - - pixmaps/odd72.xpm | 81 - - pixmaps/odl33.xpm | 42 - - pixmaps/odl49.xpm | 58 - - pixmaps/odl72.xpm | 81 - - pixmaps/old33.xpm | 42 - - pixmaps/old49.xpm | 58 - - pixmaps/old72.xpm | 81 - - pixmaps/oll33.xpm | 42 - - pixmaps/oll49.xpm | 58 - - pixmaps/oll72.xpm | 81 - - pixmaps/pdd108.xpm | 116 - - pixmaps/pdd116.xpm | 124 - - pixmaps/pdd129.xpm | 137 - - pixmaps/pdd21.xpm | 29 - - pixmaps/pdd25.xpm | 33 - - pixmaps/pdd29.xpm | 37 - - pixmaps/pdd33.xpm | 41 - - pixmaps/pdd37.xpm | 45 - - pixmaps/pdd40.xpm | 48 - - pixmaps/pdd45.xpm | 53 - - pixmaps/pdd49.xpm | 57 - - pixmaps/pdd54.xpm | 62 - - pixmaps/pdd58.xpm | 66 - - pixmaps/pdd64.xpm | 72 - - pixmaps/pdd72.xpm | 80 - - pixmaps/pdd80.xpm | 88 - - pixmaps/pdd87.xpm | 95 - - pixmaps/pdd95.xpm | 103 - - pixmaps/pdl108.xpm | 116 - - pixmaps/pdl116.xpm | 124 - - pixmaps/pdl129.xpm | 137 - - pixmaps/pdl21.xpm | 29 - - pixmaps/pdl25.xpm | 33 - - pixmaps/pdl29.xpm | 37 - - pixmaps/pdl33.xpm | 41 - - pixmaps/pdl37.xpm | 45 - - pixmaps/pdl40.xpm | 48 - - pixmaps/pdl45.xpm | 53 - - pixmaps/pdl49.xpm | 57 - - pixmaps/pdl54.xpm | 62 - - pixmaps/pdl58.xpm | 66 - - pixmaps/pdl64.xpm | 72 - - pixmaps/pdl72.xpm | 80 - - pixmaps/pdl80.xpm | 88 - - pixmaps/pdl87.xpm | 95 - - pixmaps/pdl95.xpm | 103 - - pixmaps/pixmaps.h | 1349 ------- - pixmaps/pld108.xpm | 117 - - pixmaps/pld116.xpm | 125 - - pixmaps/pld129.xpm | 138 - - pixmaps/pld21.xpm | 30 - - pixmaps/pld25.xpm | 34 - - pixmaps/pld29.xpm | 38 - - pixmaps/pld33.xpm | 42 - - pixmaps/pld37.xpm | 46 - - pixmaps/pld40.xpm | 49 - - pixmaps/pld45.xpm | 54 - - pixmaps/pld49.xpm | 58 - - pixmaps/pld54.xpm | 63 - - pixmaps/pld58.xpm | 67 - - pixmaps/pld64.xpm | 73 - - pixmaps/pld72.xpm | 81 - - pixmaps/pld80.xpm | 89 - - pixmaps/pld87.xpm | 96 - - pixmaps/pld95.xpm | 104 - - pixmaps/pll108.xpm | 117 - - pixmaps/pll116.xpm | 125 - - pixmaps/pll129.xpm | 138 - - pixmaps/pll21.xpm | 30 - - pixmaps/pll25.xpm | 34 - - pixmaps/pll29.xpm | 38 - - pixmaps/pll33.xpm | 42 - - pixmaps/pll37.xpm | 46 - - pixmaps/pll40.xpm | 49 - - pixmaps/pll45.xpm | 54 - - pixmaps/pll49.xpm | 58 - - pixmaps/pll54.xpm | 63 - - pixmaps/pll58.xpm | 67 - - pixmaps/pll64.xpm | 73 - - pixmaps/pll72.xpm | 81 - - pixmaps/pll80.xpm | 89 - - pixmaps/pll87.xpm | 96 - - pixmaps/pll95.xpm | 104 - - pixmaps/qdd108.xpm | 117 - - pixmaps/qdd116.xpm | 125 - - pixmaps/qdd129.xpm | 138 - - pixmaps/qdd21.xpm | 30 - - pixmaps/qdd25.xpm | 31 - - pixmaps/qdd29.xpm | 38 - - pixmaps/qdd33.xpm | 42 - - pixmaps/qdd37.xpm | 46 - - pixmaps/qdd40.xpm | 49 - - pixmaps/qdd45.xpm | 54 - - pixmaps/qdd49.xpm | 58 - - pixmaps/qdd54.xpm | 63 - - pixmaps/qdd58.xpm | 67 - - pixmaps/qdd64.xpm | 73 - - pixmaps/qdd72.xpm | 78 - - pixmaps/qdd80.xpm | 89 - - pixmaps/qdd87.xpm | 96 - - pixmaps/qdd95.xpm | 104 - - pixmaps/qdl108.xpm | 117 - - pixmaps/qdl116.xpm | 125 - - pixmaps/qdl129.xpm | 138 - - pixmaps/qdl21.xpm | 30 - - pixmaps/qdl25.xpm | 31 - - pixmaps/qdl29.xpm | 38 - - pixmaps/qdl33.xpm | 42 - - pixmaps/qdl37.xpm | 46 - - pixmaps/qdl40.xpm | 49 - - pixmaps/qdl45.xpm | 54 - - pixmaps/qdl49.xpm | 58 - - pixmaps/qdl54.xpm | 63 - - pixmaps/qdl58.xpm | 67 - - pixmaps/qdl64.xpm | 73 - - pixmaps/qdl72.xpm | 78 - - pixmaps/qdl80.xpm | 89 - - pixmaps/qdl87.xpm | 96 - - pixmaps/qdl95.xpm | 104 - - pixmaps/qld108.xpm | 117 - - pixmaps/qld116.xpm | 125 - - pixmaps/qld129.xpm | 138 - - pixmaps/qld21.xpm | 30 - - pixmaps/qld25.xpm | 31 - - pixmaps/qld29.xpm | 38 - - pixmaps/qld33.xpm | 42 - - pixmaps/qld37.xpm | 46 - - pixmaps/qld40.xpm | 49 - - pixmaps/qld45.xpm | 54 - - pixmaps/qld49.xpm | 58 - - pixmaps/qld54.xpm | 63 - - pixmaps/qld58.xpm | 67 - - pixmaps/qld64.xpm | 73 - - pixmaps/qld72.xpm | 78 - - pixmaps/qld80.xpm | 89 - - pixmaps/qld87.xpm | 96 - - pixmaps/qld95.xpm | 104 - - pixmaps/qll108.xpm | 117 - - pixmaps/qll116.xpm | 125 - - pixmaps/qll129.xpm | 138 - - pixmaps/qll21.xpm | 30 - - pixmaps/qll25.xpm | 31 - - pixmaps/qll29.xpm | 38 - - pixmaps/qll33.xpm | 42 - - pixmaps/qll37.xpm | 46 - - pixmaps/qll40.xpm | 49 - - pixmaps/qll45.xpm | 54 - - pixmaps/qll49.xpm | 58 - - pixmaps/qll54.xpm | 63 - - pixmaps/qll58.xpm | 67 - - pixmaps/qll64.xpm | 73 - - pixmaps/qll72.xpm | 78 - - pixmaps/qll80.xpm | 89 - - pixmaps/qll87.xpm | 96 - - pixmaps/qll95.xpm | 104 - - pixmaps/rdd108.xpm | 117 - - pixmaps/rdd116.xpm | 125 - - pixmaps/rdd129.xpm | 138 - - pixmaps/rdd21.xpm | 30 - - pixmaps/rdd25.xpm | 34 - - pixmaps/rdd29.xpm | 38 - - pixmaps/rdd33.xpm | 42 - - pixmaps/rdd37.xpm | 46 - - pixmaps/rdd40.xpm | 46 - - pixmaps/rdd45.xpm | 54 - - pixmaps/rdd49.xpm | 58 - - pixmaps/rdd54.xpm | 63 - - pixmaps/rdd58.xpm | 67 - - pixmaps/rdd64.xpm | 73 - - pixmaps/rdd72.xpm | 81 - - pixmaps/rdd80.xpm | 89 - - pixmaps/rdd87.xpm | 96 - - pixmaps/rdd95.xpm | 104 - - pixmaps/rdl108.xpm | 117 - - pixmaps/rdl116.xpm | 125 - - pixmaps/rdl129.xpm | 138 - - pixmaps/rdl21.xpm | 30 - - pixmaps/rdl25.xpm | 34 - - pixmaps/rdl29.xpm | 38 - - pixmaps/rdl33.xpm | 42 - - pixmaps/rdl37.xpm | 46 - - pixmaps/rdl40.xpm | 46 - - pixmaps/rdl45.xpm | 54 - - pixmaps/rdl49.xpm | 58 - - pixmaps/rdl54.xpm | 63 - - pixmaps/rdl58.xpm | 67 - - pixmaps/rdl64.xpm | 73 - - pixmaps/rdl72.xpm | 81 - - pixmaps/rdl80.xpm | 89 - - pixmaps/rdl87.xpm | 96 - - pixmaps/rdl95.xpm | 104 - - pixmaps/rld108.xpm | 117 - - pixmaps/rld116.xpm | 125 - - pixmaps/rld129.xpm | 138 - - pixmaps/rld21.xpm | 30 - - pixmaps/rld25.xpm | 34 - - pixmaps/rld29.xpm | 38 - - pixmaps/rld33.xpm | 42 - - pixmaps/rld37.xpm | 46 - - pixmaps/rld40.xpm | 49 - - pixmaps/rld45.xpm | 54 - - pixmaps/rld49.xpm | 58 - - pixmaps/rld54.xpm | 63 - - pixmaps/rld58.xpm | 67 - - pixmaps/rld64.xpm | 73 - - pixmaps/rld72.xpm | 81 - - pixmaps/rld80.xpm | 89 - - pixmaps/rld87.xpm | 96 - - pixmaps/rld95.xpm | 104 - - pixmaps/rll108.xpm | 117 - - pixmaps/rll116.xpm | 125 - - pixmaps/rll129.xpm | 138 - - pixmaps/rll21.xpm | 30 - - pixmaps/rll25.xpm | 34 - - pixmaps/rll29.xpm | 38 - - pixmaps/rll33.xpm | 42 - - pixmaps/rll37.xpm | 46 - - pixmaps/rll40.xpm | 49 - - pixmaps/rll45.xpm | 54 - - pixmaps/rll49.xpm | 58 - - pixmaps/rll54.xpm | 63 - - pixmaps/rll58.xpm | 67 - - pixmaps/rll64.xpm | 73 - - pixmaps/rll72.xpm | 81 - - pixmaps/rll80.xpm | 89 - - pixmaps/rll87.xpm | 96 - - pixmaps/rll95.xpm | 104 - - pixmaps/sdd49.xpm | 58 - - pixmaps/sdd72.xpm | 81 - - pixmaps/sdl49.xpm | 58 - - pixmaps/sdl72.xpm | 81 - - pixmaps/sld49.xpm | 58 - - pixmaps/sld72.xpm | 81 - - pixmaps/sll49.xpm | 58 - - pixmaps/sll72.xpm | 81 - - pixmaps/test.c | 13 - - pixmaps/udd49.xpm | 58 - - pixmaps/udd72.xpm | 81 - - pixmaps/udl49.xpm | 58 - - pixmaps/udl72.xpm | 81 - - pixmaps/uld49.xpm | 58 - - pixmaps/uld72.xpm | 81 - - pixmaps/ull49.xpm | 58 - - pixmaps/ull72.xpm | 81 - - pixmaps/vdd33.xpm | 42 - - pixmaps/vdd49.xpm | 58 - - pixmaps/vdd72.xpm | 81 - - pixmaps/vdl33.xpm | 42 - - pixmaps/vdl49.xpm | 58 - - pixmaps/vdl72.xpm | 81 - - pixmaps/vld33.xpm | 42 - - pixmaps/vld49.xpm | 58 - - pixmaps/vld72.xpm | 81 - - pixmaps/vll33.xpm | 42 - - pixmaps/vll49.xpm | 58 - - pixmaps/vll72.xpm | 81 - - pixmaps/wdd33.xpm | 42 - - pixmaps/wdd49.xpm | 58 - - pixmaps/wdd72.xpm | 81 - - pixmaps/wdl33.xpm | 42 - - pixmaps/wdl49.xpm | 58 - - pixmaps/wdl72.xpm | 81 - - pixmaps/wld33.xpm | 42 - - pixmaps/wld49.xpm | 58 - - pixmaps/wld72.xpm | 81 - - pixmaps/wldd49.xpm | 58 - - pixmaps/wldd72.xpm | 81 - - pixmaps/wldl49.xpm | 58 - - pixmaps/wldl72.xpm | 81 - - pixmaps/wll33.xpm | 42 - - pixmaps/wll49.xpm | 58 - - pixmaps/wll72.xpm | 81 - - pixmaps/wlld49.xpm | 58 - - pixmaps/wlld72.xpm | 81 - - pixmaps/wlll49.xpm | 58 - - pixmaps/wlll72.xpm | 81 - - pixmaps/wndd49.xpm | 58 - - pixmaps/wndd72.xpm | 81 - - pixmaps/wndl49.xpm | 58 - - pixmaps/wndl72.xpm | 81 - - pixmaps/wnld49.xpm | 58 - - pixmaps/wnld72.xpm | 81 - - pixmaps/wnll49.xpm | 58 - - pixmaps/wnll72.xpm | 81 - - pixmaps/wood_d.xpm | 239 -- - pixmaps/wood_l.xpm | 192 - - pixmaps/wpdd49.xpm | 58 - - pixmaps/wpdd72.xpm | 81 - - pixmaps/wpdl49.xpm | 58 - - pixmaps/wpdl72.xpm | 81 - - pixmaps/wpld49.xpm | 58 - - pixmaps/wpld72.xpm | 81 - - pixmaps/wpll49.xpm | 58 - - pixmaps/wpll72.xpm | 81 - - pixmaps/wsdd49.xpm | 58 - - pixmaps/wsdd72.xpm | 81 - - pixmaps/wsdl49.xpm | 58 - - pixmaps/wsdl72.xpm | 81 - - pixmaps/wsld49.xpm | 58 - - pixmaps/wsld72.xpm | 81 - - pixmaps/wsll49.xpm | 58 - - pixmaps/wsll72.xpm | 81 - - pixmaps/xqboard.xpm | 498 --- - pixmaps/xqwood.xpm | 597 --- - png/BlackAdvisor.png | Bin 0 -> 1928 bytes - png/BlackArchbishop.png | Bin 0 -> 1856 bytes - png/BlackBishop.png | Bin 0 -> 1478 bytes - png/BlackCanon.png | Bin 0 -> 1302 bytes - png/BlackChancellor.png | Bin 0 -> 2147 bytes - png/BlackCobra.png | Bin 0 -> 1308 bytes - png/BlackCommoner.png | Bin 0 -> 1954 bytes - png/BlackCrownedBishop.png | Bin 0 -> 1537 bytes - png/BlackCrownedRook.png | Bin 0 -> 1133 bytes - png/BlackElephant.png | Bin 0 -> 2437 bytes - png/BlackGold.png | Bin 0 -> 2198 bytes - png/BlackGoldKnight.png | Bin 0 -> 2219 bytes - png/BlackGoldLance.png | Bin 0 -> 2268 bytes - png/BlackGoldPawn.png | Bin 0 -> 1936 bytes - png/BlackGoldSilver.png | Bin 0 -> 2161 bytes - png/BlackHawk.png | Bin 0 -> 2071 bytes - png/BlackKing.png | Bin 0 -> 3255 bytes - png/BlackKnight.png | Bin 0 -> 2715 bytes - png/BlackLance.png | Bin 0 -> 810 bytes - png/BlackMarshall.png | Bin 0 -> 2143 bytes - png/BlackNightrider.png | Bin 0 -> 2930 bytes - png/BlackPawn.png | Bin 0 -> 800 bytes - png/BlackPrincess.png | Bin 0 -> 1845 bytes - png/BlackQueen.png | Bin 0 -> 2165 bytes - png/BlackRook.png | Bin 0 -> 885 bytes - png/BlackUnicorn.png | Bin 0 -> 2035 bytes - png/WhiteAdvisor.png | Bin 0 -> 2836 bytes - png/WhiteArchbishop.png | Bin 0 -> 2452 bytes - png/WhiteBishop.png | Bin 0 -> 2607 bytes - png/WhiteCanon.png | Bin 0 -> 1914 bytes - png/WhiteChancellor.png | Bin 0 -> 2490 bytes - png/WhiteCobra.png | Bin 0 -> 2336 bytes - png/WhiteCommoner.png | Bin 0 -> 2879 bytes - png/WhiteCrownedBishop.png | Bin 0 -> 2626 bytes - png/WhiteCrownedRook.png | Bin 0 -> 1492 bytes - png/WhiteElephant.png | Bin 0 -> 3871 bytes - png/WhiteGold.png | Bin 0 -> 3141 bytes - png/WhiteGoldKnight.png | Bin 0 -> 3183 bytes - png/WhiteGoldLance.png | Bin 0 -> 3240 bytes - png/WhiteGoldPawn.png | Bin 0 -> 2909 bytes - png/WhiteGoldSilver.png | Bin 0 -> 3166 bytes - png/WhiteHawk.png | Bin 0 -> 3078 bytes - png/WhiteKing.png | Bin 0 -> 3159 bytes - png/WhiteKnight.png | Bin 0 -> 2926 bytes - png/WhiteLance.png | Bin 0 -> 1611 bytes - png/WhiteMarshall.png | Bin 0 -> 2876 bytes - png/WhiteNightrider.png | Bin 0 -> 2926 bytes - png/WhitePawn.png | Bin 0 -> 1609 bytes - png/WhitePrincess.png | Bin 0 -> 3630 bytes - png/WhiteQueen.png | Bin 0 -> 4397 bytes - png/WhiteRook.png | Bin 0 -> 1072 bytes - png/WhiteUnicorn.png | Bin 0 -> 3162 bytes - png/hatch.png | Bin 0 -> 397 bytes - png/marble_d.png | Bin 0 -> 40546 bytes - png/marble_l.png | Bin 0 -> 47660 bytes - png/wood_d.png | Bin 0 -> 34729 bytes - png/wood_l.png | Bin 0 -> 30195 bytes - png/xqboard.png | Bin 0 -> 4423 bytes - png/xqwood.png | Bin 0 -> 359345 bytes - po/POTFILES.in | 25 +- - po/da.po | 3791 ++++++++++--------- - po/de.po | 3806 ++++++++++--------- - po/es.po | 3341 ++++++++-------- - po/it.po | 3331 ++++++++-------- - po/lng2po.sh | 2 +- - po/ru.po | 3343 ++++++++-------- - po/tr.po | 3017 ++++++++------- - po/uk.po | 3831 ++++++++++--------- - po/vi.po | 3120 ++++++++------- - po/xboard.pot | 2609 +++++++------ - po/zh_CN.po | 3332 ++++++++-------- - po/zh_HK.po | 3316 ++++++++-------- - po/zh_TW.po | 3302 ++++++++-------- - shogipixmaps/bdd64.xpm | 73 - - shogipixmaps/bdl64.xpm | 73 - - shogipixmaps/bld64.xpm | 74 - - shogipixmaps/bll64.xpm | 74 - - shogipixmaps/fdd64.xpm | 73 - - shogipixmaps/fdl64.xpm | 73 - - shogipixmaps/fld64.xpm | 74 - - shogipixmaps/fll64.xpm | 74 - - shogipixmaps/kdd64.xpm | 73 - - shogipixmaps/kdl64.xpm | 73 - - shogipixmaps/kld64.xpm | 73 - - shogipixmaps/kll64.xpm | 73 - - shogipixmaps/ldd64.xpm | 73 - - shogipixmaps/ldl64.xpm | 73 - - shogipixmaps/lld64.xpm | 73 - - shogipixmaps/lll64.xpm | 73 - - shogipixmaps/ndd64.xpm | 73 - - shogipixmaps/ndl64.xpm | 73 - - shogipixmaps/nld64.xpm | 74 - - shogipixmaps/nll64.xpm | 74 - - shogipixmaps/pdd64.xpm | 73 - - shogipixmaps/pdl64.xpm | 73 - - shogipixmaps/pld64.xpm | 74 - - shogipixmaps/pll64.xpm | 74 - - shogipixmaps/qdd64.xpm | 73 - - shogipixmaps/qdl64.xpm | 73 - - shogipixmaps/qld64.xpm | 73 - - shogipixmaps/qll64.xpm | 73 - - shogipixmaps/rdd64.xpm | 73 - - shogipixmaps/rdl64.xpm | 73 - - shogipixmaps/rld64.xpm | 73 - - shogipixmaps/rll64.xpm | 73 - - shogipixmaps/wdd64.xpm | 73 - - shogipixmaps/wdl64.xpm | 73 - - shogipixmaps/wld64.xpm | 73 - - shogipixmaps/wldd64.xpm | 73 - - shogipixmaps/wldl64.xpm | 73 - - shogipixmaps/wll64.xpm | 73 - - shogipixmaps/wlld64.xpm | 73 - - shogipixmaps/wlll64.xpm | 73 - - shogipixmaps/wndd64.xpm | 73 - - shogipixmaps/wndl64.xpm | 73 - - shogipixmaps/wnld64.xpm | 73 - - shogipixmaps/wnll64.xpm | 73 - - shogipixmaps/wpdd64.xpm | 73 - - shogipixmaps/wpdl64.xpm | 73 - - shogipixmaps/wpld64.xpm | 73 - - shogipixmaps/wpll64.xpm | 73 - - shogipixmaps/wsdd64.xpm | 73 - - shogipixmaps/wsdl64.xpm | 73 - - shogipixmaps/wsld64.xpm | 73 - - shogipixmaps/wsll64.xpm | 73 - - svg/BlackAdvisor.svg | 70 + - svg/BlackArchbishop.svg | 92 + - svg/BlackBishop.svg | 78 + - svg/BlackCanon.svg | 68 + - svg/BlackChancellor.svg | 73 + - svg/BlackCobra.svg | 78 + - svg/BlackCommoner.svg | 71 + - svg/BlackCrownedBishop.svg | 73 + - svg/BlackCrownedRook.svg | 82 + - svg/BlackElephant.svg | 98 + - svg/BlackGold.svg | 63 + - svg/BlackGoldKnight.svg | 63 + - svg/BlackGoldLance.svg | 63 + - svg/BlackGoldPawn.svg | 58 + - svg/BlackGoldSilver.svg | 63 + - svg/BlackHawk.svg | 98 + - svg/BlackKing.svg | 83 + - svg/BlackKnight.svg | 48 + - svg/BlackLance.svg | 58 + - svg/BlackMarshall.svg | 77 + - svg/BlackNightrider.svg | 58 + - svg/BlackPawn.svg | 38 + - svg/BlackPrincess.svg | 98 + - svg/BlackQueen.svg | 58 + - svg/BlackRook.svg | 78 + - svg/BlackUnicorn.svg | 63 + - svg/WhiteAdvisor.svg | 65 + - svg/WhiteArchbishop.svg | 86 + - svg/WhiteBishop.svg | 72 + - svg/WhiteCanon.svg | 62 + - svg/WhiteChancellor.svg | 91 + - svg/WhiteCobra.svg | 68 + - svg/WhiteCommoner.svg | 63 + - svg/WhiteCrownedBishop.svg | 68 + - svg/WhiteCrownedRook.svg | 73 + - svg/WhiteElephant.svg | 87 + - svg/WhiteGold.svg | 63 + - svg/WhiteGoldKnight.svg | 63 + - svg/WhiteGoldLance.svg | 63 + - svg/WhiteGoldPawn.svg | 58 + - svg/WhiteGoldSilver.svg | 63 + - svg/WhiteHawk.svg | 94 + - svg/WhiteKing.svg | 73 + - svg/WhiteKnight.svg | 58 + - svg/WhiteLance.svg | 58 + - svg/WhiteMarshall.svg | 80 + - svg/WhiteNightrider.svg | 58 + - svg/WhitePawn.svg | 38 + - svg/WhitePrincess.svg | 98 + - svg/WhiteQueen.svg | 110 + - svg/WhiteRook.svg | 68 + - svg/WhiteUnicorn.svg | 77 + - svg/eo_Analyzing.svg | 115 + - svg/eo_Black.svg | 84 + - svg/eo_Clear.svg | 36 + - svg/eo_Ponder.svg | 111 + - svg/eo_Thinking.svg | 132 + - svg/eo_Unknown.svg | 84 + - svg/eo_White.svg | 84 + - svg/icon_black.svg | 41 + - svg/icon_white.svg | 41 + - themes/Mono/BlackAdvisor.svg | 92 + - themes/Mono/BlackArchbishop.svg | 111 + - themes/Mono/BlackBishop.svg | 100 + - themes/Mono/BlackCanon.svg | 92 + - themes/Mono/BlackChancellor.svg | 90 + - themes/Mono/BlackCobra.svg | 99 + - themes/Mono/BlackCommoner.svg | 92 + - themes/Mono/BlackCrownedBishop.svg | 95 + - themes/Mono/BlackCrownedRook.svg | 106 + - themes/Mono/BlackElephant.svg | 120 + - themes/Mono/BlackGold.svg | 85 + - themes/Mono/BlackGoldKnight.svg | 85 + - themes/Mono/BlackGoldLance.svg | 85 + - themes/Mono/BlackGoldPawn.svg | 80 + - themes/Mono/BlackGoldSilver.svg | 85 + - themes/Mono/BlackHawk.svg | 125 + - themes/Mono/BlackKing.svg | 104 + - themes/Mono/BlackKnight.svg | 66 + - themes/Mono/BlackLance.svg | 81 + - themes/Mono/BlackMarshall.svg | 99 + - themes/Mono/BlackNightrider.svg | 76 + - themes/Mono/BlackPawn.svg | 65 + - themes/Mono/BlackPrincess.svg | 120 + - themes/Mono/BlackQueen.svg | 80 + - themes/Mono/BlackRook.svg | 106 + - themes/Mono/BlackUnicorn.svg | 81 + - themes/Mono/WhiteAdvisor.svg | 89 + - themes/Mono/WhiteArchbishop.svg | 112 + - themes/Mono/WhiteBishop.svg | 97 + - themes/Mono/WhiteCanon.svg | 86 + - themes/Mono/WhiteChancellor.svg | 105 + - themes/Mono/WhiteCobra.svg | 92 + - themes/Mono/WhiteCommoner.svg | 87 + - themes/Mono/WhiteCrownedBishop.svg | 92 + - themes/Mono/WhiteCrownedRook.svg | 97 + - themes/Mono/WhiteElephant.svg | 107 + - themes/Mono/WhiteGold.svg | 87 + - themes/Mono/WhiteGoldKnight.svg | 80 + - themes/Mono/WhiteGoldLance.svg | 87 + - themes/Mono/WhiteGoldPawn.svg | 82 + - themes/Mono/WhiteGoldSilver.svg | 87 + - themes/Mono/WhiteHawk.svg | 120 + - themes/Mono/WhiteKing.svg | 97 + - themes/Mono/WhiteKnight.svg | 75 + - themes/Mono/WhiteLance.svg | 75 + - themes/Mono/WhiteMarshall.svg | 106 + - themes/Mono/WhiteNightrider.svg | 72 + - themes/Mono/WhitePawn.svg | 62 + - themes/Mono/WhitePrincess.svg | 122 + - themes/Mono/WhiteQueen.svg | 134 + - themes/Mono/WhiteRook.svg | 92 + - themes/Mono/WhiteUnicorn.svg | 85 + - themes/Mono/eo_Analyzing.svg | 71 + - themes/Mono/eo_Black.svg | 64 + - themes/Mono/eo_Clear.svg | 36 + - themes/Mono/eo_Ponder.svg | 71 + - themes/Mono/eo_Thinking.svg | 185 + - themes/Mono/eo_Unknown.svg | 36 + - themes/Mono/eo_White.svg | 36 + - themes/Mono/icon_black.svg | 41 + - themes/Mono/icon_white.svg | 41 + - themes/Mono/shogi_bishop.svg | 119 + - themes/Mono/shogi_bishop_promoted.svg | 83 + - themes/Mono/shogi_gold.svg | 153 + - themes/Mono/shogi_king.svg | 125 + - themes/Mono/shogi_knight.svg | 138 + - themes/Mono/shogi_knight_promoted.svg | 65 + - themes/Mono/shogi_lance.svg | 134 + - themes/Mono/shogi_lance_promoted.svg | 65 + - themes/Mono/shogi_pawn.svg | 108 + - themes/Mono/shogi_pawn_promoted.svg | 54 + - themes/Mono/shogi_rook.svg | 137 + - themes/Mono/shogi_rook_promoted.svg | 112 + - themes/Mono/shogi_silver.svg | 163 + - themes/Mono/shogi_silver_promoted.svg | 73 + - themes/shogi/BlackAdvisor.svg | 187 + - themes/shogi/BlackBishop.svg | 143 + - themes/shogi/BlackCrownedBishop.svg | 107 + - themes/shogi/BlackCrownedRook.svg | 136 + - themes/shogi/BlackGold.svg | 177 + - themes/shogi/BlackGoldKnight.svg | 89 + - themes/shogi/BlackGoldLance.svg | 89 + - themes/shogi/BlackGoldPawn.svg | 78 + - themes/shogi/BlackGoldSilver.svg | 97 + - themes/shogi/BlackKing.svg | 149 + - themes/shogi/BlackKnight.svg | 162 + - themes/shogi/BlackLance.svg | 158 + - themes/shogi/BlackPawn.svg | 132 + - themes/shogi/BlackRook.svg | 161 + - themes/shogi/WhiteAdvisor.svg | 163 + - themes/shogi/WhiteBishop.svg | 119 + - themes/shogi/WhiteCrownedBishop.svg | 83 + - themes/shogi/WhiteCrownedRook.svg | 112 + - themes/shogi/WhiteGold.svg | 153 + - themes/shogi/WhiteGoldKnight.svg | 65 + - themes/shogi/WhiteGoldLance.svg | 65 + - themes/shogi/WhiteGoldPawn.svg | 54 + - themes/shogi/WhiteGoldSilver.svg | 73 + - themes/shogi/WhiteKing.svg | 125 + - themes/shogi/WhiteKnight.svg | 138 + - themes/shogi/WhiteLance.svg | 134 + - themes/shogi/WhitePawn.svg | 108 + - themes/shogi/WhiteRook.svg | 137 + - themes/xiangqi/.DS_Store | Bin 0 -> 6148 bytes - themes/xiangqi/BlackAdvisor.svg | 86 + - themes/xiangqi/BlackCanon.svg | 81 + - themes/xiangqi/BlackElephant.svg | 80 + - themes/xiangqi/BlackGold.svg | 80 + - themes/xiangqi/BlackKnight.svg | 81 + - themes/xiangqi/BlackPawn.svg | 83 + - themes/xiangqi/BlackRook.svg | 80 + - themes/xiangqi/WhiteAdvisor.svg | 90 + - themes/xiangqi/WhiteCanon.svg | 85 + - themes/xiangqi/WhiteElephant.svg | 85 + - themes/xiangqi/WhiteGold.svg | 85 + - themes/xiangqi/WhiteKnight.svg | 85 + - themes/xiangqi/WhitePawn.svg | 85 + - themes/xiangqi/WhiteRook.svg | 86 + - uci.c | 2 +- - usounds.c | 174 + - usystem.c | 792 ++++ - usystem.h | 75 + - winboard/config.h | 6 +- - winboard/defaults.h | 2 +- - winboard/help.c | 2 +- - winboard/help/html/24.htm | 2 +- - winboard/jaws.c | 2 +- - winboard/language.txt | 45 +- - winboard/language/deutsch.lng | 2 +- - winboard/language/italiano.lng | 2 +- - winboard/language/nederlands.lng | 46 +- - winboard/language/romanian.lng | 2 +- - winboard/language/russian.lng | 2 +- - winboard/language/spanish.lng | 2 +- - winboard/language/vietnamese.lng | 2 +- - winboard/resource.h | 7 +- - winboard/wchat.c | 2 +- - winboard/wclipbrd.c | 2 +- - winboard/wclipbrd.h | 2 +- - winboard/wedittags.c | 2 +- - winboard/wengineoutput.c | 4 +- - winboard/wevalgraph.c | 4 +- - winboard/wgamelist.c | 23 +- - winboard/winboard.c | 259 +- - winboard/winboard.h | 6 +- - winboard/winboard.rc | 28 +- - winboard/wlayout.c | 12 +- - winboard/woptions.c | 46 +- - winboard/woptions.h | 2 +- - winboard/wsettings.c | 250 +- - winboard/wsockerr.c | 2 +- - winboard/wsockerr.h | 2 +- - xaw/.dirstamp | 0 - xaw/xboard.c | 2600 +++++++++++++ - xaw/xboard.h | 176 + - xaw/xengineoutput.c | 285 ++ - xaw/xgamelist.c | 117 + - xaw/xgamelist.h | 31 + - xaw/xhistory.c | 111 + - xaw/xhistory.h | 30 + - xaw/xoptions.c | 1365 +++++++ - xboard-config.desktop | 52 + - xboard.c | 8845 ------------------------------------------- - xboard.conf.in | 19 +- - xboard.h | 177 - - xboard.texi | 289 +- - xboard.xml | 6 + - xboard2.h | 9 + - xedittags.c | 128 - - xedittags.h | 31 - - xengineoutput.c | 617 --- - xevalgraph.c | 443 --- - xevalgraph.h | 29 - - xgamelist.c | 930 ----- - xgamelist.h | 35 - - xhistory.c | 168 - - xhistory.h | 32 - - xoptions.c | 1912 ---------- - zic2xpm.c | 2 +- - zic2xpm.man | 2 +- - zippy.c | 12 +- - zippy.h | 2 +- - 1574 files changed, 63046 insertions(+), 113777 deletions(-) - delete mode 100644 bitmaps/README.bitmaps - delete mode 100644 bitmaps/a33o.bm - delete mode 100644 bitmaps/a33s.bm - delete mode 100644 bitmaps/a37o.bm - delete mode 100644 bitmaps/a37s.bm - delete mode 100644 bitmaps/a40o.bm - delete mode 100644 bitmaps/a40s.bm - delete mode 100644 bitmaps/a45o.bm - delete mode 100644 bitmaps/a45s.bm - delete mode 100644 bitmaps/a49o.bm - delete mode 100644 bitmaps/a49s.bm - delete mode 100644 bitmaps/a54o.bm - delete mode 100644 bitmaps/a54s.bm - delete mode 100644 bitmaps/a58o.bm - delete mode 100644 bitmaps/a58s.bm - delete mode 100644 bitmaps/a64o.bm - delete mode 100644 bitmaps/a64s.bm - delete mode 100644 bitmaps/a72o.bm - delete mode 100644 bitmaps/a72s.bm - delete mode 100644 bitmaps/as45o.bm - delete mode 100644 bitmaps/as45s.bm - delete mode 100644 bitmaps/b108o.bm - delete mode 100644 bitmaps/b108s.bm - delete mode 100644 bitmaps/b116o.bm - delete mode 100644 bitmaps/b116s.bm - delete mode 100644 bitmaps/b129o.bm - delete mode 100644 bitmaps/b129s.bm - delete mode 100644 bitmaps/b21o.bm - delete mode 100644 bitmaps/b21s.bm - delete mode 100644 bitmaps/b25o.bm - delete mode 100644 bitmaps/b25s.bm - delete mode 100644 bitmaps/b29o.bm - delete mode 100644 bitmaps/b29s.bm - delete mode 100644 bitmaps/b33o.bm - delete mode 100644 bitmaps/b33s.bm - delete mode 100644 bitmaps/b37o.bm - delete mode 100644 bitmaps/b37s.bm - delete mode 100644 bitmaps/b40o.bm - delete mode 100644 bitmaps/b40s.bm - delete mode 100644 bitmaps/b45o.bm - delete mode 100644 bitmaps/b45s.bm - delete mode 100644 bitmaps/b49o.bm - delete mode 100644 bitmaps/b49s.bm - delete mode 100644 bitmaps/b54o.bm - delete mode 100644 bitmaps/b54s.bm - delete mode 100644 bitmaps/b58o.bm - delete mode 100644 bitmaps/b58s.bm - delete mode 100644 bitmaps/b64o.bm - delete mode 100644 bitmaps/b64s.bm - delete mode 100644 bitmaps/b72o.bm - delete mode 100644 bitmaps/b72s.bm - delete mode 100644 bitmaps/b80o.bm - delete mode 100644 bitmaps/b80s.bm - delete mode 100644 bitmaps/b87o.bm - delete mode 100644 bitmaps/b87s.bm - delete mode 100644 bitmaps/b95o.bm - delete mode 100644 bitmaps/b95s.bm - delete mode 100644 bitmaps/bitmaps.h - delete mode 100644 bitmaps/c33o.bm - delete mode 100644 bitmaps/c33s.bm - delete mode 100644 bitmaps/c37o.bm - delete mode 100644 bitmaps/c37s.bm - delete mode 100644 bitmaps/c40o.bm - delete mode 100644 bitmaps/c40s.bm - delete mode 100644 bitmaps/c45o.bm - delete mode 100644 bitmaps/c45s.bm - delete mode 100644 bitmaps/c49o.bm - delete mode 100644 bitmaps/c49s.bm - delete mode 100644 bitmaps/c54o.bm - delete mode 100644 bitmaps/c54s.bm - delete mode 100644 bitmaps/c58o.bm - delete mode 100644 bitmaps/c58s.bm - delete mode 100644 bitmaps/c64o.bm - delete mode 100644 bitmaps/c64s.bm - delete mode 100644 bitmaps/c72o.bm - delete mode 100644 bitmaps/c72s.bm - delete mode 100644 bitmaps/d33o.bm - delete mode 100644 bitmaps/d33s.bm - delete mode 100644 bitmaps/d37o.bm - delete mode 100644 bitmaps/d37s.bm - delete mode 100644 bitmaps/d40o.bm - delete mode 100644 bitmaps/d40s.bm - delete mode 100644 bitmaps/d45o.bm - delete mode 100644 bitmaps/d45s.bm - delete mode 100644 bitmaps/d49o.bm - delete mode 100644 bitmaps/d49s.bm - delete mode 100644 bitmaps/d54o.bm - delete mode 100644 bitmaps/d54s.bm - delete mode 100644 bitmaps/d58o.bm - delete mode 100644 bitmaps/d58s.bm - delete mode 100644 bitmaps/d64o.bm - delete mode 100644 bitmaps/d64s.bm - delete mode 100644 bitmaps/d72o.bm - delete mode 100644 bitmaps/d72s.bm - delete mode 100644 bitmaps/dopkbm.sh - delete mode 100644 bitmaps/dopkbm1.sh - delete mode 100644 bitmaps/e33o.bm - delete mode 100644 bitmaps/e33s.bm - delete mode 100644 bitmaps/e49o.bm - delete mode 100644 bitmaps/e49s.bm - delete mode 100644 bitmaps/e72o.bm - delete mode 100644 bitmaps/e72s.bm - delete mode 100644 bitmaps/f33o.bm - delete mode 100644 bitmaps/f33s.bm - delete mode 100644 bitmaps/f49o.bm - delete mode 100644 bitmaps/f49s.bm - delete mode 100644 bitmaps/f72o.bm - delete mode 100644 bitmaps/f72s.bm - delete mode 100644 bitmaps/g33o.bm - delete mode 100644 bitmaps/g33s.bm - delete mode 100644 bitmaps/g49o.bm - delete mode 100644 bitmaps/g49s.bm - delete mode 100644 bitmaps/g72o.bm - delete mode 100644 bitmaps/g72s.bm - delete mode 100644 bitmaps/h33o.bm - delete mode 100644 bitmaps/h33s.bm - delete mode 100644 bitmaps/h49o.bm - delete mode 100644 bitmaps/h49s.bm - delete mode 100644 bitmaps/h72o.bm - delete mode 100644 bitmaps/h72s.bm - delete mode 100644 bitmaps/i33o.bm - delete mode 100644 bitmaps/i33s.bm - delete mode 100644 bitmaps/i49o.bm - delete mode 100644 bitmaps/i49s.bm - delete mode 100644 bitmaps/i72o.bm - delete mode 100644 bitmaps/i72s.bm - delete mode 100644 bitmaps/icon_b.bm - delete mode 100644 bitmaps/icon_outline.bm - delete mode 100644 bitmaps/j33o.bm - delete mode 100644 bitmaps/j33s.bm - delete mode 100644 bitmaps/j49o.bm - delete mode 100644 bitmaps/j49s.bm - delete mode 100644 bitmaps/j72o.bm - delete mode 100644 bitmaps/j72s.bm - delete mode 100644 bitmaps/k108o.bm - delete mode 100644 bitmaps/k108s.bm - delete mode 100644 bitmaps/k116o.bm - delete mode 100644 bitmaps/k116s.bm - delete mode 100644 bitmaps/k129o.bm - delete mode 100644 bitmaps/k129s.bm - delete mode 100644 bitmaps/k21o.bm - delete mode 100644 bitmaps/k21s.bm - delete mode 100644 bitmaps/k25o.bm - delete mode 100644 bitmaps/k25s.bm - delete mode 100644 bitmaps/k29o.bm - delete mode 100644 bitmaps/k29s.bm - delete mode 100644 bitmaps/k33o.bm - delete mode 100644 bitmaps/k33s.bm - delete mode 100644 bitmaps/k37o.bm - delete mode 100644 bitmaps/k37s.bm - delete mode 100644 bitmaps/k40o.bm - delete mode 100644 bitmaps/k40s.bm - delete mode 100644 bitmaps/k45o.bm - delete mode 100644 bitmaps/k45s.bm - delete mode 100644 bitmaps/k49o.bm - delete mode 100644 bitmaps/k49s.bm - delete mode 100644 bitmaps/k54o.bm - delete mode 100644 bitmaps/k54s.bm - delete mode 100644 bitmaps/k58o.bm - delete mode 100644 bitmaps/k58s.bm - delete mode 100644 bitmaps/k64o.bm - delete mode 100644 bitmaps/k64s.bm - delete mode 100644 bitmaps/k72o.bm - delete mode 100644 bitmaps/k72s.bm - delete mode 100644 bitmaps/k80o.bm - delete mode 100644 bitmaps/k80s.bm - delete mode 100644 bitmaps/k87o.bm - delete mode 100644 bitmaps/k87s.bm - delete mode 100644 bitmaps/k95o.bm - delete mode 100644 bitmaps/k95s.bm - delete mode 100644 bitmaps/l33o.bm - delete mode 100644 bitmaps/l33s.bm - delete mode 100644 bitmaps/l37o.bm - delete mode 100644 bitmaps/l37s.bm - delete mode 100644 bitmaps/l40o.bm - delete mode 100644 bitmaps/l40s.bm - delete mode 100644 bitmaps/l45o.bm - delete mode 100644 bitmaps/l45s.bm - delete mode 100644 bitmaps/l49o.bm - delete mode 100644 bitmaps/l49s.bm - delete mode 100644 bitmaps/l54o.bm - delete mode 100644 bitmaps/l54s.bm - delete mode 100644 bitmaps/l58o.bm - delete mode 100644 bitmaps/l58s.bm - delete mode 100644 bitmaps/l64o.bm - delete mode 100644 bitmaps/l64s.bm - delete mode 100644 bitmaps/l72o.bm - delete mode 100644 bitmaps/l72s.bm - delete mode 100644 bitmaps/m33o.bm - delete mode 100644 bitmaps/m33s.bm - delete mode 100644 bitmaps/m49o.bm - delete mode 100644 bitmaps/m49s.bm - delete mode 100644 bitmaps/m72o.bm - delete mode 100644 bitmaps/m72s.bm - delete mode 100644 bitmaps/n108o.bm - delete mode 100644 bitmaps/n108s.bm - delete mode 100644 bitmaps/n116o.bm - delete mode 100644 bitmaps/n116s.bm - delete mode 100644 bitmaps/n129o.bm - delete mode 100644 bitmaps/n129s.bm - delete mode 100644 bitmaps/n21o.bm - delete mode 100644 bitmaps/n21s.bm - delete mode 100644 bitmaps/n25o.bm - delete mode 100644 bitmaps/n25s.bm - delete mode 100644 bitmaps/n29o.bm - delete mode 100644 bitmaps/n29s.bm - delete mode 100644 bitmaps/n33o.bm - delete mode 100644 bitmaps/n33s.bm - delete mode 100644 bitmaps/n37o.bm - delete mode 100644 bitmaps/n37s.bm - delete mode 100644 bitmaps/n40o.bm - delete mode 100644 bitmaps/n40s.bm - delete mode 100644 bitmaps/n45o.bm - delete mode 100644 bitmaps/n45s.bm - delete mode 100644 bitmaps/n49o.bm - delete mode 100644 bitmaps/n49s.bm - delete mode 100644 bitmaps/n54o.bm - delete mode 100644 bitmaps/n54s.bm - delete mode 100644 bitmaps/n58o.bm - delete mode 100644 bitmaps/n58s.bm - delete mode 100644 bitmaps/n64o.bm - delete mode 100644 bitmaps/n64s.bm - delete mode 100644 bitmaps/n72o.bm - delete mode 100644 bitmaps/n72s.bm - delete mode 100644 bitmaps/n80o.bm - delete mode 100644 bitmaps/n80s.bm - delete mode 100644 bitmaps/n87o.bm - delete mode 100644 bitmaps/n87s.bm - delete mode 100644 bitmaps/n95o.bm - delete mode 100644 bitmaps/n95s.bm - delete mode 100644 bitmaps/o33o.bm - delete mode 100644 bitmaps/o33s.bm - delete mode 100644 bitmaps/o49o.bm - delete mode 100644 bitmaps/o49s.bm - delete mode 100644 bitmaps/o72o.bm - delete mode 100644 bitmaps/o72s.bm - delete mode 100644 bitmaps/p108o.bm - delete mode 100644 bitmaps/p108s.bm - delete mode 100644 bitmaps/p116o.bm - delete mode 100644 bitmaps/p116s.bm - delete mode 100644 bitmaps/p129o.bm - delete mode 100644 bitmaps/p129s.bm - delete mode 100644 bitmaps/p21o.bm - delete mode 100644 bitmaps/p21s.bm - delete mode 100644 bitmaps/p25o.bm - delete mode 100644 bitmaps/p25s.bm - delete mode 100644 bitmaps/p29o.bm - delete mode 100644 bitmaps/p29s.bm - delete mode 100644 bitmaps/p33o.bm - delete mode 100644 bitmaps/p33s.bm - delete mode 100644 bitmaps/p37o.bm - delete mode 100644 bitmaps/p37s.bm - delete mode 100644 bitmaps/p40o.bm - delete mode 100644 bitmaps/p40s.bm - delete mode 100644 bitmaps/p45o.bm - delete mode 100644 bitmaps/p45s.bm - delete mode 100644 bitmaps/p49o.bm - delete mode 100644 bitmaps/p49s.bm - delete mode 100644 bitmaps/p54o.bm - delete mode 100644 bitmaps/p54s.bm - delete mode 100644 bitmaps/p58o.bm - delete mode 100644 bitmaps/p58s.bm - delete mode 100644 bitmaps/p64o.bm - delete mode 100644 bitmaps/p64s.bm - delete mode 100644 bitmaps/p72o.bm - delete mode 100644 bitmaps/p72s.bm - delete mode 100644 bitmaps/p80o.bm - delete mode 100644 bitmaps/p80s.bm - delete mode 100644 bitmaps/p87o.bm - delete mode 100644 bitmaps/p87s.bm - delete mode 100644 bitmaps/p95o.bm - delete mode 100644 bitmaps/p95s.bm - delete mode 100644 bitmaps/q108o.bm - delete mode 100644 bitmaps/q108s.bm - delete mode 100644 bitmaps/q116o.bm - delete mode 100644 bitmaps/q116s.bm - delete mode 100644 bitmaps/q129o.bm - delete mode 100644 bitmaps/q129s.bm - delete mode 100644 bitmaps/q21o.bm - delete mode 100644 bitmaps/q21s.bm - delete mode 100644 bitmaps/q25o.bm - delete mode 100644 bitmaps/q25s.bm - delete mode 100644 bitmaps/q29o.bm - delete mode 100644 bitmaps/q29s.bm - delete mode 100644 bitmaps/q33o.bm - delete mode 100644 bitmaps/q33s.bm - delete mode 100644 bitmaps/q37o.bm - delete mode 100644 bitmaps/q37s.bm - delete mode 100644 bitmaps/q40o.bm - delete mode 100644 bitmaps/q40s.bm - delete mode 100644 bitmaps/q45o.bm - delete mode 100644 bitmaps/q45s.bm - delete mode 100644 bitmaps/q49o.bm - delete mode 100644 bitmaps/q49s.bm - delete mode 100644 bitmaps/q54o.bm - delete mode 100644 bitmaps/q54s.bm - delete mode 100644 bitmaps/q58o.bm - delete mode 100644 bitmaps/q58s.bm - delete mode 100644 bitmaps/q64o.bm - delete mode 100644 bitmaps/q64s.bm - delete mode 100644 bitmaps/q72o.bm - delete mode 100644 bitmaps/q72s.bm - delete mode 100644 bitmaps/q80o.bm - delete mode 100644 bitmaps/q80s.bm - delete mode 100644 bitmaps/q87o.bm - delete mode 100644 bitmaps/q87s.bm - delete mode 100644 bitmaps/q95o.bm - delete mode 100644 bitmaps/q95s.bm - delete mode 100644 bitmaps/r108o.bm - delete mode 100644 bitmaps/r108s.bm - delete mode 100644 bitmaps/r116o.bm - delete mode 100644 bitmaps/r116s.bm - delete mode 100644 bitmaps/r129o.bm - delete mode 100644 bitmaps/r129s.bm - delete mode 100644 bitmaps/r21o.bm - delete mode 100644 bitmaps/r21s.bm - delete mode 100644 bitmaps/r25o.bm - delete mode 100644 bitmaps/r25s.bm - delete mode 100644 bitmaps/r29o.bm - delete mode 100644 bitmaps/r29s.bm - delete mode 100644 bitmaps/r33o.bm - delete mode 100644 bitmaps/r33s.bm - delete mode 100644 bitmaps/r37o.bm - delete mode 100644 bitmaps/r37s.bm - delete mode 100644 bitmaps/r40o.bm - delete mode 100644 bitmaps/r40s.bm - delete mode 100644 bitmaps/r45o.bm - delete mode 100644 bitmaps/r45s.bm - delete mode 100644 bitmaps/r49o.bm - delete mode 100644 bitmaps/r49s.bm - delete mode 100644 bitmaps/r54o.bm - delete mode 100644 bitmaps/r54s.bm - delete mode 100644 bitmaps/r58o.bm - delete mode 100644 bitmaps/r58s.bm - delete mode 100644 bitmaps/r64o.bm - delete mode 100644 bitmaps/r64s.bm - delete mode 100644 bitmaps/r72o.bm - delete mode 100644 bitmaps/r72s.bm - delete mode 100644 bitmaps/r80o.bm - delete mode 100644 bitmaps/r80s.bm - delete mode 100644 bitmaps/r87o.bm - delete mode 100644 bitmaps/r87s.bm - delete mode 100644 bitmaps/r95o.bm - delete mode 100644 bitmaps/r95s.bm - delete mode 100644 bitmaps/s49o.bm - delete mode 100644 bitmaps/s49s.bm - delete mode 100644 bitmaps/s72o.bm - delete mode 100644 bitmaps/s72s.bm - delete mode 100644 bitmaps/test.c - delete mode 100644 bitmaps/u49o.bm - delete mode 100644 bitmaps/u49s.bm - delete mode 100644 bitmaps/u72o.bm - delete mode 100644 bitmaps/u72s.bm - delete mode 100644 bitmaps/v33o.bm - delete mode 100644 bitmaps/v33s.bm - delete mode 100644 bitmaps/v49o.bm - delete mode 100644 bitmaps/v49s.bm - delete mode 100644 bitmaps/v72o.bm - delete mode 100644 bitmaps/v72s.bm - delete mode 100644 bitmaps/w33o.bm - delete mode 100644 bitmaps/w33s.bm - delete mode 100644 bitmaps/w49o.bm - delete mode 100644 bitmaps/w49s.bm - delete mode 100644 bitmaps/w72o.bm - delete mode 100644 bitmaps/w72s.bm - delete mode 100644 bitmaps/wl49o.bm - delete mode 100644 bitmaps/wl49s.bm - delete mode 100644 bitmaps/wl72o.bm - delete mode 100644 bitmaps/wl72s.bm - delete mode 100644 bitmaps/wn49o.bm - delete mode 100644 bitmaps/wn49s.bm - delete mode 100644 bitmaps/wn72o.bm - delete mode 100644 bitmaps/wn72s.bm - delete mode 100644 bitmaps/wp49o.bm - delete mode 100644 bitmaps/wp49s.bm - delete mode 100644 bitmaps/wp72o.bm - delete mode 100644 bitmaps/wp72s.bm - delete mode 100644 bitmaps/ws49o.bm - delete mode 100644 bitmaps/ws49s.bm - delete mode 100644 bitmaps/ws72o.bm - delete mode 100644 bitmaps/ws72s.bm - create mode 100644 board.c - create mode 100644 board.h - create mode 100644 dialogs.c - create mode 100644 dialogs.h - create mode 100644 doc-maint/coding-standards.org - create mode 100755 doc-maint/gendocs.sh - create mode 100644 doc-maint/make-xboard-release - create mode 100644 doc-maint/release.org - create mode 100644 doc-maint/web-pages.org - create mode 100644 draw.c - create mode 100644 draw.h - delete mode 100644 filebrowser/README - delete mode 100644 filebrowser/dir.c - delete mode 100644 filebrowser/draw.c - delete mode 100644 filebrowser/path.c - delete mode 100644 filebrowser/selfile.c - delete mode 100644 filebrowser/selfile.h - delete mode 100644 filebrowser/xstat.h - create mode 100644 gtk/.dirstamp - create mode 100644 gtk/xboard.c - create mode 100644 gtk/xboard.h - create mode 100644 gtk/xengineoutput.c - create mode 100644 gtk/xoptions.c - create mode 100644 gtk/xtimer.c - create mode 100644 menus.c - create mode 100644 menus.h - create mode 100644 nengineoutput.c - create mode 100644 nevalgraph.c - create mode 100644 ngamelist.c - create mode 100644 nhistory.c - delete mode 100644 pixmaps/README.pixmaps - delete mode 100644 pixmaps/add33.xpm - delete mode 100644 pixmaps/add37.xpm - delete mode 100644 pixmaps/add40.xpm - delete mode 100644 pixmaps/add45.xpm - delete mode 100644 pixmaps/add49.xpm - delete mode 100644 pixmaps/add54.xpm - delete mode 100644 pixmaps/add58.xpm - delete mode 100644 pixmaps/add64.xpm - delete mode 100644 pixmaps/add72.xpm - delete mode 100644 pixmaps/adl33.xpm - delete mode 100644 pixmaps/adl37.xpm - delete mode 100644 pixmaps/adl40.xpm - delete mode 100644 pixmaps/adl45.xpm - delete mode 100644 pixmaps/adl49.xpm - delete mode 100644 pixmaps/adl54.xpm - delete mode 100644 pixmaps/adl58.xpm - delete mode 100644 pixmaps/adl64.xpm - delete mode 100644 pixmaps/adl72.xpm - delete mode 100644 pixmaps/ald33.xpm - delete mode 100644 pixmaps/ald37.xpm - delete mode 100644 pixmaps/ald40.xpm - delete mode 100644 pixmaps/ald45.xpm - delete mode 100644 pixmaps/ald49.xpm - delete mode 100644 pixmaps/ald54.xpm - delete mode 100644 pixmaps/ald58.xpm - delete mode 100644 pixmaps/ald64.xpm - delete mode 100644 pixmaps/ald72.xpm - delete mode 100644 pixmaps/all33.xpm - delete mode 100644 pixmaps/all37.xpm - delete mode 100644 pixmaps/all40.xpm - delete mode 100644 pixmaps/all45.xpm - delete mode 100644 pixmaps/all49.xpm - delete mode 100644 pixmaps/all54.xpm - delete mode 100644 pixmaps/all58.xpm - delete mode 100644 pixmaps/all64.xpm - delete mode 100644 pixmaps/all72.xpm - delete mode 100644 pixmaps/asdd33.xpm - delete mode 100644 pixmaps/asdd49.xpm - delete mode 100644 pixmaps/asdd72.xpm - delete mode 100644 pixmaps/asdl33.xpm - delete mode 100644 pixmaps/asdl49.xpm - delete mode 100644 pixmaps/asdl72.xpm - delete mode 100644 pixmaps/asld33.xpm - delete mode 100644 pixmaps/asld49.xpm - delete mode 100644 pixmaps/asld72.xpm - delete mode 100644 pixmaps/asll33.xpm - delete mode 100644 pixmaps/asll49.xpm - delete mode 100644 pixmaps/asll72.xpm - delete mode 100644 pixmaps/bdd108.xpm - delete mode 100644 pixmaps/bdd116.xpm - delete mode 100644 pixmaps/bdd129.xpm - delete mode 100644 pixmaps/bdd21.xpm - delete mode 100644 pixmaps/bdd25.xpm - delete mode 100644 pixmaps/bdd29.xpm - delete mode 100644 pixmaps/bdd33.xpm - delete mode 100644 pixmaps/bdd37.xpm - delete mode 100644 pixmaps/bdd40.xpm - delete mode 100644 pixmaps/bdd45.xpm - delete mode 100644 pixmaps/bdd49.xpm - delete mode 100644 pixmaps/bdd54.xpm - delete mode 100644 pixmaps/bdd58.xpm - delete mode 100644 pixmaps/bdd64.xpm - delete mode 100644 pixmaps/bdd72.xpm - delete mode 100644 pixmaps/bdd80.xpm - delete mode 100644 pixmaps/bdd87.xpm - delete mode 100644 pixmaps/bdd95.xpm - delete mode 100644 pixmaps/bdl108.xpm - delete mode 100644 pixmaps/bdl116.xpm - delete mode 100644 pixmaps/bdl129.xpm - delete mode 100644 pixmaps/bdl21.xpm - delete mode 100644 pixmaps/bdl25.xpm - delete mode 100644 pixmaps/bdl29.xpm - delete mode 100644 pixmaps/bdl33.xpm - delete mode 100644 pixmaps/bdl37.xpm - delete mode 100644 pixmaps/bdl40.xpm - delete mode 100644 pixmaps/bdl45.xpm - delete mode 100644 pixmaps/bdl49.xpm - delete mode 100644 pixmaps/bdl54.xpm - delete mode 100644 pixmaps/bdl58.xpm - delete mode 100644 pixmaps/bdl64.xpm - delete mode 100644 pixmaps/bdl72.xpm - delete mode 100644 pixmaps/bdl80.xpm - delete mode 100644 pixmaps/bdl87.xpm - delete mode 100644 pixmaps/bdl95.xpm - delete mode 100644 pixmaps/bld108.xpm - delete mode 100644 pixmaps/bld116.xpm - delete mode 100644 pixmaps/bld129.xpm - delete mode 100644 pixmaps/bld21.xpm - delete mode 100644 pixmaps/bld25.xpm - delete mode 100644 pixmaps/bld29.xpm - delete mode 100644 pixmaps/bld33.xpm - delete mode 100644 pixmaps/bld37.xpm - delete mode 100644 pixmaps/bld40.xpm - delete mode 100644 pixmaps/bld45.xpm - delete mode 100644 pixmaps/bld49.xpm - delete mode 100644 pixmaps/bld54.xpm - delete mode 100644 pixmaps/bld58.xpm - delete mode 100644 pixmaps/bld64.xpm - delete mode 100644 pixmaps/bld72.xpm - delete mode 100644 pixmaps/bld80.xpm - delete mode 100644 pixmaps/bld87.xpm - delete mode 100644 pixmaps/bld95.xpm - delete mode 100644 pixmaps/bll108.xpm - delete mode 100644 pixmaps/bll116.xpm - delete mode 100644 pixmaps/bll129.xpm - delete mode 100644 pixmaps/bll21.xpm - delete mode 100644 pixmaps/bll25.xpm - delete mode 100644 pixmaps/bll29.xpm - delete mode 100644 pixmaps/bll33.xpm - delete mode 100644 pixmaps/bll37.xpm - delete mode 100644 pixmaps/bll40.xpm - delete mode 100644 pixmaps/bll45.xpm - delete mode 100644 pixmaps/bll49.xpm - delete mode 100644 pixmaps/bll54.xpm - delete mode 100644 pixmaps/bll58.xpm - delete mode 100644 pixmaps/bll64.xpm - delete mode 100644 pixmaps/bll72.xpm - delete mode 100644 pixmaps/bll80.xpm - delete mode 100644 pixmaps/bll87.xpm - delete mode 100644 pixmaps/bll95.xpm - delete mode 100644 pixmaps/cdd33.xpm - delete mode 100644 pixmaps/cdd37.xpm - delete mode 100644 pixmaps/cdd40.xpm - delete mode 100644 pixmaps/cdd45.xpm - delete mode 100644 pixmaps/cdd49.xpm - delete mode 100644 pixmaps/cdd54.xpm - delete mode 100644 pixmaps/cdd58.xpm - delete mode 100644 pixmaps/cdd64.xpm - delete mode 100644 pixmaps/cdd72.xpm - delete mode 100644 pixmaps/cdl33.xpm - delete mode 100644 pixmaps/cdl37.xpm - delete mode 100644 pixmaps/cdl40.xpm - delete mode 100644 pixmaps/cdl45.xpm - delete mode 100644 pixmaps/cdl49.xpm - delete mode 100644 pixmaps/cdl54.xpm - delete mode 100644 pixmaps/cdl58.xpm - delete mode 100644 pixmaps/cdl64.xpm - delete mode 100644 pixmaps/cdl72.xpm - delete mode 100644 pixmaps/cld33.xpm - delete mode 100644 pixmaps/cld37.xpm - delete mode 100644 pixmaps/cld40.xpm - delete mode 100644 pixmaps/cld45.xpm - delete mode 100644 pixmaps/cld49.xpm - delete mode 100644 pixmaps/cld54.xpm - delete mode 100644 pixmaps/cld58.xpm - delete mode 100644 pixmaps/cld64.xpm - delete mode 100644 pixmaps/cld72.xpm - delete mode 100644 pixmaps/cll33.xpm - delete mode 100644 pixmaps/cll37.xpm - delete mode 100644 pixmaps/cll40.xpm - delete mode 100644 pixmaps/cll45.xpm - delete mode 100644 pixmaps/cll49.xpm - delete mode 100644 pixmaps/cll54.xpm - delete mode 100644 pixmaps/cll58.xpm - delete mode 100644 pixmaps/cll64.xpm - delete mode 100644 pixmaps/cll72.xpm - delete mode 100644 pixmaps/convbm - delete mode 100644 pixmaps/convbm.sed - delete mode 100644 pixmaps/convbm2.sed - delete mode 100644 pixmaps/convert.c - delete mode 100644 pixmaps/cvdd33.xpm - delete mode 100644 pixmaps/cvdd37.xpm - delete mode 100644 pixmaps/cvdd40.xpm - delete mode 100644 pixmaps/cvdd45.xpm - delete mode 100644 pixmaps/cvdd49.xpm - delete mode 100644 pixmaps/cvdd54.xpm - delete mode 100644 pixmaps/cvdd58.xpm - delete mode 100644 pixmaps/cvdd64.xpm - delete mode 100644 pixmaps/cvdd72.xpm - delete mode 100644 pixmaps/cvdl33.xpm - delete mode 100644 pixmaps/cvdl37.xpm - delete mode 100644 pixmaps/cvdl40.xpm - delete mode 100644 pixmaps/cvdl45.xpm - delete mode 100644 pixmaps/cvdl49.xpm - delete mode 100644 pixmaps/cvdl54.xpm - delete mode 100644 pixmaps/cvdl58.xpm - delete mode 100644 pixmaps/cvdl64.xpm - delete mode 100644 pixmaps/cvdl72.xpm - delete mode 100644 pixmaps/cvld33.xpm - delete mode 100644 pixmaps/cvld37.xpm - delete mode 100644 pixmaps/cvld40.xpm - delete mode 100644 pixmaps/cvld45.xpm - delete mode 100644 pixmaps/cvld49.xpm - delete mode 100644 pixmaps/cvld54.xpm - delete mode 100644 pixmaps/cvld58.xpm - delete mode 100644 pixmaps/cvld64.xpm - delete mode 100644 pixmaps/cvld72.xpm - delete mode 100644 pixmaps/cvll33.xpm - delete mode 100644 pixmaps/cvll37.xpm - delete mode 100644 pixmaps/cvll40.xpm - delete mode 100644 pixmaps/cvll45.xpm - delete mode 100644 pixmaps/cvll49.xpm - delete mode 100644 pixmaps/cvll54.xpm - delete mode 100644 pixmaps/cvll58.xpm - delete mode 100644 pixmaps/cvll64.xpm - delete mode 100644 pixmaps/cvll72.xpm - delete mode 100644 pixmaps/dkdd33.xpm - delete mode 100644 pixmaps/dkdd49.xpm - delete mode 100644 pixmaps/dkdd72.xpm - delete mode 100644 pixmaps/dkdl33.xpm - delete mode 100644 pixmaps/dkdl49.xpm - delete mode 100644 pixmaps/dkdl72.xpm - delete mode 100644 pixmaps/dkld33.xpm - delete mode 100644 pixmaps/dkld49.xpm - delete mode 100644 pixmaps/dkld72.xpm - delete mode 100644 pixmaps/dkll33.xpm - delete mode 100644 pixmaps/dkll49.xpm - delete mode 100644 pixmaps/dkll72.xpm - delete mode 100644 pixmaps/edd33.xpm - delete mode 100644 pixmaps/edd49.xpm - delete mode 100644 pixmaps/edd72.xpm - delete mode 100644 pixmaps/edl33.xpm - delete mode 100644 pixmaps/edl49.xpm - delete mode 100644 pixmaps/edl72.xpm - delete mode 100644 pixmaps/eld33.xpm - delete mode 100644 pixmaps/eld49.xpm - delete mode 100644 pixmaps/eld72.xpm - delete mode 100644 pixmaps/ell33.xpm - delete mode 100644 pixmaps/ell49.xpm - delete mode 100644 pixmaps/ell72.xpm - delete mode 100644 pixmaps/fdd33.xpm - delete mode 100644 pixmaps/fdd49.xpm - delete mode 100644 pixmaps/fdd72.xpm - delete mode 100644 pixmaps/fdl33.xpm - delete mode 100644 pixmaps/fdl49.xpm - delete mode 100644 pixmaps/fdl72.xpm - delete mode 100644 pixmaps/fld33.xpm - delete mode 100644 pixmaps/fld49.xpm - delete mode 100644 pixmaps/fld72.xpm - delete mode 100644 pixmaps/fll33.xpm - delete mode 100644 pixmaps/fll49.xpm - delete mode 100644 pixmaps/fll72.xpm - delete mode 100644 pixmaps/gdd33.xpm - delete mode 100644 pixmaps/gdd49.xpm - delete mode 100644 pixmaps/gdd72.xpm - delete mode 100644 pixmaps/gdl33.xpm - delete mode 100644 pixmaps/gdl49.xpm - delete mode 100644 pixmaps/gdl72.xpm - delete mode 100644 pixmaps/gld33.xpm - delete mode 100644 pixmaps/gld49.xpm - delete mode 100644 pixmaps/gld72.xpm - delete mode 100644 pixmaps/gll33.xpm - delete mode 100644 pixmaps/gll49.xpm - delete mode 100644 pixmaps/gll72.xpm - delete mode 100644 pixmaps/hdd33.xpm - delete mode 100644 pixmaps/hdd49.xpm - delete mode 100644 pixmaps/hdd72.xpm - delete mode 100644 pixmaps/hdl33.xpm - delete mode 100644 pixmaps/hdl49.xpm - delete mode 100644 pixmaps/hdl72.xpm - delete mode 100644 pixmaps/hld33.xpm - delete mode 100644 pixmaps/hld49.xpm - delete mode 100644 pixmaps/hld72.xpm - delete mode 100644 pixmaps/hll33.xpm - delete mode 100644 pixmaps/hll49.xpm - delete mode 100644 pixmaps/hll72.xpm - create mode 100644 pixmaps/ini32.xpm - create mode 100644 pixmaps/ini48.xpm - delete mode 100644 pixmaps/kdd108.xpm - delete mode 100644 pixmaps/kdd116.xpm - delete mode 100644 pixmaps/kdd129.xpm - delete mode 100644 pixmaps/kdd21.xpm - delete mode 100644 pixmaps/kdd25.xpm - delete mode 100644 pixmaps/kdd29.xpm - delete mode 100644 pixmaps/kdd33.xpm - delete mode 100644 pixmaps/kdd37.xpm - delete mode 100644 pixmaps/kdd40.xpm - delete mode 100644 pixmaps/kdd45.xpm - delete mode 100644 pixmaps/kdd49.xpm - delete mode 100644 pixmaps/kdd54.xpm - delete mode 100644 pixmaps/kdd58.xpm - delete mode 100644 pixmaps/kdd64.xpm - delete mode 100644 pixmaps/kdd72.xpm - delete mode 100644 pixmaps/kdd80.xpm - delete mode 100644 pixmaps/kdd87.xpm - delete mode 100644 pixmaps/kdd95.xpm - delete mode 100644 pixmaps/kdl108.xpm - delete mode 100644 pixmaps/kdl116.xpm - delete mode 100644 pixmaps/kdl129.xpm - delete mode 100644 pixmaps/kdl21.xpm - delete mode 100644 pixmaps/kdl25.xpm - delete mode 100644 pixmaps/kdl29.xpm - delete mode 100644 pixmaps/kdl33.xpm - delete mode 100644 pixmaps/kdl37.xpm - delete mode 100644 pixmaps/kdl40.xpm - delete mode 100644 pixmaps/kdl45.xpm - delete mode 100644 pixmaps/kdl49.xpm - delete mode 100644 pixmaps/kdl54.xpm - delete mode 100644 pixmaps/kdl58.xpm - delete mode 100644 pixmaps/kdl64.xpm - delete mode 100644 pixmaps/kdl72.xpm - delete mode 100644 pixmaps/kdl80.xpm - delete mode 100644 pixmaps/kdl87.xpm - delete mode 100644 pixmaps/kdl95.xpm - delete mode 100644 pixmaps/kld108.xpm - delete mode 100644 pixmaps/kld116.xpm - delete mode 100644 pixmaps/kld129.xpm - delete mode 100644 pixmaps/kld21.xpm - delete mode 100644 pixmaps/kld25.xpm - delete mode 100644 pixmaps/kld29.xpm - delete mode 100644 pixmaps/kld33.xpm - delete mode 100644 pixmaps/kld37.xpm - delete mode 100644 pixmaps/kld40.xpm - delete mode 100644 pixmaps/kld45.xpm - delete mode 100644 pixmaps/kld49.xpm - delete mode 100644 pixmaps/kld54.xpm - delete mode 100644 pixmaps/kld58.xpm - delete mode 100644 pixmaps/kld64.xpm - delete mode 100644 pixmaps/kld72.xpm - delete mode 100644 pixmaps/kld80.xpm - delete mode 100644 pixmaps/kld87.xpm - delete mode 100644 pixmaps/kld95.xpm - delete mode 100644 pixmaps/kll108.xpm - delete mode 100644 pixmaps/kll116.xpm - delete mode 100644 pixmaps/kll129.xpm - delete mode 100644 pixmaps/kll21.xpm - delete mode 100644 pixmaps/kll25.xpm - delete mode 100644 pixmaps/kll29.xpm - delete mode 100644 pixmaps/kll33.xpm - delete mode 100644 pixmaps/kll37.xpm - delete mode 100644 pixmaps/kll40.xpm - delete mode 100644 pixmaps/kll45.xpm - delete mode 100644 pixmaps/kll49.xpm - delete mode 100644 pixmaps/kll54.xpm - delete mode 100644 pixmaps/kll58.xpm - delete mode 100644 pixmaps/kll64.xpm - delete mode 100644 pixmaps/kll72.xpm - delete mode 100644 pixmaps/kll80.xpm - delete mode 100644 pixmaps/kll87.xpm - delete mode 100644 pixmaps/kll95.xpm - delete mode 100644 pixmaps/ldd33.xpm - delete mode 100644 pixmaps/ldd37.xpm - delete mode 100644 pixmaps/ldd40.xpm - delete mode 100644 pixmaps/ldd45.xpm - delete mode 100644 pixmaps/ldd49.xpm - delete mode 100644 pixmaps/ldd54.xpm - delete mode 100644 pixmaps/ldd58.xpm - delete mode 100644 pixmaps/ldd64.xpm - delete mode 100644 pixmaps/ldd72.xpm - delete mode 100644 pixmaps/ldl33.xpm - delete mode 100644 pixmaps/ldl37.xpm - delete mode 100644 pixmaps/ldl40.xpm - delete mode 100644 pixmaps/ldl45.xpm - delete mode 100644 pixmaps/ldl49.xpm - delete mode 100644 pixmaps/ldl54.xpm - delete mode 100644 pixmaps/ldl58.xpm - delete mode 100644 pixmaps/ldl64.xpm - delete mode 100644 pixmaps/ldl72.xpm - delete mode 100644 pixmaps/lld33.xpm - delete mode 100644 pixmaps/lld37.xpm - delete mode 100644 pixmaps/lld40.xpm - delete mode 100644 pixmaps/lld45.xpm - delete mode 100644 pixmaps/lld49.xpm - delete mode 100644 pixmaps/lld54.xpm - delete mode 100644 pixmaps/lld58.xpm - delete mode 100644 pixmaps/lld64.xpm - delete mode 100644 pixmaps/lld72.xpm - delete mode 100644 pixmaps/lll33.xpm - delete mode 100644 pixmaps/lll37.xpm - delete mode 100644 pixmaps/lll40.xpm - delete mode 100644 pixmaps/lll45.xpm - delete mode 100644 pixmaps/lll49.xpm - delete mode 100644 pixmaps/lll54.xpm - delete mode 100644 pixmaps/lll58.xpm - delete mode 100644 pixmaps/lll64.xpm - delete mode 100644 pixmaps/lll72.xpm - delete mode 100644 pixmaps/marble_d.xpm - delete mode 100644 pixmaps/marble_l.xpm - delete mode 100644 pixmaps/mdd33.xpm - delete mode 100644 pixmaps/mdd49.xpm - delete mode 100644 pixmaps/mdd72.xpm - delete mode 100644 pixmaps/mdl33.xpm - delete mode 100644 pixmaps/mdl49.xpm - delete mode 100644 pixmaps/mdl72.xpm - delete mode 100644 pixmaps/mld33.xpm - delete mode 100644 pixmaps/mld49.xpm - delete mode 100644 pixmaps/mld72.xpm - delete mode 100644 pixmaps/mll33.xpm - delete mode 100644 pixmaps/mll49.xpm - delete mode 100644 pixmaps/mll72.xpm - delete mode 100644 pixmaps/ndd108.xpm - delete mode 100644 pixmaps/ndd116.xpm - delete mode 100644 pixmaps/ndd129.xpm - delete mode 100644 pixmaps/ndd21.xpm - delete mode 100644 pixmaps/ndd25.xpm - delete mode 100644 pixmaps/ndd29.xpm - delete mode 100644 pixmaps/ndd33.xpm - delete mode 100644 pixmaps/ndd37.xpm - delete mode 100644 pixmaps/ndd40.xpm - delete mode 100644 pixmaps/ndd45.xpm - delete mode 100644 pixmaps/ndd49.xpm - delete mode 100644 pixmaps/ndd54.xpm - delete mode 100644 pixmaps/ndd58.xpm - delete mode 100644 pixmaps/ndd64.xpm - delete mode 100644 pixmaps/ndd72.xpm - delete mode 100644 pixmaps/ndd80.xpm - delete mode 100644 pixmaps/ndd87.xpm - delete mode 100644 pixmaps/ndd95.xpm - delete mode 100644 pixmaps/ndl108.xpm - delete mode 100644 pixmaps/ndl116.xpm - delete mode 100644 pixmaps/ndl129.xpm - delete mode 100644 pixmaps/ndl21.xpm - delete mode 100644 pixmaps/ndl25.xpm - delete mode 100644 pixmaps/ndl29.xpm - delete mode 100644 pixmaps/ndl33.xpm - delete mode 100644 pixmaps/ndl37.xpm - delete mode 100644 pixmaps/ndl40.xpm - delete mode 100644 pixmaps/ndl45.xpm - delete mode 100644 pixmaps/ndl49.xpm - delete mode 100644 pixmaps/ndl54.xpm - delete mode 100644 pixmaps/ndl58.xpm - delete mode 100644 pixmaps/ndl64.xpm - delete mode 100644 pixmaps/ndl72.xpm - delete mode 100644 pixmaps/ndl80.xpm - delete mode 100644 pixmaps/ndl87.xpm - delete mode 100644 pixmaps/ndl95.xpm - delete mode 100644 pixmaps/nld108.xpm - delete mode 100644 pixmaps/nld116.xpm - delete mode 100644 pixmaps/nld129.xpm - delete mode 100644 pixmaps/nld21.xpm - delete mode 100644 pixmaps/nld25.xpm - delete mode 100644 pixmaps/nld29.xpm - delete mode 100644 pixmaps/nld33.xpm - delete mode 100644 pixmaps/nld37.xpm - delete mode 100644 pixmaps/nld40.xpm - delete mode 100644 pixmaps/nld45.xpm - delete mode 100644 pixmaps/nld49.xpm - delete mode 100644 pixmaps/nld54.xpm - delete mode 100644 pixmaps/nld58.xpm - delete mode 100644 pixmaps/nld64.xpm - delete mode 100644 pixmaps/nld72.xpm - delete mode 100644 pixmaps/nld80.xpm - delete mode 100644 pixmaps/nld87.xpm - delete mode 100644 pixmaps/nld95.xpm - delete mode 100644 pixmaps/nll108.xpm - delete mode 100644 pixmaps/nll116.xpm - delete mode 100644 pixmaps/nll129.xpm - delete mode 100644 pixmaps/nll21.xpm - delete mode 100644 pixmaps/nll25.xpm - delete mode 100644 pixmaps/nll29.xpm - delete mode 100644 pixmaps/nll33.xpm - delete mode 100644 pixmaps/nll37.xpm - delete mode 100644 pixmaps/nll40.xpm - delete mode 100644 pixmaps/nll45.xpm - delete mode 100644 pixmaps/nll49.xpm - delete mode 100644 pixmaps/nll54.xpm - delete mode 100644 pixmaps/nll58.xpm - delete mode 100644 pixmaps/nll64.xpm - delete mode 100644 pixmaps/nll72.xpm - delete mode 100644 pixmaps/nll80.xpm - delete mode 100644 pixmaps/nll87.xpm - delete mode 100644 pixmaps/nll95.xpm - delete mode 100644 pixmaps/odd33.xpm - delete mode 100644 pixmaps/odd49.xpm - delete mode 100644 pixmaps/odd72.xpm - delete mode 100644 pixmaps/odl33.xpm - delete mode 100644 pixmaps/odl49.xpm - delete mode 100644 pixmaps/odl72.xpm - delete mode 100644 pixmaps/old33.xpm - delete mode 100644 pixmaps/old49.xpm - delete mode 100644 pixmaps/old72.xpm - delete mode 100644 pixmaps/oll33.xpm - delete mode 100644 pixmaps/oll49.xpm - delete mode 100644 pixmaps/oll72.xpm - delete mode 100644 pixmaps/pdd108.xpm - delete mode 100644 pixmaps/pdd116.xpm - delete mode 100644 pixmaps/pdd129.xpm - delete mode 100644 pixmaps/pdd21.xpm - delete mode 100644 pixmaps/pdd25.xpm - delete mode 100644 pixmaps/pdd29.xpm - delete mode 100644 pixmaps/pdd33.xpm - delete mode 100644 pixmaps/pdd37.xpm - delete mode 100644 pixmaps/pdd40.xpm - delete mode 100644 pixmaps/pdd45.xpm - delete mode 100644 pixmaps/pdd49.xpm - delete mode 100644 pixmaps/pdd54.xpm - delete mode 100644 pixmaps/pdd58.xpm - delete mode 100644 pixmaps/pdd64.xpm - delete mode 100644 pixmaps/pdd72.xpm - delete mode 100644 pixmaps/pdd80.xpm - delete mode 100644 pixmaps/pdd87.xpm - delete mode 100644 pixmaps/pdd95.xpm - delete mode 100644 pixmaps/pdl108.xpm - delete mode 100644 pixmaps/pdl116.xpm - delete mode 100644 pixmaps/pdl129.xpm - delete mode 100644 pixmaps/pdl21.xpm - delete mode 100644 pixmaps/pdl25.xpm - delete mode 100644 pixmaps/pdl29.xpm - delete mode 100644 pixmaps/pdl33.xpm - delete mode 100644 pixmaps/pdl37.xpm - delete mode 100644 pixmaps/pdl40.xpm - delete mode 100644 pixmaps/pdl45.xpm - delete mode 100644 pixmaps/pdl49.xpm - delete mode 100644 pixmaps/pdl54.xpm - delete mode 100644 pixmaps/pdl58.xpm - delete mode 100644 pixmaps/pdl64.xpm - delete mode 100644 pixmaps/pdl72.xpm - delete mode 100644 pixmaps/pdl80.xpm - delete mode 100644 pixmaps/pdl87.xpm - delete mode 100644 pixmaps/pdl95.xpm - delete mode 100644 pixmaps/pixmaps.h - delete mode 100644 pixmaps/pld108.xpm - delete mode 100644 pixmaps/pld116.xpm - delete mode 100644 pixmaps/pld129.xpm - delete mode 100644 pixmaps/pld21.xpm - delete mode 100644 pixmaps/pld25.xpm - delete mode 100644 pixmaps/pld29.xpm - delete mode 100644 pixmaps/pld33.xpm - delete mode 100644 pixmaps/pld37.xpm - delete mode 100644 pixmaps/pld40.xpm - delete mode 100644 pixmaps/pld45.xpm - delete mode 100644 pixmaps/pld49.xpm - delete mode 100644 pixmaps/pld54.xpm - delete mode 100644 pixmaps/pld58.xpm - delete mode 100644 pixmaps/pld64.xpm - delete mode 100644 pixmaps/pld72.xpm - delete mode 100644 pixmaps/pld80.xpm - delete mode 100644 pixmaps/pld87.xpm - delete mode 100644 pixmaps/pld95.xpm - delete mode 100644 pixmaps/pll108.xpm - delete mode 100644 pixmaps/pll116.xpm - delete mode 100644 pixmaps/pll129.xpm - delete mode 100644 pixmaps/pll21.xpm - delete mode 100644 pixmaps/pll25.xpm - delete mode 100644 pixmaps/pll29.xpm - delete mode 100644 pixmaps/pll33.xpm - delete mode 100644 pixmaps/pll37.xpm - delete mode 100644 pixmaps/pll40.xpm - delete mode 100644 pixmaps/pll45.xpm - delete mode 100644 pixmaps/pll49.xpm - delete mode 100644 pixmaps/pll54.xpm - delete mode 100644 pixmaps/pll58.xpm - delete mode 100644 pixmaps/pll64.xpm - delete mode 100644 pixmaps/pll72.xpm - delete mode 100644 pixmaps/pll80.xpm - delete mode 100644 pixmaps/pll87.xpm - delete mode 100644 pixmaps/pll95.xpm - delete mode 100644 pixmaps/qdd108.xpm - delete mode 100644 pixmaps/qdd116.xpm - delete mode 100644 pixmaps/qdd129.xpm - delete mode 100644 pixmaps/qdd21.xpm - delete mode 100644 pixmaps/qdd25.xpm - delete mode 100644 pixmaps/qdd29.xpm - delete mode 100644 pixmaps/qdd33.xpm - delete mode 100644 pixmaps/qdd37.xpm - delete mode 100644 pixmaps/qdd40.xpm - delete mode 100644 pixmaps/qdd45.xpm - delete mode 100644 pixmaps/qdd49.xpm - delete mode 100644 pixmaps/qdd54.xpm - delete mode 100644 pixmaps/qdd58.xpm - delete mode 100644 pixmaps/qdd64.xpm - delete mode 100644 pixmaps/qdd72.xpm - delete mode 100644 pixmaps/qdd80.xpm - delete mode 100644 pixmaps/qdd87.xpm - delete mode 100644 pixmaps/qdd95.xpm - delete mode 100644 pixmaps/qdl108.xpm - delete mode 100644 pixmaps/qdl116.xpm - delete mode 100644 pixmaps/qdl129.xpm - delete mode 100644 pixmaps/qdl21.xpm - delete mode 100644 pixmaps/qdl25.xpm - delete mode 100644 pixmaps/qdl29.xpm - delete mode 100644 pixmaps/qdl33.xpm - delete mode 100644 pixmaps/qdl37.xpm - delete mode 100644 pixmaps/qdl40.xpm - delete mode 100644 pixmaps/qdl45.xpm - delete mode 100644 pixmaps/qdl49.xpm - delete mode 100644 pixmaps/qdl54.xpm - delete mode 100644 pixmaps/qdl58.xpm - delete mode 100644 pixmaps/qdl64.xpm - delete mode 100644 pixmaps/qdl72.xpm - delete mode 100644 pixmaps/qdl80.xpm - delete mode 100644 pixmaps/qdl87.xpm - delete mode 100644 pixmaps/qdl95.xpm - delete mode 100644 pixmaps/qld108.xpm - delete mode 100644 pixmaps/qld116.xpm - delete mode 100644 pixmaps/qld129.xpm - delete mode 100644 pixmaps/qld21.xpm - delete mode 100644 pixmaps/qld25.xpm - delete mode 100644 pixmaps/qld29.xpm - delete mode 100644 pixmaps/qld33.xpm - delete mode 100644 pixmaps/qld37.xpm - delete mode 100644 pixmaps/qld40.xpm - delete mode 100644 pixmaps/qld45.xpm - delete mode 100644 pixmaps/qld49.xpm - delete mode 100644 pixmaps/qld54.xpm - delete mode 100644 pixmaps/qld58.xpm - delete mode 100644 pixmaps/qld64.xpm - delete mode 100644 pixmaps/qld72.xpm - delete mode 100644 pixmaps/qld80.xpm - delete mode 100644 pixmaps/qld87.xpm - delete mode 100644 pixmaps/qld95.xpm - delete mode 100644 pixmaps/qll108.xpm - delete mode 100644 pixmaps/qll116.xpm - delete mode 100644 pixmaps/qll129.xpm - delete mode 100644 pixmaps/qll21.xpm - delete mode 100644 pixmaps/qll25.xpm - delete mode 100644 pixmaps/qll29.xpm - delete mode 100644 pixmaps/qll33.xpm - delete mode 100644 pixmaps/qll37.xpm - delete mode 100644 pixmaps/qll40.xpm - delete mode 100644 pixmaps/qll45.xpm - delete mode 100644 pixmaps/qll49.xpm - delete mode 100644 pixmaps/qll54.xpm - delete mode 100644 pixmaps/qll58.xpm - delete mode 100644 pixmaps/qll64.xpm - delete mode 100644 pixmaps/qll72.xpm - delete mode 100644 pixmaps/qll80.xpm - delete mode 100644 pixmaps/qll87.xpm - delete mode 100644 pixmaps/qll95.xpm - delete mode 100644 pixmaps/rdd108.xpm - delete mode 100644 pixmaps/rdd116.xpm - delete mode 100644 pixmaps/rdd129.xpm - delete mode 100644 pixmaps/rdd21.xpm - delete mode 100644 pixmaps/rdd25.xpm - delete mode 100644 pixmaps/rdd29.xpm - delete mode 100644 pixmaps/rdd33.xpm - delete mode 100644 pixmaps/rdd37.xpm - delete mode 100644 pixmaps/rdd40.xpm - delete mode 100644 pixmaps/rdd45.xpm - delete mode 100644 pixmaps/rdd49.xpm - delete mode 100644 pixmaps/rdd54.xpm - delete mode 100644 pixmaps/rdd58.xpm - delete mode 100644 pixmaps/rdd64.xpm - delete mode 100644 pixmaps/rdd72.xpm - delete mode 100644 pixmaps/rdd80.xpm - delete mode 100644 pixmaps/rdd87.xpm - delete mode 100644 pixmaps/rdd95.xpm - delete mode 100644 pixmaps/rdl108.xpm - delete mode 100644 pixmaps/rdl116.xpm - delete mode 100644 pixmaps/rdl129.xpm - delete mode 100644 pixmaps/rdl21.xpm - delete mode 100644 pixmaps/rdl25.xpm - delete mode 100644 pixmaps/rdl29.xpm - delete mode 100644 pixmaps/rdl33.xpm - delete mode 100644 pixmaps/rdl37.xpm - delete mode 100644 pixmaps/rdl40.xpm - delete mode 100644 pixmaps/rdl45.xpm - delete mode 100644 pixmaps/rdl49.xpm - delete mode 100644 pixmaps/rdl54.xpm - delete mode 100644 pixmaps/rdl58.xpm - delete mode 100644 pixmaps/rdl64.xpm - delete mode 100644 pixmaps/rdl72.xpm - delete mode 100644 pixmaps/rdl80.xpm - delete mode 100644 pixmaps/rdl87.xpm - delete mode 100644 pixmaps/rdl95.xpm - delete mode 100644 pixmaps/rld108.xpm - delete mode 100644 pixmaps/rld116.xpm - delete mode 100644 pixmaps/rld129.xpm - delete mode 100644 pixmaps/rld21.xpm - delete mode 100644 pixmaps/rld25.xpm - delete mode 100644 pixmaps/rld29.xpm - delete mode 100644 pixmaps/rld33.xpm - delete mode 100644 pixmaps/rld37.xpm - delete mode 100644 pixmaps/rld40.xpm - delete mode 100644 pixmaps/rld45.xpm - delete mode 100644 pixmaps/rld49.xpm - delete mode 100644 pixmaps/rld54.xpm - delete mode 100644 pixmaps/rld58.xpm - delete mode 100644 pixmaps/rld64.xpm - delete mode 100644 pixmaps/rld72.xpm - delete mode 100644 pixmaps/rld80.xpm - delete mode 100644 pixmaps/rld87.xpm - delete mode 100644 pixmaps/rld95.xpm - delete mode 100644 pixmaps/rll108.xpm - delete mode 100644 pixmaps/rll116.xpm - delete mode 100644 pixmaps/rll129.xpm - delete mode 100644 pixmaps/rll21.xpm - delete mode 100644 pixmaps/rll25.xpm - delete mode 100644 pixmaps/rll29.xpm - delete mode 100644 pixmaps/rll33.xpm - delete mode 100644 pixmaps/rll37.xpm - delete mode 100644 pixmaps/rll40.xpm - delete mode 100644 pixmaps/rll45.xpm - delete mode 100644 pixmaps/rll49.xpm - delete mode 100644 pixmaps/rll54.xpm - delete mode 100644 pixmaps/rll58.xpm - delete mode 100644 pixmaps/rll64.xpm - delete mode 100644 pixmaps/rll72.xpm - delete mode 100644 pixmaps/rll80.xpm - delete mode 100644 pixmaps/rll87.xpm - delete mode 100644 pixmaps/rll95.xpm - delete mode 100644 pixmaps/sdd49.xpm - delete mode 100644 pixmaps/sdd72.xpm - delete mode 100644 pixmaps/sdl49.xpm - delete mode 100644 pixmaps/sdl72.xpm - delete mode 100644 pixmaps/sld49.xpm - delete mode 100644 pixmaps/sld72.xpm - delete mode 100644 pixmaps/sll49.xpm - delete mode 100644 pixmaps/sll72.xpm - delete mode 100644 pixmaps/test.c - delete mode 100644 pixmaps/udd49.xpm - delete mode 100644 pixmaps/udd72.xpm - delete mode 100644 pixmaps/udl49.xpm - delete mode 100644 pixmaps/udl72.xpm - delete mode 100644 pixmaps/uld49.xpm - delete mode 100644 pixmaps/uld72.xpm - delete mode 100644 pixmaps/ull49.xpm - delete mode 100644 pixmaps/ull72.xpm - delete mode 100644 pixmaps/vdd33.xpm - delete mode 100644 pixmaps/vdd49.xpm - delete mode 100644 pixmaps/vdd72.xpm - delete mode 100644 pixmaps/vdl33.xpm - delete mode 100644 pixmaps/vdl49.xpm - delete mode 100644 pixmaps/vdl72.xpm - delete mode 100644 pixmaps/vld33.xpm - delete mode 100644 pixmaps/vld49.xpm - delete mode 100644 pixmaps/vld72.xpm - delete mode 100644 pixmaps/vll33.xpm - delete mode 100644 pixmaps/vll49.xpm - delete mode 100644 pixmaps/vll72.xpm - delete mode 100644 pixmaps/wdd33.xpm - delete mode 100644 pixmaps/wdd49.xpm - delete mode 100644 pixmaps/wdd72.xpm - delete mode 100644 pixmaps/wdl33.xpm - delete mode 100644 pixmaps/wdl49.xpm - delete mode 100644 pixmaps/wdl72.xpm - delete mode 100644 pixmaps/wld33.xpm - delete mode 100644 pixmaps/wld49.xpm - delete mode 100644 pixmaps/wld72.xpm - delete mode 100644 pixmaps/wldd49.xpm - delete mode 100644 pixmaps/wldd72.xpm - delete mode 100644 pixmaps/wldl49.xpm - delete mode 100644 pixmaps/wldl72.xpm - delete mode 100644 pixmaps/wll33.xpm - delete mode 100644 pixmaps/wll49.xpm - delete mode 100644 pixmaps/wll72.xpm - delete mode 100644 pixmaps/wlld49.xpm - delete mode 100644 pixmaps/wlld72.xpm - delete mode 100644 pixmaps/wlll49.xpm - delete mode 100644 pixmaps/wlll72.xpm - delete mode 100644 pixmaps/wndd49.xpm - delete mode 100644 pixmaps/wndd72.xpm - delete mode 100644 pixmaps/wndl49.xpm - delete mode 100644 pixmaps/wndl72.xpm - delete mode 100644 pixmaps/wnld49.xpm - delete mode 100644 pixmaps/wnld72.xpm - delete mode 100644 pixmaps/wnll49.xpm - delete mode 100644 pixmaps/wnll72.xpm - delete mode 100644 pixmaps/wood_d.xpm - delete mode 100644 pixmaps/wood_l.xpm - delete mode 100644 pixmaps/wpdd49.xpm - delete mode 100644 pixmaps/wpdd72.xpm - delete mode 100644 pixmaps/wpdl49.xpm - delete mode 100644 pixmaps/wpdl72.xpm - delete mode 100644 pixmaps/wpld49.xpm - delete mode 100644 pixmaps/wpld72.xpm - delete mode 100644 pixmaps/wpll49.xpm - delete mode 100644 pixmaps/wpll72.xpm - delete mode 100644 pixmaps/wsdd49.xpm - delete mode 100644 pixmaps/wsdd72.xpm - delete mode 100644 pixmaps/wsdl49.xpm - delete mode 100644 pixmaps/wsdl72.xpm - delete mode 100644 pixmaps/wsld49.xpm - delete mode 100644 pixmaps/wsld72.xpm - delete mode 100644 pixmaps/wsll49.xpm - delete mode 100644 pixmaps/wsll72.xpm - delete mode 100644 pixmaps/xqboard.xpm - delete mode 100644 pixmaps/xqwood.xpm - create mode 100644 png/BlackAdvisor.png - create mode 100644 png/BlackArchbishop.png - create mode 100644 png/BlackBishop.png - create mode 100644 png/BlackCanon.png - create mode 100644 png/BlackChancellor.png - create mode 100644 png/BlackCobra.png - create mode 100644 png/BlackCommoner.png - create mode 100644 png/BlackCrownedBishop.png - create mode 100644 png/BlackCrownedRook.png - create mode 100644 png/BlackElephant.png - create mode 100644 png/BlackGold.png - create mode 100644 png/BlackGoldKnight.png - create mode 100644 png/BlackGoldLance.png - create mode 100644 png/BlackGoldPawn.png - create mode 100644 png/BlackGoldSilver.png - create mode 100644 png/BlackHawk.png - create mode 100644 png/BlackKing.png - create mode 100644 png/BlackKnight.png - create mode 100644 png/BlackLance.png - create mode 100644 png/BlackMarshall.png - create mode 100644 png/BlackNightrider.png - create mode 100644 png/BlackPawn.png - create mode 100644 png/BlackPrincess.png - create mode 100644 png/BlackQueen.png - create mode 100644 png/BlackRook.png - create mode 100644 png/BlackUnicorn.png - create mode 100644 png/WhiteAdvisor.png - create mode 100644 png/WhiteArchbishop.png - create mode 100644 png/WhiteBishop.png - create mode 100644 png/WhiteCanon.png - create mode 100644 png/WhiteChancellor.png - create mode 100644 png/WhiteCobra.png - create mode 100644 png/WhiteCommoner.png - create mode 100644 png/WhiteCrownedBishop.png - create mode 100644 png/WhiteCrownedRook.png - create mode 100644 png/WhiteElephant.png - create mode 100644 png/WhiteGold.png - create mode 100644 png/WhiteGoldKnight.png - create mode 100644 png/WhiteGoldLance.png - create mode 100644 png/WhiteGoldPawn.png - create mode 100644 png/WhiteGoldSilver.png - create mode 100644 png/WhiteHawk.png - create mode 100644 png/WhiteKing.png - create mode 100644 png/WhiteKnight.png - create mode 100644 png/WhiteLance.png - create mode 100644 png/WhiteMarshall.png - create mode 100644 png/WhiteNightrider.png - create mode 100644 png/WhitePawn.png - create mode 100644 png/WhitePrincess.png - create mode 100644 png/WhiteQueen.png - create mode 100644 png/WhiteRook.png - create mode 100644 png/WhiteUnicorn.png - create mode 100644 png/hatch.png - create mode 100644 png/marble_d.png - create mode 100644 png/marble_l.png - create mode 100644 png/wood_d.png - create mode 100644 png/wood_l.png - create mode 100644 png/xqboard.png - create mode 100644 png/xqwood.png - delete mode 100644 shogipixmaps/bdd64.xpm - delete mode 100644 shogipixmaps/bdl64.xpm - delete mode 100644 shogipixmaps/bld64.xpm - delete mode 100644 shogipixmaps/bll64.xpm - delete mode 100644 shogipixmaps/fdd64.xpm - delete mode 100644 shogipixmaps/fdl64.xpm - delete mode 100644 shogipixmaps/fld64.xpm - delete mode 100644 shogipixmaps/fll64.xpm - delete mode 100644 shogipixmaps/kdd64.xpm - delete mode 100644 shogipixmaps/kdl64.xpm - delete mode 100644 shogipixmaps/kld64.xpm - delete mode 100644 shogipixmaps/kll64.xpm - delete mode 100644 shogipixmaps/ldd64.xpm - delete mode 100644 shogipixmaps/ldl64.xpm - delete mode 100644 shogipixmaps/lld64.xpm - delete mode 100644 shogipixmaps/lll64.xpm - delete mode 100644 shogipixmaps/ndd64.xpm - delete mode 100644 shogipixmaps/ndl64.xpm - delete mode 100644 shogipixmaps/nld64.xpm - delete mode 100644 shogipixmaps/nll64.xpm - delete mode 100644 shogipixmaps/pdd64.xpm - delete mode 100644 shogipixmaps/pdl64.xpm - delete mode 100644 shogipixmaps/pld64.xpm - delete mode 100644 shogipixmaps/pll64.xpm - delete mode 100644 shogipixmaps/qdd64.xpm - delete mode 100644 shogipixmaps/qdl64.xpm - delete mode 100644 shogipixmaps/qld64.xpm - delete mode 100644 shogipixmaps/qll64.xpm - delete mode 100644 shogipixmaps/rdd64.xpm - delete mode 100644 shogipixmaps/rdl64.xpm - delete mode 100644 shogipixmaps/rld64.xpm - delete mode 100644 shogipixmaps/rll64.xpm - delete mode 100644 shogipixmaps/wdd64.xpm - delete mode 100644 shogipixmaps/wdl64.xpm - delete mode 100644 shogipixmaps/wld64.xpm - delete mode 100644 shogipixmaps/wldd64.xpm - delete mode 100644 shogipixmaps/wldl64.xpm - delete mode 100644 shogipixmaps/wll64.xpm - delete mode 100644 shogipixmaps/wlld64.xpm - delete mode 100644 shogipixmaps/wlll64.xpm - delete mode 100644 shogipixmaps/wndd64.xpm - delete mode 100644 shogipixmaps/wndl64.xpm - delete mode 100644 shogipixmaps/wnld64.xpm - delete mode 100644 shogipixmaps/wnll64.xpm - delete mode 100644 shogipixmaps/wpdd64.xpm - delete mode 100644 shogipixmaps/wpdl64.xpm - delete mode 100644 shogipixmaps/wpld64.xpm - delete mode 100644 shogipixmaps/wpll64.xpm - delete mode 100644 shogipixmaps/wsdd64.xpm - delete mode 100644 shogipixmaps/wsdl64.xpm - delete mode 100644 shogipixmaps/wsld64.xpm - delete mode 100644 shogipixmaps/wsll64.xpm - create mode 100644 svg/BlackAdvisor.svg - create mode 100644 svg/BlackArchbishop.svg - create mode 100644 svg/BlackBishop.svg - create mode 100644 svg/BlackCanon.svg - create mode 100644 svg/BlackChancellor.svg - create mode 100644 svg/BlackCobra.svg - create mode 100644 svg/BlackCommoner.svg - create mode 100644 svg/BlackCrownedBishop.svg - create mode 100644 svg/BlackCrownedRook.svg - create mode 100644 svg/BlackElephant.svg - create mode 100644 svg/BlackGold.svg - create mode 100644 svg/BlackGoldKnight.svg - create mode 100644 svg/BlackGoldLance.svg - create mode 100644 svg/BlackGoldPawn.svg - create mode 100644 svg/BlackGoldSilver.svg - create mode 100644 svg/BlackHawk.svg - create mode 100644 svg/BlackKing.svg - create mode 100644 svg/BlackKnight.svg - create mode 100644 svg/BlackLance.svg - create mode 100644 svg/BlackMarshall.svg - create mode 100644 svg/BlackNightrider.svg - create mode 100644 svg/BlackPawn.svg - create mode 100644 svg/BlackPrincess.svg - create mode 100644 svg/BlackQueen.svg - create mode 100644 svg/BlackRook.svg - create mode 100644 svg/BlackUnicorn.svg - create mode 100644 svg/WhiteAdvisor.svg - create mode 100644 svg/WhiteArchbishop.svg - create mode 100644 svg/WhiteBishop.svg - create mode 100644 svg/WhiteCanon.svg - create mode 100644 svg/WhiteChancellor.svg - create mode 100644 svg/WhiteCobra.svg - create mode 100644 svg/WhiteCommoner.svg - create mode 100644 svg/WhiteCrownedBishop.svg - create mode 100644 svg/WhiteCrownedRook.svg - create mode 100644 svg/WhiteElephant.svg - create mode 100644 svg/WhiteGold.svg - create mode 100644 svg/WhiteGoldKnight.svg - create mode 100644 svg/WhiteGoldLance.svg - create mode 100644 svg/WhiteGoldPawn.svg - create mode 100644 svg/WhiteGoldSilver.svg - create mode 100644 svg/WhiteHawk.svg - create mode 100644 svg/WhiteKing.svg - create mode 100644 svg/WhiteKnight.svg - create mode 100644 svg/WhiteLance.svg - create mode 100644 svg/WhiteMarshall.svg - create mode 100644 svg/WhiteNightrider.svg - create mode 100644 svg/WhitePawn.svg - create mode 100644 svg/WhitePrincess.svg - create mode 100644 svg/WhiteQueen.svg - create mode 100644 svg/WhiteRook.svg - create mode 100644 svg/WhiteUnicorn.svg - create mode 100644 svg/eo_Analyzing.svg - create mode 100644 svg/eo_Black.svg - create mode 100644 svg/eo_Clear.svg - create mode 100644 svg/eo_Ponder.svg - create mode 100644 svg/eo_Thinking.svg - create mode 100644 svg/eo_Unknown.svg - create mode 100644 svg/eo_White.svg - create mode 100644 svg/icon_black.svg - create mode 100644 svg/icon_white.svg - create mode 100644 themes/Mono/BlackAdvisor.svg - create mode 100644 themes/Mono/BlackArchbishop.svg - create mode 100644 themes/Mono/BlackBishop.svg - create mode 100644 themes/Mono/BlackCanon.svg - create mode 100644 themes/Mono/BlackChancellor.svg - create mode 100644 themes/Mono/BlackCobra.svg - create mode 100644 themes/Mono/BlackCommoner.svg - create mode 100644 themes/Mono/BlackCrownedBishop.svg - create mode 100644 themes/Mono/BlackCrownedRook.svg - create mode 100644 themes/Mono/BlackElephant.svg - create mode 100644 themes/Mono/BlackGold.svg - create mode 100644 themes/Mono/BlackGoldKnight.svg - create mode 100644 themes/Mono/BlackGoldLance.svg - create mode 100644 themes/Mono/BlackGoldPawn.svg - create mode 100644 themes/Mono/BlackGoldSilver.svg - create mode 100644 themes/Mono/BlackHawk.svg - create mode 100644 themes/Mono/BlackKing.svg - create mode 100644 themes/Mono/BlackKnight.svg - create mode 100644 themes/Mono/BlackLance.svg - create mode 100644 themes/Mono/BlackMarshall.svg - create mode 100644 themes/Mono/BlackNightrider.svg - create mode 100644 themes/Mono/BlackPawn.svg - create mode 100644 themes/Mono/BlackPrincess.svg - create mode 100644 themes/Mono/BlackQueen.svg - create mode 100644 themes/Mono/BlackRook.svg - create mode 100644 themes/Mono/BlackUnicorn.svg - create mode 100644 themes/Mono/WhiteAdvisor.svg - create mode 100644 themes/Mono/WhiteArchbishop.svg - create mode 100644 themes/Mono/WhiteBishop.svg - create mode 100644 themes/Mono/WhiteCanon.svg - create mode 100644 themes/Mono/WhiteChancellor.svg - create mode 100644 themes/Mono/WhiteCobra.svg - create mode 100644 themes/Mono/WhiteCommoner.svg - create mode 100644 themes/Mono/WhiteCrownedBishop.svg - create mode 100644 themes/Mono/WhiteCrownedRook.svg - create mode 100644 themes/Mono/WhiteElephant.svg - create mode 100644 themes/Mono/WhiteGold.svg - create mode 100644 themes/Mono/WhiteGoldKnight.svg - create mode 100644 themes/Mono/WhiteGoldLance.svg - create mode 100644 themes/Mono/WhiteGoldPawn.svg - create mode 100644 themes/Mono/WhiteGoldSilver.svg - create mode 100644 themes/Mono/WhiteHawk.svg - create mode 100644 themes/Mono/WhiteKing.svg - create mode 100644 themes/Mono/WhiteKnight.svg - create mode 100644 themes/Mono/WhiteLance.svg - create mode 100644 themes/Mono/WhiteMarshall.svg - create mode 100644 themes/Mono/WhiteNightrider.svg - create mode 100644 themes/Mono/WhitePawn.svg - create mode 100644 themes/Mono/WhitePrincess.svg - create mode 100644 themes/Mono/WhiteQueen.svg - create mode 100644 themes/Mono/WhiteRook.svg - create mode 100644 themes/Mono/WhiteUnicorn.svg - create mode 100644 themes/Mono/eo_Analyzing.svg - create mode 100644 themes/Mono/eo_Black.svg - create mode 100644 themes/Mono/eo_Clear.svg - create mode 100644 themes/Mono/eo_Ponder.svg - create mode 100644 themes/Mono/eo_Thinking.svg - create mode 100644 themes/Mono/eo_Unknown.svg - create mode 100644 themes/Mono/eo_White.svg - create mode 100644 themes/Mono/icon_black.svg - create mode 100644 themes/Mono/icon_white.svg - create mode 100644 themes/Mono/shogi_bishop.svg - create mode 100644 themes/Mono/shogi_bishop_promoted.svg - create mode 100644 themes/Mono/shogi_gold.svg - create mode 100644 themes/Mono/shogi_king.svg - create mode 100644 themes/Mono/shogi_knight.svg - create mode 100644 themes/Mono/shogi_knight_promoted.svg - create mode 100644 themes/Mono/shogi_lance.svg - create mode 100644 themes/Mono/shogi_lance_promoted.svg - create mode 100644 themes/Mono/shogi_pawn.svg - create mode 100644 themes/Mono/shogi_pawn_promoted.svg - create mode 100644 themes/Mono/shogi_rook.svg - create mode 100644 themes/Mono/shogi_rook_promoted.svg - create mode 100644 themes/Mono/shogi_silver.svg - create mode 100644 themes/Mono/shogi_silver_promoted.svg - create mode 100644 themes/shogi/BlackAdvisor.svg - create mode 100644 themes/shogi/BlackBishop.svg - create mode 100644 themes/shogi/BlackCrownedBishop.svg - create mode 100644 themes/shogi/BlackCrownedRook.svg - create mode 100644 themes/shogi/BlackGold.svg - create mode 100644 themes/shogi/BlackGoldKnight.svg - create mode 100644 themes/shogi/BlackGoldLance.svg - create mode 100644 themes/shogi/BlackGoldPawn.svg - create mode 100644 themes/shogi/BlackGoldSilver.svg - create mode 100644 themes/shogi/BlackKing.svg - create mode 100644 themes/shogi/BlackKnight.svg - create mode 100644 themes/shogi/BlackLance.svg - create mode 100644 themes/shogi/BlackPawn.svg - create mode 100644 themes/shogi/BlackRook.svg - create mode 100644 themes/shogi/WhiteAdvisor.svg - create mode 100644 themes/shogi/WhiteBishop.svg - create mode 100644 themes/shogi/WhiteCrownedBishop.svg - create mode 100644 themes/shogi/WhiteCrownedRook.svg - create mode 100644 themes/shogi/WhiteGold.svg - create mode 100644 themes/shogi/WhiteGoldKnight.svg - create mode 100644 themes/shogi/WhiteGoldLance.svg - create mode 100644 themes/shogi/WhiteGoldPawn.svg - create mode 100644 themes/shogi/WhiteGoldSilver.svg - create mode 100644 themes/shogi/WhiteKing.svg - create mode 100644 themes/shogi/WhiteKnight.svg - create mode 100644 themes/shogi/WhiteLance.svg - create mode 100644 themes/shogi/WhitePawn.svg - create mode 100644 themes/shogi/WhiteRook.svg - create mode 100644 themes/xiangqi/.DS_Store - create mode 100644 themes/xiangqi/BlackAdvisor.svg - create mode 100644 themes/xiangqi/BlackCanon.svg - create mode 100644 themes/xiangqi/BlackElephant.svg - create mode 100644 themes/xiangqi/BlackGold.svg - create mode 100644 themes/xiangqi/BlackKnight.svg - create mode 100644 themes/xiangqi/BlackPawn.svg - create mode 100644 themes/xiangqi/BlackRook.svg - create mode 100644 themes/xiangqi/WhiteAdvisor.svg - create mode 100644 themes/xiangqi/WhiteCanon.svg - create mode 100644 themes/xiangqi/WhiteElephant.svg - create mode 100644 themes/xiangqi/WhiteGold.svg - create mode 100644 themes/xiangqi/WhiteKnight.svg - create mode 100644 themes/xiangqi/WhitePawn.svg - create mode 100644 themes/xiangqi/WhiteRook.svg - create mode 100644 usounds.c - create mode 100644 usystem.c - create mode 100644 usystem.h - create mode 100644 xaw/.dirstamp - create mode 100644 xaw/xboard.c - create mode 100644 xaw/xboard.h - create mode 100644 xaw/xengineoutput.c - create mode 100644 xaw/xgamelist.c - create mode 100644 xaw/xgamelist.h - create mode 100644 xaw/xhistory.c - create mode 100644 xaw/xhistory.h - create mode 100644 xaw/xoptions.c - create mode 100644 xboard-config.desktop - delete mode 100644 xboard.c - delete mode 100644 xboard.h - create mode 100644 xboard2.h - delete mode 100644 xedittags.c - delete mode 100644 xedittags.h - delete mode 100644 xengineoutput.c - delete mode 100644 xevalgraph.c - delete mode 100644 xevalgraph.h - delete mode 100644 xgamelist.c - delete mode 100644 xgamelist.h - delete mode 100644 xhistory.c - delete mode 100644 xhistory.h - delete mode 100644 xoptions.c - -** Version 4.6.2 ** - -(git diff -b --stat --summary -M v4.6.1 HEAD) - - backend.c | 16 +++++++++------- - configure.ac | 2 +- - winboard/config.h | 6 +++--- - winboard/language.txt | 2 ++ - winboard/language/nederlands.lng | 2 ++ - winboard/winboard.c | 1 + - 6 files changed, 18 insertions(+), 11 deletions(-) - -** Version 4.6.1 ** - -(git diff -b --stat --summary -M v4.6.0 HEAD) - - ChangeLog | 228 +++++++++++ - DIFFSTAT | 38 ++ - NEWS | 28 ++ - SHORTLOG | 45 +++ - args.h | 5 +- - autogen.sh | 2 +- - backend.c | 89 ++++- - common.h | 1 + - configure.ac | 2 +- - engineoutput.c | 19 +- - evalgraph.c | 4 +- - moves.c | 3 +- - po/da.po | 987 +++++++++++++++++++++++------------------------ - po/de.po | 980 +++++++++++++++++++++++------------------------ - po/es.po | 980 +++++++++++++++++++++++------------------------ - po/it.po | 980 +++++++++++++++++++++++------------------------ - po/ru.po | 980 +++++++++++++++++++++++------------------------ - po/tr.po | 980 +++++++++++++++++++++++------------------------ - po/uk.po | 1032 +++++++++++++++++++++++++------------------------- - po/vi.po | 980 +++++++++++++++++++++++------------------------ - po/xboard.pot | 981 +++++++++++++++++++++++------------------------ - po/zh_CN.po | 980 +++++++++++++++++++++++------------------------ - po/zh_HK.po | 980 +++++++++++++++++++++++------------------------ - po/zh_TW.po | 980 +++++++++++++++++++++++------------------------ - winboard/config.h | 6 +- - winboard/wsettings.c | 13 +- - xboard.c | 25 +- - xboard.h | 8 +- - xboard.texi | 107 ++---- - xengineoutput.c | 6 +- - xevalgraph.c | 6 +- - xgamelist.c | 103 +++-- - xoptions.c | 19 +- - 33 files changed, 6499 insertions(+), 6078 deletions(-) - -** Version 4.6.0 ** - -(git diff -b --stat --summary -M v4.5.3a HEAD) - - .gitignore | 3 + - ABOUT-NLS | 1282 ++++++++++ - COPYRIGHT | 2 +- - ChangeLog | 3106 ++++++++++++++++++++++-- - DIFFSTAT | 210 ++ - Makefile.am | 56 +- - NEWS | 35 + - SHORTLOG | 435 ++++ - args.h | 139 +- - autogen.sh | 2 +- - backend.c | 3426 ++++++++++++++++++-------- - backend.h | 55 +- - backendz.h | 2 +- - bitmaps/bitmaps.h | 2 +- - book.c | 261 ++- - childio.c | 26 +- - childio.h | 2 +- - common.h | 142 +- - config.rpath | 280 ++- - configure.ac | 37 +- - copyright.texi | 2 +- - engineoutput.c | 100 +- - engineoutput.h | 3 +- - evalgraph.c | 85 +- - evalgraph.h | 3 +- - filebrowser/dir.c | 2 +- - filebrowser/draw.c | 42 + - filebrowser/path.c | 19 +- - filebrowser/selfile.c | 66 +- - filebrowser/selfile.h | 2 - - frontend.h | 16 +- - gamelist.c | 137 +- - gettext.h | 262 ++- - history.c | 33 +- - lists.c | 41 +- - lists.h | 2 +- - m4/gettext.m4 | 383 +++ - m4/iconv.m4 | 214 ++ - m4/lib-ld.m4 | 110 + - m4/lib-link.m4 | 774 ++++++ - m4/lib-prefix.m4 | 224 ++ - m4/nls.m4 | 32 + - m4/po.m4 | 449 ++++ - m4/progtest.m4 | 92 + - moves.c | 341 ++-- - moves.h | 8 +- - parser.c | 4644 ++++------------------------------- - parser.h | 2 +- - parser.l | 1203 --------- - pgntags.c | 145 +- - pixmaps/board32.xpm | 42 + - pixmaps/board48.xpm | 58 + - pixmaps/cross32.xpm | 42 + - pixmaps/cross48.xpm | 58 + - po/LINGUAS | 3 +- - po/Makefile.in.in | 162 +- - po/Makevars | 2 +- - po/Makevars.template | 41 + - po/POTFILES.in | 10 +- - po/Rules-quot | 47 + - po/boldquot.sed | 10 + - po/da.po | 2977 ++++++++++++++++++++++ - po/de.po | 3464 +++++++++++++++++++------- - po/en@boldquot.header | 25 + - po/en@quot.header | 22 + - po/es.po | 2925 ++++++++++++++++++++++ - po/insert-header.sin | 23 + - po/it.po | 2933 ++++++++++++++++++++++ - po/lng2po.sh | 96 + - po/metascript | 125 + - po/normalize.pl | 10 + - po/quot.sed | 6 + - po/ru.po | 2919 ++++++++++++++++++++++ - po/strip-bad-utf8.pl | 14 + - po/tr.po | 3306 +++++++++++++++++++------ - po/uk.po | 3002 ++++++++++++++++++++++ - po/vi.po | 2904 ++++++++++++++++++++++ - po/xboard.pot | 2958 +++++++++++++++++------ - po/zh_CN.po | 2917 ++++++++++++++++++++++ - po/zh_HK.po | 2922 ++++++++++++++++++++++ - po/zh_TW.po | 2915 ++++++++++++++++++++++ - uci.c | 7 +- - winboard/bitmaps/cross.ico | Bin 0 -> 766 bytes - winboard/bitmaps/ni49o.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/ni49s.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/ni49w.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/ni72o.bmp | Bin 926 -> 0 bytes - winboard/bitmaps/ni72s.bmp | Bin 926 -> 0 bytes - winboard/bitmaps/ni72w.bmp | Bin 926 -> 0 bytes - winboard/config.h | 6 +- - winboard/defaults.h | 3 +- - winboard/help.c | 2 +- - winboard/help/html/24.htm | 2 +- - winboard/jaws.c | 47 +- - winboard/language.txt | 138 +- - winboard/language/chinese(simp).lng | 787 ++++++ - winboard/language/chinese(trad).lng | 785 ++++++ - winboard/language/deutsch.lng | 971 ++++++++ - winboard/language/italiano.lng | 976 ++++++++ - winboard/language/nederlands.lng | 1216 +++++++++ - winboard/language/romanian.lng | 1042 ++++++++ - winboard/language/russian.lng | 994 ++++++++ - winboard/language/spanish.lng | 953 +++++++ - winboard/language/vietnamese.lng | 973 ++++++++ - winboard/makefile.gcc | 15 +- - winboard/makefile.ms | 3 - - winboard/resource.h | 31 + - winboard/wchat.c | 2 +- - winboard/wclipbrd.c | 2 +- - winboard/wclipbrd.h | 2 +- - winboard/wedittags.c | 16 +- - winboard/wengineoutput.c | 10 +- - winboard/wevalgraph.c | 3 +- - winboard/wgamelist.c | 39 +- - winboard/winboard.c | 483 +++-- - winboard/winboard.h | 11 +- - winboard/winboard.rc | 158 +- - winboard/winboard.rtf | 1644 +++++++------ - winboard/woptions.c | 163 ++- - winboard/woptions.h | 2 +- - winboard/wsettings.c | 437 +++- - winboard/wsockerr.c | 2 +- - winboard/wsockerr.h | 2 +- - xboard-fen-viewer.desktop | 52 + - xboard-pgn-viewer.desktop | 52 + - xboard-tourney.desktop | 52 + - xboard.c | 2653 +++++++++----------- - xboard.conf.in | 16 +- - xboard.h | 26 +- - xboard.png | Bin 15116 -> 1726 bytes - xboard.texi | 1092 +++++++-- - xboard.xml | 61 + - xedittags.c | 316 +--- - xedittags.h | 2 +- - xengineoutput.c | 96 +- - xevalgraph.c | 69 +- - xevalgraph.h | 2 +- - xgamelist.c | 205 +- - xgamelist.h | 3 +- - xhistory.c | 461 +--- - xhistory.h | 4 +- - xoptions.c | 1482 ++++++------ - zic2xpm.c | 67 +- - zic2xpm.man | 2 +- - zippy.c | 54 +- - zippy.h | 2 +- - 146 files changed, 60376 insertions(+), 14197 deletions(-) - create mode 100644 ABOUT-NLS - create mode 100644 m4/gettext.m4 - create mode 100644 m4/iconv.m4 - create mode 100644 m4/lib-ld.m4 - create mode 100644 m4/lib-link.m4 - create mode 100644 m4/lib-prefix.m4 - create mode 100644 m4/nls.m4 - create mode 100644 m4/po.m4 - create mode 100644 m4/progtest.m4 - delete mode 100644 parser.l - create mode 100644 pixmaps/board32.xpm - create mode 100644 pixmaps/board48.xpm - create mode 100644 pixmaps/cross32.xpm - create mode 100644 pixmaps/cross48.xpm - mode change 100755 => 100644 po/Makefile.in.in - create mode 100644 po/Makevars.template - create mode 100644 po/Rules-quot - create mode 100644 po/boldquot.sed - create mode 100644 po/da.po - create mode 100644 po/en@boldquot.header - create mode 100644 po/en@quot.header - create mode 100644 po/es.po - create mode 100644 po/insert-header.sin - create mode 100644 po/it.po - create mode 100755 po/lng2po.sh - create mode 100644 po/metascript - create mode 100755 po/normalize.pl - create mode 100644 po/quot.sed - mode change 100755 => 100644 po/remove-potcdate.sin - create mode 100644 po/ru.po - create mode 100755 po/strip-bad-utf8.pl - create mode 100644 po/uk.po - create mode 100644 po/vi.po - mode change 100755 => 100644 po/xboard.pot - create mode 100644 po/zh_CN.po - create mode 100644 po/zh_HK.po - create mode 100644 po/zh_TW.po - create mode 100644 winboard/bitmaps/cross.ico - delete mode 100644 winboard/bitmaps/ni49o.bmp - delete mode 100644 winboard/bitmaps/ni49s.bmp - delete mode 100644 winboard/bitmaps/ni49w.bmp - delete mode 100644 winboard/bitmaps/ni72o.bmp - delete mode 100644 winboard/bitmaps/ni72s.bmp - delete mode 100644 winboard/bitmaps/ni72w.bmp - create mode 100644 winboard/language/chinese(simp).lng - create mode 100644 winboard/language/chinese(trad).lng - create mode 100644 winboard/language/deutsch.lng - create mode 100644 winboard/language/italiano.lng - create mode 100644 winboard/language/nederlands.lng - create mode 100644 winboard/language/romanian.lng - create mode 100644 winboard/language/russian.lng - create mode 100644 winboard/language/spanish.lng - create mode 100644 winboard/language/vietnamese.lng - create mode 100644 xboard-fen-viewer.desktop - create mode 100644 xboard-pgn-viewer.desktop - create mode 100644 xboard-tourney.desktop - create mode 100644 xboard.xml - - -** Version 4.5.3a ** - -(git diff -b --stat --summary -M v4.5.3 HEAD) - - winboard/makefile.gcc | 2 +- - winboard/winboard.c | 10 +++++----- - winboard/winboard.h | 2 +- - winboard/woptions.c | 2 +- - 4 files changed, 8 insertions(+), 8 deletions(-) - -** Version 4.5.3 ** - -(git diff -b --stat --summary -M v4.5.2a HEAD) - - args.h | 27 +++++++++++++--------- - backend.c | 54 +++++++++++++++++++++++++++++++++++-------- - backend.h | 4 ++- - book.c | 1 + - configure.ac | 2 +- - engineoutput.c | 14 +++++----- - filebrowser/dir.c | 13 +++++----- - filebrowser/draw.c | 7 +----- - filebrowser/path.c | 10 +------- - filebrowser/selfile.c | 17 +++---------- - filebrowser/selfile.h | 17 +++++++++++++ - history.c | 6 +++- - moves.c | 6 ++-- - uci.c | 2 +- - winboard/config.h | 6 ++-- - winboard/jaws.c | 37 +++++++++++++++++++++++++----- - winboard/language.txt | 40 +------------------------------- - winboard/makefile.gcc | 10 ++++++- - winboard/winboard.c | 6 +++- - winboard/winboard.h | 1 + - winboard/winboard.rc | 32 +++++++++++++------------- - winboard/wsettings.c | 33 +++++++++++++++++--------- - xboard.c | 24 ++++++++++++------- - xboard.h | 28 ++++++++++++++++++++++ - xboard.png | Bin 1342 -> 15116 bytes - xboard.svg | 26 ++++++++++++++------ - xedittags.c | 11 --------- - xengineoutput.c | 16 ------------- - xevalgraph.c | 14 ----------- - xgamelist.c | 61 +++++++++++++++++++++++++++++++----------------- - xhistory.c | 6 ----- - xoptions.c | 50 +++++++++++----------------------------- - 32 files changed, 308 insertions(+), 273 deletions(-) - - -** Version 4.5.2a (Winboard only) ** - -(git diff -b --stat --summary -M v4.5.2 HEAD) - - winboard/wsettings.c | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - - -** Version 4.5.2 ** - -(git diff -b --stat --summary -M v4.5.1 HEAD) - - ChangeLog | 361 +++++++++ - DIFFSTAT | 31 + - Makefile.am | 92 +++- - NEWS | 20 + - SHORTLOG | 50 ++ - args.h | 13 +- - backend.c | 112 ++-- - backend.h | 7 +- - common.h | 1 + - configure.ac | 6 +- - engineoutput.c | 1 - - filebrowser/dir.c | 13 + - filebrowser/draw.c | 9 +- - filebrowser/path.c | 10 + - filebrowser/selfile.c | 149 ++++- - filebrowser/selfile.h | 6 + - history.c | 1 - - moves.c | 1 + - parser.l | 4 +- - shogipixmaps/add64.xpm | 73 -- - shogipixmaps/adl64.xpm | 73 -- - shogipixmaps/ald64.xpm | 73 -- - shogipixmaps/all64.xpm | 73 -- - shogipixmaps/ddd64.xpm | 73 -- - shogipixmaps/ddl64.xpm | 73 -- - shogipixmaps/dld64.xpm | 73 -- - shogipixmaps/dll64.xpm | 73 -- - shogipixmaps/qdd64.xpm | 2 +- - shogipixmaps/qdl64.xpm | 2 +- - shogipixmaps/qld64.xpm | 2 +- - shogipixmaps/qll64.xpm | 112 ++-- - shogipixmaps/wldd64.xpm | 2 +- - shogipixmaps/wldl64.xpm | 2 +- - uci.c | 4 - - winboard/bitmaps/convert.c | 1 + - winboard/config.h | 6 +- - winboard/wgamelist.c | 9 +- - winboard/winboard.c | 13 +- - winboard/winboard.h | 1 + - winboard/woptions.c | 2 +- - winboard/wsettings.c | 24 +- - xboard.c | 962 ++++++++++-------------- - xboard.conf.in | 37 +- - xboard.h | 2 + - xboard.texi | 467 ++++++++---- - xgamelist.c | 1 + - xoptions.c | 1790 +++++++++++++++++++++++--------------------- - 47 files changed, 2591 insertions(+), 2321 deletions(-) - delete mode 100644 shogipixmaps/add64.xpm - delete mode 100644 shogipixmaps/adl64.xpm - delete mode 100644 shogipixmaps/ald64.xpm - delete mode 100644 shogipixmaps/all64.xpm - delete mode 100644 shogipixmaps/ddd64.xpm - delete mode 100644 shogipixmaps/ddl64.xpm - delete mode 100644 shogipixmaps/dld64.xpm - delete mode 100644 shogipixmaps/dll64.xpm - -** Version 4.5.1 ** - -(git diff -b --stat --summary -M v4.5.0 HEAD) - - ChangeLog | 142 ++++++++++++++++++++++++++++++++++++++++++++ - DIFFSTAT | 26 ++++++++ - Makefile.am | 2 +- - NEWS | 32 ++++++++++ - SHORTLOG | 27 ++++++++ - backend.c | 11 ++-- - childio.c | 1 + - configure.ac | 40 ++++++------- - filebrowser/dir.c | 18 ++---- - filebrowser/draw.c | 34 ++++++---- - filebrowser/path.c | 99 ++++++++++++++++--------------- - filebrowser/selfile.c | 12 ++++- - moves.c | 5 +- - winboard/config.h | 6 +- - winboard/help.c | 1 + - winboard/help/html/01.htm | 2 +- - winboard/help/html/02.htm | 14 ++++- - winboard/help/winboard.chm | Bin 86507 -> 86883 bytes - winboard/makefile.ms | 4 +- - winboard/wchat.c | 2 +- - winboard/winboard.c | 29 +++++---- - winboard/winboard.dsp | 6 ++- - winboard/woptions.c | 3 +- - winboard/wsettings.c | 5 +- - xboard.c | 5 +- - xboard.texi | 10 ++-- - 26 files changed, 398 insertions(+), 138 deletions(-) - -** Version 4.5.0 ** - -(git diff -b --stat --summary -M v4.4.4 HEAD) - - AUTHORS | 16 +- - COPYRIGHT | 2 +- - ChangeLog | 2326 +++++++++++++++++++-- - DIFFSTAT | 271 +++- - FAQ.html | 15 + - Makefile.am | 55 +- - NEWS | 818 +++++++- - README | 8 +- - SHORTLOG | 293 +++ - args.h | 1425 +++++++++++++ - autogen.sh | 2 +- - backend.c | 3916 ++++++++++++++++++++++------------ - backend.h | 48 +- - backendz.h | 2 +- - bitmaps/bitmaps.h | 2 +- - book.c | 39 +- - childio.c | 9 +- - childio.h | 2 +- - cmail.in | 2 +- - common.h | 118 +- - config.rpath | 2 +- - configure.ac | 20 +- - copyright.texi | 2 +- - engineoutput.c | 518 +++++ - engineoutput.h | 69 + - evalgraph.c | 339 +++ - evalgraph.h | 60 + - filebrowser/README | 3 + - filebrowser/dir.c | 163 ++ - filebrowser/draw.c | 935 ++++++++ - filebrowser/path.c | 917 ++++++++ - filebrowser/selfile.c | 756 +++++++ - filebrowser/selfile.h | 149 ++ - filebrowser/xstat.h | 23 + - frontend.h | 35 +- - gamelist.c | 186 ++- - gettext.h | 2 +- - history.c | 246 +++ - lists.c | 2 +- - lists.h | 2 +- - moves.c | 666 ++++--- - moves.h | 20 +- - winboard/parser.c => parser.c | 2669 ++++++++++++----------- - parser.h | 9 +- - parser.l | 228 ++- - pgntags.c | 26 +- - pixmaps/convert.c | 29 +- - pixmaps/marble_d.xpm | 238 ++ - pixmaps/marble_l.xpm | 359 ++++ - pixmaps/pixmaps.h | 2 +- - pixmaps/wood_d.xpm | 239 +++ - pixmaps/wood_l.xpm | 192 ++ - pixmaps/xqboard.xpm | 498 +++++ - pixmaps/xqwood.xpm | 597 ++++++ - readme_HGM.txt | 411 ---- - shogipixmaps/add64.xpm | 73 + - shogipixmaps/adl64.xpm | 73 + - shogipixmaps/ald64.xpm | 73 + - shogipixmaps/all64.xpm | 73 + - shogipixmaps/bdd64.xpm | 73 + - shogipixmaps/bdl64.xpm | 73 + - shogipixmaps/bld64.xpm | 74 + - shogipixmaps/bll64.xpm | 74 + - shogipixmaps/ddd64.xpm | 73 + - shogipixmaps/ddl64.xpm | 73 + - shogipixmaps/dld64.xpm | 73 + - shogipixmaps/dll64.xpm | 73 + - shogipixmaps/fdd64.xpm | 73 + - shogipixmaps/fdl64.xpm | 73 + - shogipixmaps/fld64.xpm | 74 + - shogipixmaps/fll64.xpm | 74 + - shogipixmaps/kdd64.xpm | 73 + - shogipixmaps/kdl64.xpm | 73 + - shogipixmaps/kld64.xpm | 73 + - shogipixmaps/kll64.xpm | 73 + - shogipixmaps/ldd64.xpm | 73 + - shogipixmaps/ldl64.xpm | 73 + - shogipixmaps/lld64.xpm | 73 + - shogipixmaps/lll64.xpm | 73 + - shogipixmaps/ndd64.xpm | 73 + - shogipixmaps/ndl64.xpm | 73 + - shogipixmaps/nld64.xpm | 74 + - shogipixmaps/nll64.xpm | 74 + - shogipixmaps/pdd64.xpm | 73 + - shogipixmaps/pdl64.xpm | 73 + - shogipixmaps/pld64.xpm | 74 + - shogipixmaps/pll64.xpm | 74 + - shogipixmaps/qdd64.xpm | 73 + - shogipixmaps/qdl64.xpm | 73 + - shogipixmaps/qld64.xpm | 73 + - shogipixmaps/qll64.xpm | 73 + - shogipixmaps/rdd64.xpm | 73 + - shogipixmaps/rdl64.xpm | 73 + - shogipixmaps/rld64.xpm | 73 + - shogipixmaps/rll64.xpm | 73 + - shogipixmaps/wdd64.xpm | 73 + - shogipixmaps/wdl64.xpm | 73 + - shogipixmaps/wld64.xpm | 73 + - shogipixmaps/wldd64.xpm | 73 + - shogipixmaps/wldl64.xpm | 73 + - shogipixmaps/wll64.xpm | 73 + - shogipixmaps/wlld64.xpm | 73 + - shogipixmaps/wlll64.xpm | 73 + - shogipixmaps/wndd64.xpm | 73 + - shogipixmaps/wndl64.xpm | 73 + - shogipixmaps/wnld64.xpm | 73 + - shogipixmaps/wnll64.xpm | 73 + - shogipixmaps/wpdd64.xpm | 73 + - shogipixmaps/wpdl64.xpm | 73 + - shogipixmaps/wpld64.xpm | 73 + - shogipixmaps/wpll64.xpm | 73 + - shogipixmaps/wsdd64.xpm | 73 + - shogipixmaps/wsdl64.xpm | 73 + - shogipixmaps/wsld64.xpm | 73 + - shogipixmaps/wsll64.xpm | 73 + - uci.c | 105 +- - winboard/WB4Jaws.dev | 94 +- - winboard/Winboard.dev | 94 +- - winboard/bitmaps/wl33o.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/wl33s.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/wn33o.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/wn33s.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/wp33o.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/wp33s.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/ws33o.bmp | Bin 0 -> 326 bytes - winboard/bitmaps/ws33s.bmp | Bin 0 -> 326 bytes - winboard/config.h | 6 +- - winboard/defaults.h | 11 +- - winboard/help.c | 4 +- - winboard/help/html/01.htm | 8 +- - winboard/help/html/03.htm | 2 +- - winboard/help/html/04.htm | 35 +- - winboard/help/html/05.htm | 6 + - winboard/help/html/06.htm | 9 +- - winboard/help/html/07.htm | 57 +- - winboard/help/html/09.htm | 6 + - winboard/help/html/14.htm | 42 + - winboard/help/html/15.htm | 16 +- - winboard/help/html/16.htm | 19 +- - winboard/help/html/18.htm | 12 +- - winboard/help/html/24.htm | 2 +- - winboard/help/winboard.chm | Bin 79031 -> 86507 bytes - winboard/help/winboard.hhk | 138 ++- - winboard/help/winboard.hhp | 13 +- - winboard/jaws.c | 131 +- - winboard/language.txt | 1425 +++++++++---- - winboard/makefile.gcc | 38 +- - winboard/makefile.ms | 34 +- - winboard/resource.h | 87 + - winboard/wchat.c | 165 ++- - winboard/wclipbrd.c | 65 +- - winboard/wclipbrd.h | 2 +- - winboard/wedittags.c | 42 +- - winboard/wengineo.c | 856 -------- - winboard/wengineoutput.c | 436 ++++ - winboard/wevalgraph.c | 359 +--- - winboard/wgamelist.c | 97 +- - winboard/wgamelist.h | 28 - - winboard/whistory.c | 264 +-- - winboard/winboard.c | 3449 +++++++++++------------------- - winboard/winboard.dsp | 18 +- - winboard/winboard.h | 57 +- - winboard/winboard.rc | 776 ++++---- - winboard/winboard.rtf | 1719 ++++++++------- - winboard/wlayout.c | 3 +- - winboard/woptions.c | 424 ++-- - winboard/woptions.h | 2 +- - winboard/wsettings.c | 28 +- - winboard/wsockerr.c | 2 +- - winboard/wsockerr.h | 2 +- - xboard.c | 2912 ++++++++++++------------- - xboard.conf.in | 77 + - xboard.desktop | 154 ++ - xboard.h | 26 +- - xboard.texi | 960 ++++++--- - xedittags.c | 13 +- - xedittags.h | 3 +- - xengineoutput.c | 597 ++---- - xevalgraph.c | 456 ++++ - winboard/wedittags.h => xevalgraph.h | 14 +- - xgamelist.c | 413 ++++- - xgamelist.h | 5 +- - xhistory.c | 76 +- - xhistory.h | 4 +- - xoptions.c | 243 ++- - zic2xpm.c | 19 +- - zic2xpm.man | 2 +- - zippy.c | 88 +- - zippy.h | 2 +- - 189 files changed, 29433 insertions(+), 12188 deletions(-) - create mode 100644 args.h - create mode 100644 engineoutput.c - create mode 100644 engineoutput.h - create mode 100644 evalgraph.c - create mode 100644 evalgraph.h - create mode 100644 filebrowser/README - create mode 100644 filebrowser/dir.c - create mode 100644 filebrowser/draw.c - create mode 100644 filebrowser/path.c - create mode 100644 filebrowser/selfile.c - create mode 100644 filebrowser/selfile.h - create mode 100644 filebrowser/xstat.h - create mode 100644 history.c - rename winboard/parser.c => parser.c (51%) - mode change 100755 => 100644 parser.l - create mode 100644 pixmaps/marble_d.xpm - create mode 100644 pixmaps/marble_l.xpm - create mode 100644 pixmaps/wood_d.xpm - create mode 100644 pixmaps/wood_l.xpm - create mode 100644 pixmaps/xqboard.xpm - create mode 100644 pixmaps/xqwood.xpm - delete mode 100644 readme_HGM.txt - create mode 100644 shogipixmaps/add64.xpm - create mode 100644 shogipixmaps/adl64.xpm - create mode 100644 shogipixmaps/ald64.xpm - create mode 100644 shogipixmaps/all64.xpm - create mode 100644 shogipixmaps/bdd64.xpm - create mode 100644 shogipixmaps/bdl64.xpm - create mode 100644 shogipixmaps/bld64.xpm - create mode 100644 shogipixmaps/bll64.xpm - create mode 100644 shogipixmaps/ddd64.xpm - create mode 100644 shogipixmaps/ddl64.xpm - create mode 100644 shogipixmaps/dld64.xpm - create mode 100644 shogipixmaps/dll64.xpm - create mode 100644 shogipixmaps/fdd64.xpm - create mode 100644 shogipixmaps/fdl64.xpm - create mode 100644 shogipixmaps/fld64.xpm - create mode 100644 shogipixmaps/fll64.xpm - create mode 100644 shogipixmaps/kdd64.xpm - create mode 100644 shogipixmaps/kdl64.xpm - create mode 100644 shogipixmaps/kld64.xpm - create mode 100644 shogipixmaps/kll64.xpm - create mode 100644 shogipixmaps/ldd64.xpm - create mode 100644 shogipixmaps/ldl64.xpm - create mode 100644 shogipixmaps/lld64.xpm - create mode 100644 shogipixmaps/lll64.xpm - create mode 100644 shogipixmaps/ndd64.xpm - create mode 100644 shogipixmaps/ndl64.xpm - create mode 100644 shogipixmaps/nld64.xpm - create mode 100644 shogipixmaps/nll64.xpm - create mode 100644 shogipixmaps/pdd64.xpm - create mode 100644 shogipixmaps/pdl64.xpm - create mode 100644 shogipixmaps/pld64.xpm - create mode 100644 shogipixmaps/pll64.xpm - create mode 100644 shogipixmaps/qdd64.xpm - create mode 100644 shogipixmaps/qdl64.xpm - create mode 100644 shogipixmaps/qld64.xpm - create mode 100644 shogipixmaps/qll64.xpm - create mode 100644 shogipixmaps/rdd64.xpm - create mode 100644 shogipixmaps/rdl64.xpm - create mode 100644 shogipixmaps/rld64.xpm - create mode 100644 shogipixmaps/rll64.xpm - create mode 100644 shogipixmaps/wdd64.xpm - create mode 100644 shogipixmaps/wdl64.xpm - create mode 100644 shogipixmaps/wld64.xpm - create mode 100644 shogipixmaps/wldd64.xpm - create mode 100644 shogipixmaps/wldl64.xpm - create mode 100644 shogipixmaps/wll64.xpm - create mode 100644 shogipixmaps/wlld64.xpm - create mode 100644 shogipixmaps/wlll64.xpm - create mode 100644 shogipixmaps/wndd64.xpm - create mode 100644 shogipixmaps/wndl64.xpm - create mode 100644 shogipixmaps/wnld64.xpm - create mode 100644 shogipixmaps/wnll64.xpm - create mode 100644 shogipixmaps/wpdd64.xpm - create mode 100644 shogipixmaps/wpdl64.xpm - create mode 100644 shogipixmaps/wpld64.xpm - create mode 100644 shogipixmaps/wpll64.xpm - create mode 100644 shogipixmaps/wsdd64.xpm - create mode 100644 shogipixmaps/wsdl64.xpm - create mode 100644 shogipixmaps/wsld64.xpm - create mode 100644 shogipixmaps/wsll64.xpm - create mode 100644 winboard/bitmaps/wl33o.bmp - create mode 100644 winboard/bitmaps/wl33s.bmp - create mode 100644 winboard/bitmaps/wn33o.bmp - create mode 100644 winboard/bitmaps/wn33s.bmp - create mode 100644 winboard/bitmaps/wp33o.bmp - create mode 100644 winboard/bitmaps/wp33s.bmp - create mode 100644 winboard/bitmaps/ws33o.bmp - create mode 100644 winboard/bitmaps/ws33s.bmp - delete mode 100644 winboard/wengineo.c - create mode 100644 winboard/wengineoutput.c - delete mode 100644 winboard/wgamelist.h - create mode 100644 xboard.conf.in - create mode 100644 xboard.desktop - create mode 100644 xevalgraph.c - rename winboard/wedittags.h => xevalgraph.h (74%) - - -** Version 4.4.4 ** - -(git diff -b --stat --summary -M v4.4.3...HEAD) - - backend.c | 69 +++++++++++++++++++++++-------------------------- - backend.h | 2 +- - configure.ac | 10 +++--- - moves.c | 4 +- - parser.l | 16 ++++++------ - winboard/config.h | 6 ++-- - winboard/wgamelist.c | 4 +- - winboard/winboard.c | 29 +++++++++++++++++--- - winboard/woptions.c | 3 +- - xboard.c | 2 +- - xoptions.c | 2 +- - zippy.c | 11 +------ - 12 files changed, 82 insertions(+), 76 deletions(-) - -** Version 4.4.3 ** - -(git diff -b --stat --summary -M v4.4.2...HEAD) - - AUTHORS | 16 +- - COPYRIGHT | 2 +- - ChangeLog | 323 ++++ - DIFFSTAT | 84 + - Makefile.am | 7 +- - NEWS | 35 + - SHORTLOG | 57 + - autogen.sh | 2 +- - backend.c | 224 ++- - backend.h | 10 +- - backendz.h | 2 +- - bitmaps/bitmaps.h | 2 +- - childio.c | 2 +- - childio.h | 2 +- - cmail.in | 2 +- - common.h | 4 +- - config.rpath | 2 +- - configure.ac | 6 +- - copyright.texi | 2 +- - frontend.h | 2 +- - gamelist.c | 2 +- - gettext.h | 2 +- - lists.c | 2 +- - lists.h | 2 +- - moves.c | 26 +- - moves.h | 8 +- - parser.h | 2 +- - parser.l | 14 +- - pgntags.c | 2 +- - pixmaps/pixmaps.h | 2 +- - winboard/config.h | 6 +- - winboard/defaults.h | 2 +- - winboard/help.c | 2 +- - winboard/help/html/18.htm | 4 +- - winboard/help/winboard.hhk | 4 +- - winboard/jaws.c | 16 +- - winboard/makefile.gcc | 8 +- - winboard/makefile.ms | 8 +- - winboard/parser.c | 3866 +++++++++++++++++++++++--------------------- - winboard/resource.h | 1 + - winboard/wchat.c | 30 +- - winboard/wclipbrd.c | 2 +- - winboard/wclipbrd.h | 2 +- - winboard/wedittags.c | 2 +- - winboard/wedittags.h | 2 +- - winboard/wengineo.c | 1 + - winboard/wgamelist.c | 2 +- - winboard/wgamelist.h | 2 +- - winboard/winboard.c | 29 +- - winboard/winboard.h | 2 +- - winboard/winboard.rc | 2 + - winboard/winboard.rtf | 2 +- - winboard/woptions.c | 8 +- - winboard/woptions.h | 2 +- - winboard/wsockerr.c | 2 +- - winboard/wsockerr.h | 2 +- - xboard.c | 13 +- - xboard.h | 2 +- - xboard.png | Bin 0 -> 1342 bytes - xboard.svg | 119 ++ - xboard.texi | 5 +- - xedittags.c | 2 +- - xedittags.h | 2 +- - xengineoutput.c | 2 +- - xgamelist.c | 2 +- - xgamelist.h | 2 +- - xhistory.c | 2 +- - xhistory.h | 2 +- - xoptions.c | 15 +- - zic2xpm.c | 2 +- - zic2xpm.man | 2 +- - zippy.c | 2 +- - zippy.h | 2 +- - 73 files changed, 2973 insertions(+), 2060 deletions(-) - mode change 100755 => 100644 backend.c - mode change 100755 => 100644 gamelist.c - mode change 100755 => 100644 gettext.h - mode change 100755 => 100644 winboard/woptions.c - create mode 100644 xboard.png - create mode 100644 xboard.svg - -** Version 4.4.2 ** - -(git diff --stat --summary -M v4.4.1...HEAD) - - Makefile.am | 6 +- - backend.c | 108 +++++++++++++++++++++++------------------------ - backend.h | 1 + - configure.ac | 12 ++++- - moves.c | 36 +--------------- - pixmaps/asdd72.xpm | 26 ++++++------ - pixmaps/asdl72.xpm | 26 ++++++------ - pixmaps/cvdd37.xpm | 32 +++++++------- - pixmaps/cvdd45.xpm | 42 +++++++++--------- - pixmaps/cvdd49.xpm | 48 +++++++++++----------- - pixmaps/cvdl37.xpm | 32 +++++++------- - pixmaps/cvdl45.xpm | 42 +++++++++--------- - pixmaps/cvdl49.xpm | 48 +++++++++++----------- - pixmaps/hdd49.xpm | 64 ++++++++++++++-------------- - pixmaps/hdd72.xpm | 108 ++++++++++++++++++++++++------------------------ - pixmaps/hdl49.xpm | 64 ++++++++++++++-------------- - pixmaps/hdl72.xpm | 108 ++++++++++++++++++++++++------------------------ - shogibitmaps/README | 2 - - shogibitmaps/sa58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sb58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sc58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sf58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sg58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sh58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sk58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sk58w.bmp | Bin 526 -> 0 bytes - shogibitmaps/sl58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sl58w.bmp | Bin 526 -> 0 bytes - shogibitmaps/sn58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sn58w.bmp | Bin 526 -> 0 bytes - shogibitmaps/sp58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sp58w.bmp | Bin 526 -> 0 bytes - shogibitmaps/sr58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sr58w.bmp | Bin 526 -> 0 bytes - shogibitmaps/ss58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/su58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sw58o.bmp | Bin 526 -> 0 bytes - shogibitmaps/sw58w.bmp | Bin 526 -> 0 bytes - winboard/config.h | 6 +- - winboard/makefile.gcc | 2 +- - winboard/makefile.ms | 2 +- - winboard/wchat.c | 5 +- - winboard/wclipbrd.c | 3 +- - winboard/winboard.c | 9 +--- - winboard/woptions.c | 4 +- - xboard.c | 1 + - xengineoutput.c | 4 ++ - xhistory.c | 25 ++++++----- - xoptions.c | 5 +- - 49 files changed, 424 insertions(+), 447 deletions(-) - delete mode 100644 shogibitmaps/README - delete mode 100644 shogibitmaps/sa58o.bmp - delete mode 100644 shogibitmaps/sb58o.bmp - delete mode 100644 shogibitmaps/sc58o.bmp - delete mode 100644 shogibitmaps/sf58o.bmp - delete mode 100644 shogibitmaps/sg58o.bmp - delete mode 100644 shogibitmaps/sh58o.bmp - delete mode 100644 shogibitmaps/sk58o.bmp - delete mode 100644 shogibitmaps/sk58w.bmp - delete mode 100644 shogibitmaps/sl58o.bmp - delete mode 100644 shogibitmaps/sl58w.bmp - delete mode 100644 shogibitmaps/sn58o.bmp - delete mode 100644 shogibitmaps/sn58w.bmp - delete mode 100644 shogibitmaps/sp58o.bmp - delete mode 100644 shogibitmaps/sp58w.bmp - delete mode 100644 shogibitmaps/sr58o.bmp - delete mode 100644 shogibitmaps/sr58w.bmp - delete mode 100644 shogibitmaps/ss58o.bmp - delete mode 100644 shogibitmaps/su58o.bmp - delete mode 100644 shogibitmaps/sw58o.bmp - delete mode 100644 shogibitmaps/sw58w.bmp - -** Version 4.4.1 ** - -(git diff --stat --summary -M vold...vnew) - - .gitignore | 27 +- - ChangeLog | 1445 +++++++++++++++++++++++++++++++------------- - Makefile.am | 41 +- - NEWS | 24 + - README | 1 - - ToDo => TODO | 0 - backend.c | 1322 +++++++++++++++++++++++++---------------- - backend.h | 15 +- - backendz.h | 1 + - bitmaps/a49c.bm | 27 - - bitmaps/b129o.bm | 189 ++++++- - bitmaps/b129s.bm | 189 ++++++- - bitmaps/bitmaps.h | 1060 ++++++++++++++++---------------- - bitmaps/fixup.sed | 3 - - bitmaps/h129o.bm | 5 - - bitmaps/k129o.bm | 189 ++++++- - bitmaps/k129s.bm | 189 ++++++- - bitmaps/m33s.bm | 18 +- - bitmaps/n129o.bm | 189 ++++++- - bitmaps/n129s.bm | 189 ++++++- - bitmaps/p129o.bm | 189 ++++++- - bitmaps/p129s.bm | 189 ++++++- - bitmaps/q129o.bm | 189 ++++++- - bitmaps/q129s.bm | 189 ++++++- - bitmaps/r129o.bm | 189 ++++++- - bitmaps/r129s.bm | 189 ++++++- - bitmaps/unsigned.sh | 8 - - bitmaps/v54o.bm | 30 - - bitmaps/v54s.bm | 30 - - bitmaps/w54o.bm | 27 - - bitmaps/w54s.bm | 27 - - book.c | 6 +- - cmail.in | 6 +- - common.h | 14 +- - configure.ac | 2 +- - copyright.texi | 1 + - engine-intf.html | 1118 ++++++++++++++++------------------ - frontend.h | 15 +- - gamelist.c | 27 +- - moves.c | 49 +- - parser.h | 4 +- - parser.l | 15 +- - pgntags.c | 4 + - pixmaps/add33.xpm | 23 +- - pixmaps/add37.xpm | 21 +- - pixmaps/add40.xpm | 23 +- - pixmaps/add45.xpm | 27 +- - pixmaps/add49.xpm | 29 +- - pixmaps/add54.xpm | 39 +- - pixmaps/add58.xpm | 35 +- - pixmaps/add64.xpm | 39 +- - pixmaps/add72.xpm | 41 +- - pixmaps/adl33.xpm | 23 +- - pixmaps/adl37.xpm | 21 +- - pixmaps/adl40.xpm | 23 +- - pixmaps/adl45.xpm | 27 +- - pixmaps/adl49.xpm | 29 +- - pixmaps/adl54.xpm | 39 +- - pixmaps/adl58.xpm | 35 +- - pixmaps/adl64.xpm | 39 +- - pixmaps/adl72.xpm | 41 +- - pixmaps/asdd33.xpm | 47 +- - pixmaps/asdd45.xpm | 53 -- - pixmaps/asdd49.xpm | 61 +- - pixmaps/asdd72.xpm | 85 ++-- - pixmaps/asdl33.xpm | 47 +- - pixmaps/asdl45.xpm | 53 -- - pixmaps/asdl49.xpm | 61 +- - pixmaps/asdl72.xpm | 85 ++-- - pixmaps/asld45.xpm | 54 -- - pixmaps/asll45.xpm | 54 -- - pixmaps/cdd33.xpm | 41 +- - pixmaps/cdd37.xpm | 53 +- - pixmaps/cdd40.xpm | 53 +- - pixmaps/cdd45.xpm | 57 +- - pixmaps/cdd49.xpm | 61 +- - pixmaps/cdd54.xpm | 71 ++-- - pixmaps/cdd58.xpm | 73 ++-- - pixmaps/cdd64.xpm | 81 ++-- - pixmaps/cdd72.xpm | 91 ++-- - pixmaps/cdl33.xpm | 41 +- - pixmaps/cdl37.xpm | 53 +- - pixmaps/cdl40.xpm | 53 +- - pixmaps/cdl45.xpm | 57 +- - pixmaps/cdl49.xpm | 61 +- - pixmaps/cdl54.xpm | 71 ++-- - pixmaps/cdl58.xpm | 73 ++-- - pixmaps/cdl64.xpm | 81 ++-- - pixmaps/cdl72.xpm | 91 ++-- - pixmaps/convert.c | 30 +- - pixmaps/cvdd33.xpm | 39 +- - pixmaps/cvdd37.xpm | 23 +- - pixmaps/cvdd40.xpm | 49 +- - pixmaps/cvdd45.xpm | 27 +- - pixmaps/cvdd49.xpm | 31 +- - pixmaps/cvdd54.xpm | 67 +- - pixmaps/cvdd58.xpm | 77 ++-- - pixmaps/cvdd64.xpm | 79 ++-- - pixmaps/cvdd72.xpm | 87 ++-- - pixmaps/cvdl33.xpm | 39 +- - pixmaps/cvdl37.xpm | 23 +- - pixmaps/cvdl40.xpm | 49 +- - pixmaps/cvdl45.xpm | 27 +- - pixmaps/cvdl49.xpm | 31 +- - pixmaps/cvdl54.xpm | 67 +- - pixmaps/cvdl58.xpm | 77 ++-- - pixmaps/cvdl64.xpm | 79 ++-- - pixmaps/cvdl72.xpm | 87 ++-- - pixmaps/dkdd33.xpm | 19 +- - pixmaps/dkdd49.xpm | 23 +- - pixmaps/dkdd72.xpm | 37 +- - pixmaps/dkdl33.xpm | 19 +- - pixmaps/dkdl49.xpm | 23 +- - pixmaps/dkdl72.xpm | 37 +- - pixmaps/edd33.xpm | 49 +- - pixmaps/edd49.xpm | 63 +- - pixmaps/edd72.xpm | 101 ++-- - pixmaps/edl33.xpm | 49 +- - pixmaps/edl49.xpm | 63 +- - pixmaps/edl72.xpm | 101 ++-- - pixmaps/fdd33.xpm | 35 +- - pixmaps/fdd49.xpm | 43 +- - pixmaps/fdd72.xpm | 37 +- - pixmaps/fdl33.xpm | 35 +- - pixmaps/fdl49.xpm | 43 +- - pixmaps/fdl72.xpm | 37 +- - pixmaps/gdd33.xpm | 11 +- - pixmaps/gdd49.xpm | 11 +- - pixmaps/gdd72.xpm | 19 +- - pixmaps/gdl33.xpm | 11 +- - pixmaps/gdl49.xpm | 11 +- - pixmaps/gdl72.xpm | 19 +- - pixmaps/hdd33.xpm | 47 +- - pixmaps/hdd49.xpm | 39 +- - pixmaps/hdd72.xpm | 63 +- - pixmaps/hdl33.xpm | 47 +- - pixmaps/hdl49.xpm | 39 +- - pixmaps/hdl72.xpm | 63 +- - pixmaps/ldd33.xpm | 23 +- - pixmaps/ldd37.xpm | 25 +- - pixmaps/ldd40.xpm | 29 +- - pixmaps/ldd45.xpm | 31 +- - pixmaps/ldd49.xpm | 25 +- - pixmaps/ldd54.xpm | 39 +- - pixmaps/ldd58.xpm | 39 +- - pixmaps/ldd64.xpm | 37 +- - pixmaps/ldd72.xpm | 45 +- - pixmaps/ldl33.xpm | 23 +- - pixmaps/ldl37.xpm | 25 +- - pixmaps/ldl40.xpm | 29 +- - pixmaps/ldl45.xpm | 31 +- - pixmaps/ldl49.xpm | 25 +- - pixmaps/ldl54.xpm | 39 +- - pixmaps/ldl58.xpm | 39 +- - pixmaps/ldl64.xpm | 37 +- - pixmaps/ldl72.xpm | 45 +- - pixmaps/mdd33.xpm | 84 ++-- - pixmaps/mdd49.xpm | 23 +- - pixmaps/mdd72.xpm | 29 +- - pixmaps/mdl33.xpm | 84 ++-- - pixmaps/mdl49.xpm | 23 +- - pixmaps/mdl72.xpm | 29 +- - pixmaps/odd33.xpm | 19 +- - pixmaps/odd49.xpm | 31 +- - pixmaps/odd72.xpm | 45 +- - pixmaps/odl33.xpm | 19 +- - pixmaps/odl49.xpm | 31 +- - pixmaps/odl72.xpm | 45 +- - pixmaps/sdd49.xpm | 19 +- - pixmaps/sdd72.xpm | 27 +- - pixmaps/sdl49.xpm | 19 +- - pixmaps/sdl72.xpm | 27 +- - pixmaps/udd49.xpm | 49 +- - pixmaps/udd72.xpm | 59 +- - pixmaps/udl49.xpm | 49 +- - pixmaps/udl72.xpm | 59 +- - pixmaps/vdd33.xpm | 39 +- - pixmaps/vdd49.xpm | 57 +- - pixmaps/vdd54.xpm | 62 -- - pixmaps/vdd72.xpm | 77 ++-- - pixmaps/vdl33.xpm | 39 +- - pixmaps/vdl49.xpm | 57 +- - pixmaps/vdl54.xpm | 62 -- - pixmaps/vdl72.xpm | 77 ++-- - pixmaps/vld54.xpm | 63 -- - pixmaps/vll54.xpm | 63 -- - pixmaps/wdd33.xpm | 39 +- - pixmaps/wdd49.xpm | 49 +- - pixmaps/wdd54.xpm | 62 -- - pixmaps/wdd72.xpm | 69 ++- - pixmaps/wdl33.xpm | 39 +- - pixmaps/wdl49.xpm | 49 +- - pixmaps/wdl54.xpm | 62 -- - pixmaps/wdl72.xpm | 69 ++- - pixmaps/wld54.xpm | 63 -- - pixmaps/wldd49.xpm | 49 +- - pixmaps/wldd72.xpm | 69 ++- - pixmaps/wldl49.xpm | 49 +- - pixmaps/wldl72.xpm | 69 ++- - pixmaps/wll54.xpm | 63 -- - pixmaps/wndd49.xpm | 47 +- - pixmaps/wndd72.xpm | 69 ++- - pixmaps/wndl49.xpm | 47 +- - pixmaps/wndl72.xpm | 69 ++- - pixmaps/wpdd49.xpm | 37 +- - pixmaps/wpdd72.xpm | 53 +- - pixmaps/wpdl49.xpm | 37 +- - pixmaps/wpdl72.xpm | 53 +- - pixmaps/wsdd49.xpm | 49 +- - pixmaps/wsdd72.xpm | 69 ++- - pixmaps/wsdl49.xpm | 49 +- - pixmaps/wsdl72.xpm | 69 ++- - shiphtml | 25 - - winboard/COMPILING | 26 +- - winboard/WB4Jaws.dev | 30 +- - winboard/Winboard.dev | 30 +- - winboard/bitmaps/as45o.bmp | Bin 422 -> 0 bytes - winboard/bitmaps/as45s.bmp | Bin 422 -> 0 bytes - winboard/bitmaps/as45w.bmp | Bin 422 -> 0 bytes - winboard/bitmaps/bas.gif | Bin 308 -> 0 bytes - winboard/bitmaps/bcv.gif | Bin 295 -> 0 bytes - winboard/bitmaps/bitmaps.h | 368 ----------- - winboard/bitmaps/convert.c | 4 +- - winboard/bitmaps/h129o.bmp | Bin 2642 -> 0 bytes - winboard/bitmaps/m129o.bmp | Bin 2642 -> 0 bytes - winboard/bitmaps/m33s.bmp | Bin 3354 -> 326 bytes - winboard/bitmaps/v54o.bmp | Bin 494 -> 0 bytes - winboard/bitmaps/v54s.bmp | Bin 494 -> 0 bytes - winboard/bitmaps/v54w.bmp | Bin 494 -> 0 bytes - winboard/bitmaps/w54o.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/w54s.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/w54w.bmp | Bin 454 -> 0 bytes - winboard/bitmaps/was.gif | Bin 326 -> 0 bytes - winboard/bitmaps/wcv.gif | Bin 314 -> 0 bytes - winboard/config.h | 10 +- - winboard/internationalize | 3 + - winboard/jaws.c | 98 ++-- - winboard/language.txt | 460 ++++++++++++++ - winboard/makefile.gcc | 9 +- - winboard/makefile.ms | 9 +- - winboard/metascript.txt | 14 + - winboard/resource.h | 9 + - winboard/wchat.c | 256 ++++++++ - winboard/wclipbrd.c | 13 - - winboard/wevalgraph.c | 356 ++++++----- - winboard/wgamelist.c | 5 +- - winboard/winboard.c | 668 +++++++-------------- - winboard/winboard.dsp | 4 + - winboard/winboard.h | 1 + - winboard/winboard.rc | 70 ++- - winboard/winboard.rtf | 1002 ++++++++++++++++--------------- - winboard/woptions.c | 60 +-- - winboard/wsettings.c | 136 +---- - xboard.c | 533 +++++++---------- - xboard.texi | 166 +++--- - xedittags.c | 16 - - xengineoutput.c | 40 +- - xhistory.c | 53 -- - xoptions.c | 148 +---- - zippy.c | 13 +- - 260 files changed, 11230 insertions(+), 8943 deletions(-) - rename ToDo => TODO (100%) - mode change 100644 => 100755 backend.c - delete mode 100644 bitmaps/a49c.bm - delete mode 100644 bitmaps/fixup.sed - delete mode 100644 bitmaps/h129o.bm - delete mode 100644 bitmaps/unsigned.sh - delete mode 100644 bitmaps/v54o.bm - delete mode 100644 bitmaps/v54s.bm - delete mode 100644 bitmaps/w54o.bm - delete mode 100644 bitmaps/w54s.bm - mode change 100644 => 100755 gamelist.c - delete mode 100644 pixmaps/asdd45.xpm - delete mode 100644 pixmaps/asdl45.xpm - delete mode 100644 pixmaps/asld45.xpm - delete mode 100644 pixmaps/asll45.xpm - delete mode 100644 pixmaps/vdd54.xpm - delete mode 100644 pixmaps/vdl54.xpm - delete mode 100644 pixmaps/vld54.xpm - delete mode 100644 pixmaps/vll54.xpm - delete mode 100644 pixmaps/wdd54.xpm - delete mode 100644 pixmaps/wdl54.xpm - delete mode 100644 pixmaps/wld54.xpm - delete mode 100644 pixmaps/wll54.xpm - delete mode 100644 shiphtml - delete mode 100644 winboard/bitmaps/as45o.bmp - delete mode 100644 winboard/bitmaps/as45s.bmp - delete mode 100644 winboard/bitmaps/as45w.bmp - delete mode 100644 winboard/bitmaps/bas.gif - delete mode 100644 winboard/bitmaps/bcv.gif - delete mode 100644 winboard/bitmaps/bitmaps.h - delete mode 100644 winboard/bitmaps/h129o.bmp - delete mode 100644 winboard/bitmaps/m129o.bmp - delete mode 100644 winboard/bitmaps/v54o.bmp - delete mode 100644 winboard/bitmaps/v54s.bmp - delete mode 100644 winboard/bitmaps/v54w.bmp - delete mode 100644 winboard/bitmaps/w54o.bmp - delete mode 100644 winboard/bitmaps/w54s.bmp - delete mode 100644 winboard/bitmaps/w54w.bmp - delete mode 100644 winboard/bitmaps/was.gif - delete mode 100644 winboard/bitmaps/wcv.gif - create mode 100644 winboard/internationalize - create mode 100644 winboard/language.txt - create mode 100644 winboard/metascript.txt - create mode 100644 winboard/wchat.c - mode change 100644 => 100755 winboard/winboard.dsp - mode change 100644 => 100755 winboard/woptions.c - - diff --git a/FAQ.html b/FAQ.html deleted file mode 100644 index a2a264c..0000000 --- a/FAQ.html +++ /dev/null @@ -1,1912 +0,0 @@ - - - - - - - - - - -XBoard and WinBoard: Frequently Asked Questions - - - - - - - -

XBoard and WinBoard: Frequently Asked Questions

- -

This document answers some frequently asked questions about the -graphical chess interfaces XBoard and WinBoard. -A hyperlinked version of this FAQ is available on -the Web through the page - -http://www.gnu.org/software/xboard/FAQ.html.

- -

This FAQ is in need of revision. Please contact us if you'd like -to help update it.

- -
-

Outline

- - - -
-

Detailed contents

- - - -
-

[A] Introduction and hot topics

- -
-

[A.1] What are XBoard and WinBoard?

- -

XBoard and WinBoard are graphical user interfaces for chess. - XBoard runs with the X Window System on Unix systems (including - GNU/Linux); see topic [B.1]. WinBoard runs - on true 32-bit Microsoft Windows operating systems, such as Windows - 95, 98, NT, 2000, ME, XP, Vista, and should continue to work on future - 32-bit Windows systems. It does not work on Windows CE (also known - as Pocket PC), nor does it work on 16-bit Windows systems such as - Windows 3.1. See topic [B.2].

- -
-

[A.2] Where can I get chess information and chess - software?

- -

As a shortcut to most things mentioned in this FAQ, try Tim Mann's - Chess Web page, http://www.tim-mann.org/chess.html. - This page page is currently a very bad place to get the latest released - versions of XBoard and WinBoard and the most up-to-date version of this - FAQ, though. A better place is the - WinBoard forum. - Also see our Savannah - project pages at https://savannah.gnu.org/projects/xboard/.

- -

If you have other questions about XBoard/WinBoard that aren't - answered in this FAQ, you can try Aaron Tay's WinBoard and Chess - Engines FAQ, - atdefunct - URL.

- -

For general news and information about chess, try the -CCC forum -or the - WinBoard forum. -Anothe possibility is the newsgroup hierarchy -rec.games.chess.*, especially the groups rec.games.chess.misc and -rec.games.chess.computer. Both of the latter groups have very informative -FAQs maintained by Steve Pribut; look for them on the newsgroups or at -defunct URL.

- -

Like other GNU software, you can get XBoard, and WinBoard by anonymous FTP from -ftp://ftp.gnu.org/pub/gnu/ -and its many mirror sites. Look in the subdirectories xboard, and winboard. -The .tar.gz suffix on the files there indicates they were packed with tar -and compressed with gzip. The .exe or .zip suffixes indicate files that -were packed and compressed with zip.

- -

For other chess software, try the Internet Chess Library. Use -anonymous FTP to connect to ftp.freechess.org, or go to the Web page -http://www.freechess.org/. -You can get chess software, game -collections, the FAQ file for rec.games.chess, and other chess-related -material there, in the directory pub/chess. The FTP server can -automatically decompress files for you as you download them, useful if you -don't have gzip.

- -

Here is a sample anonymous ftp session. Some of the ftp server's responses -are abbreviated, but all the commands you must type are included.

- -
-    % ftp ftp.gnu.org
-    Connected to ftp.gnu.org
-    Name: anonymous
-    Password: your-email-address@your-site
-    ftp> binary
-    200 Type set to I.
-    ftp> cd /pub/gnu/xboard
-    ftp> dir
-    -rw-r--r-- 1 14910 wheel  1057625 May 20 00:25 xboard-4.2.7.tar.gz
-    ftp> get xboard-4.2.7.tar.gz
-    150 BINARY connection for xboard-4.2.7.tar.gz (1057625 bytes).
-    226 Transfer complete.
-    ftp> quit
-
- -
-

[A.3] What are the current version numbers for -XBoard and WinBoard?

- -

At this writing, the current version numbers are:

- -
    -
  • XBoard 4.4.0
  • -
  • WinBoard 4.4.0
  • -
- -
-

[A.4] Who is working on this project?

- -Please see our Savannah project pages -at https://savannah.gnu.org/projects/xboard/ -for a list of active developers. Many others occasionally contribute -suggestions and snippets of code, for which we are grateful. - -
-

[A.5] How do I report bugs, offer help, etc.?

- -

Bug reports, suggestions, and offers to help on XBoard -or WinBoard should be sent to bug-xboard@gnu.org.

- -

Beginner questions and discussion about the program may get faster -answers on the WinBoard Forum at http://www.open-aurec.com/wbforum/. -This forum also constains a section dedicated to propose and discuss -new features for WinBoard / XBoard or WinBoard protocol, -and reposrt bugs, -and offers downloads of pre-installed packages of WinBoard -bundled with other software, -useful for conducting computer-computer tournaments.

- -

If you are developing a -chess engine that works with XBoard or WinBoard (or an alternative -GUI that works with such engines), see the Chess Engines mailing -list, hosted at -http://groups.yahoo.com/group/chess-engines. -For better response, join the above-mentioned WinBoard forum, -or the CCC forum.

- - -

Any time you want to report a possible bug in XBoard or WinBoard, -we need to know exactly what you did, and exactly what error (or -other) messages you got.

- -

If you are using Unix, run the "script" program, run XBoard with -the -debug flag (if you get as far as running it), do whatever is -necessary to reproduce the problem, type "exit" to the shell, and mail -us the resulting typescript file. We also need to know what -hardware/operating system combination you are using. The command -"uname -a" will usually tell you this; include its output in your -typescript.

- -

If you are using MS Windows, run WinBoard with the -debug flag, and -send us a copy of the WinBoard.debug file. If you aren't sure how to -add command-line flags to WinBoard, you can hit Ctrl+Alt+F12 to create -a WinBoard.debug file after WinBoard starts, but that is not as good, -because a few messages that would have been printed at the start are -lost.

- -

Either way, please send us the exact text of the commands you typed -and the output you got, not just your recollection of approximately -what they were. The messages may seem meaningless to you, but they -are very meaningful to us and essential for diagnosing problems.

- -
-

[A.6] What are the future plans for XBoard and - WinBoard?

- -

Our plans are always in flux. As with most free software projects, -the next release will happen when it happens -- or it may never -happen. This has always been the policy for XBoard/WinBoard. -Releases have never been promised in specific time frames.

- -

Starting in November 2003, several new developers have joined the -project, and work is now hosted at https://savannah.gnu.org/projects/xboard/. Lots of work is just -getting underway, but nothing is far along yet.

- -

Here is a partial list of items that have a nonzero probability of -happening in finite time.

- -
    -
  • Small bug fixes. Occasionally someone sends us a fix, or reports -a small bug very clearly so that we're able to fix it in a few minutes -work.
  • - -
  • Protocol version 3. The members of the chess engine authors' -mailing list discussed a set of proposed features for the next version -of the XBoard/WinBoard chess engine communication protocol. -The WinBoard 4.3 fork has taken the protocol in a different direction, -though, extending version 2 with new features as they were needed, -rather than upgrading to a new protocol in a single sweep. -It does not seem likely that there will be a v3 protocol in the -foreseeable future. -
  • - -
  • Contributed features. Several people have mailed me code to add -various features. Most of this code is available on the -XBoard/WinBoard extensions page -at -http://www.tim-mann.org/extensions.html, -but it is not in any official releases yet. We are in the process of -getting folks to formally assign the copyrights on their contributions -to the Free Software Foundation so that we can include it in official -releases in the future.
  • - -
  • Internationalization. Several people have expressed interest in -internationalizing XBoard/WinBoard. Version 4.4 implements -internationalization in its XBoard branch, and includes (partial) -Turkish and German translations. For WinBoard a suitable way for -internationalization still has to be found, as all menu strings there -are not in the C code, but in a Windows resource file. In any case, we -will need more translators, to update the existing translations (for -version 4.2.7) to the current version, and to provide translaions for -oter languages. Watch for news on the xboard-devel mailing list on -our Savannah pages.
  • - -
- -
-

[B] XBoard and WinBoard

-
-

[B.1] What is XBoard?

- -

XBoard is a graphical user interface for chess. It displays a -chessboard on the screen, accepts moves made with the mouse, and loads -and saves games in Portable Game Notation (PGN). XBoard is free software. -It serves as a front-end for many different chess services, including:

- -

Chess engines that will run on your machine and -play a game against you or help you analyze, such as GNU Chess and -Crafty (topic [D.3] below).

- -

Chess servers on the Internet, where you can -connect to play chess with people from all over the world, watch other -users play, or just hang out and chat.

- -

Correspondence chess played by electronic -mail. The cmail program (topic [B.6] below) -automates the tasks of parsing email from your opponent, playing his -moves out on your board, and mailing your reply move after you've -chosen it.

- -

The Web and your own saved games. You can use -XBoard as a helper application to view PGN games in your -Web browser, or to load and save your own PGN files.

- -

XBoard runs under Unix or Unix-compatible systems. It requires the -X Window System, version X11R4 or later. There are also ports of -XBoard to 32-bit Microsoft Windows and to -the Amiga. See topics [B.2] and [B.3] respectively.

- -
-

[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?

- -

WinBoard is a port of XBoard to 32-bit Microsoft Windows systems, such -as Windows 95, 98, NT, 2000, ME, and XP. It uses the same back end -chess code as XBoard, but the front end graphics code is a complete -rewrite. WinBoard is free software.

- -

The WinBoard distribution includes a sample Chess engine.

- -

The WinBoard distribution also includes the ICC timestamp and FICS -timeseal programs (topic [B.12]).

- -

cmail (topic [B.6]) has not been ported to -Windows. All the other XBoard functions are included in WinBoard. -The International Email Chess Group web site at http://www.iecg.org/ recommends -ECTool (http://www.ectool.nu/) -for playing correspondence chess under Windows.

- -

You install WinBoard as follows. Download the WinBoard package to -your PC (see topic [A.2]). It will be a file -with a name like winboard-4_0_0.exe. Double-click on this file -in the Explorer or File Manager to run it. Follow the on-screen -prompts.

- -
-

[B.3] Is there an XBoard for the Amiga? What is AmyBoard?

- -

AmyBoard is a port of XBoard to the Amiga, by Jochen Wiedmann. -The distribution includes a port of GNU Chess. -AmyBoard is free software.

- -

The current version of AmyBoard is 330.5 (based on XBoard 3.3.0). -No one is currently maintaining it.

- -

System requirements:

- -
    -
  • An Amiga (obviously :-), running OS 2.04 or later, 2Mb RAM or more.
  • -
  • MUI 2.0 or later.
  • -
  • Workbench or another screen with no less than 640x400 pixels (adjustable - with the MUI-Prefs); this restriction is just because we don't have - bitmaps with less than 40x40 pixels per square. If someone contributes - bitmaps with 20x20 or 20x25, they will work with any Hires mode.
  • -
- -

If you would like to use an ICS, you need an Internet connection via either

- -
    -
  • a telnet-like program, or
  • -
  • a terminal program reading from stdin and writing to stdout.
  • -
- -

AmyBoard is available in the Internet Chess Library (topic [A.2]).

- -
-

[B.4] Is there an XBoard for the Macintosh?

- -

Note: I am not a Mac user and have not tried this myself, so I cannot -answer questions about it.

- -

Because MacOS X has a Unix base, XBoard will compile and run on it. -You do need an X11 (X Window System) server and client libraries. I'm -told that these come standard with MacOS X 10.3 and later. Once you -install the X11 package, XBoard is reported to compile and run without -changes.

- -

You can avoid having to compile XBoard (and GNU Chess) yourself by -using the Fink sofware packaging system. See -http://fink.sourceforge.net/ and -http://finkcommander.sourceforge.net/ for more info on Fink.

- -

There is no version of XBoard or WinBoard that runs with the native -(non-X11) Mac graphical interface, and none that runs on MacOS 9 or -earlier.

- - -
-

[B.5] Does XBoard run on VMS?

- -

No. This port would probably be a lot easier than the Win32 and Amiga -ports were, because VMS has the X Window system (under the name -DECwindows) and is now POSIX compliant. If you are working on this, -send mail to bug-xboard@gnu.org to let us know.

- - -
-

[B.6] What is cmail?

- -

cmail is a program that helps you play and keep track of electronic mail -correspondence chess games using XBoard. It is distributed with XBoard and -has its own manual page. cmail is free software. It was written by -Even Welsh. cmail has not been ported to Windows; sorry.

- -
-

[B.7] How do I build XBoard? Do I need gcc?

- -

The first step to building XBoard is to get the distribution file. See topic -[A.2] for places you can ftp the software from.

- -

Next, decide what directory tree you are going to install XBoard -in. The default is /usr/local, but you probably don't have write -access to that directory unless you are a system administrator. If -you do, type the following to install it there:

- -
-    gzip -cd xboard-*.tar.gz | tar -xvf -
-    cd xboard-*/
-    ./configure
-    make
-    su
-    make install
-
- -

If you want to install xboard in your personal home directory ($HOME/bin), -type this:

- -
-    gzip -cd xboard-*.tar.gz | tar -xvf -
-    cd xboard-*/
-    ./configure --prefix=$HOME
-    make
-    make install
-
- -

If the first step above fails because you don't have gzip, see -topic [A.2], and ask a local Unix expert if you -need more help. If you have any problems with the last two steps, -read the READ_ME and INSTALL files in the xboard-*/ directory. You -will also find this FAQ there.

- -

You don't need to have gcc to build XBoard. Almost any Unix C -compiler should do.

- -
-

[B.8] Can I use XBoard or WinBoard to play a game - of chess with another human?

- -

The only way for two humans on different machines to play chess in -real time using XBoard/WinBoard is to use an Internet Chess Server -as an intermediary. That is, each player runs his own copy of XBoard -or WinBoard, both of them log into an ICS, and they play a game there. -Two copies of XBoard/WinBoard cannot communicate with each other -directly.

- -

Instructions on how to get started with Internet chess are included -with the XBoard and WinBoard distributions. The network addresses -included in the distribution may not always be current. The oldest -and largest ICS is the Internet Chess Club at chessclub.com, which now -has a fee for registered use, but still allows free unregistered use. -There are also many newer sites with no fees, using the Free Internet -Chess Server implementation (FICS). The most active FICS site is -freechess.org. On these and most other chess servers, -the port number to use is 5000.

- -

If you don't have network connectivity to any ICS site, you -can run your own server using a version of the FICS code, but this -is not easy. See http://www.tim-mann.org/ics.html#ownics for advice and pointers.

- -

The cmail program included with XBoard lets you play email postal games with -another human; see topic [B.6].

- -

Two humans can play chess on the same machine using one copy of -XBoard/WinBoard in -Edit Game mode, but the clocks don't run in this mode, so it's of limited -usefulness.

- -

See also topic [D.2], Winsock Chess.

- -
-

[B.9] Will WinBoard run on Windows 3.1? - How about Windows CE (also known as Pocket PC)? -

- -

WinBoard does not run on Windows 3.1, Windows for Workgroups 3.11, etc., -not even with the Win32s compatibility package. The main problem is -that Win32s does not have threads or real concurrent processes. A -port of WinBoard to Windows 3.1 is possible in theory, but it would be -difficult and messy, and no one is going to do it.

- -

WinBoard does not run on Windows CE (also -known as Pocket PC). I don't know what would be required to port it.

- -

WinBoard does run well on full 32-bit versions of Windows, such as -Windows 95, 98, NT, 2000, ME, XP, and Vista, and should continue to work -on future 32-bit Windows systems. -To use the help files in Vista, you will need to install the WinHlp32.exe -from MicroSoft on your Vista system. -

- -
-

[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files - with my Web browser?

- -
    -
  1. On Unix systems: -
      -
    • Add the following line to the file .mime.types in your home directory. -(Create the file if it doesn't exist already.) -
      -    application/x-chess-pgn    pgn
      -
      -
    • -
    • -Add the following line to the file .mailcap in your home directory. -(Create the file if it doesn't exist already.) -
      -    application/x-chess-pgn; xboard -ncp -lgf %s
      -
      -
    • -
    • - Exit from your Web browser and restart it. -
    • -
    -
  2. -
  3. On MS Windows systems: -

    The exact procedure depends on which Web browser you are using. -The current version of WinBoard automatically configures itself as -your PGN viewer for local files, Netscape 4.x and later, and Internet -Explorer. This automatic setup probably works for all other current Web -browsers, too.

    -
  4. -
- -
-

[B.11] How do I use WinBoard as an external viewer - for PGN files with the MS Windows File Manager or Explorer?

- -

WinBoard sets this up automatically when you install it, except on old -versions of Windows NT (prior to 4.0). On Windows NT 3.51 or earlier, -go to the File Manager, click on the File menu, select Associate, -enter "pgn" as the extension, and use the Browse button to find your -copy of WinBoard and set up the association.

- -
-

[B.12] How do I use ICC timestamp or FICS timeseal -with XBoard?

- -

First, get the appropriate version of timestamp or timeseal for your -machine from ftp.chessclub.com or ftp.freechess.org. -Second, be sure that you can connect using XBoard without -timestamp/timeseal. Third, be sure that you can connect using -timestamp/timeseal without XBoard. See the help files on ICC and FICS -or ask people online if you have problems.

- -

If you are in a completely ordinary situation, where your machine -is directly on the Internet and you can connect to ICC or FICS -without timestamp/timeseal using -just the command "xboard -ics" or "xboard -ics -icshost freechess.org", -change that command to one of the following:

- -
-    xboard -ics -icshost chessclub.com -icshelper timestamp
-
-    xboard -ics -icshost freechess.org -icshelper timeseal
-
- -

If you have a firewall between your machine and the ICS, see topic -[B.19].

- -

If you normally have to use the "/icscomm" command line option on -xboard to log into a second machine, and then telnet to ICC or FICS -from there, you are going to have to run the Unix version of timestamp -or timeseal on the second machine. (If the second machine is not -running Unix, you are out of luck.) Get the appropriate version of -timestamp or timeseal onto the shell machine via FTP; see the help -files on ICC and FICS for instructions. Then simply run it when you -would normally run telnet. In this configuration you are not -protected against lag between your PC and the shell machine, or for -lag caused by heavy load on the shell machine itself from other users.

- -

For further information on timestamp and timeseal, see the help -files on ICC and FICS.

- -
-

[B.13] How do I use ICC timestamp or FICS timeseal -with WinBoard?

- -

If you select an ICS from either the WinBoard Startup dialog or the -Windows Start submenu that WinBoard installs, WinBoard automatically -runs timestamp or timeseal if the ICS you chose is known to support it.

- -

If you are constructing a WinBoard command line by hand, add the -option "/icshelper timestamp" or "/icshelper timeseal" to the WinBoard -command line to use timestamp or timeseal. Both timestamp.exe and -timeseal.exe are included in the WinBoard distribution. They both -function identically to the Unix versions, as documented in "help -timestamp" on ICC and "help timeseal" on FICS.

- -

If you have a firewall between your machine and the ICS, see topic -[B.19].

- -

If you normally have to use the "/icscomm" command line option on -WinBoard to log into a shell account, and then telnet to ICC or FICS -from there, you are going to have to run the Unix version of timestamp -or timeseal on the shell machine. (If the shell account is not on a -Unix machine, you are out of luck.) Get the appropriate version of -timestamp or timeseal onto the shell machine via FTP; see the help -files on ICC and FICS for instructions. Then simply run it when you -would normally run telnet. In this configuration you are not protected -against lag between your PC and the shell machine, or for lag caused by -heavy load on the shell machine itself from other users.

- -

For further information on timestamp and timeseal, see the help -files on ICC and FICS.

- -
-

[B.14] How do I play bughouse with XBoard or WinBoard? -

- -

XBoard and WinBoard have full bughouse support. -Offboard piece holdings are shown next to the board, and -you drop offboard pieces by dragging them with the mouse -(holding the left button down) to their drop square, -or left-click the piece and the drop square, just like when you enter -any ordinary move.

- -

XBoard and WinBoard can display only one board at a time, but you -can observe your partner's game by running a second copy of the -program and logging in as a guest. (Unfortunately, this is not -possible if you are using the /icscomm option.) To observe your -partner's games automatically, use the "follow" or "pfollow" ICS -command; see the ICS online help for details.

- -
-

[B.16] What is Zippy? How can I interface a -chess program to the Internet Chess Servers?

- -

Zippy is an interface that lets a compatible chess engine (such as GNU -Chess or Crafty) act as a computer -player on an Internet Chess Server. Zippy is included in both the -XBoard and WinBoard distributions. It is implemented as a small -amount of additional code within XBoard or WinBoard. -For documentation, see the file -zippy.README, included in both distributions or available -from my chess Web page, -http://www.tim-mann/chess.html. -The version of zippy.README on my Web page is often more up-to-date -than those in the XBoard/WinBoard distributions. -You'll also find a "biography" of Zippy and pointers to the original -Zippy the Pinhead comic strips on my Web page. -Please read zippy.README carefully before you ask me any questions about Zippy.

- -

Using a computer to choose your moves on a chess server is -considered cheating unless your account is on the computer (C) list. -Read "help computer" on your favorite server for details on their -policy. Most of the servers have plenty of computers running now, so they -will not be excited about having you run a new one unless you have -written your own chess engine. They don't really need yet another -Crafty or GNU Chess clone.

- -
-

[B.17] How can I interface my own chess program -to XBoard or WinBoard?

- -

This is a non-trivial task. XBoard and WinBoard were not designed -with a clean interface for talking to chess programs; they were -written to work with an existing version of GNU Chess that expects to -be talking to a person. Your program has to emulate GNU Chess's -rather idiosyncratic command structure to work with XBoard and -WinBoard. We are gradually cleaning up, improving, and documenting -the interface as newer versions of XBoard and WinBoard come out, -however.

- -

For documentation, see the file engine-intf.html, included in both -distributions or available from Tim Mann's chess Web page, http://www.tim-mann.org/chess.html. -The version of engine-intf.html on Tim's Web page might totally obsolete, -though. -To know how the current WinBoard or XBoard version communicate with their -engines, use the documentation in the XBoard/WinBoard distributions, -or on the WinBoard forum.

- -
-

[B.18] How can I recompile WinBoard from source?

- -

The source code for WinBoard is available from the author's Web page, -http://www.tim-mann.org/chess.html.

- -

WinBoard is currently developed using gcc under Cygwin. -To build WinBoard with the free Cygwin tools, available from http://www.cygwin.com/), use the -command "make -f makefile.gcc" from the winboard directory of the -source distribution.

-

You can build the program from the MSVC++ GUI by opening the project -file (winboard.dsp) and telling MSVC++ to build the project. You can -also build it from the the command line by using the nmake program -supplied with MSVC++. -The makefile for MSVC is makefile.ms in the winboard directory.

- -

WinBoard 4.2.5 was successfully -compiled with the net release of Cygwin as downloaded on 20-March-2001 -(cygwin1.dll 1.1.8, gcc 2.95.2-6, binutils 20001221-1, flex 2.5.4-1), -but exhibits a command-line parsing bug; see item 511 in the ToDo file -that comes with WinBoard. WinBoard 4.1.0 does not compile with -Cygwin. WinBoard 4.0.7 is known to compile with Cygwin BL20.1.

- -

To build WinBoard with Borland C++ 4.5, use "borland.mak", supplied -with the WinBoard sources, as the Makefile. Support for Borland C++ -was contributed by Don Fong and has not been tested by the author of WinBoard.

- -

WinBoard is a Win32 application, so you definitely need a compiler -and tool set that supports Win32. In particular, older versions of -DJGPP can build only 32-bit MSDOS programs; that is, programs that use -a DOS extender to get a 32-bit address space and do not make any -Windows calls. The latest versions of DJGPP are said to be able to -build Win32 programs when used with the proper extension package(s), -but this is not known to work with WinBoard. Use Cygwin instead.

- -

See also topic [C.16].

- -
-

[B.19] -How can I use XBoard or WinBoard to talk -to an Internet Chess Server through a firewall or proxy? -

- -

There is no single answer to this question, because there are many -different kinds of firewalls in use. They work in various different -ways and have various different security policies. This answer can -only provide hints.

- -

Note that you can't access Internet Chess Servers through a Web proxy, -because they are not a Web service. You talk to them through a raw -TCP connection, not an HTTP connection. If you can only access the -Web through a proxy, there may be a firewall that stops you from -making direct TCP connections, but there may also be a way through it. -Read on for hints, and contact your local system administrator if you -need more information about your local configuration.

- -

A helpful user mailed me the following explanation of how to use -WinBoard with WinGate:

-
-"I have managed to setup WinBoard though my WinGate proxy. I have the -Office version. What I needed to do was to setup the TCP/IP -connection to add the User/Host name and my provider service name for -the DNS, but I had to leave the HOST IP address blank. I have not -played with all the variations, so it may be just that I have the DNS -lookup enabled." -
-

I hope this helps, though I don't find it very clear. I don't have -a copy of WinGate myself and can't help if you have questions about it.

- -

If you are using some other non-SOCKS firewall, read the FIREWALLS section -in your XBoard or WinBoard documentation (man page, info document, or -Help file). If you can telnet to a chess server in some way, then you -can almost certainly connect to it with xboard/WinBoard, though in -some cases you may not be able to run timestamp or timeseal. The -timestamp and timeseal protocols require a clean, 8-bit wide TCP -connection from your machine to the ICS, which some firewalls do not -provide.

- -

If you have a SOCKS firewall and are using XBoard, -you should be able to SOCKSify xboard and use it. See http://www.socks.nec.com/ for -information about SOCKS and socksification. However, if you do this, -you can't use timestamp or timeseal; what you really need is a -socksified version of timestamp or timeseal. This is hard because the -source code for timestamp and timeseal is proprietary; the folks -running the chess servers don't give it out because that would make it -too easy to cheat. On some versions of Unix, you may be able to -socksify a program that you don't have the source code to by running -it with an appropriate dynamic library; see http://www.socks.nec.com/. For -others, you might be able to get a pre-built socksified version from -the chess server administrators. For timeseal versions, see ftp://ftp.freechess.org/pub/chess/timeseal/. For timestamp -versions, the directory would be ftp://ftp.chessclub.com/pub/icc/timestamp/, but at this writing -there don't seem to be any socksified timestamps there. Once you have -a socksified timestamp or timeseal, simply run it with a normal, -non-socksified xboard in place of the standard timestamp or timeseal.

- -

If you have a SOCKS firewall and you are using -WinBoard, we now know how to make this configuration -work, complete with timestamp or timeseal!

- -

Start by getting SocksCap32. This software is freely available -from http://www.socks.nec.com/. -Install it on your machine, read the documentation, and learn to use -it. You may find it useful with many other programs besides WinBoard.

- -

Next, don't socksify WinBoard. Socksifying -WinBoard itself doesn't let you use it with timestamp or timeseal. -For some reason I don't understand -- something strange that -SocksCap32 does -- the socksified WinBoard runs but does nothing, and -timestamp/timeseal runs all by itself in its own window.

- -

Instead, use the following workaround. Follow the instructions -exactly; don't try to skip steps or simplify things.

- -

First, make SocksCap32 application profiles for timestamp and -timeseal. Use the following command lines in the SocksCap32 -profiles. Name the first profile "timestamp" and the second -"timeseal".

- -
-    "c:\program files\winboard\timestamp.exe" chessclub.com 5000 -p 5000
-    "c:\program files\winboard\timeseal.exe" freechess.org 5000 -p 5000
-
- -

Second, run timestamp or timeseal by itself, socksified, using its -profile. This will open an unneeded, black window that will not -respond to typing. Minimize it to the task bar and ignore it. It will -go away when you exit from WinBoard.

- -

Next, run WinBoard using the following command line. Make a shortcut -or type this command into an MS-DOS Prompt box. Don't run WinBoard -itself socksified, just run it directly.

- -
-    "c:\program files\winboard.exe" /ics /icshost=localhost /icsport=5000
-
- -

After you get this working, you can try getting the timestamp window to -auto-minimize by starting it from a shortcut instead of from the -SocksCap32 control window. As it says in the SocksCap32 help file, put -the following in the Target field of a shortcut's Properties page:

- -
-    "c:\program files\sockscap32\sc32.exe" timestamp
-
- -

Then select "Run: Minimized" on the same page. Do the same for timeseal.

- -

Another method that can work is to use a .bat file to start both -timestamp and WinBoard. It would look something like this:

- -
-    REM --
-    REM -- icc.bat
-    REM -- Start timestamp under SocksCap32 and use WinBoard to connect to it.
-    REM -- The string "timestamp" refers to a SocksCap32 profile for timestamp.
-    REM --  Do not change it to the filename of the timestamp program!
-    REM --
-    start /minimized "c:\program files\sockscap32\sc32.exe" timestamp
-    cd "c:\program files\winboard"
-    winboard /ics /icshost=localhost /icsport=5000
-
- -

This workaround has a problem if you want to run two copies of -WinBoard at once, talking to the same chess server twice (for -bughouse) or to two different chess servers. If you need to do that, -you will need to run a separate copy of timestamp with a different -port number for each connection. You'll need to make a second set of -profile entries with a different value after the -p flag (say, 5001) -and you'll need to change the WinBoard command line /icsport=5000 for -the second WinBoard to match.

- -
-

[B.20] -How can I use XBoard or WinBoard on chess.net with accuclock? -

- -

I believe chess.net provides a Win32 command-line version of -accuclock that will work with WinBoard. Please see the documentation -on the chess.net server itself; don't ask the author of WinBoard.

- -

I don't know whether chess.net provides versions of accuclock for -Unix at this time. Ask them.

- -
-

[B.21] - Can I get Zippy to do one or more ICS commands automatically at the - start or end of each game?

- -

By default, Zippy automatically sends the command "gameend" to ICS -at the end of each game. You can alias this command (using the ICS -"alias" feature) to anything you want. On ICC, you can use the -"multi" feature to alias gameend to several commands, but other -servers don't have that feature. Zippy doesn't send anything at the -start of the game by default.

- -

You can get Zippy to send one or more commands of your choosing, at -the start and/or end of each game, by using the -zippyGameStart and --zippyGameEnd command line options, newly added in version 4.0.3. -Both xboard and WinBoard have (somewhat obscure) ways of getting -newlines into this option to send several commands. Here is an -example of one way to do it for each.

- -
-    xboard -ics -zp -xrm '*zippyGameStart: say hi\nsay prepare to die\n'
-
-    WinBoard /ics /zp /zippyGameEnd='say thanks\nseek 5 0\nseek 2 12\n'
-
- -
-

[B.22] - How do I print from WinBoard? -

- -

WinBoard does not have built-in printing functionality. -If you want to print a picture of the board, press Alt+PrintScrn, run the -standard Windows application Paintbrush, select Paste, and print from there. -If you want to print a list of moves, save your game as a PGN file, -then open the PGN file with Notepad or any other plain text editor and -print it from there.

- -

WinBoard 4.4 has a menu item "Save Diagram..." in the file menu, -which saves the board part of the display as a Windows .bmp file, -but only if the board size is not too big.

- -
-

[B.23] - Can I get Zippy to automatically reconnect to ICS when its connection - breaks?

- -

There isn't a perfect solution to this problem yet, but a pretty -good one is to write a shell script (for xboard) or .bat script (for -WinBoard) that automatically restarts the program whenever it exits. -Use the -xexit flag so that you don't get a popup dialog that must be -dismissed with the OK button before the program will exit. The gap in -this solution is that your connection to ICS can sometimes get into a -state where the program does not notice that the connection is broken -until the next time it tries to send a command. Perhaps some future -version of xboard/WinBoard will have an option to send a harmless -command every five minutes or so.

- -

Anyway, here is a sample Windows .bat file that restarts WinBoard each -time it exits. Thanks to Jason Williamson. It assumes that you have put -your computer account's name and password in a file named logon.ini.

- -
-REM --
-REM -- wbrecon.bat
-REM -- Start WinBoard in Zippy mode, and restart it each time it exits.
-REM -- Add or change parameters as needed for your application.
-REM --
-:loop
-start /w winboard /zp /ics /icslogon logon.ini /xexit /xautoraise
-REM -- The next line is to have a short delay setup for 139 seconds.
-REM -- Leave it out if it doesn't work on the version of Windows you use.
-TYPE NUL | CHOICE.COM /N /CY /TY,99 >NUL
-goto loop
-
- -

Here is a Unix shell script to do the same thing for xboard. -It's a bit more elaborate. It is based on the script I use for the -original Zippy. It logs all ICS output to a file named zippy.out, -and it lets you type commands to Zippy by running "cat > zippy.fifo".

- -
-#! /bin/sh
-host="204.178.125.65 -icsport 5000 -telnet -telnetProgram timestamp"
-#host="164.58.253.13 -icsport 5000 -telnet -telnetProgram timeseal"
-out=zippy.out
-fifo=zippy.fifo
-ZIPPYPASSWORD='something'
-export ZIPPYPASSWORD
-ZIPPYPASSWORD2='orother'
-export ZIPPYPASSWORD2
-ZIPPYLINES=`pwd`/all.lines
-export ZIPPYLINES
-ZIPPYGAMEEND='say Yow, that was FUN!
-gameend'
-export ZIPPYGAMEEND
-zippylogon=`pwd`/logon.ini
-DISPLAY=`hostname`:0.0
-export DISPLAY
-mv -f $out ${out}.old
-rm -f $fifo
-mkfifo $fifo
-pid=$$
-( while [ true ] ; do cat -u $fifo ; done ) | \
-      ( while [ true ] ; do
-          xboard -iconic -ics -icshost $host \
-                 -zt -zp -xbell -xanimate \
-                 -xautosave -xquiet -fcp "gnuchessx -h" \
-                 -icslogon $zippylogon -xexit -autoflag -xautoraise $*
-          sleep 600
-        done ) > $out 2>&1 &
-
- -
-

[B.24] - The chess engines are too strong and always beat me. How can I adjust - the difficulty level to make them weaker?

- -

The best way is to get a weaker chess engine. -On the ChessWar website -you will find a rating list of virtually all engines that are able to -play under XBoard/WinBoard, from super-humanly strong to ridculously weak. -Most of them can be downloaded for free from the internet.

- -

A way to get that effect is to limit the time the engine can use for -deciding on its move. The time-odds options or menu items in the -time-control dialog) can be used to this end. This is only of limited -help, as engines do not weeken that much at faster time-control, -and there is a practical limit to how fast you can order the engine -to go. Also feel free to use Retract Move if -you make a blunder.

- -

Many chess coaches will let you switch sides after -they get a stronger position so that you can get experience playing -positions where you are winning. You can try this with XBoard/WinBoard -by using the Machine White or Machine Black menu command to make the -machine take over your position.

- -

The -depth command-line option to XBoard/WinBoard can also be used to -weaken the engine (see the man page or Help file). It's a bit of a -nuisance to set command line options in Windows, but see topic [C.7] for instructions.

- -

Other ways of weakening engines are engine-specific. Many of them -let you adjust various parameters, and if you choose bad settings, the -engine will play more poorly. Consult whatever documentation came with -the engine you are using.

- -
-

[B.25] - May I use the piece bitmaps from XBoard/WinBoard in my own program?

- -

The piece bitmaps used in XBoard and WinBoard were designed by -Elmar Bartel. He released them under the GNU General Public -License. This means that if your program is also free software -distributed under the GPL, you can use them freely. If your program -is distributed under some other license, including commercial, -shareware, or non-GPL freeware, then you cannot use the bitmaps unless -you obtain special permission from Elmar. See the file README.bitmaps -that comes with the XBoard and WinBoard source code for more -information and an email address you can write to.

- -
-

[B.26] - How can I get rid of these silly logos that this new WinBoard displays above the board?

- -

WinBoard 4.4.0 has an option /autoLogo, which makes is search for bitmap files to display as logo, -in the engine directory or in the folder "logos". -If you see logos without having asked for them, the settings in your winboard.ini file probably contains the line

-
/autoLogo=true
-

Just change that to /autoLogo=false. -You can also achieve that by starting WinBoard through the startup dialog (from the start menu), -and then tick "additional options" at the bottom, -and type /autoLogo=false in the edit field, before pressing OK. -If you then later select "Save Settings Now" from the Option menu, -or when "Save Settings on Exit" is on, and you close WinBoard, -this will automatically end up in your settings field. -

-When /autoLogo=false, logos will only be displayed if you explicitly ask for them, -by running WinBoard with the option /firstLogo=FILENAME.bmp or /secondLogo=FILENAME.bmp. -(Which will not be stored in the winboard.ini, -but might of course be hidden somewhere in a settings file mentioned on the command line as @SETTINGSFILE.ini.) -

- -
-

[B.27] - How can I install logos for other engines, Internet Chess Servers or Human users?

- -

With the option /autoLogo=true, (which is remembered in your settings file), -WinBoard automatically looks into the engine folder -(specified by the /fd="..." or /sd="..." option), for a file called "logo.bmp". -If it is found, it is used as a logo for the engine when it plays. -So all you have to do is put a logo.bmp file there. -Popular logo formats are 100x50 and 130x65; many engine logos are available from -David Dahlem or -Graham Banks -

-It is possible to overrule the /autoLogo by explicitly using a /firstLogo="FILENAME.bmp" -or /secondLogo="FILENAME.bmp" with the engine on the engine line in the startup dialog. -This is useful for engines that run with an adapter like Polyglot, -when you have only one polyglot on your system, used by many engines. -E.g. for Fruit the engine line to be typed in or selected from the combo box is -

-"polyglot fruit.ini" /firstLogo="D:\Engines\Fruit\logo.bmp" /fd="D:\Engines\Polyglot"
-
-This prevents WinBoard looking for the logo in the Polyglot folder. -

-For Internet Chess Servers and Human users the logos should be in the "logos" -sub-folder of the folder where WinBoard is installed. -With /autoLogo=true, WinBoard would look for a logo file in that folder with -the same name as the ICS, suffixed with .bmp (e.g. freechess.org.bmp) -or the Human username -(specified by the /userName="..." option or taken from the system), -suffixed by .bmp, e.g. administrator.bmp) -

- -
-

[B.28] Is there readline/history support for the input in XBoard/Winboard?

- -

There is a special ICS input box that has history support which is -the standard in Winboard and can be used in XBoard too.

-

Another good tip from Michel van der Bergh is to use the rlwarp -program together with XBoard which gives you full readline support. -Just run "rlwrap xboard" instead of just "xboard". The rlwarp program -should be available for most linux distributions or can be downloaded -at: -http://utopia.knoware.nl/~hlub/uck/rlwrap/. -

- - -

[C] XBoard and WinBoard, bugs and problems

- -

[C.1] I can't build XBoard -because the X11/Xaw/... include files are not found.

- -

These are the header files for the Athena Widgets library, which XBoard uses -heavily. Some versions of Unix don't supply these files, but they are part of -the standard X distribution, freely available from MIT.

- -

For general information on getting missing X sources, see the FAQ on -comp.windows.x. Note that you may be missing only the header files, or you -may be missing the libraries themselves too.

- -

HP-UX users are missing only the header files. You can get them by -anonymous FTP as follows. (But first check with your system -administrator to see if someone else at your site has already done -this.) Get the archive file /hpux9/X11R5/Core/Xaw-5.00.tar.gz (Xaw -header files) via anonymous FTP from the site hpux.csc.liv.ac.uk -(138.253.42.172), or one of the other official sites---Germany: -hpux.ask.uni-karlsruhe.de (129.13.200.57), US: hpux.cae.wisc.edu -(144.92.4.15), France: hpux.cict.fr (192.70.79.53) or Netherlands: -hpux.ced.tudelft.nl (130.161.140.100). Unpack the archive using gzip -and follow the instructions in its README and/or HPUX.Install files. -Thanks to Richard Lloyd for this information.

- -

If you have the Xaw header files installed in a different place -than the other X11 headers, you may need to configure XBoard with an -extra flag to help it find them. For example, if yours are in -/foo/bar/X11/Xaw, try this:

- -
-    rm config.cache
-    (setenv CFLAGS -I/foo/bar ; configure)
-
- -

Also see topic [C.2].

- -
-

[C.2] Configuring or building XBoard fails due to -missing header files, missing libraries, or undefined symbols. -

- -

Perhaps you have the X server and client programs installed on your -machine, but not the X header files and link-time libraries. If so, -you can run existing X programs, but you cannot compile a new X -program from source code. In this case the XBoard configure script -will fail and will tell you to look at this question in the FAQ. Many -GNU/Linux distributions put the headers and libraries in a separate -package, which you might not have installed. If you are using RedHat, -install the XFree86-devel package. If you are using some other -kind of Unix, ask your system administrator where to find the X header -files and link-time libraries. If this is not your problem, read on.

- -

The configure script for XBoard looks for X libraries and header -files in some common places. Sometimes it fails: If yours are -installed in an odd place, it may not find them at all. If you have -more than one version of X installed on your system, it may find the -"wrong" one, or occasionally it may find libraries from one version -and incompatible header files from another. You can work around these -problems by telling the configure script where the files are. For -example:

- -
-    configure --x-includes=/odd/place/include \
-              --x-libraries=/odd/place/lib
-
- -

The directory named in the argument to --x-includes must have a -subdirectory "X11" that contains the actual .h files. That is, if -your X.h file has full pathname /odd/place/X11R6/include/X11/X.h, then -you must give the argument --x-includes=/odd/place/X11R6/include.

- -

Some linkers have bugs that cause bogus error messages when you try -to link X programs. The configure script includes a workaround for a -bug of this kind that exists in some SunOS 4.x.x installations. See -the FAQ on comp.windows.x for more information about problems of this -kind.

- -

If all else fails, check whether anyone else at your site has been able to -compile any X programs on your system. Your X installation might be buggy. -If so, the system administrator at your site might know how to fix or work -around the problem.

- -

Also see topic [C.1].

- -

[C.3] I have problems using WinBoard on ICS -with a modem. I'm not running SLIP or PPP, but just dialing in to an -ordinary login account ("shell account").

- -

Here are solutions to some common problems in this area.

- -

Some people want to connect to ICS through HyperTerminal or some other -terminal program first, then run WinBoard. This is not how it works. -WinBoard wants to talk directly with your modem, acting as a terminal program -itself. Start out with the modem "on hook" (not making a call).

- -

Run WinBoard with a command line like this (adding more options if desired):

- -
-    WinBoard /ics /icscom com1
-
- -

Use com2, com3, or com4 in place of com1 if your modem is connected to one of those ports.

- -

After you start WinBoard, you may need to change some of the options in the -Communications dialog (on the Options menu). The dialog has the usual options -for talking to modems: bits per second, bits per byte, parity, number of stop -bits. You will probably want to use Save Settings Now when you're done.

- -

Next, type dialing commands to your modem in the text window that WinBoard -creates. You may need to turn off Local Line Editing on the Options menu -while you are typing commands to your modem. Turn it back on when you're -done. See the WinBoard Help file for instructions if you see your typing -echoed an extra time after you hit Enter.

- -
-

[C.4] -I have problems using WinBoard on ICS with Windows 95 and SLIP -or PPP. When trying to start up, it gets the error "Address family -not supported by protocol family" (or some equally strange message). -

- -

WinBoard is a 32-bit application, but some Winsock (TCP/IP) implementations -support only 16-bit applications. You get a strange looking error message -if you try to use a 32-bit application because -there is no standard Winsock error code number -for "32-bit application not supported."

- -

Microsoft TCP/IP works with both 16-bit and -32-bit applications, supports SLIP, PPP, Ethernet, etc., and is included -with Windows 95 and later Windows systems. -If possible, I recommend that you uninstall -whatever Winsock you are using and install Microsoft TCP/IP instead. -For more information, see -http://walden.mo.net/~rymabry/95winfaq.html (the Win95-L FAQ).

- -

Trumpet Winsock 2.1 (and earlier) supports only 16-bit -applications, and hence does not work with WinBoard. But there is a -beta-test release available that does support 32-bit applications. -I have not tried it with WinBoard, but it -should work. See Trumpet's Web page -http://www.trumpet.com.au/wsk/winsock.htm -for more information.

- -

The 16-bit versions of America On-Line's software do not support -32-bit Winsock applications. Get the 32-bit version. At one time the -32-bit version was called "AOL for Windows 95," but I imagine that has -changed. Hopefully the current versions are all 32-bit.

- -

A few versions of Winsock may have bugs that prevent -Windows timestamp/timeseal from working with them. I'm not sure if -such bugs exist in any versions that actually have 32-bit support, -so this point might be moot. Again, Microsoft TCP/IP is known to work.

- -
-

[C.5] When I try to run WinBoard, I get the -message "Failed to start chess program gnuchess on localhost: NO -LANGFILE (file gnuchess.lan not found)".

- -

This message means that WinBoard is trying to run GNU Chess, but -GNU Chess cannot find a file that it needs, named gnuchess.lan. -If you see it, you've probably customized WinBoard's /fcp, /fd, /scp, -and/or /sd options and made a mistake in the process. Review what -you did, and see the WinBoard help file.

- -
-

[C.6] I want to use XBoard or WinBoard as an Internet -Chess Server interface, but the ICS Client option is grayed out on the -menu.

- -

XBoard and WinBoard have three major modes that can't be changed from the -menus: local chess engine mode, -ICS mode, and standalone mode.

- -

With XBoard, you have to set the mode using command-line options. -Local chess engine mode is the default, -ics selects ICS mode, and --ncp ("no chess program") selects standalone mode.

- -

With WinBoard, if you don't set the mode using command-line -options, you get a dialog box asking which mode you want. To bypass -the dialog box, use -cp ("chess program") for local chess engine mode, -or -ics or -ncp as with XBoard. Also see topic [C.7].

- -
-

[C.7] How do I give command-line options to -a Windows program like WinBoard?

- -

There are many ways; pick your favorite:

- -
    -
  • Type the command line into an MS-DOS Prompt box. Example: -"WinBoard -ics".
  • - -
  • Make a Windows shortcut for WinBoard. You can do this by -right-dragging WinBoard.exe to the desktop and selecting "Create -Shortcut(s) Here" from the menu that appears. Right-click on the -shortcut, select Properties, and click the Shortcut tab. The -command-line text box is labelled "Target" instead of "Command line" -just to confuse you. Edit the text in this box, adding the command -line options to the end.
  • - -
  • Choose Run from the Start menu, or File / Run from the Program -Manager or File Manager, and type the command line into the dialog you -get. You may have to give WinBoard's full drivespec and filename if -it is not in a directory on your search path.
  • - -
  • Make a Program Manager icon for WinBoard. You can do this by -dragging WinBoard.exe from the File Manager into the Program Manager, -or by using File / New in the Program Manager. Select the icon and -choose File / Properties. Edit the Command Line text box to add the -command-line options to the end.
  • -
- -
-

[C.9] -When I exit from WinBoard after using it to play against a chess -program on my machine, the chess program keeps running in the background. -

- -

Be sure you have the current versions of WinBoard and the chess -engine you are using. WinBoard 3.4.1 and earlier had a bug that -caused this problem to occur with all chess engines. A buggy chess -engine that does not respond to the "quit" command will also cause -this.

- -

If you still see this problem, you can stop the rogue chess engine -by pressing Ctrl+Alt+Del, selecting the chess engine process from the -menu, and pressing the End Task button.

- -
-

[C.12] -Why do my ICS -opponents often get extra time after they make their moves? -Why do I sometimes lose time off my clock after I make my move? -

- -

If you are playing with the ICS incremental clock, both you and your -opponent get a set amount of extra time after each move.

- -

If your or your opponent has netlag, your opponent might appear to -get extra time, especially if your opponent is using timestamp or -timeseal. The ICS charges each player who is using timestamp or -timeseal only for the time between when the player received his -opponent's move and the time he sent his own move. Thus delays in -network transmission do not count against either player. But WinBoard -counts down the display of your opponent's clock on your screen under -the assumption that there is no netlag. When his move comes in, if -there was netlag, the ICS may not have really charged him for that -much time, and WinBoard corrects the clock to what the ICS says it -should read.

- -

If you are not using timestamp or timeseal, you may appear to lose -time off your clock at some point after you make your move. In this -case, the ICS charges you for the time between when it sent you your -opponent's move and the time it received your move. Thus delays in -network transmission count against you. WinBoard stops counting down -the display of your clock on your screen (and starts your opponent's) -when you make your move. When the ICS echoes your move back to you, it -may have charged you for more time than that, and WinBoard corrects -the clocks to what the ICS says they should read.

- -

See "help lag" and "help timestamp" or "help timeseal" on your ICS for -more detailed information.

- -
-

[C.13] -I can't run WinBoard unless I delete the WinBoard.ini file each time! -

- -

Most people don't have this problem, but two or three people using -Windows NT 4.0 with Service Pack 3 or 4 have reported it. I have no -idea what causes this problem. Contrary to what was reported in a -previous version of this FAQ, reinstalling the service pack after -installing WinBoard does not seem to solve the problem.

- -
-

[C.15] -I get errors compiling XBoard's parser.c. -

- -

The file parser.c is automatically generated from parser.l. The -copy included with XBoard 4.0.2 was generated by lex on Tru64 Unix and -has problems compiling and linking on current GNU/Linux versions. The -copy included with XBoard 4.0.3 was generated by flex on a GNU/Linux -machine, but it too won't necessarily work on other versions of Unix. -If you have this problem, you can fix it by deleting parser.c and -letting the Makefile re-create it from parser.l. This will work if -you have either lex or flex on your system. Flex is available in all -GNU/Linux distributions and can be obtained at no charge from the Free -Software Foundation, www.fsf.org.

- -
-

[C.16] -I get an error building WinBoard from source because "flex" is not found. -

- -

The file parser.c is automatically generated from parser.l. The -Makefile included with the WinBoard source kit has a rule for -generating parser.c using the program "flex", which will fail if you -don't have flex. However, the source kit also includes a ready-made -copy of parser.c, so you don't really need flex unless you have made -changes to parser.l. Check that you still have a copy of parser.c; if -you don't, unpack the WinBoard source zip file again to get one. -Either set the last-modified time of parser.c to be later than that of -parser.l, delete parser.l, or comment out the Makefile rule for -building parser.c from parser.l, and then try building WinBoard again.

- -

If you do want to change parser.l and rebuild parser.c, you can get -flex as part of the free Cygwin kit from -http://sourceware.cygnus.com/cygwin/. You can -probably also get flex for Windows by itself from various other places -around the Internet. It is free software distributed by the Free -Software Foundation, www.fsf.org.

- -
-

[C.17] - XBoard hangs shortly after connecting to an ICS when used with dxterm, - cmdtool, dtterm, kterm, konsole, or other substitutes for xterm. -

- -

After connecting to a chess server, XBoard 4.0.2 and later sends an -escape sequence to its terminal that is meant to display your handle -and the ICS host name (for example, -"user@chessclub.com") in the -terminal's banner and icon. It seems that several of the alternative -X terminal programs have a bug that makes them hang when sent this -escape sequence.

- -

You can work -around the problem by using xterm, nxterm, rxvt, aterm, xiterm, or -gnome-terminal, all of which seem to work fine. In fact, current -versions of kterm and konsole seem to work fine too, so if you are -having problems with one of them, be sure you are not running an -outdated version.

- -

Alternatively, you can disable this feature by commenting out the -body of DisplayIcsInteractionTitle in xboard.c and recompling xboard.

- -
-

[C.18] - The WinBoard pieces show up in the wrong colors, appear distorted, - or are not visible at all. -

- -

This can happen if you have a bug in your Windows display driver. -Check with the manufacturer of your display card, the manufacturer of -your computer, or Microsoft to see if there is an updated driver -available. You can usually download updated drivers from the Web.

- -

If you can't find an updated driver, you can try running Windows -using a different number of colors and/or disabling some of the -hardware acceleration features on your display card. To change the -number of colors, go to Windows Start / Settings / Control Panel / -Display / Settings / Color Palette. To disable hardware acceleration -features, go to Windows Start / Settings / Control Panel / Display / -Settings / Advanced Properties / Performance / Hardware Acceleration.

- -

It's also possible that Windows has the right driver for your -hardware already but you are not using it. It may help to reinstall -your driver. Go to Windows Start / Settings / Control Panel / System -and delete your display card (maybe even your monitor too), then -reboot. Windows should automatically re-detect your card and monitor -and re-install the drivers; if it doesn't, run Start / Settings / -Control Panel / Add New Hardware to force it to.

- -

If all else fails, try Monochrome mode. On WinBoard's menus, go -to Options / Color and check Monochrome. WinBoard will display in black -and white.

- -
-

[C.19] XBoard or WinBoard tells me "Error: first chess - program (...) exited unexpectedly".

- -

This message means that your chess engine crashed, probably due to -a bug in the engine, or because you have it configured incorrectly. -You can try running XBoard or WinBoard again with the "-debug" flag on -the command line. This will print out all the messages received from -the chess engine. (With WinBoard, the messages go into a file called -WinBoard.debug; with XBoard, they go to the xterm that you started -XBoard from.)

- -

If you are using GNU Chess and you see this problem as soon as it -starts up, most likely GNU Chess is exiting with an error message. If -you see the message "NO LANGFILE", it means that you did not install -GNU Chess correctly, and it is unable to find the file gnuchess.lang. -Make sure that you defined LIBDIR in the gnuchess Makefile, and that -gnuchess.lang is in that directory. If gnuchess.lang is not there, -you probably didn't type "make install" in the gnuchess src directory; -you must do this to install gnuchess.lang (and the gnuchess book). If -you defined LIBDIR to something that is not an absolute pathname (that -is, to something that does not start with a "/"), GNU Chess will work -only if you run it from the GNU Chess "src" directory where you built -it.

- -

[C.20] - XBoard tells me "Warning: Cannot allocate colormap entry", or - "too few colors available; trying monochrome mode", or - "XPM pieces cannot be used in monochrome mode". -

- -

You are running your X server with 8-bit color depth, and you are running -some program that has used up all 256 of your colors. Netscape tends -to do this, or maybe you have a background image that uses up all of -your colors.

- -

If you have a modern machine, you probably have enough display -memory to run your X server with 16-, 24-, or 32-bit color depth. If -you're using "startx" to start the X server, try giving the command as -"startx -- -bpp 24" (or 16, or 32). On newer X servers you -may have to use -depth instead of -bpp. Further details on -configuring your X server are beyond the scope of this FAQ.

- -

If you must run in 8-bit mode, try the following: -Avoid background images that use up all your colors. If you -run Netscape, try starting it up with the -install command-line -option; this gives Netscape its own private colormap that X will -switch to when Netscape has the keyboard focus.

- -

If all else fails, another possibility is to run xboard in -monochrome (black and white) mode by giving it the -mono -command-line option. XBoard will try this by itself in some cases. -Monochrome mode works only with bitmap pieces, not pixmap pieces, so -trying to use it may give you the error "XPM pieces cannot be used in -monochrome mode". To get around this, either use the -bitmapDirectory -command line option to point XBoard to the directory containing the -bitmap pieces included with the XBoard source code, or rebuild XBoard -with pixmap support disabled, using "./configure --disable-xpm ; make -clean ; make".

- -

[C.21] - When I log in to freechess.org, the Enter key doesn't work, and I - have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't - work either, so I'm stuck. -

- -

This is a pretty rare problem. It should only arise if you have to -reach freechess.org by telnetting (or connecting with WinBoard -/icsport=23) from a Windows PC to a Unix box, and then telnetting from -there to freechess.org. The Enter key should always work when -connecting directly from your PC to freechess.org.

- -

The best way to get around the problem is to run timeseal on the -intermediate Unix box instead of telnet. Get the appropriate version -of timeseal for your box from ftp.freechess.org and follow the -directions in the help files on FICS.

- -

If you can't run timeseal for some reason, there are some things -you can do to make telnet stay in line mode instead of going to -character mode. Then the Enter key will work. First, try "telnet -freechess.org 5000" instead of "telnet freechess.org." -If that still doesn't work, then when the Enter key stops working, -type the following. Here < and > surround the -names of keys.

- -
-    <Ctrl+S><Ctrl+]>mode line<Enter>
-
- -

[C.22] - XBoard says, "Failed to start first chess program fairymax - on localhost: fairymax: No such file or directory." -

- -

XBoard is looking for the Fairy-Max chess engine. -If you didn't want to use XBoard with Fairy-Max, please see topic -[C.6]. -If you did want to use Fairy-Max, be sure you have it installed and -that it is on your $PATH. If you wanted to use GNU Chess instead, -see topic [D.6].

- -
-

[D] Crafty and other topics

-
-

[D.1] What is XChess?

- -

XChess is an older chessboard program that is no longer supported. XChess was -written for X version 10, and you may or may not be able to build and run it -on an X11 system.

- -

XChess has only one significant feature that is not present in XBoard: Two -humans can play chess using XChess on different machines, without using the -Internet Chess Server as an intermediary. This feature is of interest only if -you don't have network connectivity to the Internet Chess Server.

- -

Note: There actually have been several different programs called "XChess" in -circulation at various times. The above describes one that was associated -with GNU Chess.

- -
-

[D.2] What is Winsock Chess?

- -

Winsock Chess is a program that lets two people play chess across a -network. It runs only under Microsoft Windows. Some of the code in -Winsock Chess is derived from GNU Chess, but it is not maintained by -the GNU Chess team. You can get a copy from the Internet Chess -Library; see topic [A.2]. For more information, -contact its author, Donald Munro, -ccahdm@beluga.upe.ac.za.

- -
-

[D.3] What is Crafty?

- -

Crafty is a freely-available chess program written by Bob Hyatt. -Bob is the main author of the well-known chess program Cray -Blitz. Crafty is a very strong program, its code is available, commented -and fairly readable, and its author is actively working on improvements.

- -

You can download Crafty from ftp://ftp.cis.uab.edu/pub/hyatt/. Start by getting the read.me file and -reading it. Among other things, this file contains instructions on -how to install Crafty as a command-line application on your machine.

- -

There is a Crafty mailing list. -To subscribe, send email to -majordomo@cis.uab.edu, with -"subscribe crafty-list" in the body.

- -
-

[D.4] How do I use Crafty with XBoard?

- -

First, you need to get Crafty and install it as a command-line -application on your machine. See topic [D.3].

- -

To use Crafty with XBoard, give the -fcp -parameter like this:

- -
-    xboard -fcp "./crafty" -fd crafty_directory
-
- -

Here crafty_directory is the directory where you installed Crafty. -You can add more xboard options at the end of the command line.

- -

Crafty 15.14 or later is required to work properly with XBoard -4.0.0 or later. We generally recommend using the latest versions of -both XBoard and Crafty.

- -
-

[D.5] How do I use Crafty with WinBoard?

- -

First, you need to get Crafty and install it as a command-line -application on your machine. See topic [D.3]. -It is best to use the latest version of Crafty with the latest version -of WinBoard to make sure all features are compatible and function -correctly. You can install Crafty in any directory you like.

- -

You also need to get WinBoard and install it in the normal way -using its built-in installer. You can do that either before or after -you install Crafty.

- -

After both Crafty and WinBoard are installed separately, follow the -directions in the WinBoard Help file (included with WinBoard) for -connecting new chess engines to WinBoard.

- -

If you want to have Crafty act as an automated computer player on a -chess server, see topic [B.16]. Before you try -to get that working, be sure you can play against Crafty locally, -first without WinBoard, then with it. Also be sure you can use -WinBoard to play on the chess server yourself, without having Crafty -connected to it. You have to crawl before you can walk!

- -
-

[D.6] How do I use GNU Chess with XBoard?

- -

By default, XBoard tries to use Fairy-Max by running the -command "fairymax". That's why if you don't have Fairy-Max, you -get the error message "Failed to start first chess program fairymax -on localhost: fairymax: No such file or directory."

- -

If you have GNU Chess 5, the command should be "gnuchess xboard" -instead. To make XBoard use this command, give the -fcp parameter -like this:

- -
-    xboard -fcp "gnuchess xboard" 
-
- -If you instaled GNU Chess as a package, the operating system usually -knows where to find it, and GNU Chess knwos where to find its data -files, such as the opening book. -If GNU Chess is installed in a non-compliant way, e.g. together -with its book file in a user directory, you must use: - -
-    xboard -fd gnuchess_directory -fcp "./gnuchess xboard" 
-
- -

Here gnuchess_directory is the directory where you installed -GNU Chess 5 and its book. -In all cases you can add more xboard options at the end of the command -line.

- -

If you want to use GNU Chess 4, the command should be "gnuchessx" -instead. To make XBoard use this command, give the -fcp parameter -like this:

- -
-    xboard -fcp "gnuchessx" 
-
- -

The same applies for non-compliant installs as for GNU Chess 5: -the install directory has to be given with the -fd argument.

- -
-

[D.7] How do I use GNU Chess with WinBoard?

- -

Well, why would you want to? If you want a strong free engine, -use Crafty, Glaurung, Fruit or Toga. -If you wnt an engine that plays many variants, use Fairy-Max, -Pulsar or Sjeng. -But the procedure to install and run those is not any different than -for GNU Chess. -

-

If you want to use a WinBoard-compatible chess engine that is not -automatically installed with the download, -you will have to download it yourself. -Most chess engines are downloaded as a compressed archive (e.g. a .zip file), -and on downloadig it, the decompression software on your Windows system -is automatically invoked when you seected "Open" in the download dialog. -You can then click "extract all files", and you are prompted for a place -to put the unpacked stuff. -The place it proposes is usually no good, so browse to the folder -in which you installed the winBoard download -(where you see the Fairy-Max and WinBoard folders). -

-When the archiv contained a single folder, (with files in it), -unpack it there. -If the archive contained a lot of small files, first create a folder, -and browse there, before you unpack. -(To get all the files in a single place, not mixed with others, -so you can easily delete it again.) -Say you unpacked in a folder named "NewEngine", which now sits -next to your "WinBoard" folder amongst the chess files on your system. -Say there is a file "Engine.exe" in this "NewEngine" folder. -

-Then to run the engine with WinBoard, -you have to enter the command: -

-
-        winboard /fcp="Engine.exe" /fd="..\NewEngine"
-
-

-Sometimes engines need parameters on their command line, -e.g. to set the hash-table size, or tell them they have to -deal with WinBoard. -These should then go within the quotes around the Engine.exe file name, -directly behind it, and separated from it (and each other) by spaces. -See any README files that come with the engine to learn how -exactly the engine has to be invoked. -

-
-

[D.8] What is Fairy-Max?

- -

Fairy-Max is a chess engine that plays chess at a level where -you don't need to be a super GM to still have a chance to beat it. -Apart from normal chess it plays many variants as well, -such as Capablanca or Gothic Chess, Knightmate, etc. -Dedicated versions of it are available to play Shatranj and Xiangqi -(Chinese Chess). -

- -
-

[D.9] What is UCI? What is Polyglot?

- -

UCI, or Universal Chess Interface, is a standard for communication -between chess engines and its Graphical User Interface, that was -created as an alternative to the way XBoard / WinBoard does it. -(The latter way having become known as -"WinBoard protocol"). -XBoard / WinBoard do not understand a word of UCI, -so UCI engines cannnot be run directly as engine under them. -

-Polyglot is an adapter that translates WB protocol to UCI. -It bhaves like it is a WB engine, but, without XBoard / WinBoard -knowing about this, it consults an UCI engine for getting the moves. -With the aid of Polyglot, any UCI engine can be run under WinBoard. -Polyglot is available as a Debian package for Linux, and is included -in the WinBoard installation. -Polyglot is open source software released under the GPL. -

- -
-

[D.10] How can I run a UCI engine under XBoard / WinBoard?

- -

First you have to download and install the UCI engine. -This is similar to installing WinBoard engines, -see D.7. -Furthermore, you have to make sure that -Polyglot is nstalled on -your system, in a place where XBoard / WinBoard can find it. -There are then two ways to run the UCI engine: -

-In the first method, the only thing you have to do is add an extra -option to the command that invokes XBoard / WinBoard, -to tell it that the engine is UCI: -

-
-        xboard -fcp "fruit" -fUCI
-
-        winboard /fcp="Fruit_21.exe" /fd="..\Fruit" /fUCI
-
-

-The second method is more complicated, but also more versatile. -UCI engines accept many settings from their GUI than XBoard / WinBoard -usually send to a WB engine. -Polyglot can provide such settings from a file dedicated to that engine, -usully referred to as a "polyglot.ini" file (although the actual name -can be different.) -If the engine you downloaded comes with a polyglot.ini file for it, -you can force Polyglot to use this file with engine settings -by invoking it explicitly from XBoard / WinBoard: -

-
-        xboard -fcp "polyglot INIFILE"
-
-        winboard /fcp="polyglot INIFILE" /fd="POLYGLOTDIR"
-
-

-INIFILE is the name of the polyglot.ini file (possibly a path name, -such as "PG\fruit.ini", while POLYGLOTDIR should be the directory -(path) name were the Polyglot executable is located. -The directory and name of the actual engine are described in the -polygot.ini file, and XBoard / WinBoard need not be aware of them. -

-If you don't have a polyglot.ini file for the engine, you would -have to make one. -How to do that is beyond the scope of this FAQ. -Refer to the Polyglot documentation for this, -or use method 1. -

-
-** End of XBoard/WinBoard FAQ ** - diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 0a78550..0000000 --- a/INSTALL +++ /dev/null @@ -1,181 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - The file `configure.ac' is used to create `configure' by a program -called `autoconf'. You only need `configure.ac' if you want to change -it or regenerate `configure' using a newer version of -`autoconf'. Please use the autogen.sh shell script, which will run all -the autotools to generate the `configure' script if it is missing. - -The simplest way to compile this package is: - - 0. If the configure script is missing, run ./autogen.sh in the source directory - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index a3051ba..0000000 --- a/Makefile.am +++ /dev/null @@ -1,347 +0,0 @@ -bin_PROGRAMS = xboard - -### if we are compiling with ZIPPY we need some extra source files - -if ZIPPY - ZPY = zippy.c zippy.h -else - ZPY = -endif - -### define sources for the front-end and backend -GTKsources = gtk/xboard.c gtk/xboard.h \ - gtk/xoptions.c gtk/xtimer.c \ - gtk/xengineoutput.c - -Xsources = xaw/xboard.c xaw/xboard.h \ - xaw/xengineoutput.c \ - xaw/xgamelist.c xaw/xgamelist.h \ - xaw/xhistory.c xaw/xhistory.h \ - xaw/xoptions.c \ - bitmaps/checkmark.bm bitmaps/icon_black.bm bitmaps/icon_white.bm - -if withGTK - FRONTENDsources = $(GTKsources) - FRONTENDextras = $(Xsources) - headers = -I gtk -endif -if withXaw - FRONTENDsources = $(Xsources) - FRONTENDextras = $(GTKsources) - headers = -I xaw -DX11 -endif - -xboard_SOURCES = backend.c backend.h backendz.h \ - book.c \ - childio.c childio.h \ - common.h \ - frontend.h \ - gamelist.c ngamelist.c \ - gettext.h \ - lists.c lists.h \ - moves.c moves.h \ - parser.c parser.h \ - pgntags.c \ - uci.c \ - args.h xboard2.h \ - board.c board.h \ - draw.c draw.h \ - dialogs.c dialogs.h \ - engineoutput.c nengineoutput.c engineoutput.h \ - evalgraph.c nevalgraph.c evalgraph.h \ - history.c nhistory.c \ - menus.c menus.h \ - usounds.c usystem.c usystem.h \ - $(ZPY) $(FRONTENDsources) - -### - -SUBDIRS = po -xboard_LDADD = -ldl -lm @FRONTEND_LIBS@ @X_LIBS@ @LIBINTL@ @CAIRO_LIBS@ - -EXTRA_DIST = pixmaps themes png sounds winboard \ - xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man xboard.desktop xboard-config.desktop \ - xboard-fen-viewer.desktop xboard-pgn-viewer.desktop xboard-tourney.desktop xboard.xml \ - COPYRIGHT FAQ.html engine-intf.html ics-parsing.txt readme.htm zippy.README \ - xboard.conf SHORTLOG DIFFSTAT history.c ABOUT-NLS $(FRONTENDextras) - -DISTCLEANFILES = stamp-h - -GITVERSION=$(shell sh -c 'git describe --dirty --always 2>/dev/null') -AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@ -DSYSCONFDIR='"$(sysconfdir)"' \ - -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' -D__GIT_VERSION='"$(GITVERSION)"' \ - -DCONFIGURE_OPTIONS='"@CONFIGURE_OPTIONS@"' -DDATADIR='"$(datadir)/games/xboard"' -DMANDIR='"$(mandir)"' $(headers) - -ACLOCAL_AMFLAGS = -I m4 - -info_TEXINFOS = xboard.texi -xboard_TEXINFOS = copyright.texi -man6_MANS = xboard.man - - -### config file - -sysconf_DATA = xboard.conf - -### icon files - -icondir = @ICONSDIR@ -dist_icon_DATA = xboard.png -svgicondir = @SVGICONSDIR@ -dist_svgicon_DATA = xboard.svg - - -### desktop files for KDE and gnome - -Applicationsdir = @DESKTOPDIR@ -Applications_DATA = xboard.desktop xboard-fen-viewer.desktop xboard-pgn-viewer.desktop xboard-tourney.desktop xboard-config.desktop - -### mime file -mimedir = @MIMEDIR@ -mime_DATA = xboard.xml - -gamedatadir = @GAMEDATADIR@ - -### directory and files for svgs - -svgdir = $(gamedatadir)/themes/default -dist_svg_DATA = svg/icon_white.svg svg/icon_black.svg \ - svg/BlackAdvisor.svg svg/WhiteAdvisor.svg \ - svg/BlackArchbishop.svg svg/WhiteArchbishop.svg \ - svg/BlackBishop.svg svg/WhiteBishop.svg \ - svg/BlackCanon.svg svg/WhiteCanon.svg \ - svg/BlackChancellor.svg svg/WhiteChancellor.svg \ - svg/BlackCobra.svg svg/WhiteCobra.svg \ - svg/BlackCommoner.svg svg/WhiteCommoner.svg \ - svg/BlackCrownedBishop.svg svg/WhiteCrownedBishop.svg \ - svg/BlackCrownedRook.svg svg/WhiteCrownedRook.svg \ - svg/BlackElephant.svg svg/WhiteElephant.svg \ - svg/BlackGoldKnight.svg svg/WhiteGoldKnight.svg \ - svg/BlackGoldLance.svg svg/WhiteGoldLance.svg \ - svg/BlackGoldPawn.svg svg/WhiteGoldPawn.svg \ - svg/BlackGoldSilver.svg svg/WhiteGoldSilver.svg \ - svg/BlackGold.svg svg/WhiteGold.svg \ - svg/BlackHawk.svg svg/WhiteHawk.svg \ - svg/BlackKing.svg svg/WhiteKing.svg \ - svg/BlackKnight.svg svg/WhiteKnight.svg \ - svg/BlackLance.svg svg/WhiteLance.svg \ - svg/BlackMarshall.svg svg/WhiteMarshall.svg \ - svg/BlackNightrider.svg svg/WhiteNightrider.svg \ - svg/BlackPawn.svg svg/WhitePawn.svg \ - svg/BlackPrincess.svg svg/WhitePrincess.svg \ - svg/BlackQueen.svg svg/WhiteQueen.svg \ - svg/BlackRook.svg svg/WhiteRook.svg \ - svg/BlackUnicorn.svg svg/WhiteUnicorn.svg \ - svg/BlackSword.svg svg/WhiteSword.svg \ - svg/BlackHSword.svg svg/WhiteHSword.svg \ - svg/BlackLeopard.svg svg/WhiteLeopard.svg \ - svg/BlackLion.svg svg/WhiteLion.svg \ - svg/BlackPromoBishop.svg svg/WhitePromoBishop.svg \ - svg/BlackPromoRook.svg svg/WhitePromoRook.svg \ - svg/BlackPromoHorse.svg svg/WhitePromoHorse.svg \ - svg/BlackPromoDragon.svg svg/WhitePromoDragon.svg \ - svg/BlackPromoSword.svg svg/WhitePromoSword.svg \ - svg/BlackPromoHSword.svg svg/WhitePromoHSword.svg \ - svg/BlackHCrown.svg svg/WhiteHCrown.svg \ - svg/BlackDolphin.svg svg/WhiteDolphin.svg \ - svg/BlackClaw.svg svg/WhiteClaw.svg \ - svg/BlackWolf.svg svg/WhiteWolf.svg \ - svg/BlackCamel.svg svg/WhiteCamel.svg \ - svg/BlackZebra.svg svg/WhiteZebra.svg \ - svg/BlackGnu.svg svg/WhiteGnu.svg \ - svg/BlackWizard.svg svg/WhiteWizard.svg \ - svg/BlackViking.svg svg/WhiteViking.svg \ - svg/BlackIron.svg svg/WhiteIron.svg \ - svg/BlackCopper.svg svg/WhiteCopper.svg \ - svg/BlackTower.svg svg/WhiteTower.svg \ - svg/BlackDragon.svg svg/WhiteDragon.svg \ - svg/BlackCub.svg svg/WhiteCub.svg \ - svg/BlackButterfly.svg svg/WhiteButterfly.svg \ - svg/BlackLeft.svg svg/WhiteLeft.svg \ - svg/BlackRight.svg svg/WhiteRight.svg \ - svg/BlackHat.svg svg/WhiteHat.svg \ - svg/BlackRShield.svg svg/WhiteRShield.svg \ - svg/BlackLShield.svg svg/WhiteLShield.svg \ - svg/BlackAxe.svg svg/WhiteAxe.svg \ - svg/BlackFlag.svg svg/WhiteFlag.svg \ - svg/BlackDuck.svg svg/WhiteDuck.svg \ - svg/BlackPegasus.svg svg/WhitePegasus.svg \ - svg/eo_Analyzing.svg svg/eo_Black.svg \ - svg/eo_Clear.svg svg/eo_Ponder.svg \ - svg/eo_Thinking.svg svg/eo_Unknown.svg \ - svg/eo_White.svg - -shogidir = $(gamedatadir)/themes/shogi -dist_shogi_DATA = \ - themes/shogi/WhiteGold.svg themes/shogi/WhiteCrownedBishop.svg\ - themes/shogi/WhiteBishop.svg themes/shogi/WhiteKing.svg\ - themes/shogi/WhiteKnight.svg themes/shogi/WhiteGoldKnight.svg\ - themes/shogi/WhiteLance.svg themes/shogi/WhiteGoldLance.svg\ - themes/shogi/WhitePawn.svg themes/shogi/WhiteGoldPawn.svg\ - themes/shogi/WhiteRook.svg themes/shogi/WhiteCrownedRook.svg\ - themes/shogi/WhiteAdvisor.svg themes/shogi/WhiteGoldSilver.svg\ - themes/shogi/BlackGold.svg themes/shogi/BlackCrownedBishop.svg\ - themes/shogi/BlackBishop.svg themes/shogi/BlackKing.svg\ - themes/shogi/BlackKnight.svg themes/shogi/BlackGoldKnight.svg\ - themes/shogi/BlackLance.svg themes/shogi/BlackGoldLance.svg\ - themes/shogi/BlackPawn.svg themes/shogi/BlackGoldPawn.svg\ - themes/shogi/BlackRook.svg themes/shogi/BlackCrownedRook.svg\ - themes/shogi/BlackAdvisor.svg themes/shogi/BlackGoldSilver.svg - -xiangqidir = $(gamedatadir)/themes/xiangqi -dist_xiangqi_DATA = themes/xiangqi/BlackAdvisor.svg themes/xiangqi/WhiteAdvisor.svg \ - themes/xiangqi/BlackCanon.svg themes/xiangqi/WhiteCanon.svg \ - themes/xiangqi/BlackElephant.svg themes/xiangqi/WhiteElephant.svg \ - themes/xiangqi/BlackKnight.svg themes/xiangqi/WhiteKnight.svg \ - themes/xiangqi/BlackGold.svg themes/xiangqi/WhiteGold.svg \ - themes/xiangqi/BlackPawn.svg themes/xiangqi/WhitePawn.svg \ - themes/xiangqi/BlackRook.svg themes/xiangqi/WhiteRook.svg - -### directory and files for themes (and other) configuration files - -themesdir = $(datadir)/games/xboard/themes/conf -dist_themes_DATA = conf/shogi conf/xq conf/ics conf/mini conf/mini.fen conf/sho conf/sho.fen - -### directory and files for pixmaps - -pixmapsdir = $(gamedatadir)/pixmaps/textures -dist_pixmaps_DATA = pixmaps/cross32.png pixmaps/cross48.png pixmaps/board32.png pixmaps/board48.png pixmaps/ini32.png pixmaps/ini48.png - -### directory and files for pngs - -pngdir = $(gamedatadir)/themes/textures -dist_png_DATA = png/hatch.png png/wood_d.png png/wood_l.png png/xqboard-9x10.png - -### directory and files for sound files - -soundsdir = $(gamedatadir)/sounds -dist_sounds_DATA = \ - sounds/cymbal.wav sounds/pop2.wav sounds/slap.wav sounds/ding1.wav sounds/laser.wav \ - sounds/woodthunk.wav sounds/gong.wav sounds/penalty.wav sounds/honkhonk.wav sounds/phone.wav sounds/roar.wav - -### the man page depends on several files, so we add a special rule - -xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi - $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false) - -### install mime-type files and corresponding icons and menu entries if enabled during configure - -install-data-hook: install-mime-database -uninstall-hook: uninstall-mime-database - -install-mime-database: -if ENABLE_UPDATE_MIMEDB - -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \ - $(XDG_MIME) install --mode system --novendor xboard.xml ;\ - $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-pgn-viewer.desktop;\ - $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-fen-viewer.desktop;\ - $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-tourney.desktop;\ - $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-config.desktop;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/board32.png application-x-chess-pgn;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/cross32.png application-x-xboard-trn;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/ini32.png application-x-xboard-opt;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/board48.png application-x-chess-pgn;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/cross48.png application-x-xboard-trn;\ - $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/ini48.png application-x-xboard-opt;\ - fi -endif - -uninstall-mime-database: -if ENABLE_UPDATE_MIMEDB - -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \ - $(XDG_MIME) uninstall --mode system --novendor xboard.xml;\ - $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-pgn-viewer.desktop;\ - $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-fen-viewer.desktop;\ - $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-tourney.desktop;\ - $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-config.desktop;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 board32.png application-x-chess-pgn;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 cross32.png application-x-xboard-trn;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 ini32.png application-x-xboard-opt;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 board48.png application-x-chess-pgn;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 cross48.png application-x-xboard-trn;\ - $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 ini48.png application-x-xboard-opt;\ - fi -endif - -if OSX_APP -osxapp: all-recursive install install-recursive -macportsprefix = $(shell which port | sed s/[/]bin[/]port//) - $(MKDIR_P) $(datarootdir)/bin - $(MKDIR_P) $(datarootdir)/lib - $(MKDIR_P) $(sysconfdir)/gtk-2.0 - $(MKDIR_P) $(datadir)/themes - $(MKDIR_P) $(datadir)/gtk-engines - $(MKDIR_P) $(gamedatadir)/themes - $(INSTALL) ./osxapp/Info.plist $(prefix) - $(INSTALL) ./osxapp/PkgInfo $(prefix) - $(INSTALL) ./osxapp/XBoard.gtklauncher $(bindir)/XBoard - $(INSTALL) ./xboard $(bindir)/xboard-bin - cp -R ./osxapp/icons/. $(datarootdir) - sed -e 's?-soundProgram "aplay -q"?-soundProgram "afplay"?'\ - -e 's?-firstChessProgram fairymax?-firstChessProgram "./fairymax"?'\ - -e 's?-firstChessProgramNames {fairymax?-firstChessProgramNames {"fairymax" -fcp "./fairymax" -fd "~~/../../bin/fairymax"?'\ - -e 's?"Fruit 2.1" -fcp fruit -fUCI?"fruit" -fcp "./fruit" -fd "~~/../../bin/fruit" -fUCI?'\ - -e '/"Crafty" -fcp crafty/d'\ - -e '/"GNU Chess" -fcp gnuchess/d'\ - -e 's?"icc" -icshost chessclub.com -icshelper timestamp?"icc" -icshost 207.99.83.228 -icshelper timestamp?'\ - -e 's?"kc" -icshost alanimus.com -icshelper timeseal?"vics" -icshost winboard.nl -icshelper timeseal?'\ - -e '/; Save user settings./d'\ - -e '/; Must be last in file to make user options prevail over system-wide settings!/d'\ - -e '/-saveSettingsOnExit true/d'\ - -e '/-saveSettingsFile "~\/.xboardrc"/d'\ - -e '/-settingsFile "~\/.xboardrc"/d'<./xboard.conf >$(sysconfdir)/xboard.conf - echo '; OSX' >>$(sysconfdir)/xboard.conf - echo ';'>>$(sysconfdir)/xboard.conf - echo '-clockFont "Sans Bold 26" '>>$(sysconfdir)/xboard.conf - echo '-pieceImageDirectory "~~/themes/default"' >>$(sysconfdir)/xboard.conf - echo '-autoLogo true' >>$(sysconfdir)/xboard.conf - echo '-logoDir "~~/logos"' >>$(sysconfdir)/xboard.conf - echo '-logoSize 100' >>$(sysconfdir)/xboard.conf - echo '-openCommand "open"' >>$(sysconfdir)/xboard.conf - echo '-firstDirectory "~~/../../bin/fairymax"' >>$(sysconfdir)/xboard.conf - echo '-secondDirectory "~~/../../bin/fairymax"' >>$(sysconfdir)/xboard.conf - echo '-secondChessProgram "./fairymax"' >>$(sysconfdir)/xboard.conf - echo '-uxiAdapter "uci2wb -%variant %fcp %fd"' >>$(sysconfdir)/xboard.conf - echo ';' >>$(sysconfdir)/xboard.conf - echo '; Save user settings.' >>$(sysconfdir)/xboard.conf - echo '; Must be last in file to make user options prevail over system-wide settings!' >>$(sysconfdir)/xboard.conf - echo ';' >>$(sysconfdir)/xboard.conf - echo '-saveSettingsOnExit true' >>$(sysconfdir)/xboard.conf - echo '-saveSettingsFile "~/Library/Preferences/XBoard.conf"' >>$(sysconfdir)/xboard.conf - echo '-settingsFile "~/Library/Preferences/XBoard.conf"' >>$(sysconfdir)/xboard.conf - - sed 's?$(macportsprefix)/lib?/tmp/skl/XBoard.app/Contents/Resources/lib?' <$(macportsprefix)/etc/gtk-2.0/gdk-pixbuf.loaders >$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders - sed -e 's?$(macportsprefix)/lib?/tmp/skl/XBoard.app/Contents/Resources/lib?' -e 's?$(macportsprefix)/share/locale?/tmp/skl/XBoard.app/Contents/Resources/share/locale?' <$(macportsprefix)/etc/gtk-2.0/gtk.immodules >$(sysconfdir)/gtk-2.0/gtk.immodules - $(INSTALL) ./osxapp/launcher_rc $(datarootdir)/ - $(INSTALL) $(macportsprefix)/etc/gtk-2.0/im-multipress.conf $(sysconfdir)/gtk-2.0 - $(INSTALL) ./osxapp/gtkrc $(sysconfdir)/gtk-2.0/gtkrc - cp -R $(macportsprefix)/lib/gtk-2.0 $(datarootdir)/lib - cp -R $(macportsprefix)/lib/gdk-pixbuf-2.0 $(datarootdir)/lib - cp -R $(macportsprefix)/share/themes/Mac $(datadir)/themes - cp -R ./osxapp/gtk2-themes/Mac/gtk-2.0 $(datadir)/themes/Mac - cp -R ./osxapp/themes/default/. $(gamedatadir)/themes/default - cp $(macportsprefix)/share/gtk-engines/murrine.xml $(datadir)/gtk-engines/murrine.xml - $(INSTALL) ./png/marble_d.png $(gamedatadir)/themes/textures - $(INSTALL) ./png/marble_l.png $(gamedatadir)/themes/textures - $(INSTALL) ./png/xqwood-9x10.png $(gamedatadir)/themes/textures - cp -R ./osxapp/logos $(gamedatadir)/ -if NLS_ENABLED - cp -R $(macportsprefix)/share/strings/. $(datarootdir)/ - for i in po/*gmo; do lang=`basename $$i .gmo`; $(INSTALL) $(macportsprefix)/share/locale/$$lang/LC_MESSAGES/gtk20.mo $(localedir)/$$lang/LC_MESSAGES/; done -endif - dylibbundler -of -b -x $(bindir)/xboard-bin -d $(datarootdir)/lib -p @executable_path/../Resources/lib - dylibbundler -of -b -x $(datarootdir)/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so -d $(datarootdir)/lib -p @executable_path/../Resources/lib - dylibbundler -of -b -x $(datarootdir)/lib/gtk-2.0/2.10.0/immodules/im-quartz.so -d $(datarootdir)/lib -p @executable_path/../Resources/lib - dylibbundler -of -b -x $(datarootdir)/lib/gtk-2.0/2.10.0/engines/libpixmap.so -d $(datarootdir)/lib -p @executable_path/../Resources/lib - dylibbundler -of -b -x $(datarootdir)/lib/gtk-2.0/2.10.0/engines/libmurrine.so -d $(datarootdir)/lib -p @executable_path/../Resources/lib - find ./XBoard.app -name '*.a' -print0 | xargs -0 rm - rm -r $(datarootdir)/lib/gtk-2.0/include - rm -r $(datarootdir)/share/applications - rm $(datarootdir)/share/info/dir - rm -r $(datarootdir)/share/icons - rm -r $(datarootdir)/share/mime - mv $(datarootdir)/share/games/xboard/themes/conf $(datarootdir)/share/xboard/conf - rm -r $(datarootdir)/share/xboard/pixmaps - rm -r $(datarootdir)/share/games -endif - diff --git a/NEWS b/NEWS deleted file mode 100644 index 2b51c6a..0000000 --- a/NEWS +++ /dev/null @@ -1,1493 +0,0 @@ -** Version 4.8.0 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.8.0/ ) - - * New features in this release - * Resuming saved unfinished games - * Setting up positions more easily - * Bitbase adjudication - * Showing tablebase hits - * A new ICS window - * Recalling board themes (XBoard) - * Playing moves by clicking them - * Fonts in the XBoard GTK build - * Using the mousewheel (XBoard) - * Displaying a blunder graph - * Slicing up a PGN database - * Auto-install of engines - - * New variant support - * ASEAN Chess - * Chu Shogi - * Mighty Lion - * Highlighting squares on engine command - * Let the engine finish a user move - * Non-standard variant names - * Fischer castling in any variant - * Knowing the moves of unknown pieces - - * Fixed bugs - * Fix crash on using some Browse buttons in dialogs of the GTK - build. - * Fix buffer overflow in PGN parser, when all lines end in - comments. - * Fix crash on specifying non-existent board texture. - * Prevent crash on double-click in XB Game List Tags dialog. - * Fix the auto-display comment control in the General Options - dialog of WinBoard, which was ignored. - * Fix adjusting clocks by clicking them in Xaw build. - * Fix zooming of Evaluation Graph XB with mousewheel, which was - not working at all. - * Fix sticky-windows feature WB for Windows 8, where it did not - work at all. - * WinBoard's seek graph is now sized to also cover any board rim. - * Key bindings XB for non menu items are no longer ignored. - * Set castling rights correctly after loading of game file from - command line. - * Allow castling and e.p. moves to be edited into opening book - (and prevent their disappearance from it). - * The sorting of engine output was made more robust against - engines that send thinking output on fail lows. - * Fix node-count display, which was clipped to 32 bits. - * Suppress board-size oscillations in GTK build. - * Fixed detection of screen size in GTK. (This is a mixed - blessing, as now it picks the largest possible window size, and - in GTK interactive down-sizing is not possible.) - * Fix mode highlighting after refusal of Two Machines mode because - 2nd engine did not support variant. - * Blow up textures that are too small. - * Ignore invalid color specs in stead of treating them as black - (important because Cairo does not understand old xpm color - names). - * Prevent XB and WB from becoming unresponsive during lengthy - tasks such as book building. - * Fix slowdown of WB during loading of huge PGN files due to - Game-List window update. - * Limit width of menu bar for small board sizes in GTK build. - * Improve the code to kill rogue engines in XB. - * Drawing of pieces outside the board (in maximaized windows), - which left lots of debris, is now suppressed. - * Make WB window sizing handle multiple screens. - * 50-move counter is no longer reset on Chess960 castlings. - * Fix legality testing of A-side castling in FRC (which was - allowed with Rook on a- and blocker on b-file). - * Fixed piece ID of Falcon in Falcon Chess, which was written as - '.' and could not be selected on promotion. - * Fix cross-edge e.p. captures in Cylinder Chess (which was not - recognized as e.p.). - * Fix animation of Seirawan Chess castling + gating at Rook - square, which made Rook disappear. - * Fix adjudication of stalemates in variant Giveaway. - * Display of the variant tag in the Game List now works. - * Reset move entry (clearing target-square markers) on 'clear - board' in Edit Position mode. - * The Game List is automatically updated when you alter the tag - selection for the game lines. - * Indicate current variant in New Variant dialog of the GTK build - (by printing it in boldface on the button). - - * Known Problems - * GTK: in a tiling window manager the size of the board seems to be - calculated incorrectly. A temporary fix for this is to use a fixed - size by using the "-size " and "-fixedSize true" options - on the command line. - - -** Version 4.7.3 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.7.3/ ) - - bugfix release for 4.7.2 - - * Fix buffer overflow in parser on long PGN with scores - * Allow castling and e.p. capture moves to survive when editing opening book - * Fix node-count overflow in engine output - * Better sorting of fail-low lines in engine output - * Fix Chess960 a-side castling legality check - * Fix position search in Chess960 - * Fix adjudication of Giveaway stalemates - * Adapt WinBoard window positioning to work with multiple screens - * Cure some weirdness in XBoard when dragging pieces outside the board - * Some dialog layout improvements to facilitate internationalization - * Fix crash on using some dialog Browse buttons in GTK version - * Connect manual menu item work in GTK version - * Put code for OS X integration in the GTK version - -** Version 4.7.2 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.7.2/ ) - - bugfix release for 4.7.1 - - * Make PGN parser immune to unprotected time stamps - * Fix book creation - * Fix GUI book after setup position - * Allow drops / promotions/ deferrals to be edited into book - * Allow entry of negative numbers in spin control (WB) - * Fix grabbing of selected piece - * Fix initial board sizing WB - * Fix -zippyVariants option - - -** Version 4.7.1 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.7.1/ ) - - bugfix release for 4.7.0 - - * updated translations - * fixed texinfo 5.0 problems - * Work-around for Xt selection bug - * Add -backupSettingsFile option - * Make skipping of unknown option smarter - * Let popping up of WinBoard chatbox for channel open it - * Fix vertical sizing of GTK board - * Fix buffer overflow in feature parsing - * Accept setup command for non-standard board size - * Fix fatal error on unsupported board size - * Fix GTK box popup - * Let XBoard -autoBox option also affect move type-in - * Fix spurious popup after batch-mode Analyze Game - * Fix saving of analyzed game - * Provide compatibility with Alien Edition setup command - * Fix quoting of book name in tourney file - * Fix disappearence of pieces that were moved illegally - * Fix horrible bug in reading scores from PGN - * Print score of final position in Analyze Game - * Fix GTK SetInsertPos - * Fix scrolling of Chat Box - * Make Chat Box window obey -topLevel option - * Fix Xaw file browser - * Update zippy.README - - -** Version 4.7.0 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.7.0/ ) - - * Code refactoring of XBoard - * The old X11 front-end has been largely rewritten, - so that all windows are now created by a single - generic routine - * XBoard now uses the Cairo library for all drawing - * Pixmaps and bitmaps no longer supported; - XBoard now uses PNG and SVG images instead. - * An alternative (as yet experimental) front-end - using GTK has been added - - * Interactive Analysis - * Excluding moves from analysis by playing them - * Excluded-moves header in Engine Output window - * Analyzing with two engines simultaneously - * Annotating an entire muti-game file - * Analysing positions by Monte-Carlo play - - * Other New Functionality - * Displaying player logos (XB) - * Player logo on ICS can be based on player handle - * Chat boxes for XBoard - * Narrowing down of position searches - * Copying pieces when editing a position - * Starting WinBoard through drag & drop - * Recalling fully configured engines and ICS - * Creating an opening book from a game file - * Pausing a game - * Automatically observing partner games with dual-board - - * Interface Improvements - * Recognizes file type of lone argument by extension - * Default startup settings configurable per mode - * Separate menu items for loading 1st and 2nd engine - * Engines can be selected from listboxes - * Grouping of engines in the installed-engines list - * Stay in Analyze or Game Start mode after engine loading - * 'Continue Later' button in WB tournament dialog - * A new --help option (XB) - * A second board window for observing ICS games (XB) - * Smoother graphics and a resizable board (XB) - * A rejuvenated file browser (XB Xaw) - * Scrolling listboxes with mouse wheel (XB Xaw) - * Tabbing through dialog etry fields (XB Xaw) - * Adapt width of auxilliary windows on board resize (WB) - * External piece bitmaps (WB) - * Border around the board (WB) - * Saving settings as themes (WB) - - * Bug fixes - * Grayout of Analysis menu item in zippy mode - * Crash on flagging in -st mode - * Keep track of virginity in variant seirawan FENs - * Immunity to capitalized promo pieces - * Avoid board sizes with unavailabile variant pieces - * Work-around for FICS violation of SAN - * Check validity of tourney participants - * Loop-Chess promotions with legality testing on - * Fix -fSAN option in Analyze File mode - * Scrolling of Engine Output after PV walk (XB) - * Start browsing in currently-selected folder (WB) - * Allow entry of fractional timeIncrement (WB) - * Resolve conflict between -mps and -inc options - * Size of mini-Shogi promotion zone - * Adjudication of stalemate and perpetuals in Shogi - * Rep-draw detection in drop games - * Insufficient-material draws in Knightmate - * Replacing of engine in non-last game position - * Sweep selection of promo-piece in click-click move - * Don't save aborted games in tourney PGN - * Remember ponder, book and other settings in tourney file - * Do not erase PGN tags on engine loading - * Solved feature problems with engine loading in match mode - * Re-send option settings to -xreuse engine - * Allow use of 'shadow' promotion pieces in any variant - * WinBoard did not always start in its installation folder - * Initialization of 'Twice' checkbox in Tournament dialog (WB) - * Clearing of marker dots after mode or settings change - * some smaller bugfixes - -** Version 4.6.2 ** - (for a more detailed list with screenshots see http://www.gnu.org/software/xboard/whats_new/4.6.2/ ) - bugfix relase for 4.6.1 - * Suppress clear-board message after pasting FEN - * Fix faking of castling rights after editing position with holdings - * Fix second-engine variant test - -** Version 4.6.1 ** - (for a more detailed list with screenshots see http://www.gnu.org/software/xboard/whats_new/4.6.1/ ) - - bugfix release for 4.6.0 - - * Fix memory corruption bug on second-engine loading (through menu or in tournament), - which could destroy -firstInitString - * Fix bug loading a new engine through the menu (not loading it with the full game, - but just upto the current move) - * Prefix engine command with "./" when a pathname is split up during install, so the engine actually runs (XB) - * Fix fall-back to -ncp mode when engine does not start (cutting short the feature timeout) - * Fix bug in position search for FRC castlings (where a King could 'fall off' the board) - * Add a message to inform the user how to clear the board, in sweep-select edit-position mode - * Fix a bug that could stop the clock when the board window was dragged (XB) - * Fix switching off highlighting during game (so last highlights do not remain for the rest of the game) - * Allow user to enter the name of a non-existing file when browsing for a save file (WB) - * Make sure rarely used engine-related options (such as -firstNPS) are also correctly loaded during session - * Correctly handle parsing of Crazyhouse promotions with legality-testing off - * Fix click-click detour under-promotions, which were not working for non-captures - * Don't strip path from engine command if directory is explicitly given in Load Engine dialog - * Consistently make auxiliary windows top level-shells or not, with new -topLevel option (XB) - * No longer fatal if second engine does not support current variant (just refuse Two Machines mode) - * Scroll XBoard game list to keep selected item in view (XB) - * Suppress spurious error popup when starting observing of bughouse games - * Fix vertical axis ticks in eval graph with drop games - * Put title on same line as menu bar only for -size 72 and larger (with -titleInWindow, XB) - * Properly open and close debug file when switching debug mode through key binding Ctrl-D (XB) - -** Version 4.6.0 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.6.0/ ) - - * Engine vs. Engine - * Loading and installing engines through the menu - * Running tournaments with more than two partipants - * Stopping a match between two engines - * Replacing a tourney participant - * Playing openings in color-reversed pairs - * Perpetual chasing in Xiangqi - - * Interface Improvements - * Auto-Queen, and still under-promote? - * Piece fonts and figurine fonts - * Displaying PVs as SAN - * Small scores in the Eval Graph - * How close is the 50-move draw? - * Sign of the engine scores - - * Interactive Analysis - * Playing moves from the PV - * Rapidly changing the number of PVs - * Setting the other side to move in analysis - * Annotating a game with an engine - - * Other New Functionality - * Searching a position in a PGN file - * Editing the opening book - - * XBoard -> WinBoard Convergence - * Exporting the game list (XB) - * A move type-in box (XB) - * New-style Move History window (XB) - -** Version 4.5.3a ** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.3a/ ) - - * only changes to Winboard : build non JAW by default, fix compile errors - -** Version 4.5.3 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.3/ ) - - * fixes of major bugs: - * In the file-browse dialog . and .. no longer mask other files if they are non-first in the directory - * Fix XBoard crash on showing an empty Engine Settings dialog, printing a message in stead - * The XBoard Game List can now handle files with more than 1900 games, by paging through them - * The state of the Move-History window is now remembered by XBoard even when the Engine-Output window is up - * Fix crash on switching sounds in WinBoard under Windows Vista - * Fix empty-string option values on XBoard command line (which were ignored) - * Fix spurious vertical scrolling in XBoard Engine-Output window on clicking in it - * Obey an engine's san feature when sending book moves to it - * Fix XBoard crash when 'filtering' made Game List empty - * Suppress clearing of Engine-Output window on automatic updates in analyze mode - * Force Move-History refresh after loading/reverting variation - * Fix closing brace, when joining two comments to same move - - * fixes of minor bugs: - * Suppress playing sounds when no -soundProgram is set - * Fix display of last move of last match game - * Update window title after last game of match - * Never one-click move when legality testing is off - * Suppress playing book move when total weigth of all moves is zero - * Restore echo after ^C killed XBoard during ICS password - * Fix default of -remoteUser, which could cause crash when playing remote engines - * Fix recognition of separators between options in -adapterCommand command line - * Fix button sizing in generic popup - * Fix translatability of 'Spartan Chess' menu item WB - * Remove some duplicats from WB language template file - * Fix spurious 'Unfinished' sounds during ICS examining - * Fix bug in handling of partner command in zippy-mode bughouse games - * Create more space in some WB dialogs to accomodate translations - - * Improvements benefitting the speaking version for the visually impaired (WB): - * Implement NVDA support in JAWS version - * Fix translation of spoken composite messages - * Fix JAWS reading of Engine-Settings dialog by removing group-boxes - * Add tab stops in WB generic popup - * Reorder controls in Engine-Setings dialog WB, so they are tabbed through in logical order - - * fixed compiler warnings/errors and portability: - * Fix use of random function in XBoard shuffle dialog callback - * Fix inconsistent type of the variable 'shuffleOpenings' - * Silence warnings during rpm build - * Fix warnings XBoard file browser - * Fix some warnings and header-file improvement - - * misc: - * Add -at and -opt options as alternative for @, as work-around for Windows shortcut bug - * Make occurrence of unknown option in settings file non-fatal - * Stale output no longer lingers in the engine-output window when a new game starts - * Popdown (stale) Comment window on new game - -** Version 4.5.2a (Winboard only)** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.2/ ) - - * Fix Engine Settings button options in WinBoard - -** Version 4.5.2 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.2/ ) - - * Main new feature: - * Added many option dialogs and reworked some of the old ones - - * bugfixes, packaging and install: - * Fix nps bug - * Fix flipBlack option XBoard with board texture - * Fix two bugs in reading position diagram - * Fix parsing bug of FRC castling - * Fix bugs in FRC castling rights - * Fix display of promotion piece in ICS superchess - * Fix path browsing in WinBoard - * Fix use of game/position file in first match game - * Fix build on Mac OS X - * install bitmaps and sounds during "make install" - * some minor bug fixes - * code cleanup (e.g. 64 bit warnings, removed malloc.h) - -** Version 4.5.1 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.1/ ) - - * bugfixes: - * Revert "Implement -reset option feature in WinBoard" - * Fix deselection of greyed-out variant button (WB) - * Put warning in HTML help - * Fix unmarked translation - * Fix Alfil bug - * Fix variant janus size prefix - * Fix Xiangqi King facing - * Fix showing of user move after adjudication - * Make language choice from menu persistent - * Fix ICS channel 0 - * Fix some resource leaks - - * fixed packaging issues: - * add DIFFSTAT and SHORTLOG to tar-ball - * added history.c to the tar-ball. Needed for Winboard - - * fixed compiler warnings/errors: - * added missing header file for sprintf - * added missing #includes and missing prototypes to filebrowser - * Fix MSVC compilability - * Fix 64-bit Windows compilability - * Fix MSVC snprintf problem - - * fixed configure problems: - * fixed configure script to correctly detect Xaw3d library - * updated configure.ac to check for Xaw header files - - * misc: - * Fix two typos in option names in texi file - - -** Version 4.5.0 ** - - (see http://www.gnu.org/software/xboard/whats_new/4.5.0/ for more details) - - General - ------- - * User specific settings files - * More logical (and standard) menu structure - * Translation into other languages (WB) - * Walking the PV of an engine - * Exploring variations - * Playing through PGN variations - * Annotating a game with analysis results - * Editing Comments - * Controlling move choice of the GUI book - * Keeping the clock in sync in tournaments - * Starting an engine match from the menu - * Fixed thinking time per move - * Improved multi-PV support - * Where your pieces can move to - * Editing crazyhouse holdings - * Thai Chess (Makruk) and Seirawan Chess - * Non-compliant FEN and SAN input - * Improved Xiangqi adjudications - * Allowing engines to setup a position - - Merging XBoard & WinBoard - ------------------------------ - * Evaluation graph (XB) - * Settings file (XB) - * Filtering the game list (XB) - * Game-List options dialog (XB) - * Recalling the ICS input history (XB) - * Aribtrary board textures (XB) - * Highlight arrow (XB) - - ICS-client Enhancements - ----------------------- - * Maintaining a healty ICS connection - * Claiming a draw after your move - * ICS seek graph - * One-click moving - * Observing your bughouse partner - * Improved Chat-Box interface (WB) - * Uploading games to an ICS - * Side-by-side boards - - -** Version 4.4.4 ** - - * Repair exit-popup deadlock patch - * Fix bug in sending "usermove" when forcing book moves - * Let move parser return ImpossibleMove for off-board moves - * Prevent engine stall on perpetual-chase evasion - * Pop down old tags on loadng new game in WinBoard - * Fix game end during dragging - * Repair animate dragging - * Fix bug in sending cores command to engine - * Fix parsing of SAN shogi promotions - * Fix variant switch on PGN loading - * Allow -flipBlack to work with font-based piece rendering - * Allow font-based piece rendering in board sizes below petite - * Fix WinBoard game-list title - * Fix deadlock in match-result display - * Fix regression in colorization of zippy-matched commands - * Fix zippy handling of draw offers from ICS - * Make some more zippy code obey the --disable-zippy flag - * Remove unnecessary double equals from configure.ac. - * Cut board squares out of texture bitmap more cleverly - -** Version 4.4.3 ** - - * Add variant Makruk - * Implement castling for variant CRC - * Extensive bugfix of -autoKibitz - * Accept for changing chat partner - * Change opening array -variant fairy - * Send continuation lines to chat box they belong to - * Use -keepAlive option to determine connection health - * Fix of ancient WinBoard bug: check value of int options - * Fix bug for incommensurate time odds - * Fix piece-to-char table -variant fairy - * Fix TwoKings ICS castling-rights bug - * Fix reading castling rights FEN in knightmate and twokings - * Fix OO-castling in FRC after pasting FEN - * Fix bug in display of logos - * Fix highlighting bug in XBoard - * Match handles with multiple titles for channel Chat Boxes - * Make WinBoard makefiles use parser.c in XBoard directory - * Added missing sounds files to be able to compile on windows - * Added logo files for xboard - * Bugfix stale first-click - * Fix copying of WB Chat Window contents - * Fix XB crash on giving keyboard focus to non-text widget - * Bugfix copying from Chat Box, own lines - * Fix 'mamer bug' in Chat Boxes - * Fix copying of kibitzed lines from WB Engine-Output window - * Do not recognize non-ICS variants from PGN event tag - * Remake programVersion string after receiving engine features - * Set keyboard focus at startup to board window - * Fix window-position upset on failing engine start in WinBoard - * Allow lower-case promochar in moves of type h8=Q - * Small bugfixed for JAWS version - * Small bugfixes - -** Version 4.4.2 ** - - * add Winboard source files into tar-ball - * remove trailing \r in xboard output - * double buffer size to prevent overflow - * fix problem with empty string in -firstNeedsNoncompliantFEN - * updates makefiles to include dependency on config.h - * correctly apply some check boxes from the option menu - * score sign in analysis mode - * fix for bug #28077: xboard needs to link against x11 - * fix castling rights when copying FEN to clipboard (again) - * fixed some outstanding pixmaps - * fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. - * use xtell for talking to handles, but tell for talking into a channel. - * fix bug in bughouse drop menu - * removing some rather verbose debug messages that seem no longer needed. - * fix engine-sync on move-number type-in bug - * fix declaration of engineOutputDialogUp - * fix double start of zippy engine after switch to gothic - * the last move before the time control now gets its time listed in the PGN - * fix casting rights after FEN pasting - * fix crash on engine crash - * fixed build on openbsd - * cleaned up some debug messages and typos - * removed files that should only be in the windboard directory - * added missing library for build on OS X - -** Version 4.4.1 ** - - * added chat windows to keep track of multiple conversations (WinBoard only) - * allow the result comment as a display item in the game list - * added a "Mute All Sounds" item in the WinBoard Options menu - * new -forceIllegalMoves option - * new -keepAlive option (for ICS play) - * ported -autoDisplayComment and -autoDisplayTags to xboard, controling popups - * replaces analysispopup with engineoutputpopup in xboard - * allow copy/paste position and game to use clipboard (xboard) - * updated several bitmaps (xboard) - * Made the beep sounds for JAWS board navigation configurable - through command-line options - * added the result comment to the game-list tags when the game - list is exported to the clipboard - * updated RTF docs - * fixed premove problem - * fixed engine did not start playing when out of GUI book on second - move with white - * fix bug using opening books (file were not closed) - * fixed crash when opening Engine #1 Settings when there were no - text-edit options in the dialog - * fixed loading of games from command lines, fixes cmail bug - * fix joining lines split by ICS and resizing terminal window when using ICS - (new option -keepLineBreaksICS, -wrapContinuationSequence, -useInternalWrap) - * fixed -autoDisplayComment - * fixed wrong default value for engineDebugOutput in xboard - * swapped 'tell' and 'message' parsing order for correct colorization. - * fixed parse bug for pgn files - * fix for edit-position "moves" being sent by XBoard to the engine - * bugfix for protocol extensions: egtbpath -> egtpath - * fix bug in parser - * further bugfixes: #8847, #10990, #27427, #27642, - #27666, #27667, #27668, #27715, #27751, #27760, - #27772, #27799, #27826 and several small ones - * use "make distcheck" to generate tar-balls - * prepared a system to internationalize winboard menus - * improved mouse handler - * rewrote wevalgraph for better frontend/backend separation - * code cleanup - -** Version 4.4.0 ** - -A new release of both XBoard and WinBoard is now available. Version -4.4.0 includes many changes. It is the first major release of -xboard/winboard after a fork of the project after version 4.2.7. It -includes small changes made in the main line and changes made by a -fork of Alessandro Scotti and lots of changes made afterwards by -H.G. Muller (released as versions 4.3.x). This release represents a -unified version of all changes made after the fork. It includes many -new features and bugfixes. - -You can get both XBoard and WinBoard from the Savannah -project pages: - -https://savannah.gnu.org/projects/xboard/ - -If you find a bug, please report it in the bug tracker at -https://savannah.gnu.org/projects/xboard/ or by email to bug-xboard -(AT) gnu.org. - - -** Version 4.3.16 ** - -New command-line options -/niceEngines=N for adjusting the priority of engine processes so they don't soak up all your system resources -/firstOptions="..." Allows the setting of options that engines define through the feature option="..." commands -/secondOptions="..." -/firstLogo=filename.bmp Displays the mentioned bitmap next to the clock (with H:W =1:2 aspect ratio) (WB only) -/secondLogo=filename.bmp -/autoLogo=false get logo files automatically from engineDirectory\logo.bmp - -General enhancements: -* New WB-protocol command: 'feature option="NAME -TYPE VALUE OTHER"', which engines can use to define options -* New WB-protocol command: 'option NAME VALUE' used to set value of engine-defned options. -* implements /delayAfterQuit and /delayBeforeQuit in XBoard, and uses SIGKILL to terminate rogue engine processes - - -** Version 4.3.15 ** - -New command-line options -/rewindIndex=N (for the new auto-increment mode of the loadGameIndex or loadPositionIndex in match mode) -/sameColorGames=N (for playing a match where the same player has white all the time) -/egtFormats="..." (for specifying where various end-game tables are installed on the computer) - -New menu items -+ Time-odds factors can be set in the time-control dialog -+ Nr of CPUs for SMP engines can be set in the Options -> UCI dialog -+ Own-Book options can be switched from the Options -> UCI dialog -+ The ScoreIsAbs options can be set from the Options -> Engine dialog -+ New-Variant menu adds Superchess - -General Enhancements: -* WinBoard engines can now also use the Polyglot opening book (implemented as general GUI book) -* New WB-protocol commands memory, cores and egtpath make interactive setting of these parameters - possible on WB engines -* New Polyglot is available that relays the interactive setting of these parameters to UCI engines -* Match mode suports an auto-increment mode, so that all games or positions from a file can be played -* Draw claims with Kings and an arbitrary number of like Bishops (e.g. KBBKB) are accepted - -The source tree in original xboard 4.2.7 format can now be compiled under Cygwin with the aid -of the cygwin.mak file in the ~/winboard/ subdirectory of the source releasy, after you put -the hep-file from an executabl distribution there. Maefiles for other compilers are not updated -since 4.2.7, as I do not have those compilers. - - -** Version 4.3.14 ** - -This relaese was not made by the GNU xboard team, but by H.G.Muller. -It mainly contains developments on WinBoard. Nevertheless, an attempt -has been started to back-port the enormous number of improvements that -have been made to WinBoard since the Linux and Windows developments branched -to xboard. This is reflected by the source tree now having the same format -as that of xboard 4.2.7, including all the xboard sources. - -An enormous amount of work still has to be done to make the xboard version -fully equivalent to WinBoard, especially on user-interface side. As a modest -beginning, the xboard source files have been patched to allow their compilation -with the newer back-end files from WinBoard. To this end, the number of piece -types in xboard has been increased from 6 to 22, and the WinBoard bitmaps -have been converted to xboard source format (.bm) and are included in the -xboard bitmaps directory. Other quick patches include the coloring of the -board squares (for xiangqi and holdings), and some code in the user-move -handling to suppress all moves into or out of the area between board and -holdings in crazyhouse, and the treatment of king-captures-own-piece -as a possibly valid move (for FRC castling). This should make it possible -to run xboard with the new back-end files without too much inconvenience. - -New xboard command-line options have been added to make the added back-end -features available. The include the new variants (as argument of the old --variant option), -boardWidth, -boardHeight and -holdingsSize. Be sure -to call xboard with "-boardSize middling" or "-boardSize bulky" if you -want to play with fairy pieces, or xboard might crash due to unavailability -of bitmaps. Other added xboard options are: - -ADJUDICATION OPTIONS: --checkMates --testClaims --materialDraws --trivialDraws --ruleMoves --repeatsToDraw --adjudicateLossThreshold --firstScoreAbsolute --secondScoreAbsolute - -TIME-CONTROL OPTIONS --firstTimeOdds --secondTimeOdds --timeOddsMode --firstNPS --secondNPS - -GENERAL OPTIONS --matchPause --engineDebugOutput --userName --pgnExtendedInfo --pgnEventHeader --hideThinkingFromHuman - -This is all completely untested, but as the options merely switch on well-tested -code in the back-end, there should not be too many problems with them. -Bugs can be reported in the WinBoard forum. - - -** Version 4.3.14k ** - -Compared to version 4.3.13 described below, this version features - -New command-line options: -/autoKibitz (for relaying the PV info of the engine to the ICS) -/userName="..." (for setting the name of the Human player, also as menu) -/engineDebugOutput=N (controlling the writing of engine output to debug file) -/firstNPS=N (for time management by node count or CPU time) -/secondNPS=N (likewise for the other engine) - -New Menu items -+ Enter Username (same as /userName command-line option) -+ Save Diagram (for saving the Chessboard display as bitmap file) -+ Machine Both (not implemented yet, but menu item already provided) -+ New-Variant menu adds CRC, Janus and Berolina (the latter only with legality testing off!) -+ Any variant can be played from a shuffled opening setup - -Bugfixes: -* Problems with switching the variant in ICS zippy mode solved -* In ICS observing mode game history is now fully accessible -* Moves are not fed to engine in zippy mode, when observing a game from a variant unknown to the engine -* a problem with loading PGN of FRC games with move disambiguation and initial castling rights was fixed. -* A bug in the clock display that made previous versions of WinBoard crash for tiny displays is fixed - -General enhancements: -* variant name displayed in title bar in ICS mode, when not 'normal' -* when receiving a challenge in ICS zippy mode, it is checked if the engine supports the variant (/zippyVariants="..." can still be used to limit the allowed variants, and for protocol-1 engines is still the only thing to go on) -* when loading a game from a PGN file, WB automatically switches to the variant specified in the PGN tags -* when starting from a loaded position (using /loadPositionFile), this position will be used on subsequent 'New Game' commands as well (until we switch variant) - -New is also that the source tree is now brought back in the original WinBoard 4.2.7 format, including -xboard source files. Note, however, that the xboard sources are from an older date, and I did not test -if they still compile together with the much newer backend sources. I did add code in xboard.c to recognize -the new command-line options I added since then, and in so far they are back-end options that should be enough -to make them work. This is completely untested, though; I did not even try to compile it. Last time anyone -built a working xboard.exe from this was at a stage where WinBoard did have adjustable board size, allowing -it to play Xiangqi. But no crazyhouse holdings yet. - - -** Version 4.3.13a ** - -This version of WinBoard_F fixes several bugs in 4.3.12, and also addse a few new features. -The new features include: -- some more fairy pieces, so that each side now has 22 piece types in stead of 17, -making most fairy pieces available in board size "petite" (next to "bulky" and "middling"), -making the ArchBishop and Chancellor, as well as one wildcard piece (the Lance) available in all -sizes from "petite" to "bulky". -- The FRC support is fully fixed, both in local and ICS mode. -- A mechanism is provided for safe draw claiming in cases where a 3-fold repetition woud occur only - after your own move. In this case a draw will be awarded by WinBoard if the engine sends "offer draw" - before making its move. -- Genuine draw offers are not passed on immediately to the opponent but held up to when the offerer announces - its move. -- Variants FRC, Cylinder and Falcon are added to the "New Variant..." menu. -- Support for playing time-odds games is added. (Options /firstTimeOdds, /secondTimeOdds, /timeOddsMode) -- A mechanism is provided for attaching WinBoard options to the engine command, to create options that -follow the engine (e.g. time odds) in a tournament run under a tournament manager. -Bugfixes include: -- Shatranj in ICS mode (did not work at all before) -- Some draw adjudications (QRKR was mistaken for KRKR, and KBKB with like Bishops is now recognized) -- time info in the PGN is now correct - -** Winboard_F.4.3.12 release notes - -This WinBoard (beta-)version is derived from Allessandro Scotti's -Winboard_x, and supports the following new options, mainly in the area -of adjudication of engine-engine games, improved Crazyhouse support, -and allowing variants with non-conventional pieces and or board -sizes. (All option are shown here with their default values): - -/variant=normal -This (already existing) option has been expanded with -several new variants, involving non-conventional pieces and deviating -board sizes. The board size is automatically adapted to the selected -variant, unless explicitly overruled (see below). The new variants are -(with default board size, files x ranks, in parentheses): - -variant name Game board description -knightmate Knightmate (8x8) Variant where the King moves as a Knight, and vice versa -capablanca Capablanca Chess (10x8) Variant featuring Archbishop and Chancellor as new pieces -gothic Gothic Chess (10x8) Same as Capablanca, with a more interesting opening position -courier Courier Chess (12x8) a Medieval form that combines elements of Shatranj and modern Chess -shogi Shogi (9x9) Japanese Chess -xiangqi Xiangqi (9x10) Chinese Chess -fairy Fairy Chess (8x8) Variant were you can use all pieces of other variants together - -The variant can be set from the newly added "File -> New Variant..." -sub-menu. Extra board files are indicated by the letters i, j, k, l, -... For boards with more than 9 ranks, the counting starts at zero! -More than 10 ranks is not tested and unlikely to work in the area of -PGN saving / reading. Non-FIDE pieces will be referred to in FENs and -PGN by letters that depend on the variant, and might collide with -piece designators in other variants. E.g. in Xiangqi 'C' is a Cannon, -in Capablanca Chess it is a Chancellor. Pieces that do not belong in a -variant cannot be addressed in FEN and PGN either, for as long as that -variant is selected, unless the letter assignment is overruled with -the aid of the /pieceToCharTable option. The variant is not saved in -the winboard.ini file; on start-up we always get variant "normal" -unless we use the command-line option, or have added the option to the -winboard.ini file manually (in which case it will disappear when this -file is overwritten by WinBoard saving its options). WinBoard_F knows -the movement of all pieces occurring in Capablanca Chess (of which -FIDE Chess is a subset), Shatranj, Courier, Xiangqi and 9x9 Shogi, so -that these games can be played with legality testing enabled. - -/pieceToCharTable="PNBRQFWEMOUHACGSKpnbrqfwemouhacgsk" -Each piece that WinBoard knows (in its legality test) has a letter -associated with it, by which it will be referred to in FEN or PGN. The -default assignment can be overruled with this option. The value has to -be a string of even length, with at least 12 characters. The first -half of the string designates the white pieces, the second half the -black. The last letter for each color will be assigned to the -King. (This is the piece that moves as an orthodox King; note that -Nightmate and Xiangqi have a different royal piece.) All letters -before it will be assigned to the other pieces in the order: - -P Pawn (move often depends on variant) -N Knight (move subtly different in Xiangqi (where it is written as H) or Shogi) -B Bishop -R Rook -Q Queen (Lance L in Shogi) -F Ferz/General (The Shatranj 'Queen' and Xiangqi 'Adviser', used for Silver General S in Shogi.) -W Wazir/GrandVizer (Gold General G in Shogi, in Xiangqi it is royal and denoted by K) -E Alfil/Elephant (Moves subtly different in Xiangqi vs Shatranj/Courier) -M Commoner/Man -O Cannon/Pao -U Unicorn (representation of Royal Knight in Knightmate, used as promoted Pawn in Shogi) -H Nightrider (Promoted Knight in Shogi and CrazyHouse) -A Archbishop/Cardinal (Promoted Bishop in Shogi and CrazyHouse) -C Chancellor/Marshall (Promoted Rook in Shogi and CrazyHouse) -G Grasshopper (Promoted Queen in Crazyhouse, promoted Lance in Shogi) -S (Promoted Silver in Shogi) -K King - -Pieces that are not mentioned (because the argument has less than 34 -characters) will remain disabled. Mentioned pieces can be disabled by -assigning them a '.' (period). They are then not recognized in FEN or -PGN input. Non-FIDE pieces that are not assigned a letter will also -not appear on the promotion menu. It is not advisable to disable a -piece that is present in the opening position of the selected variant, -though. -Promoted pieces that need to be distinguished from original pieces of -the same type (because of demotion on capture and transfer to the -holdings) will be indicated by the letter for the unpromoted piece -with a '+' in front of it (Shogi), or by the letter of the promoted -piece with a '~' after it (Crazyhouse, Bughouse, in general everything -with holdings that is not Shogi). To achieve this, they should be -assigned the characters '+' or '~', respectively. -All the new pieces have a native bitmap representation in the board -sizes 'bulky' and 'middling'. For all window sizes that do not support -such fairy bitmaps, promoted NBRQ are represented as a 2-sizes-smaller -normal piece symbol, so that Crazyhouse can be played at any -size. People disliking the fairy representations might even prefer -this. -There is an enhanced 'Edit Position' menu popup (right-clicking on the -squares after selecting this mode in the main menu), featuring some -common non-FIDE pieces, and 'promote' and 'demote' options to make -those not directly in the menu. The promotion popup shows ArchBishop -and Chancellor in Capablanca and Gothic, (or in fact in any game where -this piece is not disabled or a promoted version of a normal piece), -and leaves only the options YES / NO in Shogi. In Xiangqi there are no -promotions. - -/fontPieceToCharTable="PNBRQFWEMOUHACGSKpnbrqfwemouhacgsk" -This option is similar to /pieceToCharTable, but sets the font -character that is used to display the piece on the screen (when -font-based rendering is in use), rather than in the FEN or PGN. The -default setting should work with George Tsavdaris' WinboardF font, -which uses the 'intuitive' mapping of font characters to symbols. With -font-based rendering the fairy pieces can be used at any board size. -Note that UHACGS are also used to represent the promoted versions of -PNBRQF, in games like Crazyhouse and Shogi, where the promotion has to -be undone on capture. In such games you are likely to prefer a -different representation of those pieces then when they represent true -fairy pieces. - -/flipBlack=FALSE -Traditional Shogi bitmaps are only included for size "moderate". For -other sizes you must depend on font-based rendering. - -/detectMate=TRUE -/testClaim=TRUE -/materialDraws=TRUE -/trivialDraws=FALSE -/ruleMoves=51 -/repeatsToDraw=6 -The option /materialDraws=TRUE causes games with insufficient mating -material to be adjudicated immediately as draws, in case the engines -would not claim these draws. This applies to KK, KNK and KBK. The -option /trivialDraws adjudicates KNNK, KBKB, KNKN, KBKN, KRKR and KQKQ -to draws after 3 moves (to allow for a quick tactical win). Note that -in KQKQ this might not be sound, but that problem would disappear once -bitbase probing is implemented. - -Clocks -The flag-fell condition is now indicated as '(!)' behind the displayed -time, to eliminate the necessity for overwriting the message in the -title bar (which might contain indispensible information in match -mode). - -Other improvements / changes -Castling rights and e.p. rights are now fully maintained, and -considered in legality testing. They are imported from and written to -FEN, as is the 50-move counter. (When reading an incomplete FEN they -are still guessed, though.) The time (in sec, or min:sec) is now -always stored together with the PV information to the PGN, if storing -the latter was requested (through ticking "extended PGN info" in -"Options -> General..."). The saved time is the WinBoard clock time -(as opposed to the time reported by the engine). - -** Winboard_F.4.3.8 release notes - -This Winboard supports the following new options (shown here with their default values): - -/variant=normal -This (already existing) option has been expanded with several new -variants, involving non-conventional pieces and deviating board -sizes. The board size is automatically adapted to the selected -variant, unless explicitly overruled (see below). The new variants are -(with default board size, files x ranks, in parentheses): - -variant name Game board description -knightmate Knightmate (8x8) Variant where the King moves as a Knight, and vice versa -capablanca Capablanca Chess (10x8) Variant featuring Archbishop and Chancellor as new pieces -gothic Gothic Chess (10x8) Same as Capablanca, with a more interesting opening position -courier Courier Chess (12x8) a Medieval form that combines elements of Shatranj and modern Chess -shogi Shogi (9x9) Japanese Chess -xiangqi Xiangqi (9x10) Chinese Chess -fairy Fairy Chess (8x8) Variant were you can use all pieces of other variants together - -The variant can be set from the newly added "File -> New Variant..." sub-menu. -Extra board files are indicated by the letters i, j, k, l, ... For -boards with more than 9 ranks, the counting starts at zero! Non-FIDE -pieces will be referred to in FENs and PGN by letters that depend on -the variant, and might collide with piece designators in other -variants. E.g. in Xiangqi 'C' is a Cannon, in Capablanca Chess it is a -Chancellor. Pieces that do not belong in a variant cannot be addressed -in FEN and PGN either as long as that variant is selected, unless the -letter assignment is overruled by the /pieceToCharTable option. The -variant is not saved in the winboard.ini file; on start-up we always -get variant "normal" unless we use the command-line opton, or have -added the option to the winboard.ini file manually (in which case it -will disappear when this file is overwritten). WinBoard_F knows the -movement of all pieces occurring in Capablanca Chess (of which FIDE -Chess is a subset), Shatranj, Courier, Xiangqi and 9x9 Shogi, so that -these games can be played with legality testing enabled. - -/pieceToCharTable="PNBRQFWEMOUHACGSKpnbrqfwemouhacgsk" -Each piece that WinBoard knows (in its legality test) has a letter -associated with it, by which it will be referred to in FEN or PGN. The -default assignment can be overruled with this option. The value has to -be a string of even length, with at least 12 characters. The first -half of the string designates the white pieces, the second half the -black. The last letter for each color will be assigned to the -King. (This is the piece that moves as an orthodox King; note that -Nightmate and Xiangqi have a different royal piece.) All letters -before it will be assigned to the other pieces in the order: - -P Pawn (move often depends on variant) -N Knight (move subtly different in Xiangqi (where it is written as H) or Shogi) -B Bishop -R Rook -Q Queen (Lance L in Shogi) -F Ferz/General (Silver General S in Shogi) -W Wazir/GrandVizer (Gold General G in Shogi, in Xiangqi it is royal and denoted by K) -E Alfil/Elephant (Moves subtly different in Xiangqi vs Shatranj/Courier) -M Commoner/Man -O Cannon/Pao -U Unicorn (representation of Royal Knight in Knightmate, used as promoted Pawn in Shogi) -H Nightrider (Promoted Knight in Shogi and CrazyHouse) -A Archbishop/Cardinal (Promoted Bishop in Shogi and CrazyHouse) -C Chancellor/Marshall (Promoted Rook in Shogi and CrazyHouse) -G Grasshopper (Promoted Queen in Crazyhouse, promoted Lance in Shogi) -S (Promoted Silver in Shogi) -K King - -Pieces that are not mentioned (because the argument has less than 34 -characters) will remain disabled. Mentioned pieces can be disabled by -assigning them a '.' (period). They are then not recognized in FEN or -PGN input. It is not advisable to disable a piece that is present in -the opening position of the selected variant, though. -Promoted pieces that need to be distinguished from original pieces of -the same type (because of demotion on capture and transfer to the -holdings) will be indicated by the letter for the unpromoted piece -with a '+' in front of it (Shogi), or by the letter of the promoted -piece with a '~' after it (Crazyhouse, Bughouse, in general everything -with holdings that is not Shogi). -All the new pieces have a native biytmap representation in the board -sizes 'bulky' and 'middling'. For all window sizes that do not support -such fairy bitmaps, promoted NBRQ are represented as a 2-sizes-smaller -normal piece symbol, so that Crazyhouse can be played at any -size. People disliking the fairy representations might even prefer -that. -There is an enhanced 'Edit Position' menu popup (right-clicking on the -squares after selecting this mode in the main menu), featuring some -common non-FIDE pieces, and 'promote' and 'demote' options to make -those not directly in the menu. The promotion popup shows ArchBishop -and Chancellor in Capablanca and Gothic, (or in fact in any game where -this piece is not disabled), and leaves only the options YES / NO in -Shogi. In Xiangqi there are no promotions. - -/alphaRank=FALSE -This option does not seem to work for reading PGN files. Saving works -fine. For now, using it is not recommended. In the future it might be -redefined as only affecting engine-engine communication, . - -/flipBlack=FALSE -Setting this option will cause upside-down display of the native piece -bitmaps used to represent the pieces of the side that plays black, as -would be needed for a traditional representation of Shogi pieces. It -can be set from the "Options -> Board..." sub-menu, and it is saved in -the winboard.ini file. For now, traditional Shogi bitmaps are not -included, though. - -Other improvements / changes -Castling rights and e.p. rights are now fully maintained, and -considered in legality testing. They are imported from and written to -FEN, as is the 50-move counter. The time (in sec, or min:sec) is now -always stored together with the PV information to the PGN, if storing -the latter was requested (through ticking 'extended PGN info' in -"Options -> General..."). The saved time is the Winboard clock time -(as opposed to the time reported by the engine). - -** Winboard_F.4.3.7 release notes - -This Winboard supports the following new options (shown here with -their default values): - -/variant=normal -This (already existing) option has been expanded with several new -variants, involving non-conventional pieces and deviating board -sizes. The board size is automatically adapted to the selected -variant, unless explicitly overruled (see below). The new variants are -(with default board size, files x ranks, in parentheses): - -variant name Game board description -knightmate Knightmate (8x8) Variant where the King moves as a Knight, and vice versa -capablanca Capablanca Chess (10x8) Variant featuring Archbishop and Chancellor as new pieces -gothic Gothic Chess (10x8) Same as Capablanca, with a more interesting opening position -courier Courier Chess (12x8) a Medieval form that combines elements of Shatranj and modern Chess -shogi Shogi (9x9) Japanese Chess -xiangqi Xiangqi (9x10) Chinese Chess -fairy Fairy Chess (8x8) Variant were you can use all pieces of other variants together - -The variant can be set from the newly added "File -> New Variant..." sub-menu. -Extra board files are indicated by the letters i, j, k, l, ... For -boards with more than 9 ranks, the counting starts at zero! Non-FIDE -pieces will be referred to in FENs and PGN by letters that depend on -the variant, and might collide with piece designators in other -variants. E.g. in Xiangqi 'C' is a Cannon, in Capablanca Chess it is a -Chancellor. Pieces that do not belong in a variant cannot be addressed -in FEN and PGN either as long as that variant is selected, unless the -letter assignment is overruled by the /pieceToCharTable option. The -variant is not saved in the winboard.ini file; on start-up we always -get variant "normal" unless we use the command-line opton, or have -added the option to the winboard.ini file manually (in which case it -will disappear when this file is overwritten). WinBoard_F knows the -movement of all pieces occurring in Capablanca Chess (of which FIDE -Chess is a subset), Shatranj, Courier, Xiangqi and 9x9 Shogi, so that -these games can be played with legality testing enabled. - -/pieceToCharTable="PNBRQFWEMOUHACGSKpnbrqfwemouhacgsk" -Each piece that WinBoard knows (in its legality test) has a letter -associated with it, by which it will be referred to in FEN or PGN. The -default assignment can be overruled with this option. The value has to -be a string of even length, with at least 12 characters. The first -half of the string designates the white pieces, the second half the -black. The last letter for each color will be assigned to the -King. (This is the piece that moves as an orthodox King; note that -Nightmate and Xiangqi have a different royal piece.) All letters -before it will be assigned to the other pieces in the order: - -P Pawn (move often depends on variant) -N Knight (move subtly different in Xiangqi (where it is written as H) or Shogi) -B Bishop -R Rook -Q Queen (Lance L in Shogi) -F Ferz/General (Silver General S in Shogi) -W Wazir/GrandVizer (Gold General G in Shogi, in Xiangqi it is royal and denoted by K) -E Alfil/Elephant (Moves subtly different in Xiangqi vs Shatranj/Courier) -M Commoner/Man -O Cannon/Pao -U Unicorn (representation of Royal Knight in Knightmate, used as promoted Pawn in Shogi) -H Nightrider (Promoted Knight in Shogi and CrazyHouse) -A Archbishop/Cardinal (Promoted Bishop in Shogi and CrazyHouse) -C Chancellor/Marshall (Promoted Rook in Shogi and CrazyHouse) -G Grasshopper (Promoted Queen in Crazyhouse, promoted Lance in Shogi) -S (Promoted Silver in Shogi) -K King - -Pieces that are not mentioned (because the argument has less than 34 -characters) will remain disabled. Mentioned pieces can be disabled by -assigning them a '.' (period). They are then not recognized in FEN or -PGN input. It is not advisable to disable a piece that is present in -the opening position of the selected variant, though. -Promoted pieces that need to be distinguished from original pieces of -the same type (because of demotion on capture and transfer to the -holdings) will be indicated by the letter for the unpromoted piece -with a '+' in front of it (Shogi), or by the letter of the promoted -piece with a '~' after it (Crazyhouse, Bughouse, in general everything -with holdings that is not Shogi). -All the new pieces have a native biytmap representation in the board -sizes 'bulky' and 'middling'. For all window sizes that do not support -such fairy bitmaps, promoted NBRQ are represented as a 2-sizes-smaller -normal piece symbol, so that Crazyhouse can be played at any -size. People disliking the fairy representations might even prefer -that. -There is an enhanced 'Edit Position' menu popup (right-clicking on the -squares after selecting this mode in the main menu), featuring some -common non-FIDE pieces, and 'promote' and 'demote' options to make -those not directly in the menu. The promotion popup shows ArchBishop -and Chancellor in Capablanca and Gothic, (or in fact in any game where -this piece is not disabled), and leaves only the options YES / NO in -Shogi. In Xiangqi there are no promotions. - -/fontPieceToCharTable="PNBRQFWEMOUHACGSKpnbrqfwemouhacgsk" -This option is similar to /pieceToCharTable, but sets the font -character that is used to display the piece on the screen (when -font-based rendering is in use), rather than in the FEN or PGN. The -default setting should work with the WinboardF font, which uses the -'intuitive' mapping of font characters to symbols. Note that UHACGS -are also used to represent the promoted versions of PNBRQF, in games -like Crazyhouse and Shogi, where the promotion has to be undone on -capture. - -/boardWidth=-1 /boardHeight=-1 -Set a number of files and ranks of the playing board to a value that -will override the defaults for the variant that is selected. A value -of -1 means the variant default board size will be used for the -corresponding parameter (and is itself the default value of these -options). These parameters can be set in the "Files -> New Variant..." -sub-menu, where they are reset to the default -1 is you OK the chosen -variant without typing something to overrule it. These parameters are -saved in the winboard.ini file. (But unless you saved while a variant -with board-size override was selected, they will always be saved as --1.) -A variant with a non-standard board size will be communicated to the -engine(s) with the board size prefixed to the variant name, -e.g. "variant 12x8_capablanca". In protocol 2 the engine must first -enable this feature by sending "boardsizeFxR" amongst the accepted -variants, where F is the maximum number of files, and R the maximum -number of ranks, as decimal numbers. - -/holdingsSize=-1 -Set the size of the holdings for dropable pieces to a value that will -override the default for the variant that is selected. A value of -1 -means the variant default holdings size will be used for that -parameter (and is itself the default value of this options). This -parameter can be set in the Files -> New Variant... sub-menu, where it -is reset to the default -1 is you OK the chosen variant without typing -something to overrule it. This parameters is saved in the winboard.ini -file. To disable holdings, set their size to 0. They will then not be -displayed. For non-zero holding size N, the holdings are displayed -left and right of the board, and piece drops can be effected by -dragging pieces from the holdings to the drop square. In bughouse, the -holdings will be filled by the ICS. In all other variants, captured -pieces will go into the holdings (after reversing their color). Only -the first N pieces of the /pieceToCharTable argument will go into the -holdings. All other pieces will be converted to Pawns. (In Shogi, -however they will be demoted in the regular way before determining if -they fit.) Pieces that are disabled (per default and per -/pieceToCharTable option) might not be counted when determining what -are the first N pieces. Non-standard holdingsize will be communicated -to the engine by prefixing it (together with the board size, even if -this is standard) to the variant name, e.g. "variant 7x7+5_shogi". In -protocol 2 the engine should enable this feature by sending -"holdingsH" amongst the variant names, where H is the maximum -acceptable holdings size as a decimal number. - -/alphaRank=FALSE -When this parameter is true, a-h are converted to 1-9, and vice versa, -in all move output and input (to PGN files or SAN move display as well -as in communication with the engine). This might be useful for Shogi, -where conventionally one uses letters to designate ranks, and digits -to designate files. Engines that want to use this option must make -sure pieces are never represented by lower case! This option can be -set from the Files -> New Variant... menu, where it defaults to FALSE -unless you explicitly set it. It is not saved in the winboard.ini -file. Note that the PGN format in Shogi also leaves out the trailing -'+' as check indicator: In Shogi such a trailing '+' means promotion, -while a trailing '=' means defer promotion. Prefix '+' signs are used -on moves with promoted pieces, disambiguation is done western SAN -style. - -/allWhite=FALSE -Causes the outline of the 'white' pieces to be superimposed onto the -'black' piece symbols as well (as a black outline) when native bitmaps -are used (as opposed to font-based rendering). This is useful if we -choose a very light color to represent the 'black' pieces. It might be -particularly useful in Shogi, where the conventional representation of -the 'black' pieces is as upside-down white pieces, so that both colors -would be white. This option is saved in the winboard.ini file, and can -be set in the "Options -> Board..." sub-menu. - -/flipBlack=FALSE -This option is reserved for future use. It will cause upside-down -display of the 'black' native piece bitmaps, as would be needed for -Shogi. For now it can be set from the "Options -> Board..." sub-menu, -and it is saved in the winboard.ini file, but it is ignored. - -/detectMate=TRUE -/testClaim=TRUE -/materialDraws=TRUE -/trivialDraws=FALSE -/ruleMoves=51 -/repeatsToDraw=6 -These are all options that only affect engine-engine play, and can be -set from the "Options -> Engine..." sub-menu. They are all related to -adjudication of games by the GUI. Legality checking must be switched -on for them to work. If /detectMate is TRUE, the GUI recognizes -checkmate and stalemate (but not in games with holdings!), and ends -the game accordingly before the engines can claim. This is convenient -for play with engines that fail to claim, and just exit. With -/testClaim set, all result and illegal-move claims by engines that -claim more than their own loss are scrutinized for validity, and false -claims result in forfeit of the game. Useful with buggy engines. The -option /materialDraws=TRUE causes games with insufficient mating -material to be adjudicated immediately as draws, in case the engines -would not claim them. The option /trivialDraws adjudicates KNNK, -KBKB, KNKN, KBKN, KRKR and KQKQ to draws after 3 moves (to allow for a -quick tactical win. Note that in KQKQ this might not be sound, but -that problem would disappear once bitbase probing is added). The -/ruleMoves determine after how many reversible moves the game is -adjudicated as a draw. Setting this to 0 turns this option off. Draw -claims by the engine are still accepted (by /testClaim) after 50 -reversible moves, even if /ruleMoves species a larger number. Note -that it is perfectly legal according to FIDE rules to play on after 50 -reversible moves, but in tournaments having two engines that want to -play on forever is a nuisance in endings like KBNKR, where one of the -engines thinks it is ahead and can avoids repeats virtually forever. -The option /repeatsToDraw makes the GUI adjudicate a game as draw -after the same position has occurred the specified number of times. If -it is set to a value > 3, engines can still claim the draw after -3-fold repeat. All these options are saved in the winboard.ini file. - -Clocks -There is an "Options -> flip Clocks" command, that swaps the position -of white and black clocks (convenient in over-the-board matches, where -the screen is next to the board, and you want your own time to be -displayed on your side of the screen). The clocks can be adjusted in -"edit game" mode: right-clicking them adds one minute, left-clicking -subtracts one minute. (Also for OTB matches, to keep them synchronized -with the official match clock.) The flag-fell condition is now -indicated as (!) behind the time. - -Other improvements -Castling rights and e.p. rights are now fully maintained, and -considered in legality testing. They are imported from and written to -FEN, as is the 50-move counter. - -** Winboard_F 4.3.2 - -These are the release notes of Winboard_F 4.3.2, which is released -under the GPL. This version was derived from Allessandro Scotti's -Winboard_x 4.2.7 source files. It only includes the files that were -changed: - -config.h -common.h -parser.h -moves.h -resource.h - -winboard.c -backend.c -moves.c - -parser.l -winboard.rc - -and some bitmaps for piece symbols - -I made modifications in the following areas: - -1) Adjudication and claim verification -2) Fairy pieces and board sizes other than 8x8 -3) Miscellaneous - -Miscellaneous - -/matchPause=10000 -is an option to set the length of the pause between two games of a -match. The value is in msec, default value is 10000 (I will present -all newly implemented options with their default value as example). Be -aware that some engines might not be stopped yet if you make the pause -too small, but might still be puking output, which then will interfere -with the next game. But the fixed value of 10 sec of the old Winboard -seemed like overdoing it. - -Time info in PGN -When you ask for the PV-info to be stored in the PGN (a Winboard_x -option), it now also stores the time spent on the move with it. - -Flag fell -In engine-engine games the messge "white/black/both" flag(s) fell" no -longer appears in the window caption, but as an exclamation point -behind the clock time. (To prevent the annoying overwriting of the -normal header line). - -Adjudications and Claim verification. - -These functions are only present in engine-engine games, and only if -legality-testing is switched on. (The latter will be typically -switched off in games with bizarre rules, which the GUI doesn't know, -and in that case the GUI can never have an opinion on the outcome of a -game.) - -Illegal-move forfeit -As soon as one of the engines plays an illegal move, it forfeits the -game. This feature was already present, but it should be 100% reliable -now, as it also takes e.p. and castling rights into account, rather -than erring on the safe side. - -Illegal-move claim -From the above, it follows that any illegal-move claims by an engine -must be false, and will result in forfeiting the game. (In Winboard_x -this message is ignored, causing the game or match to hang.) - -Checkmate adjudication -As soon as one of the engines does a move that results in checkmate, -the GUI declares the game won, without waiting for the engine to claim -it. - -Insufficient mating material -As soon as the material on the board has shrunk to KK, KNK or KBK, the -game is declared draw. - -/adjudicateLossThreshold=0 -This option was already present in Winboard_x, (to declare a game lost -for which both engines agree for 3 moves that the score is below the -given threshold), but a non-zero value is now also used to enable the -following adjudications. If you only want the latter, just make the -threshold impossibly low (-40000 will usually do the trick). - -Trivial draws -If we are 3 moves into a KQKQ, KRKR, KBKB KBKN or KNKN end-game, the -game is adjudicated as draw. - -/repeatsToDraw=6 -When the specified number of repeats occurs, the game is adjudicated -draw. Should keep track of e.p. and castling rights. This does not -require legality-testing to be switched on. The engines retain the -legal right to claim after a 3-fold repetition, though. If you set -this parameter to 3 or less, they will never get the chance. Better -not set it to 1 or less. - -/ruleMoves=51 -After the given number of full moves without capture or Pawn move, the -game is adjudicated draw. Even without legality testing. The engines -retain the legal right to claim after 50 moves. - -/testClaims=FALSE -When enabled, this option verifies all result claims made by the -engines, and overrules the claim if it is false (forfeiting the game -for the claimer). An engine can still safely claim a win for its -opponent on a nonsense reason, though; this is taken to be the -equivalent of 'resign'. Draw claims (made before a draw adjudication) -are checked against the 50-move, 3-fold-repetition or -insufficient-material rules. Win claims are always considered false, -as the GUI adjudicates checkmates (and stalemates) before any engine -can claim them. - -Fairy-Chess support - -/boardWidth=8 -Sets the number of files on the board. The additional files are named -i, j, k, l... in PGN, and should be indicated this way in -communicating moves to and from the engine. Currently works upto -12. No guarantees on how the rest of the display (clocks, etc.) looks -if you make this number < 8. - -/boardHeight=8 -Sets the number of ranks. Extra ranks are numbered 9, 10, 11... in -PGN. This is so far largely untested, and unlikely to work for -double-digit ranks. Displaying boards with upto 12 ranks seems to -work, though, but double-digit ranks might cause all kind of unforseen -problems in PGN file and move parser, or in communication with the -engine. To avoid such problems as much as possible, in boards with -more than 9 ranks the counting of ranks will start at zero rather than -one! - -/fontPieceToCharTable="......." -This paramater, controlling the mapping of font symbols to piece -types, was already present in Winboard_x. The default is dependent on -the font selected with the /renderPiecesWithFont option. It can now -accept upto 32 pieces, but the length should always be even. The first -half designates the white pieces, the second half the black, both in -the order PNBRACHFEWDOGMQK. (The letters mentioned here are the -letters by which the pieces will be indicated in PGN and FEN notation, -what you have to give as argument depends on the font you use. A black -king might be 'l', for instance). If you give fewer then 32 pieces, -this will go at the expense of what is just before Queen. So the last -two symbols you give for each color are always Queen and King, the -others are assigned in the order Pawn, Knight, ... Pieces that do not -get a symbol assigned will remain invisible. - -fairy-FEN support -The letters ACDEFGHMOW are accepted in FENs in addition to the regular -PNBRQK,(and of course the lower case versions for black), and are -passed to the engine in a setboard or edit menu. Double-digit skips -are acceptable in FENs. 'x' is interpreted as a skip of 10. Castling -rights should no longer be ignored. (Doesn't work for FRC yet, -though.) The 50-move-plies field should also be meaningful now. - -Legality testing for Fairy pieces -There is a build in notion of what some of the new pieces can do, according to -A = Archbishop (aka Cardinal) = N+B -C = Chancellor (aka Marshall) = N+R -F = Ferz (aka General), moves 1 step diagonal -W = Wazir (aka Grand Vizer), moves 1 step orthogonal -E = Elephant (aka Alfil), jumps 2 steps diagonal -D = Dabbabah (aka War Machine), jumps 2 steps orthogonal -M = Man (aka Commoner), moves as King, but is not a royal piece -O = Cannon, moves along Rook lines, but cannot capture unless it jumps over - exactly one piece (friend or foe), and captures the first piece - it encounters thereafter. It can only jump if it captures something. - The piece jumped over (the 'platform') is not affected. -The other pieces have not yet any moves implemented: -H = Nightrider -G = Grasshopper -In games that use the mentioned pieces as described (Shatranj, -Courier, Capablanca Chess) you can leave legality testing on. If you -use them to represent pieces that move differently, you should switch -legality testing off. - -Pawn moves -Pawn motion is made dependent on the variant played: in Shatranj and -Courier the double move is forbidden. In those games promotions are -always to Ferz. In Capablanca Chess the ArchBishop and Chancellor also -appear as choices in the promotion popup box. - - -/variant="normal" -Several new variants names are added (replacing "variant31" upto -"variant36"). They affect the initial position. (Board size has to be -set separately.) They are: courier (a Medieval predecessor of modern -Chess, played on a 12x8 board) capablanca (on a 10x8 board, featuring -Archbishop and Chancellor) gothic (as Capablanca, but with a more -exciting initial setup) xiangqi (Chinese Chess) shogi (Japanese Chess, -no support yet) fairy (This variant plays on 8x8 with HEW in stead of -NBR on the Queen side, so that all back-rank pieces are (potentially) -different) Make sure the selected board size matches the variant; this -is not automatic - -Xiangqi and Shogi support (or lack thereof) -Xiangqi is only partially supported. The board display is -western-style (the pieces play on squares, rather than grid -intersections). The legality testing uses the Shatranj Knight and -Elephant, that cannot be blocked, and thus allows some moves that -should be illegal in Xiangqi. The Palace region is indicated on the -board, but there is no testing if the King or Mandarins (implemented -as ordinary Ferzes) leave the Palace. SAN might be non-standard, as it -uses O to indicate Cannon. Most of this will be fixed in a future -version. Shogi is not yet supported at all, first the shaky -implementation of Crazyhouse will have to be beefed up. diff --git a/README b/README deleted file mode 100644 index ce3c783..0000000 --- a/README +++ /dev/null @@ -1,73 +0,0 @@ -What is XBoard? -=============== -XBoard is a graphical chessboard for the X Window System. It can -serve as a user interface for chess engines such as Fairy-Max, -Crafty or GNU Chess, for the Internet Chess Server, or for electronic -mail correspondence chess. It supports all major forms of chess, such -as international chess, xiangqi and shogi. XBoard can also be used by -itself as viewer for stored chess games. See the manual page for -further details. - -XBoard is free software, copyrighted by the Free Software Foundation -and released under the GNU General Public License (GPL). See the file -COPYING for details. - -You can build xboard on most systems with the following commands. - - ./configure - make - -See the file INSTALL for more detailed instructions. - -See the file FAQ.html for answers to frequently asked questions. - - -What is WinBoard? -================= -WinBoard is a port of XBoard to run natively on Windows. It is part -of the XBoard project and is released under the same terms as XBoard. - -You can build WinBoard using the free Cygwin toolchain from -www.cygnus.com with the following commands. - - cd winboard - make -f makefile.gcc - -You can build WinBoard using Microsoft Visual C with the following -commands, or by opening the project in Visual Studio and clicking the -build button. - - cd winboard - nmake -f makefile.ms - - -Reporting problems -================== - -Report bugs and problems with XBoard and WinBoard to -. With XBoard, please use the "script" program -to start a typescript, run XBoard with the -debug command line option, -and include the typescript output in your message. With WinBoard, -please use the /debug command line option and include the contents of -the file WinBoard.debug. Also tell us what kind of machine and what -operating system version you are using. On Unix, the command "uname --a" will tell you this. On Windows, right-click on My Computer and -select Properties. - -Here is a sample of approximately what you should type (on Unix): - - script - uname -a - ./configure - make - ./xboard -debug - exit - mail bug-xboard@gnu.org - Subject: Your short description of the problem - Your detailed description of the problem - ~r typescript - . - -If you improve XBoard, please send a message about your changes, and -we will get in touch with you about merging them in to the main line -of development. diff --git a/SHORTLOG b/SHORTLOG deleted file mode 100644 index 5fad4f7..0000000 --- a/SHORTLOG +++ /dev/null @@ -1,2356 +0,0 @@ -** Version 4.8.0 ** - -(git log --pretty=short --no-merges --cherry-pick --left-only v4.8.x...v4.7.3^ |git shortlog --no-merges) - -Arun Persaud (44): - Updated German translation - Updated Ukrainian translations - Added Dutch translation - Translation: fixed some inconsistencies reported by Benno Schulenberg - fixed some whitespace issues in configure.ac - configure.ac: don't set xaw if we choose gtk - expose the configure options to xboard - output configure options when looking at --version - fixed some more translation strings - more translations fixes: use uppercase for variant names - updated Dutch translation - updated German translation - updated Dutch translation - updated Spanish translation - another round of translation string fixes - Updated Spanish translation - remove xpm from XBoard - converted icons from xpm to png - added check for apply OS X - new version number for developer release - updated po/pot files - updated Dutch translation - new version number for developer release - updated po/pot files - updated spanish translation, added new polish translation - update gettext configuration to not include any generated files in git - fixed whitespace error in configure.ac for os x - new version number for release 4.8.0 - update po/pot files - updated spanish, ukranian, and dutch translation - replaced hardcoded pngdir with built-in ~~ - update NEWS file - only enable osxapp build target on apple systems, clean up configure.ac a tiny bit - remove experimental from gtk build option - fix osxapp enable option in configure.ac - updated Changelog, DIFFSTAT, and SHORTLOG - make all tests for strings in configure use the same scheme - USE OSXAPP instead of APPLE and fix withval->enableval in AC_ARG_ENABLE - fix typo and prefix - forget a few __APPLE__ ifdefs; changed to OSXAPP - updated NEWS - updated ChangeLog, DIFFSTAT and SHORTLOG - line numbers in PO got updated - mac: only use gtk compile flag, if osxapp is enabled - -H.G. Muller (166): - Implement variant ASEAN - Make PGN parser immune to unprotected time stamps - Make writing of move counts in PositionToFEN optional - Do not always start Makruk & ASEAN as setup position - Build in limited EPD capability for engine fingerprintig - Add quit-after-game checkbox in ICS options dialog XB - Fix book creation - Fix GUI book after setup position - Allow drops / promotions/ deferrals to be edited into book - Add Save button to Edit Tags dialog - Allow entry of negative numbers in spin control (WB) - Fix grabbing of selected piece - Fix initial board sizing WB - Add checkboxes for autoDisplayTags/Comments in menu WB - Allow seting of -egtPath through menu WB - Implement board-marker protocol - Use highlight command to specify move legality - Expand number of marker colors to 8 - Implement hover command - Let magenta marker activate sweep promotion - Allow engine to click squares on behalf of user - Fix XBoard hover command - Fix -zippyVariants option - Allow engine to define its own variant names - Fix engine-defined names - Fix variant choice for second engine - Implement (inaccessible) dark squares - Make XBoard xpm-free - Rename Match dialog to Tournament - Automaticaly install Java engines - Save clocks with unfinished PGN games - Only save clock settings in PGN when an engine plays - Improve Edit Position mode - Clear memory of erased position on variant switch - Automatically adapt board format to FEN - Increase number of piece types to 44 - Implement Chu Shogi - Fix hover event - Fix sweep promotions - Implement LionChess - Fix deselection of Lion - Fix promotion popup in Chu Shogi - Fix reading of SAN Lion double moves - Refactor move generator, and add Chu-Shogi pieces - Fix Shogi promoted pieces - Change Blind-Tiger symbol to claw - Fix SAN of promoted Chu pieces - Fix loading of game with multi-leg moves - Add claw svg to make-install - Animate both legs of Lion move - Implement roaring of Lion - Fix re-appearing of board markers - Fix double-leg moves on small boards - Fix sending and parsing of null moves and double moves - Fix target squares second leg - Adapt WinBoard front-end to Mighty Lion - Beef up variant detection - Fix promoted Elephant image in Shogi (XB) - Fix legality test of pinned-Lion moves - Implement ChuChess - Always alternate promo-sweep for shogi-style promoting piece - Allow piece promotion by pieceToChar in all variants - Fix disambiguation of shogi-style promotions - Fix default of Chu Chess piece promotions - Fix sweep promotions - Allow Lion sweep-selection in Chu Chess - Fix hover event (again) - Supply oriental theme settings - Change color of XQ board to better contrast with pieces - Fix promoting of Sho Elephant - Automatically switch to variant engine supports - Implement -installEngine option - Allow Crown-Prince image to differ from King - Fix Chu-Shogi Lance deferral - Fix mate and stalemate test in Chu Shogi - Implement option complex for installing engines - Make filler buttons in New Variant insensitive - Fix promotion in Ai-Wok - Make building of Windows .hlp file optional - Fix compile error promo dialog WB - Fix WB New Variant dialog - Cure weirdness when dragging outside of board - Write -date stamp always with 10 characters - Update protocol specs for setup command - Put some OSX code into gtk version - Remove use of strndup - Activate ManProc in GTK - Fix crash on use of dialog Browse buttons GTK - Implement EGBB probing and -first/secondDrawDepth - Set ~~ to bundle path for OS X - Start rank counting at 1 for boards deeper than 10 - Fix DATADIR in Xaw - Remove redefine of DATADIR that leaked in from v4.7.x - Fix Chu promotion of L, HM and GB - Fix name of master settings file in OS X - Overhaul kill code - Add --show-config special option - Allow popup of TC and Common Engine from Tournament dialog - Fix Tournament Options dialog - Add 'Continue later' button to Tournament dialog XB - Fix ManProc for OS X - Fix access to ~~/themes/conf for OS X - Fix ManProc for OS X - Fix sorting of Engine Output - Fix sticky windows on Win8 - Fix printing of engine-output headers - Allow hide/show of columns in Engine Output - Implement extended thinking output - Handle fali-low & fail high - Fix sorting of Engine Output - switch to new tbhits protocol - Put fail-high/fail-low indicators in protocol specs - Implement new mate-score standard - Drag touching edges together (WB) - Fix sticky windows on Win8 - Fix printing of engine-output headers - Fix warning in CheckTest - Add some checkboxes in General Options dialog WB - Expand %s in -openCommand to DATADIR and fix OSX settings-file name - Put ponder checkbox in Common Engine dialog WB - Make Fischer castling generally available - Fix Seirawan reverse-castling animation - Allow wild-cards in FEN - Allow shuffling indicators in FEN - Detect Fischer castling in FENs - Add Option type 'Skip' - Fix moves of Spartan Captain - Fix warnings - Add Edit Engine List menu item to XBoard - Add logo-size control XBoard - Integrate ICS output into Chat Window - Add context menu to ICS console XB-GTK - Let ICS Console pop up GTK in stead of ICS Input Box - Recognize Esc and Tab in ICS Console input - Preserve unfinished input lines during chat switch - Ctrl-N in chat opens empty chat - Add End Chat button - Let Ctrl-O key open chat for last talker - Fix Xaw Chat Console - Write broadcasts also to private chatbox of talker - Also display channel tell in ICS Console during private chat - Leave xterm at start of new line after quitting XBoard - When ICS Console open EOF from keyboard is no error - Implement copy function in ICS Text Menu - Equip Board Options dialog with themes listbox - Preserve window width on board-format change - Fix pop-down of ChatDlg and TextMenuDlg from menu - Play move right-clicked in Edit Book dialog - Allow adding played move to book - Use first engine as default for second - Kludge repair of expose after startup resize - Fix various warnings - Fix Board-dialog bug WB - Fix error Engine Output text highlighting - Also search indirection files in user's .xboard tree - Implement (clock-)font handling in GTK - Fix warnings fonts patch - Fix width of menu bar - Fix initial sizing of board - Allow writing text on pieces - Render inscriptions on Chu-promoted pieces in red - Fix loading positions in engine-defined variant - Fix reading Chu Shogi FENs - Fix piece inscriptions - Allow pseudo-engines to adjust the clocks - Fix writing of Chu-Shogi FENs - -H.G.Muller (150): - Fix crash on opening Tags window Xaw - Make EditPosition pallette work in Asian variants - Let EditPosition double-click on piece promote it - Fix null-move entry during play - Fix adjusting clocks in Xaw version - Fix typing of null moves - Fix crash on double-click in Game List Tags - Fix castling rights on using -lgf - Add final piece count to search criteria - Add Save Selected Games menu item - Fix alignment in Engine Output window - Verify if font-spec looks like one in Xaw - Fix size of time in Engine Output window - Connect mousewheel to Forward/BackwardEvent (XB) - Make sure node count is positive - Connect scroll event to Graph Option in GTK - Rewrite key-binding section of manual - Let Save Games as Book only use selected games - Describe Save Selected Games menu in manual - Fix syntax error in bitbase code - Provide DoEvents function in front-ends - Fix GameListHighlight WB - Call DoEvents during time-consuming operations - Fix auto-display comment option in General Options - Let GTK build pay attention to font arguments - Replace strcasecmp by StrCaseCmp - Fix GTK font patch - Fix MSVC problems - Define default font names - Fix Xaw key bindings - Fix key bindings for non-menu functions - Animate multi-leg in auto-play and forward event - Limit auto-extending to click on first move of PV - Fix WB DoEvents error - Include some conditional OS X fixes - Use GTK fonts in Engine Output and Move History - Correct for .Xresources form->paneA renaming in manual - Fix infinite-regression problem on OS X - Fix Chat window for Xaw build - Use -gameListFont in Game List - Use coordFont default pixel size for other fonts - Fix GTK fonts - Let message field and button bar use GTK -messageFont - Update protocol specs - Fix SetWidgetFont GTK - suppress Alien Edition standard variants - Reserve piece command in protocol specs - Reorder variants, to comply with Polyglot book specs - Fix warning in dead code Show - Make SVGDIR a variable - Fix Xaw button color error - Let OS X display dock icon - Fix crash of tournament dialog GTK - Fix checkmarking of OS X menu items - Look for logo in engine dir first (GTK) - Make inlined functions static - Fix typo - Implement -autoInstall option - Ignore color arguments not starting with # - Scale texture bitmaps that are not large enough - Implement engine-defined pieces - Fix texture scaling - Test legality even when off if engine defined pieces - Allow two Pawns per file in Tori Shogi - Force exactly overlayed texture scaling through filename - Describe the new texture conventions in manual - Sort fail lows and fail highs below others - Repair damage done by merging with v4.7.x - Add extra font field to Option struct - Control Eval Graph with mouse - Remove debug printf - Configure some themes in XBoard master settings - Prevent crash on specifying non-existent texture XB - Configure a size for the Eval Graph - Fix detection of screen size GTK - Retune -stickyWindows GTK - Improve SAN of Pawn moves and allow Betza e.p. definition - Update description of piece command in protocol specs - Allow definition of castling in piece command - Repair piece defs with showTargetSquares off - Implement Betza p and g modifiers in piece command - Improve virginity test for engine-defined pieces - Implement Betza o modifier for cylinder boards - Fix cross-edge e.p. capture in Cylinder Chess - Prevent multi-path moves from parsing as ambiguous - Reparse ambiguous move under built-in rules - Size seek graph to also cover board rim WinBoard - Always accept piece commands in partly supported variants - Print PGN Piece tag listing engine-defined pieces - Make unsupported variant on loading 1st engine non-fatal - Fix abort of machine game on variant mismatch - Fix reset of 50-move counter on FRC castling - Allow use of second-row pieces for non-promoted in drop games - Prevent board-size oscillations - Suppress use of promo-Gold bitmaps in Tori Shogi (WB) - Rename PGN Pieces tag to VariantMen - Implement ff etc. in Betza parser - Configure XBoard for -size 49 in master settings - Fix writing of Seirawan960 virginity in FEN - Fix clipping of board GTK - Fix engine-defined variant as startup - Reset move entry on stepping through game - Don't preserve setup position on board-size change - Fix pieceToCharTable of Falcon Chess - Always accept piece commands for Falcon and Cobra - Implement Betza j on W,F as skip first square - Implement Betza a modifier - Implement Betza g modifier for non-final legs - Implement Betza y modifier - Implement directional modifiers on KQ, and let y&g upgrade - Implement Betza t modifier for hop-own - Switch to new Betza orth-diag conversion standard - Preserve other Betza mode bits on setting default modality - Implement Betza hr and hr as chiral move sets - Let t on final leg in Betza notation forbid checking - Fix infinite loop in cylinder moves - Fix check test with multi-leg moves - Relocate OS X' LOCALEDIR - Implement new logo standard - Replace default Shogi pieces - Force GTK logo size to quarter board width - Increase number of engine-defined-variants Buttons XB - Show current variant on New Variant buttons GTK in bold - Fix ICS logo display - Try also /home//.logo.pgn for user logo - Fix logos Xaw - Some improvement on new Shogi SVG pieces - Remember position obtained from setup - Split Tournament dialog in side-by-side panes - Reset move entry on Clear Board - Update Game List when setting new Game List Tags - Implement displaying of variant tag in Game List - Don't switch to engine-defined variant on game loading - Always accept piece commands in variant great - Update Game List after tag selection changed - Fix some uninitialized variable bugs - Preserve parent variant for PGN of engine-defined game - Fix loading of engine-defined PGN games - Fix display of Spin Options with negative range - Let GTK dialogs open with actual-size Graph widgets - Ignore first configure event - Base new square size on board widget allocation GTK - Suppress duplicat autoInstalls - Fix variant-name recognition - Prevent unknown variant getting button in -ncp mode - Fix -xbuttons window width GTK - Attempt to make GTK sizing work with tiling WM - Fix promotion in Betza move generator - Also do dual-royal test in variant shogi - Add persistent Boolean option -fixedSize - -Joshua Pettus (2): - Add build script to configure for a XBoard.app for OS X - removed gtk theme from OSX app - -hasufell (4): - BUILD: make paths modifiable (tiny change) - BUILD: fix configure switches (tiny change) - BUILD: make Xaw frontend default (tiny change) - BUILD: fix withXaw conditional (tiny change) - - -** Version 4.7.3 ** - -(git shortlog --no-merges v4.7.2..HEAD) - -Arun Persaud (6): - cleanup some trailing whitespaces - Updated copyright notice to 2014 - removed .DS_Store file from git - updated copyright to 2014 in menu.c - new version number for release 4.7.3 - updated po/pot files - -H.G. Muller (21): - Fix buffer overflow in parser - Fix adjudication of Giveaway stalemates - Fix node count range - WinBoard multi-monitor support - Repair XBoard from node-count patch - Repair FRC A-side castling legality testing - Allow castling and e.p. to be edited in opening book - Remove width limiting of shuffle checkbox - Widen Xaw text entries for larger square sizes - Fix Xaw file-browser New Directory - Fix packing of FRC castlings - Make filler variant button inactive - Fix sorting of lines in Engine Output - Cure weirdness when dragging outside of board - Put some OSX code into gtk version - Remove use of strndup - Activate ManProc in GTK - Expand ~~/ to bundle path (OSX) - Use __APPLE__ compile switch for OS X - Make building of Windows .hlp file optional - Fix crash on use of dialog Browse buttons GTK - - -** Version 4.7.2 ** - -(git shortlog --no-merges v4.7.1..HEAD) - -H.G. Muller (8): - Make PGN parser immune to unprotected time stamps - Fix book creation - Fix GUI book after setup position - Allow drops / promotions/ deferrals to be edited into book - Allow entry of negative numbers in spin control (WB) - Fix grabbing of selected piece - Fix initial board sizing WB - Fix -zippyVariants option - - -** Version 4.7.1 ** - -(git shortlog --no-merges v4.7.0..HEAD) - -Arun Persaud (4): - new version number for developer release - updated po/pot files - Updated Ukrainian translations - Updated German translation - -Christoph Moench-Tegeder (1): - fix bug #38401: xboard.texi doesn't build with texinfo-5.0 (tiny change) - -H.G. Muller (24): - Work-around for Xt selection bug - Repair WinBoard compile error - Add -backupSettingsFile option - Make skipping of unknown option smarter - Let popping up of WinBoard chatbox for channel open it - Fix of argument error - Fix vertical sizing of GTK board - Fix buffer overflow in feature parsing - Accept setup command for non-standard board size - Fix fatal error on unsupported board size - Fix GTK box popup - Let XBoard -autoBox option also affect move type-in - Fix spurious popup after batch-mode Analyze Game - Fix saving of analyzed game - Provide compatibility with Alien Edition setup command - Fix quoting of book name in tourney file - Fix disappearence of pieces that were moved illegally - Fix horrible bug in reading scores from PGN - Print score of final position in Analyze Game - Fix GTK SetInsertPos - Fix scrolling of Chat Box - Make Chat Box window obey -topLevel option - Fix Xaw file browser - Update zippy.README - - -** Version 4.7.0 ** - -(git log --pretty=short --cherry-pick --left-only v4.7.x...v4.6.2^ |git shortlog --no-merges) - -Arun Persaud (50): - added some documentation about what's need to be done for a release and a bash-release script - Merge branch 'v4.6.x' into tmp - new version number for developer release - updated po/pot files - removed unused variables (-Wunused-variable) - enable -Wall -Wno-parentheses for all compilers that understand them - new version number for developer release - Updated German translation - fix bug #36228: reserved identifier violation - bug #36229: changed PEN_* from define to enum - bug #36229: changed STATE_* from define to enum - bug #36229: changed ICS_* from define to enum - new version number for developer release - added SVGs - added cairo and librsvg to configure process - initial svg rendering - added SVGs to dist files in automake - added a black and white theme to replace the mono option - we still need a few bitmaps, so the directory needs to be included in Makefile.am - new version number for developer release - update po/pot files - updated some icons to SVG - new version number for developer release - fix configure script for --with-Xaw and --with-gtk - updated po/pot files; added new frontend files - don't define X_LIBS when using gtk-frontend - new version number for developer release - updated po/pot files - Updated copyright notice to 2013 - removed trailing whitespace - Updated Ukrainian translations - fix configure bug that showed up on OS X (couldn't find X11/Dialog.h) - Updated German translation - new version number for release of 4.7.0 - updated Changelog, NEWS, etc. - updated po files for new release (make distcheck) - Merge remote-tracking branch 'origin/master' into v4.7.x - add test for pkg-config - Merge branch 'master' into v4.7.x - added rotated shogi pieces for -flipback option and moved them to the themes directory - keyboard accelerators for both front ends. - add close buttons to gtk windows - in debug mode also print the git-version if available during build - add keyboard shortcuts back into Xaw version - removed some translation calls for messages in the debug log - fixed gtk-warning - fixed segfault of g_markup_printf_escaped which needs utf-8 strings - removed two more translations from debug output - fix OK-response in gtk dialogs, see c7f8df124 - Merge branch 'master' into v4.7.x - -Byrial Jensen (10): - Fix typo (seach) in string. It is already fixed in branch v4.6.x - Mark new text "Click clock to clear board" for translation - Change some double literals to floats. - Remove unused variable pdown from function UserMoveEvent - Remove unused variable delayedKing from function QuickScan - Remove unused variable tm from function SaveGamePGN - Remove unused variable first_entry from function find_key - Remove unused static function MenuBarSelect - Remove unused static function ShowTC - Remove 5 unused variables from zippy code - -Daniel Dugovic (1): - Fix configure script for --enable-zippy (tiny change) - -Daniel Macks (1): - bug #37210: Mishandling of X11 -I flags (tiny change) - -H.G. Muller (381): - Fix suspected bug in Makefile - Merge branch 'v4.6.x' of git.sv.gnu.org:/srv/git/xboard - Fix fall-back on -ncp mode - Inform user in EditPosition mode how to clear board - More thorough switch to -ncp on engine failure - Implement exclude moves - Add exclude and setscore to protocol specs - Fix focus of Game List - Keep list of excluded moves in Engine Output header - Let clicking on header line exclude moves - Fix memory corruption through InitString and second-engine loading - Silence unjust warning - Implement Narrow button in WB Game List - Switch to using listboxes for engine-selection in WinBoard - Install engine within current group - Remove some unused (exclude-moves) variables - Refactor menu code, and move it to menu.c - Switch to use of short menu references - Move more back-endish menu-related stuff from xboard.c to menus.c - Contract some awful code replication - Split back-endish part off drawing code and move to board.c - Declare some shared global variables in backend.h - Split back-endish part off xoptions.c, and move to dialogs.c - Move some back-endish routines from xboard.c to dialogs.c - Cleanup of xboard.c - Remove one level of indirection on ICSInputBoxPopUp - Make routine to probe shift keys - Split usounds.c and usystem.c from xboard.c - Prevent double PopDowns - Major refactoring of GenericPopUp - Redo AskQuestion dialog with generic popup - Redo PromotionPopUp with generic dialog - Redo ErrorPopUp with generic dialog - Add -topLevel option - Add -dialogColor and -buttonColor options - Redo Game List Options with generic popup - Redo Game List with generic popup - Redo Engine Output window with generic popup - Redo Eval Graph with generic popup - Split sync-after options in Match dialog into checkbox + label - Remove unnecessary menu unmarking for Edit Tags - Redo main board window with generic popup - Switch back two two-part menu names - Fix recent-engines menu - Correct texi file for use of .Xresources - Fix switching debug option during session. - Move DisplayMessage to dialogs.c - Move LoadGamePopUp to menus.c - Add message about enabling in New Variant dialog - Use ListBox in stead of ComboBox in Load Engine dialog - Use ListBox in stead of ComboBox in Match-Options dialog - New browser - Fix default file types for browse buttons - Port grouping to XBoard Load Engine - Change default directory in Load Engine to "." - Port engine grouping to Match Options dialog - Give the dual-board option a separate board window - Reorganize main() a bit - Add 'Narrow' function to position search - Fix bug in FRC castling for position search - Use Ctrl key in EditPosition mode to copy pieces - Fix Makefile EXTRA_DIST - Update POTFILES.in - new version number for developer release - updated po/pot files - Fix auto-play - Fix vertical chaining of Buttons and browser ListBoxes - Make reference to board widgets symbolic - Fix internationalization - Fix Engine Output icon heights in international versions - Add New Directory button to file browser - Add sound files to browser menu - Fix 3 forgotten symbolic widget references - Let clocks of secondary board count down - Fix redraw of secondary board on flipping view - Allow clearing of marker dots in any mode - Fix promotion popup - Fix double promotion popup - Move clearing of target squares to after drag end - Fix click-click sweep promotions to empty square - Also do selective redraw with showTargetSquares on - Improve arrow drawing - Use in-place sweep-selection for click-click under-promotion - Fix promotionPopDown on new move entry - Fix some compile errors / warnings - Implement automatic partner observe - Fix ArrowDamage out-of-bounds access on drop moves - Remove debug printf - Fix clearing of ICS input box after send - Fix click-click under-promotion animation save - Fix MenuNameToItem - Shuffle prototypes to correct header, or add them there - Fix readout of numeric combobox - Move FileNamePopUp to dialogs.c - Move ManProc to xboard.c - Fix warnings about character index - Fix warning about signedness - Add pixmap as file type known to browser - Offer primitive paging in file browser - Solve WinBoard name clashes, fix zippy-analyze menu graying - Fix crash on time forfeit with -st option - Add logo widgets in main board window - Allow chaining of single-line text-edits to top - Port chat boxes to XBoard - Fix disabling of Load Engine menu - Fix ICS Text Menu popup - Fix key binding of DebugProc - Fix WB Engine Settings window - Keep track of virginity of back-rank pieces in variant seirawan - Decapitalize promoChar in move parser - Fix bug in Edit Position - Round board size to one where piece images available (WB) - Let windows stick to right display edge (WB) - Pay attention to extension of 'positional' arguments - Define XOP mime type for XBoard - Workaround for FICS bug - Implement variant seirawan in -serverMoves option - Implement --help option - Add check on validity of tourney participants - Add options -fe, -se, -is to load installed engines/ics from list - Allow second engine to analyze too - Let second engine move in lockstep during dual analysis - Allow Analyze Game to auto-step through entire game file - Cure some sick behavior in XBoard Engine Output right-clicks - Allow ICS nickname as positional argument - Preconfigure -icsNames in xboard.conf - Allow entry of fractional increment in WB time-control dialog - Resolve conflict between -mps and -inc options - Update texi file - Fix broken -ics and -cp options - Use Pause state in AnalyzeMode to imply move exclusion - Fix browsing for path - Fix non-NLS compile error for XFontStruct - Fix WinBoard compile errors - Reserve more space for button bar - Fix button-border-width bug in monoMode - Redo Eval Graph drawing with cairo - Fix Eval Graph resolution problems - Redo logos with cairo - Redo seek graph with cairo - Redo arrow highlighting with cairo - Redo grid with cairo - Make convenience routine SetPen globally available - Redo highlights with cairo - Redo marker dots with cairo - Add mode to draw PNG piece images through cairo - Add png pieces - Allow back-texture files to be PNG, (drawn with cairo) - Do animation with cairo - Maintain in-memory copy of the board image - Switch to using 64x64 png images - Allow resizing of board window - Specify proper condition for using cairo animation - Cure flashing of piece on from-square - Also use cairo on slave board - Redo coordinate / piece-count printing ith cairo - Fix DrawSeekText - Make dragged piece for excluding moves transparent - Let cairo also do evenly colored squares. - Remove debug print - Also render coordinates to backup board - Fix clearing of markers dots with promo popup - Implement variant-dependent png piece symbols - Remove acceleration trick - Fix highlight clearing - Draw arrow also on backup image - Cleanup CairoOverlayPiece - Fix erasing dots in seek graph - Separate off drawing routines from xboard.c - Remove all bitmap & pixmap drawing - Check in draw.c, draw.h - Clean up drawing code - Some cleanup - Do coordinate text alignment with cairo - Fall back on built-in pixmaps if png pieces unreadable - Plug resource leak on rezising with pixmaps - Make Piececolor options work on png pieces - Fix bug in resize trigger - Suppress redraw during sizing - Reload piece images when pngDirectory is changed - Make expose handler generic - remove NewSurfaces - Fix alignment of highlight expose - Fix initial display of logos - Let expose requests pay proper attenton to widget - Make draw handle for board globally available - Fix expose requests seek graph - Adapt Eval Graph code to new drawing system - Fix rsvg version in configure.ac - Always render svg pieces anew on size change - Add -trueColors option - Solve odd lineGap problem - Fix 1-pixel offset of grid lines on some cairo implementations - Fix animation with textures off - Fix exposure of atomic captures - Add hatched board texture - Install the wood textures as png - Remove bitmaps from project - Install svg pieces in themes/default - Cache svg handles - Implement proper fallback cascade - Remove piece pixmaps from project - Suppress anti-aliasing in -monoMode - Fix segfault on faulty command-line option - Increase drag delay too 200 msec - Make fallbackPieceImageDirectory hardcoded - Suppress warning for InitDrawingHandle - Code cleanup: move expose redraw to draw.c - Remove unnecessary Xt colors and call to MakeColors - Move Shogi svg pieces to own directory - Spontaeous changes in gettext stuff - Adapt docs for svg/png in stead of bitmap/pixmap - Trim board-window size - Fix garbage pixels on the right of the board - Print missing-pieces error message to console - Prevent odd-width line shift in length direction - Fix bug in resizing - Remove some unused images from png directory - Remove caveat on available pieces fromNew Variant dialog - Fix variant-dependent pieces - Get svg error message - Fix bug in fallback mechanism - Fix bug in resizing on variant switch - Rename svg shogi pieces, so they become usable - Fix re-rendering of svg on resize - Remove the texture pixmaps from project - Replace xiangqi board pixmaps by png images - Replace marble texture pixmaps by png - Fix variant-dependent pieces - Fix crash on animation after resizing - Fix message in New Variant dialog - Fix crash in promotion popup - Fix WinBoard compile error on enum PEN - Fix image extension used for browsing to .pgn - Fix initial enables in TC dialog - Move X11 front-end to directory xaw - Preserve copies of the X11 front-end in xboard directory - Prepare xoptions.c for middle-end changes - Add configure switches for Xaw vs GTK. - Move ICS-engine analyze and AnalyzeGame code to shared back-end - Remove some unnecessary header includes - move testing for no options to back-end - Move MarkMenuItem to xoptions.c - Split xhistory.c in front-end and middle-end part - Remove inclusion of frontend.h from backendz.h - Remove xedittags.c, .h from project - Cleanse back-end code of all references to X11 types - Make xevalgraph.c backend - Move timer functions to new file xtimer.c - Remove all X11 code by #ifdeffing it out - Give LoadListBox two extra parameters - Transfer most available gtk-xt code to xoptions.c - Attach expose handler and connect to mouse events - Implement menu checkmarking and enabling - Connect dialog Browse buttons to GTK browser - Transfer more gtk-xt code, and add some new - Append recent engines to engine menu - Add text insertion in engine-output memos - Better cleansing of xboard.c from X11 types - Highlight Pause button - Add key-handler for ICS Input Box - Make generic memo-event handler, and connect history callback - Add highlighting in move list - Add scrolling of Move History - Let engine-output memos use new generic callback - Implement highlighting in engine output by through generic method - Fix animation - Connect CommentClick handler - Fix ListBox, and add some support routines - Add file browser - Remove some unneeded low-level X11 code - Add Shift detection - Add type-in event to board for popping up box - Add optional callback to Label Options - Add game-list callbacks - Add access routines to checkboxes and FocusOnWidget - Close Move Type-in on Enter - Deselect first char in Move Type-in and ICS Input Box - Use different tables for different dialog columns - Add hiding / showing second Engine Output pane - Add listbox double-click callback - Add BarBegin, BarEnd options - Fix button bar - Add displaying of icons - Make some tall dialogs multi-column - Add task-bar icon - Some experimenting with sizing - Add copy-paste - Delete emptied front-end files, and move rest to gtk directory - Fix warnings - Make board sizing work through subtracting fixed height - Add window positioning - Fix logo placement - Fix clock clicking with GtkEventBox - Pay attention to NO_CANCEL dialog flag - Fix Chat Box - Fix clock highlighting - Adapt lineGap during sizing - Draw frames around memos and listboxes - Load opponent logo based on handle in ICS play (WB) - Add 'Continue Later' button in Tournament dialog (WB) - Allow external piece bitmaps and board border (WB) - Add Themes dialog (WB) - Implement auto-creation of ICS logon file - Use colors in Board-Options dialog also for font pieces (WB) - Implement book-creation functions - Start browsing in currently-selected folder (WB) - Fix move highlighting with animation off - Fix Loop-Chess promotions - Implement use of pause / resume protocol commands - Improve scaling of border bitmap (WB) - Fix -fSAN in AnalyzeFile mode - Do not clear PGN tags on Analyze File - Fix min-Shogi promotion zone - Update WinBoard translation template - Prefer pause mode on pondering engine over 'easy' - Fix rep-draw detection in drop games - Implement insufficient mating material for Knightmate - Use Ctrl key in AnalyzeMode to exclude entered move - Do not move to forwadMostMove when unpausing AnalyzeMode - Do not automatically save aborted games in tourney PGN - Store some more tourney params in tourney file - Implement aborting of games on engine request. - Resend engine-defined options after reuse=0 reload - Allow use of ~ in pieceToChar for shadow pieces in any variant - Let tellothers command add comment to PGN in local mode - Do delayed board draw also with -stickyWindows false - Fix some warnings - Update texi file - Enforce -popupMoveErrors - Fix engine timeout problem in match mode - Stalemate is a win in Shogi - Adjudicate perpetual checks as loss also in Shogi - Adjudicate pawn-drop mate as loss in Shogi - Catch unknown engine in tourney games - Preserve mode on engine loading (sometimes) - Preserve PGN tags when loading engine - Fix library order - Fix expose of to-square with grid off - Fix warning in WinBoard - Let WinBoard start in its installation folder - Assign shortcut char to WB menu item - Add some new strings to WB translation template - Update Dutch WB translation - Fix GTK error auto-raising board - Fix warnings of build server - Put GTK warning in about-box - Let initial setting of Twice checkbox reflect current state - Draw both coords in a1 - Add boolean -autoBox option - Update NEWS file - Add desktop stuff for .xop MIME type. - Remove empty-square SVG images from project - Revive -flipBlack option - Add Xiangqi piece images to project - Fix Makefile for install of Xiangqi pieces - Connect Ctrl key in WinBoard - Better fix of feature timeout - Unreserve tourney game on exit during engine load - Only perform e.p. capture if there are rights - Warn about experimental nature of dual board - Make switching between board windows absolute - Remove checkbox for 'Move Sound' - Don't add PV moves on board clicking in AnalyzeMode - Add new vertical pixel fudge - Allow display of 50-move counter in zippy mode - Add -onlyOwnGames option - Fix graying of Revert menu item - Cure GTK warning in top-level windows - Fix title of top-level windows - Print game-list timing messages only in debug mode - Fix repairing of arrow damage - Remember window params of slave board - Fix repositioning of GTK windows - Limit debug print to debug mode - Better handling of undefined window parameters - Fix sizing of slave board GTK - Suppress printing of status line in dual-board mode - Fix testing for valid window placement Xaw - Fix -topLevel option - Try to make life more bearable in Xaw menus - -** Version 4.6.2 ** - -(git shortlog --no-merges v4.6.1..HEAD) - -Arun Persaud (1): - new version number for release of 4.6.2 - -H.G. Muller (5): - Fix second-engine variant test - Add two new strings to WinBoard language file - Define TOPLEVEL in winboard.c - Fix faking of castling rights after editing position with holdings - Suppress clear-board message after pasting FEN - -** Version 4.6.1 ** - -(git shortlog --no-merges v4.6.0..HEAD) - -Arun Persaud (5): - updated Changelog, etc. for developer release - added m4 directory to search path for aclocal. As suggested by Michel Van den Bergh - removed unused variables (-Wunused-variable) - new version number for release of 4.6.1 - updated Changelog, NEWS, etc. - -Byrial Jensen (2): - New Danish translation (fixes a minor error in one string) - Translate "NPS" also in engine output window - -H.G. Muller (30): - Fix fall-back on -ncp mode - Install engines as ./exefile in XBoard - Inform user in EditPosition mode how to clear board - Fix clock stop after dragging - Fix taking effect of some option changes - Fix bug in FRC castling for position search - Fix bug on loading engine - Fix browsing for save file in WB - Fix parsing crazyhouse promotions with legality testing off - Fix TOPLEVEL stuff - Make variant-unsupported-by-second error non-fatal - Let Game List scroll to keep highlighted item in view - Extend smallLayout regime up to size Medium - Fix switching of debug mode - Correct texi file for use of .Xresources - Fix texi bug - Fix PV sorting during fail low - Fix memory corruption through InitString - Change default value for diretory to . in Load Engine dialog - Swap all engine-related options during engine loading - new version number for developer release - updated po/pot files - Don't strip path from engine name if directory given - Updated Danish and Ukranian translations - Suppress popup for fatal error after tellusererror - Detect engine exit during startup - Fix click-click sweep promotions to empty square - Suppress testing for availability in bughouse drops - Fix crash due to empty PV - Fix Eval Graph scale in drop games - -** Version 4.6.0 ** - -(git log --pretty=short --cherry-pick --left-only v4.6.x...v4.5.x^ |git shortlog --no-merges) - -Arun Persaud (79): - removed parser.l from build process, also removed flex dependency from configure - updated Changelog, NEWS, etc. - new developer release - added/fixed i18n support via gettext to xboard - updated translation files - marked more strings for gettext that were only marked with N_() - updated list of files that include translation strings; updated pot-file - updated po-files; updated german translation - replaced hardcoded email address with generic PACKAGE_BUGREPORT - updated German translation - fixed access rights to winboard language files (644 instead of 655) - lng2po.sh: added command line options, GPL header - added translations generated via lng2po from all winboard languages - deactivated new languages for the moment... - updated ChangeLog, NEWS, etc. - new developer release - updated xboard.pot with released version - translation: added new Ukrainian PO file from the TP - translation: activated Ukrainian translation - updated Changelog, NEWS, etc. - new developer release - fixed segfault in xengineoutput - Revert "fixed segfault in xengineoutput", fixed in the backend now (from HGM) - malloc.h is not needed - updated Changelog, NEWS, etc. - update po files - new developer release - updated pot file and send to translation project - translationproject.org: updated Ukrainian translation - added NEWS for release of 4.5.3 - only require 0.17 of gettext - updated Changelog, NEWS, etc. - updated pot file and send to translation project - new developer release - translation: updated uk.po - translation: updated uk.po - Merge branch 'master' into v4.6.x - translation: added danish translation - marked more strings for translation - added new files to po/POTFILES.in - updated pot file - Merge branch 'master' into v4.6.x - new developer release - updated version numnber in pot file - fixed size of XBoard icon to 48x48 - translation: updated uk.po - marked an error messages for translation - removed Iconify function. Should be handled by the window manager. - replaced unicode character for "'" in xboard.texi - change keybindings that don't use ctrl, make MoveTypeInProc ctrl aware; fixes #35000 - fix translation for engine list; fixes #34991 - make entries in CreateComboPopup not translateable; fixes #34991 - also don't translate selection in ComboSelect; fixes #34991 - only translate entries in CreateComboPopup if strlen>0; fixes #34991 - Merge branch 'master' into v4.6.x - Updated copyright notice to 2012 - code cleanup: make function definition confirm to GNU coding style - added desktop and mime-type association to autoconf install process - added some autogenerated po files to .gitignore - forgot to list new desktop files in EXTRA_DIST section in Makefile.am - Merge branch 'master' into v4.6.x - updated Changelog, NEWS, etc. - updated po-filies - new developer release - Merge branch 'master' into v4.6.x; updated to correct version number for v4.6.0 branch - fixed comments for translators: comments starting with TRANSLATORS: are now copied to the po file - added some comments for translators - translation: updated uk.po - updated Changelog, NEWS, etc. - updated po/pot files - new developer release - Merge branch 'master' into v4.6.x; updated to correct version number for v4.6.0 branch - add configure test for xdg-programs to install mime types; can be disabled for building of e.g. rpms - modified configure and makefile for handling mimedb update - translation: updated uk.po - Merge branch 'master' into v4.6.x - fixed "make install-pdf": missing target for recursive make in po directory - add information about our webpage and were to report bugs into the help menu - Merge branch 'master' into v4.6.x - -Byrial Jensen (26): - fix for repeating key issue, with this allissues this bug should be closed; fixes #35000 - Add NO_GETTEXT flag for combobox. Fix bug #34991 - Make GenericPopUp() more readable by using more named flags instead of numerals - Fix crash when selecting user soundfile due to free() of not malloc()'ed memory - Fix a memory leak in Sound Options - Fix a possible crash in the file browser - Fix possible crash on 64-bit systems when copying game or position - Give numeric options the value 0 if a non-numeric text is entered. Before the value ended up undefined. - Give numeric options the value 0 if a non-numeric text is entered (one more place). Before the value ended up undefined. - Duh! Initialise the argument to sscanf() inside the loop, so it always gets a known value when sscanf() fails. - Transfer a pointer to the promoChar from PromotionPopUp() to PromotionCallback(). Fixes #34980 - Definition of TimeMark moved from 3 c files to backend.h - Add #include "moves.h" to gamelist.c for def. of CopyBoard() - Remove the last 2 compile warnings in gamelist.h - Add 2 strings for translation - Fix unportable memory initialisation - Fix checking of return value from snprintf() - One more string marked for translation - Fix buffer possible overflow when writings tags - Use ngettext() instead of gettext() for a string to allow better translation. - Mark the strings "first" and "sencond" for translation. - Add args.h to POTFILES.in and change the interface to ExitArgError() so msg is c format string - Fix typo in translator comments explaning "first" and "second" - Fix one more typo in the translator comments explaning "first" and "second" - One missed translation of cps->which - Updated Danish translation - -H.G. Muller (375): - New parser, written in C - Implement yynewstr entry point in new parser - Fix o-o castling in new parser - Implement Edit-Comment window through generic popup - Redo Tags dialog - Remember Tags and Comment dialog coordinates - Implement sweep selection as alternative for the piece menu - Implement sweep selection of promotion piece - Fixes to sweep selection - Make sweep-select promotions work in WinBoard - Alternative sweep promotions - Third method of sweep selection - Implement Copy Game List menu item for XBoard - Implement move type-in for XBoard - Refactor move type-in code - Fix crash copying game list when there is none - Alter treatment of moves with empty squares - Fix sweep-promotions patch - Update texi file - Describe -pieceMenu option in texi file - Describe -sweepPromotions in texi file - Describe Copy Game List menu item in texi file - Describe move type-in in texi file - Fix chaining of bottom-row dialog buttons - Fix gettext macros in option dialogs - Bring structure in appData engine options - Put engine initialization code in per-engine function - Add UnloadEngine routine - Generalize WaitForSecond to WaitForEngine - Make engine loadable during session - Make engine startup error non-fatal - Put gettext markers in generic dialog creator - Create conversion tools for language files - Fix some warnings and header-file improvement - Silence more rpm warnings - Fix zippy bughouse partner bug - Delay loading of second engine until it is used - Fix grayout XB Match Options in ICS mode - Implement flock in WinBoard - Remove building rule for parser.c from WB makefiles - Lock game an position file during writing - Add callback possibility to combobox selection - Refactor code for loading games and positions in match - Fix crash on empty Engine Settings dialog - Display note in stead of empty engine-settings dialog XB - Implement Tournament Manager - Calculate and display tourney result - Allow switching off match mode through menu - Load new logo on engine change WinBoard - Implement Load Engine dialog in WinBoard - Fix error message on engine load - Make option to draw second engine from first list - Implement Tournament Options dialog WinBoard - Lift limitation of text length in generic dialog XB - Lift length-limit on text-edits in WB generic popup - Fix PV walking in analysis mode - Fix generic combobox bug - Improve sizing of comment and tags dialogs - Add default extension in file browser - Fix stopping of match in tourney mode - Fix exit popup in tourney mode - Fix range of tourneyType spin WB - Add partcipants at bottom in tourney dialog (WB) - Add WB new popup prototypes - Plug memory leak, filenames relative to installDir - Put saveGameFile in tournament dialog - Save time-control settings in tourney file - Let XB generic popup define default file extensions - Add -first/secondPgnName option - Fix resetting engine options - Make book-edit function WB - Let Shift+RightClick on PV actually play the PV moves - Import WinBoard language files into git - Allow changing MultiPV setting from Engine-Output window - Fix button sizing in generic popup - Let ParsePV always generate SAN move - Automatically play moves of clicked PV in analyze mode - Add option -absoluteAnalysisScores - Add -userFileDirectory option - Make 'add to list' default in Load Engine dialog - Improve WB Load Engine dialog texts - Implement Edit Book in XBoard - Recode some po files - Adapt default directory of lng2po - Include learn info in book edit - Alow promotions and drops in book-editing - Take account of holdings in book key - Fix initialization of engine state - Add secondry adapter command for UCCI or USI - Make engine startup failure non-fatal in WinBoard - Let mentioning completed tourney file add one cycle - Fix CR in multi-line WinBoard text-edits - Allow generic dialog to ignore OK - Add Swiss tourneys through pairing engine - Fix ArgTwo warnings - Fix layout tournament Load Engine dialog WB - Fix -matchGames option - Improve Tournament dialog layout WB - Let XBoard propose name of tourney file - Print sensible window title during tourneys - Improve quoting of engine name on install - Fix interrupting tournament - Fix round-robin schedule - Fix clock mode in tourney starting from -ncp mode - Give error popup when pairing engine fails - Fix concurrency in Swiss tourneys - Fix display of last move of last match game - Clear Engine-Output pane when initializing engine - Fix display of logos - Fix crash at end of Swiss tourney - Redo New Shuffle Game dialog with generic popup - Some refactoring in xoptions.c to separate out front-end - Redo Time Control dialog with generic popup - Add icon to WB for tournament files - Update WB docs for tourney manager - Fix default of -remoteUser - Change long form of -tf option to -tourneyFile - Make non-existing opton in settings file non-fatal - Remove stray else - Redo Move History with generic popup in WinBoard style - Make WB generic popup translatable - Update window itle after last game of match - Add Score in Move List option to general options dialog XB - Use sound for ICS tells also with engine telluser popups - Fix crash on clearing new Move List window - Cure flicker in Move History window, fix highlighting - Add -fSAN / -sSAN options - Fix compile errors WinBoard - Increase efficiency of SAN generation / disambiguation - Fix some warnings - Update texi file - Modified po - Fix texi file, and update it further - Add Absolute Analysis Scores in Genral Options dialog XB - Allow double-digit rank numbers - Create some space in WB New Variant dialog - Allow promotion to Pawn with legality testing off - Implement Grand Chess - Add tab stops in WB generic popup - Reorder controls in Engine Setings dialog WB - Fix drop moves on boards with more than 10 ranks - Fix crash on making too-long FEN - Fix coords display on large boards - Fix resetting searchTime if other TC mode is chosen (XB) - Fix writing searchTime in tourneyFile - Fix parser.c line endings - Let PGN parser accept lower-case piece in drop moves - Improve -showTargetSquares on click-click moves - Let -sweepPromotions also work for click-click moves - Display score/depth in Eval Graph title - Print 50-move counter in Engine-Output title - Add -scoreWhite option - Let WB eval graph react ot single left-click - Print reversible plies done in stead of plies to go - Improve Eval Graph with -evalZoom and -evalThreshold - Write more labels on score axis of eval graph - Put grab on sweep-selecting in Edit Position - Disable -showTargetSquares in ICS mode - Suppress some XBoard warnings - Fix crash on OK after Save Changes in Tags and Comment popup. - Give WinBoard Game List its own font - Allow null move in analysis and edit-game mode - Force Move History refresh after loading/reverting variation - Allow entry of variations in PlayFromGameFile mode - Implement searching games in Game List for a position - Parse PGN tags without allocating memory - Print progress during load / selection of game - Debug position selection - Add plain arrows as key binding for stepping forward/backward - Better fix of crash on empty game list - Fix paging - Delay file loading to allow expose event first - Speed up parser - Allow deletion of last book move - Add key bindings for loading next/previous game of list - Fix up/down arrows in game list - Allow substitution of engines during tournament - Fix generic-popup failure after empty engine-settings dialog - Fix crash on start without settings file - Add -useBoardTexture and -usePieceFont options - Translate search texts - Fix use of random - Allow two-games-per-opening to work with book - Fix ICS move-list header mistaken for null moves - Replace Analyze File by Analyz Game function - Fix quoting in Load Engine dialog - Fix treatment of PGN score/depth info with linefeeds in them - Fix display state after failed analysis attempt - Fix crash on typing non-existent enginein Load Engine dialog - Extra buttons in WB Tournament dialog - Slightly decrease sensitivity of sweep actions - Auto-popup ICS Input Box - Upgrade -serverMoves option - Add -afterGame option - Make DoSleep front-end wrapper for msec sleep - Move HistorySet to back-end - Fix write failures in concurrency - Fix some warnings (prototypes) - Clear fSAN option before new engine load - Fix LoadGameOrPosition starting up engine - Keep book file open - Make too-long game non-fatal - Fix resetting -fSAN on engine change - Fix position loading in tourneys - Make book-window update part of HistorySet - Prevent Edit Book window from stealing focus (WB) - Add Dutch WinBoard translation - Remove paragraph about .Xresources from texi file - Update texi file for position search - Update texi file for new features - Reactivate Falcon Chess - Add Romanian lng file - Reset initString and computerString on engine load - Add option -discourageOwnBooks - Add control to set -discourageOwnBooks WB - Fix crash on loading garbage game file - Fix invalid combobox entry WB - Print message on wrong use of Clone Tourney - Fix crash on adding items near book end - Refine clock adjusting - Fix PV walking with -fSAN - Fix duplicate loading of second engine in tourneys - Quickscan - Translate search-mode strings - profile - Debug position search cache - Implement flipped search - Translate search strings - Dynamically allocate move cache - Speed up position search and consider side to move - Put 'Load Next' button back in WB Game List - Fix some warnings - Fix Load Options dialog WB - Update Dutch lng file - Update language.txt file - Incorporate variant type in book hash key - Fix crash on loading garbage game file - Use other interpretation of Asia rules for chase detection - Add mechanism to translate variable messages in WinBoard - Let perpetual-chase message mention square - Change chase message in .lng files - Don't adjust clock on right-click in EditGame mode WB - Fix two warnings - Clear board markers when moving to other position - Change default sweep-promotion choicein queenless variants - Set pieceToCharTable by setup command even when ignoring FEN - Accept setup command in variant fairy even with legality testing on - Fix handling of -secondOptions option - Add feature-override options - Fix WinBoard clock-click bug - Ignore ICS game starts when already in game - Show 50-move counter also when observing ICS games - Fix parsing of O-O castling in variant janus - Refrain from making unnecessary resize X request - Put promo-suffix on ICS move in variant seirawan castlings - Change encoding of seirawan ICS gating-castlings - Add -afterTourney option - Fix alignment of generic browse button XBoard - Fix arrow highlighting in mono-mode XB - Fix showTargetSquares in mono-mode XB - Fix switching back from mono-mode XB - Fix legality of Spartan promotion to king - Fix out-of-bounds access in check test - Allow setting of holdings with edit command - Fix menu grayout after illegal move - Fix sending of S-Chess gating moves to ICS - Fix initial holdings ICS seirawan games - Fix ICS castling rights - Don't test drops as mate evasions in variant seirawan - Fix format in temporary timing printf - Clip texts on menu bar - Next try for menu-bar sizing - Use in stead of Ctrl+. for peeking last move - Describe -overrideLineGap option in texi file - Try to not confuse ICS rating adustments as shouts - Fix parser for variant seirawan - Fix parsing of faulty PGN tags - Implement peeking previous position in WinBoard - Abandon single-letter menus in tinyLayout - Clear square markers on new game - Add icons for PGN and tourney files - Add xml file for defining mime types - Add desktop files for PGN viewer and tournament player - Fix crash at match end - Fix crash in auto-comment - Implement -viewerOptions - Remove the direct commands to the engines - Update texi file and remove duplicate control - Install icons directly - Install desktop files directly - Install mime types directly - Open WB startup chat boxes only after logged on - Fix seek graph for VICS - Add Ctrl-D as alternative to Ctrl+Alt+F12 in WinBoard - Add control for overrideLineGap in WB Board dialog - Exempt variant seirawan from -disguisePromoted inheritance - Enable WB time-control dialog even when no clock mode - Fix height board dialog - Fix re-allocation of PGN-cache memory - Add new translations to WB language file - Use same translation of "vs." everywhere - Fix 4 warnings - Fix printing non-numeric kibitz with -autoKibitz - Suppress empty lines when observing on VICS - Fix seek-graph popup and popdown - Give focus to board window after ICS login - Reset protocol version before loading new engine - Prevent unnecessary loading of engines - Fix arrow damage with highlightDragging XB - Implement GenericUpdate function - Implement Clone Tourney button XBoard - Incease size of WB array of translated items - Make New Variant dialog visible in mono-mode - Fix fix of switch to mono-mode - Increase max nr of engines to 2000 - Fix registering of EditTagsProg - Put recently used engines in WB menu - Fix TidyProgramName - Allow grouping of engines in engine list - Fix bug in WB combobox readout - Create separate debug fil for each tourney game - Implement -pgnNumberTag option - Put move number in Eval Graph title - Implement kludge to set options through Move Type-in - Fix MAXENGINES in WinBoard - Fix non-bug in WinBoard - Add 5 missing strings to WinBoard translation template - Create room in some WB dialogs for translations - Update Dutch WinBoard translation - Configure XBoard engines and textures - Derive height of text-edits in dialogs from message widget - Fix heights in Engine Output window XB - Fix position of checkbox XB - Fix crash on empty combobox menu XB - Cosmetic: change 4.5 to 4.6 in xboard.conf comment - Delete some unused WinBoard bitmaps - Remove some of the most verbose debug output - Fix unloading of first engine on tourney start - Fix sleeping bug - Fix warning - Better solution to button-height problem - Put front-end support for -recentEngines in XBoard - Fix popdown seekgraph on forward-event XB - Fix heigth of multi-line labels - Configure some new features switched on - Make -pgnNumberTag option setable from menu - Fix button chaining and combo/textbox label height - Configure wider game list - Fix switching animation masks on variant switch - Fix date in copyright notice about-box - Also configure sweep selection - Update texi file - Fix OK button of error popup - Leave height of row that only contains buttons free - More updating of texi file - Merge branch 'master' of git.sv.gnu.org:/srv/git/xboard - Remove a debug printf - Fix use of middle button for position setup - Don't leave piece selected after piece menu - Fix button grab for sweep selection - Move change of debug file to before game load - Delete some load-game debug printing - Implement -autoCopyPV - Implement -serverFile option - Undo translation of cps->which = first/second - Fix translation of EngineOutputTitle WB - Use combobox line for recent engines when available - Make frame width configurable in XB - Use more reliable X-call for getting window position - Implement -stickyWindows in XBoard - Keep XBoard windows attached on resize - Fix piece symbols on switch back to variant normal - Fix two 64-bit warnings - Fix 50-move counter in ICS mode - Suppress recent-engines menu items in ICS mode - -Thomas Adam (1): - (tiny change) Clarify "-name" option is Xt-only - -Tim Mann (9): - Use getaddrinfo instead of gethostbyname. Hopefully this makes us compatible with IPv6 and with hosts that have more than one IP address. However, I don't know of any chess servers that have either of those properties, so I couldn't test that. I did test that xboard still works with freechess.org and chessclub.com and that it gives an error message for invalid host names. - Fix a size mismatch in scanf. Untested, but the code could not have - Move "hide thinking" option into alphabetical order. - Fix display of international characters outside the ASCII range. - Added "misc-fixed" as a fallback font to handle locales where - Add a final wildcard default for fonts. This gives XCreateFontSet - The empty string can't be translated and it causes the gettext - Fixed small bugs in several .po files, enabling these translations to - Internationalize the file browser. - - -** Version 4.5.3a ** - -(git shortlog --no-merges v4.5.3..HEAD) - -H.G. Muller (2): - Fix compile errors WinBoard - Let WB Makefile build non-JAWS version by default - -** Version 4.5.3 ** - -(git shortlog --no-merges v4.5.2a..HEAD) - -Arun Persaud (2): - new developer release - better contrast for XBoard icon on a dark background - -H.G. Muller (43): - Fix some warnings and header-file improvement - Fix warnings XBoard file browser - Fix zippy-partner bug - Silence more rpm warnings - Add tab stops in WB generic popup - Reorder controls in Engine Setings dialog WB - Fix Unfinished sound during ICS examining - Fix JAWS reading of Engine Settings dialog - Create some space in WB dialogs for translations - Remove some duplicats from WB language template file - Fix translatability of Spartan Chess menu item WB - Fix translation of spoken composite messages - Popdown Comment window on new game - Force Move History refresh after loading/reverting variation - Fix crash on empty Engine Settings dialog - Display note in stead of empty engine-settings dialog XB - Fix generic-popup failure after empty engine-settings dialog - No clearing of Engine-Output memos on stat01 - Fix button sizing in generic popup - Fix vscrolling in XBoard Engine-Output window - Obey san feature when sending book moves - Fix display of last move of last match game - Fix parameter handling in adapter command - Fix type of shuffleOpenings - Fix crash on switching sound in Vista - Fix empty-string option values in XBoard - Add -at and -opt options as alternative for @ - Fix default of -remoteUser - Make non-existing option in settings file non-fatal - Remove stray else - Restore echo after ^C in ICS password - Don't one-click move when legality testing is off - Update window title after last game of match - Fix missing files in file browser - Fix use of random in XBoard shuffle dialog - Better fix of crash on empty game list - Implement paging in XBoard Game List - Clear Engine-Output pane when initializing engine - Fix AppendComment - Fix playing sounds when -soundProgram is empty - Implement NVDA support in JAWS version - Suppress playing of book moves with weight 0 - Limit width of menu bar in XBoard - -** Version 4.5.2a (Winboard only) ** - -(git shortlog --no-merges v4.5.2..HEAD) - -H.G. Muller (1): - Fix Engine Settings button options in WinBoard - -** Version 4.5.2 ** - -(git shortlog --no-merges v4.5.1..HEAD) - -Arun Persaud (13): - Fix "make install" on Os X10.6.6 (removed a "/") - fixed wrong default for polyglotDir mentioned in docs. - Fix bug introduced in commit 89b4744: removed a "/" and forgot to add it in the config file - check if malloc.h is present before including it - removed check and #includes for malloc.h, since it's not needed - fixed 64 bit warnings by casting integers to intptr_t before casting to int - updated Changelog, NEWS, etc. - new developer release - configure: renamed bitmapdir to pixmapsdir, since it installed only pixmaps. also changed name of default dir - configure: added install of sounds in .../games/xboard/sounds/default - configure: added install directory for bitmaps files: .../games/xboard/bitmaps/default/ - configure: enable silent rules by default - new developer release - -H.G. Muller (57): - Fix nps bug - Fix unintended translation in debug file - Improve repairing damage of arrow highlight XBoard - Fix flipBlack option XBoard with board texture - Fix two bugs in reading position diagram - Fix parsing bug of FRC castling - Fix bugs in FRC castling rights - Fix display of promotion piece in ICS superchess - Put insertion point at end of text on SetFocus - Add file-browser option to just return name - Make generic XBoard popup, and implement 2 dialogs - Add browse button to generic popup - Add board dialog XBoard - Add ICS options dialog - Make sounds dialog for XBoard - Redo adjudications dialog through generic popup - Redo common-engine dialog with generic popup - Redo new-variant dialog with generic popup - Create General-Options dialog - Implement Machine Match menu item and options dialog - Make generic dialog popup reentrant - Merge SettingsPopUp into GenericPopUp - Let generic popup generate Engine Settings dialog - Activate -path and -file options - Redo ICS input box with generic popup - Make a kind of ICS text menu in XBoard as a dialog - Fix linegap option in board dialog - Fix animation masks on changing piece pixmaps - Let file browser filter on extension - Refinements to generic popup and color picker - Fix crash on opening ICS Text Menu - Fix path browsing in WinBoard - Fix use of game/position file in first match game - Fix saving of XBoard fonts with spaces in name - Fix game-list highight error when filtered (WB) - Fix startup focus of board window - Fix crash on closing dialogs in wrong order - Fix changing of float setting by generic popup - Couple mouse wheel to v-scrolls in file browser - Let double-click select file in file browser - Block selection of a directory when file is needed - Reorganize texi description - Update texi file - Remove outline-pieces option from board-options dialog - Fix running of clock during hash allocation engine - Fix switching between pixmap and bitmap pieces - Fix size limit on 'save as diagram' - Fix gamelist highlight - Make user wav file available for try-out in sound dialog - Change default sounds in Xboard menu - Configure some default sounds - Remove some bitmaps from install - Limit install of sound files to those in menu - Change texture-install directory to pixmaps/textures - Fix crash on using Engine #1 Settings in ICS non-zippy mode - Fix shogipixmaps - Fix gettext macros in option dialogs - -Kamil Blank (1): - Added missing fclose() - -** Version 4.5.1 ** - -(git shortlog --no-merges v4.5.0..HEAD) - -Arun Persaud (9): - add DIFFSTAT and SHORTLOG to tar-ball - Revert "Implement -reset option feature in WinBoard" - added history.c to the tar-ball. Needed for Winboard - added missing header file for sprintf - added missing #includes and missing prototypes to filebrowser - fixed configure script to correctly detect Xaw3d library - updated configure.ac to check for Xaw header files - updated Changelog, NEWS, etc. - new developer release - -H.G. Muller (14): - Fix deselection of greyed-out variant button (WB) - Fix MSVC compilability - Fix 64-bit Windows compilability - Put warning in HTML help - Fix unmarked translation - Fix Alfil bug - Fix variant janus size prefix - Fix Xiangqi King facing - Fix showing of user move after adjudication - Make language choice from menu persistent - Fix ICS channel 0 - Fix MSVC snprintf problem - Fix some resource leaks - Fix two typos in option names in texi file - -** Version 4.5.0 ** - -(git shortlog --no-merges v4.4.4..HEAD, removed duplicated from earlier versions due to cherry-picking) - -Arun Persaud (38): - fixed prototype for AppendComment - clean-up - fixed Makefile.am to handle config file correctly - new developer release - fixed hardcoded location of config file for xboard - fixed compiler warning for file-browser code - Revert "Repair settings-file name" - removed some garbage from configure.ac that got added a while ago - fixed internationalization for winboard - security fix: replaced strcpy with safeStrCpy from backend.c - security fix: replaced sprintf with snprintf - sizedefaults has 9 members, the last line of the array (NULL) only set 7. - cleaned up -Wall warnings (apart from settings some parentheses) - added new case for (Chessmove) 0 in common.h - bugfix: missing array index - add option for silent builds - security fix: replaced some strcat with strncat - added warning if icsLogon file couldn't be opened - adding gnu-readline support - fixed some typos that were introduced during the sprintf->snprintf changes - bugfix: fixed readline support with icslogon option - fixed buffer size for snprintf - Revert "bugfix: fixed readline support with icslogon option" - Revert "adding gnu-readline support" - added latest version of parser.c - new developer release - typo in date of developer release - merged readme_HGM.txt into the NEWS file - removed trailing whitespaces from NEWS - added a desktop file - fixed a typo in the configure script output - replace hard coded paths with path from configure script - added rlwrap tip to FAQ - new developer release - fixed automake process: xboard.conf couldn't be generated if $srcdir was not the current directory - Updated copyright notice to 2011 - release of version 4.5.0 - updated parser.c form parser.l - - -Eric Mullins (1): - Changes needed to compile master branch. - -H.G. Muller (353): - add fixed time per move to the WinBoard time-control menu dialog - let the clocks run in -searchTime mode - Some code refactoring and cleanup; one small bug fix - Integrate castling and e.p. rights into board array; bugfix for EditPosition - fix for new way of saving castling and e.p. information - variation-support patch - This patch gives a better handling of comments in PGN files, and adds the variation as comment to the main line on using Revert in local mode. - fix castling rights when copying FEN to clipboard - improve thinking-output for mulit-variant - refactoring of engineoutput - refactoring evalgraph code - 1st step for moving option parsing from winboard to the backend - 2nd step for moving option parsing from winboard to the backend - same argDescriptor parsing for Xboard and Winbaord - fix window positioning - use linux style options for config file and add a system config file for XBoard - restoring windows (EngineOutput and MoveHistory) on startup - A better and more flexible way of invoking Polyglot - improves the XBoard handling of the engine command line - implements the eval-graph window for XBoard - Suppress saving font settings. - Correct XBoard default debug file name - Delete old indirection settings-file code - Make WinBoard defaults for -fd and -sd equal to "." rather than empty strings. - Change format of -adapterCommand. - Fix NoncompliantFEN defaults. - Fix default castling rights on reading incomplete FEN - Implement castling in -variant caparandom - Fix castling rule assignment in shuffle games - Let XBoard print version with argument --version or -v - Improve layout of Engine #N Settings dialog - Allow popup-less (fatal) exit of engine after tellusererror - Allow Ctrl-C copying from EngineOutput window text to clipboard - Harmonize declarations of XBoard and WinBoard - Newly lexed winboard/parser.c - Display PV on right-clicking board - Display PV right-clicked from EngineOutput window - Indicate squares a lifted piece can legally move to - Allow editing of holdings in EditPosition mode - Fix new args parsing of -lowTimeWarningColor - Docs update for new features - Fix omission in castling refactoring for ICS received boards - Fix reading FEN castling rights for knightmate and twokings - Fix parsing of O-O and O-O-O after FEN pasting in FRC - Fix bug in XBoard PV display - Add fixed-time/move button in XBoard time-control dialog - Refactoring of move-history code - Convert to DOS line endings - Port game-list filtering to XBoard - Move duplicat gamelist code to backend - Allow to apply filter in XB GameList filter edit - Use arrow keys in XBoard GameList for entry selection - Refactoring of adjudication code - Also adjudicate after user move - Also allow user to claim by offering draw before his move - Send FICS atomic claim to ICS if move creates draw after offer - Use FICS atomic draw claim for sending move in zippy mode - Fix width of filter field in XBoard GameList - Save fonts in XBoard settings file per boardSize - Fix bug in edit-position of holdings - Fix of ancient WB bug: test integer option values for validity - Refactoring of game-list-options dialog - Game-List options dialog for XBoard - Merge gamelistopt sources into gamelist source files - Right-click refactoring, step I - Right-click refactoring: step II - Right-click refactoring: step III - Remove stray dot from WinBoard makefiles - Repair damage to -autoKibitz done by FICS atomic zippy claim - Shorten autoKibitz confirmation on FICS - Implement SeekGraph in XBoard - Dynamic Seek Graph - Use right mouse button to view seek ads - Use squares for computer seek ads - One-click moves - Fix error that compiler does not notice - Add promotions and e.p. to oneClickMove - Let second click on piece make only capture, with -oneClickMove - Observe a game in the background while playing - Do not pop down Seek Graph on on-dot click - Match handles with multiple titles for channel Chat Boxes - Capture holdings of background observed gamer - Allow recalling history in ICS input box with arrow keys - Interface XBoard to GhostView file-browser dialog - Fix right-edge spillover of Seek-Graph dots in WinBoard - Allow ICS context menu to pop up a Chat Box on clicking handle - Pop up ICS text menu with default item under mouse pointer - Seek-Graph bugfix: disappearing output in ICS console - Bugfix smart capture - Handle display of PV that starts with other move than played - Add upload of game to ICS for examining - Make WB Chat Boxes wrap and handle URLs - Allow arrow keys in WB Chat Box to access command history - Make Chat Windows pseudo-tabbed - Add -chatBoxes option to open Chat Boxes at startup - Allow WB Chat Box to be dedicated to shouts and 'it' - Let the sounds sound on receiving a message in a Chat Box - Add option -shuffleOpenings - Add Annotate item in Step menu - Support playing through PGN variation comments - Let yy_text determine progress of PV parsing - Newly lexed parser in XBoard directory - Don't disturb background observe when receiving new piece - Insert autoKibitz continuation lines at end of line - Allow walking a kibitzed PV - Fix copying of kibitzed info in Engine-Output window - Put newly opened Chat Box on top - Repair settings-file name - Repair background-observe patch - Use side-by-side boards to display background game - Create space in WinBoard ICS-options dialog - Put new options in WB ICS-options dialog - Group Chat Boxes with console in stead of board window - Add option Display Logo in WB general-options menu - Fix display of uninitialized boards in background observe - Print seconds with 2 digits in backgroundObserve status line - Redraw second board on expose events - Mark non-compliant lines of engine in debug file - Add kibitzes and c-shouts Chat Box - Also capture (numeric) whispers of players for -autoKibitz - Add -autokibitz checkbox to UCI-options menu dialog - Display PV from Engine-Output window (XBoard) - Fix handling username change during game - Paint highlights on dual board (WB) - Update XBoard docs - Allow loading of PGN variations in XBoard - Allow adjustment of clocks in any mode with shift+click - Update WinBoard html help - Update WinBoard RTF docs - Change name of Global Settings menu item to Common Engine Settings - Let WinBoard recognize ~ in settings file name as HOMEPATH - Prevent closing chat box - Fix disabling of Chat Box navigation buttons - Let Chat Boxes pop up above console, rather than on top of it - Fix crash on switching to ICS xiangqi game - Suppress background observe for boards with own game number - Allow any %ENVIRONMENTVAR% in WB settings file name rather than ~ - Fix rep-draw recognition - Allow escape sequences in telluser(error) messages - Fix typos in html help file - Update README file - Alter XBoard key bindings to mimic WinBoard - Fix engine stall on perpetual-check evasion - Reverse mousewheel action - Repair score printing with -serverMoves option - Fix e.p. bug in xiangqi with -serverMoves option - Ignore checks in 50-move count for Xiangqi - Remove font settings from master settings file - Adjudicate Xiangqi material draws with Advisor-less Cannons - Remove misspelled prototype - Remove duplicate testing for cores feature - Fix oneClickMove bug - Refactoring of material-draws adjudication code - Add string option /pieceNickNames - Define /firstUCI and /secondUCI as synonyms for /fUCI, /sUCI - Suggest default file name in browser dialog - Fix erors when compiling with --disable-zippy - Add some book-control options - Allow match to be started from WB menu - Tricked by the grossnes - Add -colorNickNames option - Improved patch for expansion of WB settings-file name - Fix some MSVC compile errors - Update .dev files - Trivial-draws recognition improved in Xiangqi - Do not exit after match when match started from menu - Mark XBoard result messages for internationalization - Make the ID of all WB dialog items unique - Internationalization for WinBoard - Do not translate game-end messages in PGN - Add some forgotten translation hooks - Update docs - Update WB translation template - Make WB run-time language switch possible from menu - Fix JAWS bug saying side to move in ICS play - Prevent transmission of spurious promo char to other engine - Allow parsing of upper-case machine moves - Fix silent bug in drop moves - Revert splitting of UserMoveEvent - Extend legality testing to drop moves - Extend mate test to drop games - Strip DOS line endings from parser.l - Make board-size overrule options volatile - Make Shogi promotion zone board-size dependent - Suppress spurious use of SAN castling in mini variants - Pass promoChar to SendMoveToICS - Remove promotion-piece encoding from ChessMove type - Enhance multi-session TC clock handling - Allow -timeIncrement to be a float - Fix menu translation bug - Fix uninitialized variable in book code - Change evalgraph scale in drop games - Limit multi-session clock handling to non-ICS games - Inherit promoted-info that ICS does not give from previous board - Adapt WinBoard to Shogi implementation on Variant ICS - Fix WinBoard Lance bug - Fix bug in ICS variant switch for Shogi - Allow lower-case piece indicator in drop-move notation - Allow full promotion suffixes on SAN piece moves - Add option -variations to control variation-tree walking - Disable some very verbose debug printing - Implement -flipBlack in XBoard - Add set of shogi pixmaps for XBoard - Fix merging bug - Make starting new variation dependent on shift key - Complete WB (western) bitmaps for Shogi at size 33 - Implement board textures in XBoard - The -overrideLineGap option is made to work in XBoard - Provide some sample board-texture pixmaps - Make -flipBlack and -allWhite option volatile - Let -oneClickMove also work in EditGame mode - Make Knight hop first straight, then diagonal - Suppress promotion popup if piece will explode - Animate piece explosions in drag-drop moves and in XB - Make deferral default in Shogi promotions - Fix spurious promotions with legality testing off - Bugfix for safeStrCpy patch for XBoard - Bugfix safeStrCpy patch, WinBoard - Augment moves of some fairy pieces - Delete some stale promotion code - Add the actual size-33 Shogi bitmaps - Remove validity test on promochar from parser - Make test for valid promotion piece color-dependent - Remember values set by -firstOptions, -secondOptions - Restrict use of a2a3 kludge - Implement setup (engine-GUI) command - Allow arbitrary nesting of sub-variations in PGN input - Fix some warnings - Use normal SAN for wildcard pieces - Use SAN even on illegal moves - Give Lance moves of Berolina Pawn - Keep last PV while clearing engine-output display - Fix bug in parsing illegal Pawn captures - Newly lexed parser.c - Let Engine #2 Settings start second engine - Allow clicked name internal to the icsMenu command string - Make safeStrCpy safe - Restrict use of escape expansion - List Hint with compliant commands - List some undocumented commands as compliant - Fix mouse-driver buglet - Fix one-click bug - Fix acceptance of null-move with legality testing off - Add -variant seirawan to menu - Implement variant seirawan - Implement entering gating moves with mouse - Use Falcon and Alfil as built-ins for Seirawan chess - Accept Seirawan-style gating suffixes - Fix one-click moving on up-click - Fix home-dir crash - Fix default holdings size for variant seirawan - Fix safeStrCpy - Fix safety crash when appending comments - Define moves for Dragon Horse outside Shogi - Make yyskipmoves also suppress examining of drop moves - Change representation of Bede in variant fairy initial position - Give Lance moves of Amazon in variant super - Make Hoplite moves irreversible in Spartan Chess - Reorganize WinBoard menus - Reorganize XBoard menus - Display error for wrong use of Machine Match - Fix spurious scores in comments - Revive Analyze File menu item in WB - Let Analyze File annotate the loaded game - Restrict drops in variant seirawan to back rank - Bugfix XBoard menu translation - Separate menu text from menu name in XBoard - Adapt some XBoard menu texts - Apply gettext macros to menu texts - Fix Shogi promotion popup - Let move-history window scroll to bottom after adding move - Alter WinBoard menu text - Divorce the Edit and Show Tags/Comment menu items - Add XBoard key bindings for Revert and Truncate - Update info on key bindings in texi file - Update texi file for new menu organization - Add description of Game List Options in texi file - Alter descriptionof Analyze File menu item - Improve drawing of highlight arrow - Make WinBoard clocks translation-proof - Configure -inc as volatile option in XBoard - Configure XBoard to use wood board texture by default - Write key bindings in XBoard menus - Allow line-straddling result comments - Peel PV out of comment - Fix sub-variation display with negative score - Correct the key bindings fo view menu in texi file - Move Hint and Book items to Engine menu in XBoard - Configure EGTB cache size in adapterCommand - Also exempt variant seirawan from eval-scale doubling - Fix fag-fell marker with logos on - Let user decide if he wants highlights in blindfold mode - Strip CR from xboard.c - Port highlighting with arrow to XBoard - Configure arrow highlighting as default in XBoard - Provide menus for editing WinBoard engine and server lists - Add XBoard menu items for arrow highlight and one-click move - Fix Edit Game/Position checkmarking in WinBoard - Use default logo for user - Add handle for translator acknowledgement - Create space in dialogs for translation - Add one-click move control to WB general-options dialog - Resize buttons in WB engine-settings dialog - Update translation template - Subject WB context menus to translation - Fix duplicate menu character for Edit Comment - Put OK/Cancel last in tab cycle of some WB dialogs - Remove tab stops on first radio button of WB dialogs - Change tabbing order in WB sounds dialog - Fix order of elements in WB time-control dialog - Reorganize order of WB New Variant dialog controls - Fix ICS context menu for JAWS - Translate menus after creation of JAWS menu - Adapt JAWS menu to new menu organization - Let JAWS SayString buffer full sentence - Subject JAWS menu and spoken strings to translation - Update WB language template file - Put nr CPU earlier in tab cycle of WB Common Engine dialog - Group engine-output memos with engine names - Disable some accelerators in JAWS version - Allow starting a variation from keyboard entry in WB-JAWS - Define Ctrl-R as right-click in WB Comment dialog - Fix bug in parsing variations - Fix WB promotion popup - Fix promotion of Pawn-like Lance - Fix promotion suffixon disambiguated piece moves - Fix mate test - Add variant Spartan Chess - Fix spurious reading of old game title by JAWS - Fix chat window title - Fix right-alignment pproblem in WB ICS window - Fix WB font-based piece rendering on variant switch - Fix Spartan promotion to King - Show move that causes false illegal-move claim - Reset win/loss counters before match - Reset machine colors after match - Fishy fix - Fix time in PGN info - Fix logo repainting - Reset 50-move counter on all pawn-like Lance moves - Fix legality testing for promotions - Fix move type-in truncating game - Fix type-in of drop moves - Fix spurious mate test in Edit Game mode - Remove superfluous copying of machine move - Re-instate load next/prev position menu items - Fix WB Sound Options greyout and remove some grossness - Fix legality testing of drop moves - Move clock-click code to back-end - Greyout unavailable variants in New Variant dialog - Update texi file - Update RTF file - Clean up fishy patch - -** Version 4.4.4 ** - -(git shortlog --no-merges v4.4.3...HEAD) - -Arun Persaud (1): - updated version number to indicate development on 4.4.4 - -Clint Adams (1): - Remove unnecessary double equals from configure.ac. - -H.G. Muller (18): - Let move parser return ImpossibleMove for off-board moves - Prevent engine stall on perpetual-chase evasion - Fix bug in sending "usermove" when forcing book moves - Pop down old tags on loadng new game in WinBoard - Fix game end during dragging - Repair animate dragging - Fix bug in sending cores command to engine - Fix parsing of SAN shogi promotions - Fix variant switch on PGN loading - Cut board squares out of texture bitmap more cleverly - Allow -flipBlack to work with font-based piece rendering - Allow font-based piece rendering in board sizes below petite - Fix WinBoard game-list title - Fix deadlock in match-result display - Fix regression in colorization of zippy-matched commands - Fix zippy handling of draw offers from ICS - Make some more zippy code obey the --disable-zippy flag - Repair exit-popup deadlock patch - - -** Version 4.4.3 ** - -(git shortlog --no-merges v4.4.2...HEAD) - -Arun Persaud (11): - updated to unstable version number - added missing sounds files to be able to compile on windows - new developer release - update year in copyright info - DOS line endings and 644 mode for woptions.c - updated files (AUTHORS, Changelog, etc) for new release - new developer release - added logo files for xboard - new developer release - updated winboard/parser.c - release of version 4.4.3 - -H.G. Muller (40): - Implement castling for variant CRC - Chmod 644 - Bugfix legality null move in parsing with -testLegality off - Fix bug for incommensurate time odds - Make WinBoard makefiles use parser.c in XBoard directory - Fix piece-to-char table -variant fairy - Fix TwoKings ICS castling-rights bug - Fix reading castling rights FEN in knightmate and twokings - Fix OO-castling in FRC after pasting FEN - Accept for changing chat partner - Use -keepAlive option to determine connection health - Fix of ancient WinBoard bug: check value of int options - Fix bug in display of logos - Remove stray dot from WinBoard makefiles - Fix u64 format for cygwin - Send continuation lines to chat box they belong to - Fix highlighting bug in XBoard - Extensive bugfix of -autoKibitz - Remove race condition in clock switching - Add variant Makruk - Change opening array -variant fairy - Match handles with multiple titles for channel Chat Boxes - Bugfix stale first-click - Start insertion point at end of text edits in XB dialogs - Fix copying of WB Chat Window contents - Bugfix of autoKibitz and Chat suppression in ICS window - Fix XB crash on giving keyboard focus to non-text widget - Bugfix copying from Chat Box, own lines - Fix 'mamer bug' in Chat Boxes - Make signedness of castling rights explicit in function arguments - Fix copying of kibitzed lines from WB Engine-Output window - Do not recognize non-ICS variants from PGN event tag - Remake programVersion string after receiving engine features - Set keyboard focus at startup to board window - Fix window-position upset on failing engine start in WinBoard - Fix info lines being used as normal thinking output - Correct error in texi file - Allow lower-case promochar in moves of type h8=Q - Fix Alt+M JAWS command in Two-Machines mode - Fix JAWS piece drop cursor, and streamline some sentences - -** Version 4.4.2 ** - -(git shortlog --no-merges v4.4.1...HEAD) - -Arun Persaud (7): - updated version number to unstable - added missing library for build on OS X - add Winboard source files into tar-ball - removed files that should only be in the windboard directory - fixed build on openbsd - new developer release - fix for bug #28077: xboard needs to link against x11 - -H.G. Muller (19): - cleaned up some debug messages and typos - fix crash on engine crash - fix casting rights after FEN pasting - the last move before the time control now gets its time listed in the PGN - fix double start of zippy engine after switch to gothic - fix declaration of engineOutputDialogUp - fix engine-sync on move-number type-in bug - removing some rather verbose debug messages that seem no longer needed. - fix bug in bughouse drop menu - use xtell for talking to handles, but tell for talking into a channel. - fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. - fixed some outstanding pixmaps - Fix castling rights when copying FEN to clipboard (again) - score sign in analysis mode - correctly apply some check boxes from the option menu - updates makefiles to include dependency on config.h - fix problem with empty string in -firstNeedsNoncompliantFEN - double buffer size to prevent overflow - remove trailing \r in xboard output - - -** Version 4.4.1 ** - -(git shortlog --no-merges vold...vnew) - -Arun Persaud (24): - get "make distcheck" to work - reverted .texi file and fixed Makefile.am - fixed a few more small bugs reported by Stanislav Brabec - fixed some implicit declarations reported by Stanislav Brabec - added some more files to be distributed via make dist - another bug fix found by Stanislav Brabec - more files for git to ignore - updated cmail.in to adapt the CVS->git change - wrong default value for engineDebugOutput - updated version number to 4.4.1.pre - getting ready for 4.4.1 release - bugfix: segfault when invalid option argument was given (bug #27427) - added some comments and formated code - cleanup: removed "#if 0" from source - cleanup: removed "#if 1" statements - cleaned up an old #ifdef in zippy - removed AnalysisPopUp. Use EngineOutputPopUp instead - forgot to add these two lines to the last commit - new alpha version; first one with new naming scheme - fix for bug #10990: cmail does not seem to support .cmailgames or .cmailaliases - new pre-release version; updated version numbers - unguarded debug printf. added the appropiate if statement - fixed a regression - reformated html to be correctly validated - -Chris Rorvick (1): - fix printing out help message (list of command line options) (tiny change) - -Eric Mullins (31): - Swapped 'tell' and 'message' parsing order for colorization. Sometimes messages are relayed as tells and should be colorized as tells. - Use of strcasecmp() broke Visual C++. - Add resource ID for new Mute menu item. - Previous fix for VC++/strcasecmp() was wrong-- use StrCaseCmp(). - Added wchat.c to the project files we maintain. - Fixed bug dereferencing garbage, causing crash. - Simplified future version changes. - removed _winmajor if not defined so that VC 2008 can compile the project - Updated navigation accelerators, fixing ICS problems. - Added URL detection into the console text window for ICS. - reverted winboard.c beofre URL commit to correct whitespace conversion - added URL detection and provided hotlinks in the ICS client - Restructured URL code so it fits better with how winboard is set up. - Cleaned up ConsoleWndProc (not complete, see below) - added ics_printf() and ics_update_width() and utility functions - Added width updates to ICS client on font and window size changes - added code to handle initial width update - vsnprintf() must be _vsnprintf() for MSVC - Turned off wrap when possible on ICS servers. - Added code to prevent unnecessary width updates. - Adjusted alternative joining method to obey keepLineBreaksICS - Maintainence to support all compilers. - silence some compiler warnings - Added server width adjustment based on client width changes - neglected this for the auto-width updating in xboard - Fixed joiner detection, allowing it to work with timeseal - Adjustment to joining to work around server not always including space. - Added internal wrapping ability. - Moved SIGWINCH signal so it can be used... - Changes to allow fonts with any charset (such as terminal) - Updated compiling instructions. - -H.G. Muller (77): - added a chat window to keep track of multiple conversations - fixed the HAVE_LIBXPM-dependent compile errors - allow the result comment as a display item in the game list - fixed parse bug for pgn files - fix for keepalive and chat window - rewrote wevalgraph for better frontend/backend separation - added the result comment to the game-list tags when the game list is exported to the clipboard - Prepared a system to internationalize the WinBoard menus - Made the beep sounds for JAWS board navigation configurable through command-line options - Updated the RTF docs for the chat windows, engine-settings dialog, /keepAlive option and new game-list tag - added a "Mute All Sounds" item in the WinBoard Options menu, on Eric's request - Opening Engine #1 Settings crashed XBoard when there were no text-edit options in the dialog (to which to set keyboard focus) - Engine did not start playing when out of GUI book on second move with white - fix for edit-position "moves" being sent by XBoard to the engine - bugfix for protocol extensions: egtbpath -> egtpath - small fixes for the JAWS version - fixed loading of saved games via command line - worked on premove bug - new forceIllegalMoves option - updated to winboard internationalization scripts - small improvement for JAWS version - added forceIllegalMove to xboard - fixed premove recapture problem;promotion popup appearing on obviously illegal moves; promotions in Superchess and Great Shatranj - removed test for premove - fix for bug #27642: Clock jumps strangely in engine mode - fix joining of lines split by ICS - Added a command-line option -keepLineBreaksICS true/false to control line joining. - changed enable menus - fix for bug #27666: naming of variants - fix for bug #27668: e.p. field still not passed to engine - Proper board and holdings size when switching to variants gothic, capablanca, great and super within an ICS game. - new bitmap converter (including fill option) and new pixmaps - fixed wrong number of arguments for EngineOutputPopUp - moved bitmap to correct location - fixed engingeoutput routine - updated black fairy pieces - new mousehandler to correct for premove and promotion popup - fixed segfaul in convert.c used to convert pixmaps - fix for bug #27751: negative holding counts displayed - fixed bug reported in WB forum: second game of a match would not start when using the GUI book - partly fix for bug #27715: scaling of menu bar - fix for bug #27667: window should be reference to toplevel - smarter analysis of the boards that XBoard receives from an ICS - fix for bug #27760: debug printf in backend.c and additional check for variant - fix for bug #27667: PV line missing in analysis window, part 3 - fix for bug #27715: 2 (minor) graphic issues - fixed bug when switching to variantsuper - allowe parsing / disambiguation of SAN moves like Xe4 in certain situations - fix for bug #27772: holdings not updated - better init for random number generator - fix for bug #8847: moving backward while examining on FICS not reported to engine - improved mouse handler - holdings update and regression fix - NPS plays and pondering - improved mouse handler - fix to the minor graphics issue contained some typos, as was remarked in the bugs reports - This patch adds to the characters that cause an automatic switch to the ICS console when typed to the board window. - fixed some bitmaps - removed bitmaps files that are not needed any more - replaced defective bitmaps with copies from 4.2.7 - removed unused v54?.bm bitmaps from resource file - The book-probe code forgot to close the book file after opening it. - fix for bug #27799: fix for nested-nested-nested variations - fix for two compiler warnings - fixed bug related to unsigned char in convert.c - fix for bug #27790 and 277772. - force full redraw in winboard - more work on variant switch - another bug in VriantSwitch: an unitialized board was printed. - removing empty lines from ICS play - changed stderr to debug output, since stderr is closed in winboard - quick fix for "White Mates" in parser.l - fixed jaws version - fix for bug #27826: ported two options to xboard - fix for bug #27826: fixed autoDisplayComment - switch focus to the board after loading a game - prevent buffer overflow - -Tim Mann (6): - Fix some issues in the XBoard man page - Fix up man page some more - Silence warnings when compiling 64-bit xboard - Drop an obsolete script that was only used to update my personal web site - Make copy/paste position and game use clipboard, bug #27810 - Further copy/paste fixes - diff --git a/TODO b/TODO deleted file mode 100644 index 9a84006..0000000 --- a/TODO +++ /dev/null @@ -1,1419 +0,0 @@ -Possible improvements **=somewhat higher priority ---------------------------------------------------- - -20. Some way to back up, explore variations, then return to the main -line and restore moves we backed out. Should also support exploring -side branches while loading a game file. Push/pop buttons? Button to -fork another xboard in same state as current one? - -20a. Allow side branches to be remembered in game files (and -understood on LoadGame). Use PGN variation notation. - -**62a. Support series of time controls as in later gnuchess 4.0.x -versions (and real tournaments!). Needs a protocol extension to -"level"; this is now planned for protover 3. - -62b. Perhaps we could also support the kind of clock where you get K -seconds per move, plus a reserve of J seconds per game that is used -when a move takes more than K seconds. The degenerate form of this -with J=0 is desirable in itself. Needs a protocol extension. - -68. WinBoard has some features not in xboard. Among others: -68a. LoadGameOptions dialog (good to add) -68b. SaveGameOptions dialog (good to add) -68c. TimeControl dialog (good to add) -68g. Font dialog. (leave out) -68h. Colors dialog. (leave out) -68i. Board size on Options menu (good to add) -68j. Resize with mouse -68k. Highlight dragging -68m. Move typein from keyboard. (good to add) - -69. xboard has some features not in WinBoard. Among others: -69c. Font size selection by pattern fill-in. (leave out) -69d. Alternate bitmaps specified at runtime. (good to add, often requested) -69e. Flashing. - -71. Allow restart after ICS logout instead of exiting? Many requests -for this. - -71a. Would be useful to drop into NCP mode after ICS logout and allow -for reconnect later. For instance, this would let you save your last -partial game if you didn't have autosave on. - -72. Allow switching among ICS, NCP, GNU modes?? - -74. Observe/play multiple games, each with its own window. Hard. - -80. Clone command. Saves current game to a file foo, then starts up -another copy of xboard with -lgf foo. Should probably note current -state of some options and give command line flags to set them the same -way in child. What about -ncp mode, though? Might want that to be -different. Would be nice to have a -moveNumber flag to position the -child to the same move number in the current game. - -91. Would be nice to have an option to overwrite save file instead of -appending. - -95. "Have the clock indicate how long the computer/player has been -thinking for when the -st option is used. This should be how long for -the current move only." (Dino Dini) - -97. "Have the ability to change the level of the gnuchess during a -game. For analysis purposes, sometimes it is useful to have the -computer think really hard about certain positions." (Dino Dini) - -98. Reorganize the source and split it into more files. - -107. Changing time control during a game could be made to work. -Current (WinBoard only) way of changing at start is suboptimal. - -**108. Could add search depth and time per move to (WinBoard) -TimeControl dialog. - -140. LoadPosition needs better checking for invalid data. - -142. xboard needs a real file chooser dialog. Jeff Woolsey submitted -code to merge in the one from Ghostview, but said it works only on -X11R5 or later. I have not yet tried his code or looked to see if it -could be made to work on X11R4. - -147. Improve display of held pieces in bughouse mode, putting them -closer to the player's side of the board, and perhaps using icons (and -allowing dragging from the icons to drop a piece). Actually, moving -the clocks would be beneficial too, so that it's easier to visually -associate the right clock with the right player when looking at two -boards during a bughouse match (with two copies of xboard running). -Maybe multiple window layouts should be user-selectable. [4.3 supports -drag-drops from holdings] - -150. Keep track of castling availability, en-passant availability, and -FEN half-move clock (for 50-move rule), pass the availability -information to the move generator through the existing interface, and -load/save it in the FEN code. [Fixed in 4.3] - -150a. Note that not keeping track of ep creates a bug in mate -detection. In certain positions, moving a pawn from the 3rd to 4th -rank gives mate, but it is not detected because if the pawn had moved -to the same position from the 2nd rank, ep capture would have been -legal and there would be no mate. [problem disappeared in 4.3] - -150b. Note that although we try to put in e.p. availability when -writing FEN, this works only if we have the move that got us to this -position in the moveList. If we load a position from FEN, the -e.p. availability field of the FEN is lost. [disappeared in 4.3] - -152. Generate the info file, man page, perhaps html, and perhaps even -the WinBoard help file from the same sources. Right now, -substantially the same text is duplicated in three places. This is -a huge pain in the neck. - -157. Idea: if Zippy flags some number of times in a row and keeps -getting told the opponent is not out of time (presumably due to -timestamp/timeseal), he should issue an adjourn or abort. - -160. The xboard CTRL key flashback feature is bad in Analysis mode. -Flashing back throws away the analysis. - -161. SIGINT doesn't work for local programs on Win32. There is an -equivalent, GenerateConsoleCtrlEvent(CTRL_C_EVENT), but I haven't -gotten it to work thus far. It seems that WinBoard and the chess -engine don't "have the same console"; indeed, neither has a console. - -162. Supply a non-X Zippy for Unix. Perhaps use the code from Klaus -Knopper. - -167. Alternative bitmaps loaded at runtime for WinBoard. [font-based -piece rendering provides this functionality since WinBoard_x] - -169. Upload Game on file menu? This would upload the current game -moves into a scratch examined game on ICS. Could do Upload Position -too. Some code to do Upload Game was contributed, but it didn't -handle setup positions, variants, checking for proper gameMode, etc., -so I couldn't use it. - -170. Auto step every k seconds should be a general feature you can -turn on at any time, not just in LoadGame. What should GUI be? - -171. Displaying thinking in a separate window should be an option -available at all times when Show Thinking makes sense, not just in -analysis mode. It should perhaps be orthogonal to analysis mode. -[added in WinBoard_x] - -172. Should analysis window scroll instead of showing only the last -line? There could be an extra checkbox to show all chess engine -output in it. [fixed in WinBoard_x] - -178. Need reliable kill for chess engine on Win32. See also 161. - -181. Some people want -sgf to save only played games, not observed and -examined games. Others like it to save them all. Make this an option? - -183. Search feature in Game List dialog [Igor Eged]. - -187. "Log session" feature for ICS window. - -193. Some users have reported xboard redraw bugs, but I have not -been able to reproduce them on the Digital Unix, Linux, or eXcursion X -servers (xboard). - -c. From Hawk: -Dragging in xboard does not work 100%. -* The dragged piece may disappear (try some fast e2-d3 movements - - this is easy to reproduce). -* The dragged piece may be placed on an illegal position (this - happens less frequently, but it _can_ be reproduced by doing the same - as above). -* In both of the above cases, the board is correct after forcing a - redraw (ie. minimizing/restoring the window) -I'm using eXodus - a win32 X server, perhaps it's buggy. [Seems that way, -or just possibly, these could be bugs that are fixed in 3.6.11beta or -3.6.12beta.] - -d. One user reports: "If you are 'holding' a piece over the square you -want to go to and that move becomes illegal but you make it anyway, -the display sometimes corrupts and a partial piece appears..sometimes -a whole piece." This was under RedHat 6.0. - -194. A few users have reported drawing problems with WinBoard. There -may be some color map problem on certain displays. I might possibly -have fixed this already; I cannot reproduce it. The common thing -seems to be black pieces changing to white. This may depend on having -customized the board colors. I suspect many of these problems are -buggy Windows drivers for particular display cards. (May be worked -around in 4.2.0 with reprocessed .bmp files.) - -a. From mulesmurf: if i log in and then move the board, it will happen -that the black [pieces] change to white. - -c. People have sent pictures where the grid didn't get redrawn. This -produces random bits in the grid area from uninitialized memory. -Could this be a resource leak? - -d. From James Van Buskirk: I did notice one problem tonight playing -against Comet under FX!32 1.2 (Comet, not winboard ran under FX!32): -for a couple of moves winboard didn't turn off the highlighting of the -square I dropped the piece on until Comet had moved. Later, the -problem fixed itself. Have other users noticed this? [No.] - -e. One user reports: Lastly, there is some sort of slight bug in the -piece dragging code, but it comes up only very occasionally (once in -500 moves?)...basically, I'm dragging, change my mind, throw the piece -of the side of the board, and instead it gets stuck not inside a -square. It's really disconcerting, this piece just sitting across -square boundaries. When you make another move, it gets cleared up and -goes back where it's supposed to. [Might be fixed in 4.0.6, but I -couldn't reproduce this, so I can't be sure.] - -f. DAV says: "When I resized the board on win 95 and made it smaller -some of the pieces turned into junk (I'm not able to give a screen -shot)." Later: "Seems to happen on the three sizes below small. -Win98 and NT seem to be ok, trying to get more win95 users to test -it." Works fine for me on Win 95... [Might have been fixed by the -cleanup of the Windows .bmp's that happened sometime before version -4.2.3] - -195. Flash Moves works at the end of every change to the board, using -some rather gross code in DrawPosition. This code should perhaps be -ripped out and the flashing done from inside AnimateMove instead. - -197. More color distinctions. Maybe allow several user-selected channels -to have their own colors. - -198. More sounds. Some possiblities: distinguish White vs. Black move -or your move vs. opponents, distinguish different kinds of -win/loss/draw/unfinished (checkmate, resignation, stalemate, other -draws, opponent disconnected, etc.), game ends when you aren't playing -and/or aren't in ICS mode, differentiate amongst requests (draw offer, -etc.), **check, got new offboard piece (by piece type?), opponent got -new offboard piece (ditto), arrival notification, "* who has an -adjourned game with you," draw declined, moretime received. - -199. Maybe put user names instead of White and Black on clocks, or -user names above or below clocks in a smaller font. - -200. I don't like these ideas, but some people do: -a. Highlight all of the squares that the piece you are moving can go to. -b. Clicking on the piece moves it immediately if it has only one legal move. -c. Allow clicking on the destination, then the source. -d. I guess highlight the pieces that can go to that destination. -e. Clicking on a destination that only one piece can go to moves it there. - -201. mulesmurf: piece counter so we know exactly the score - -202. mulesmurf: ziics pieces, board along with color intensity - -204. Hawk at Fri May 15, 12:58 CDT 1998: a minor thing with xboard: -the coords disappear while dragging from a square with coords on it. -[They come back when the drag is finished.] - -208. WinBoard sometimes comes up with one of the menu bar items grayed -out (one that should not be). I've seen this on different entries at -different times. - -213. Maybe add Silence to sound menu -- parallel to Monochrome on -color menus. - -214. Maybe easier startup dialog customize: -a. Buttons to add/delete/move(?) current string to/from/within current list. -b. Or maybe auto-add newly typed/edited strings up to some limit. -c. Also a drop-down for Additional Options. - -216. Maybe shorten menu names in WinBoard to one char if and only if -the menu bar would wrap with longer names. - -**217. Easier way to add engines to the WinBoard startup dialog. -Ideally, an engine author should be able to supply a simple -configuration file or script that installs his engine. "*.wbe" idea. - -218. Some folks would like Highlight Last Move to apply only to -opponent's moves. - -219. From Jorge Monasterio: Support automatic game starts when in -tournament. In other words, do that "match bigolfish mann 5 0 black" -automatically based on the info sent from mamer. [I would need to -play in some tournaments before I could evaluate this idea or fill in -the details.] - -222. Could support time handicaps. [Added in 4.3] - -223. Bug: very long comments cause buffer overflow. Need to revamp -the way comments are parsed and returned from parser.l to fix this. - -224. Larry Parrish requests: In an automated multi-games match I would -like to load the n-th game from the file for the n-th game of the -match. [That is, when -mg and -lgf or -lpf are used together without --lgi or -lpi.] [4.3.15 provides auto-increment og game and pos index] - -225. From pulp: another bug (maybe with the Microsoft RichEdit -control) I've observed is when you flood the edit control it loses the -bottom. Eg. "games" will scroll along then start slipping until by -the end of the list you are really looking at the middle of the list -and have to manually scroll back to the bottom. [May be fixed?] - -225a. Resizing the WinBoard ICS interaction window can cause the cursor -to be off the screen, which stops scrolling. - -226. From pulp: Clipboard persistence. If I copy text, then the text -disappears when Winboard is closed. Eg.: Log in, highlight and copy a -web page address, close, go to browser, paste *nothing*. [How does -one do this in Windows?] - -227a. In engine-engine matches, an engine that crashes should lose and -perhaps get restarted for the next game. [In 4.3 a crashing engine -forfeits the game, but still terminates a match.] - -227b. Maybe when an engine playing in Zippy mode exhibits a bug, we -should do a little more too. Perhaps "say Sorry, the engine seems to -have a bug", resign or abort, and maybe force an engine restart for the -next game. - -**227c. We should also detect and stop the game on false mate or draw -claims, rejecting a legal move, or (maybe) missed claims of mate or -draw. Note that draw claims require checking for repetition, 50 move -rule, and insufficient material as well as stalemate, so this is -nontrivial. [Added in 4.3] - -228. RichEdit bug: sometimes a line gets indented as if it were -wrapped when it should be flush left. - -**229. Support for sending moves from the partner's game to a bughouse -engine. Ben Dean-Kanemura submitted support that works without adding -general multi-game support, by relaying the moves without processing -them. Should also send holding updates and clock times; not sure if -Ben's code does that. Needs to be a new "feature" command option, and -to be documented in engine-intf.html, removing the note that this may -be done in the future. - -231. See Ed Collins's WinBoard bug list on his pages: - -231b. If you save an ICS examined game to disk as a PGN file, it -doesn't report the end-of-game result in both the header and at the -end of the notation. [It doesn't get this info from the server, but -maybe there is a way it could.] - -232. From Ed Collins's WinBoard wish list on his pages: - -232b. Multiple winboard.ini files for different moods, loadable from -inside the program. - -232c. Fix bug where fics% prompt is not suppressed when using -timeseal. This has something to do with a timeseal deficiency whose -details I've forgotten, but there must be some way to fix it. - -232e. When using the server's "examine" mode to examine a previously -played game, have the game clocks display the time that each player -currently had after each move was made. - -232f. [Not from Ed] Deal with ICC game relays where an "examined" game -is supposed to have running clocks. Not sure if this is still an issue. - -232g. Customizable on-screen buttons [i.e., toolbar or toolbox]. - -232h. Customizable function keys. Currently xboard can bind a key to -any built-in xboard function. Should extend this to WinBoard, and -also (in both programs) support sending an arbitrary ICS command when -button is pressed. - -233. See if anything from LightningRulez should be added. Premove is -now included (from Winboard Plus), but maybe there are other useful -things too. - -241. There might still be bugs in xboard and/or winboard when moves -come in from ICS during drag animation, though I can't reproduce them. -DAV saw the opponent's piece fail to be erased from the source square, if -I understood his message right. [DAV says this still exists in 4.2.5. -I think bug 426 is a duplicate. The description is clearer there.] - -242. User-defined "looking_at" patterns and actions. This is hard to -bombproof. - -**243. "Rematch" shortcut in /cp mode. - -246. Maybe auto-close comment window when user goes to the next move. -Whether this is desirable really depends on the content of the -comment, but maybe it is rare to have a long comment that discusses -the plan several moves ahead and should be left up. - -248. Would be nice to support retract move after checkmate or draw (etc.). - -254. Different tray icons for interaction window vs. board (suggestion -from FICS). - -256. One user asked for "delete" option in game lists. This requires -rewriting the file to close up the hole, so it's pretty heavyweight. -Next people will be asking for move, sort, search, and other game -database functionality; ugh. - -**257. Would be nice to find a way to safely implement "retract move" -when the engine is still on move. (using ping/pong) - -**260. General mechanism where engine can declare engine properties that -the user can frob and xboard/winboard will put up a simple dialog to -allow user to view and set them. See email message "special engine -commands" from Steffen Jakob: - - From: "Steffen A. Jakob" - To: mann@xxx - Cc: chess-engines@xxx - Subject: special engine commands - Date: Fri, 26 Feb 1999 09:12:26 +0100 - - Hi Tim! - - Here comes a summary of our ICC chat (I cc this mail to the - list... maybe other engine programmers can give some feedback if - they find this feature useful): - - Please add a protocol command which enables the engine to tell - xboard its special commands. Maybe a set of (label, command string) - pairs would be useful. Then create a menu for these commands. It - could look like this (that's what I would like to see for Hossa): - - engine->interface: - ------------------ - command "Reset the log file" "reset log" - command "Save Diagram as PNG" "png dia.png" - command "Disable Book" "book off" - command "Show Evaluation details" "eval" - command "Show Search statistics" "stat" - - etc. - - While typing this list I realized that an additional parameter like - this would be needed/nice (of course you can think of many more - improvements): - - command "Save Diagram as PNG" "png %s" 1 - - "1" tells xboard to ask for an additional parameter (here: filename) - which will replace the "%s" in the command string. -[XBoard 4.3.16 has an experimental implementation of this ide through -the 'feature option="..."' command.] - -261. Check that "quit" is sent to engine properly if ICS connection -fails to open due to error from timestamp/timeseal. "wzrdking" had a -case where it didn't. Timetamp had failed with "Host name not found -by name server" (because in fact there was no internet connection, arrgh). - -273. Displaying the names of the players from a PGN file in the header -of the window does not work if there is only one game in the file. -The filename is shown instead. (This was intentional, but maybe a -poor idea.) - -274. Command to go to move number N, with entry box for N. - -276. Make grid optional in winboard? Note that the highlight options -don't work without it. [The Winboard_x -overrideLineGap option provides -this.] - -276a. Make color of grid an option, instead of always black. - -277. Flooding xboard -zt + timestamp with tells hangs timestamp after -a while. xboard is blocked writing to the timestamp pipe. timestamp -is in an unknown state, not reading from the pipe nor responding to -pings. (Confirmed with the software running on milwaukee, Red Hat -5.2) - -278. Flooding winboard -zt + timestamp with tells hangs winboard after -a while. timestamp still responds to pings. This reported by -nudnick; I haven't tried to reproduce it yet. He also says that -windows explorer then crashed when he tried to close winboard. - -279. Idea from an anonymous ICSer: piece drop menu could have images, -not words. [Or maybe both?] Also might be easier to select -accurately from it if horizontally arranged, or in a 3x2 grid. -[Now 4.3 has drag & drop, piece-drop menu should be deprecated] - -284. dxterm hangs when it receives the escape sequence that sets the -title bar on xterm. I think some other xterm substitutes do too. - -**287. WinBoard can look funny if you are using themes because it -unconditionally uses white for certain colors instead of the default -background. - -289. Merge WinBoard support for the Henter-Joyce JAWS screen reader. -Source code (zip file containing modified WinBoard 4.0.2 source) is at -ftp://ftp.henter-joyce.com/users/hj/winboard/WinboardSource.exe. It -would be interesting to make this work with festival (free Unix speech -synth) or other speech synthesizers too. - -290. Could have limited voice output without a speech synthesizer by playing -wav files for piece names and square numbers. Idea suggested by Hannu -Wegner. - -291. Would be great to support DGT, Novag Universal chessboard, etc. -I'm not likely to fork out the cash to buy either for testing, however. -Note users have done various things along these lines. - -292. When an engine is analyzing, it would be cool to have a way to -automatically play out its current PV (or even older ones) on a board. -These PVs could be saved as variations when we have variation support. - -297. Windows users expect all programs to have a Print function, even -though there are other ways to print. Useful items to make printable: -PGN game scores (which are plain text, of course), maybe FEN position -diagrams, maybe graphical position diagrams (i.e., same as pressing -the "Print Screen" function key and printing the clipboard). - -298. One user suggests that automatic move stepping should not start -until you press OK in the tags window. This could be a good idea, but -I think I'd rather have automatic stepping never start until you press -a "play" button on the main window, and have that button always -available, not just when loading a game from a file. - -299. One user suggested being able to jump to a specific move by -typing its number (followed by ... if it's to be black's move). - -300. Can I put a hyperlink (that will invoke a browser) directly onto -the WinBoard Help menu or in the Help file? Useful to take users to -my chess page. - -302. On NT, check if the board is redrawn properly when exiting from -the screen saver. - -308. There is some tricky way to maximize the WinBoard board window, -although there isn't supposed to be. Maybe prevent this, or else -legalize it and make sure something reasonable looking happens. -Note: the trick is to select one of the "tile" options on the Windows -task bar. Not clear what should happen in this case. - -309. Avoid endlessly flagging every second when opponent is lagged out -and autoflag is on. Automatically courtesy-adjourn (or abort if -unrated) instead, at least if in zippy mode. - -310. Weird bug: the last character of a FICS output can appear on the -next line, *after* the fics% prompt, according to one user. I might -have seen something like this myself once too. - -314. One person wanted his engine to see tells when running in Zippy -mode. I doubt this is generally useful, so I haven't added the code I -wrote for him. (I can query for "tellfrom" in my mail file to find -it.) - -314a. Another person wants his computer account to relay tells to his -personal account. - -319. One user would like to be able to reload a PGN file and resume a -game against an engine as if after an adjournment, with the clocks -(and moves to next time control) restored as they were when the game -was saved. - -320. Display ratings of ICS players in the title bar (if there is room, -presumably), or somewhere, anyway. - -321. Maybe refresh the EditTags window if the gameInfo changes and the -window is up. (WinBoard now does this when entering MachineWhite, -MachineBlack, or TwoMachines mode -- not very general. From Winboard Plus.) - -322. One user requested that Zippy games use the engine name instead -of the ICS handle in the PGN tags, as he uses multiple engines on his -account. (My response was "I'd say it should give both"; not sure just -how to do that, though.) - -324. I'm told that Blitzin supports animated dragging without holding -down the mouse button and that this is "much better" and I should try -it too. As yet I haven't. - -326. Full support for variants and variant-capable engines in all -modes, not just ICS mode. Here are some items still needed. Some if -not all should probably wait for a rewrite, not be added to the -current code base. [4.3 supports many variants, even those not supported -by ICS. Not bughouse, though] - -326a. Menu to let you see and change the current variant type, not -just a command-line argument as at present. [Added in 4.3] - -326b. crazyhouse: Keep track of holdings and display them, keep track -of what onboard pieces are promoted so they will revert if captured, -understand offboard interposition to stop mate. [Added in 4.3, (not -sure about the interposition)] - -326bb. One user asked for a Czech variant of crazyhouse where pawns are -given to the opponent when they reach the 8th rank (after capturing, if -it's a capture) instead of promoting. - -326c. bughouse: Features in 326a would be helpful for editing one board -of a bughouse game, and getting mate indication right even in ICS mode. -In the longer term, could understand BPGN, support editing two-board games. - -326d. wildcastle: Allow wildcastle castling only when playing this variant! -Maybe support automatic shuffling for local play. [4.3 adds shuffling -for any variant played locally] - -326e. nocastle: Maybe support automatic shuffling for local play. -Note that several types of ICS shuffle chess fall under this variant. -Note that this isn't really a variant, since if we kept proper track -of castling rights and used "setboard FEN" or the ChessBase extension -of "edit" to set them, it could be treated as normal chess with a -different starting position. - -326f. fischerandom: Maybe support automatic shuffling for local play. -Support castling. Currently, you can probably play Fischer Random -successfully on ICS by typing castling moves into the ICS Interaction -window, but they will not be animated correctly, and saved games will -not be loaded correctly if castling occurs. FR castling is -problematic because the move cannot be specified by the starting and -ending coordinates of the king; in some starting positions there is a -legal non-castling move that moves the king the same way. This -violates a deeply ingrained assumption in the implementation. It also -breaks the GUI -- you need more than just dragging the king two -squares to indicate castling. (Note: In FR notation, O-O is h-side -castling, O-O-O is a-side. See "help fr_rules" and "help fr" on FICS -for rules.) [All fixed in 4.3] - -326g. kriegspiel: Could give some thought to how to support a -kriegspiel engine. I doubt anyone will ever write one, though. - -326h. losers: Know that captures are mandatory. Understand the win -condition. - -326i. suicide: Know that captures are mandatory. Understand the win/draw -condition. - -326j. giveaway: Know that captures are mandatory. Understand the win -condition. - -326k. atomic: Understand the win condition. - -326l. 3check: Understand the win condition -- ugh, have to keep a -check counter! - -327. Option to set the coord font color (or something) to make sure -there is always enough contrast with the square colors. - -329. Bernhard Maerz would like a command line option to choose the PGN -player name for an engine, overriding the default of generating the -name from the engine filename. This is for his ChessCall program. - -331. Maybe the local autoflag menu option should *also* turn -server-side autoflag on/off by sending an appropriate set command. - -**332. Bug: Autoflag for local engine/engine or engine/human matches -does not recognize that having your flag fall when your opponent has -insufficient mating material is a draw. It counts the flag fall as a -loss. [Partly fixed in 4.3, which corrects any kind of losses against -a bare King to draws.] - -336. Of course lots of people ask for a graphical seek window. - -339. There are probably some incompatibilities with chess.net, as they -have made a few gratuitous changes to message formats from the FICS -code base they started with, and perhaps they've added features since -without duplicating the syntax closely enough. In particular it's -been reported that Zippy does not correctly send "partner" and -"variant" commands to bughouse engines on chess.net. Also, I doubt -colorization works. As a matter of personal choice I do not spend any -of my time supporting chess.net, but if others want to donate patches -that allow chess.net to be supported without breaking the support for -ICC and FICS, I am willing to install them. - -342. Analysis mode automatically turns on the Show Thinking option; -the user must then turn it off manually after leaving analysis mode if -he doesn't want it. - -343. Would be nice to change xboard keyboard shortcuts to not be plain -letters, make the new shortcuts work also in the ICS input box, and -make typing plain letters to the board redirect to the ICS input box -or the xterm. Might want to change/remove the Ctrl binding at that time. - -344. One user suggested having a way to save a position as a character -string that would produce a board diagram when rendered in MS Word in -a chess font. Perhaps there is already a nice standalone tool for -this, though? - -346. Could use a better way to pick default size. Now we choose the -largest that fits on the screen, which is typically too big. Not too -bad for WinBoard, but painful for xboard since it can't be resized -after starting. - -349. Check that "quit" definitely makes it to the engine before exit, -if you exit via the File menu while a match is running. Uli Tuerke -reported that maybe it sometimes doesn't (in WinBoard 4.0.5). - -352. Perhaps recognize the ANSI escape sequence that FICS sends out -for the cls command and clear the ICS interaction window. - -**353. WinBoard can crash when the engine outputs very long PV lines -(or debug output that looks like a PV). In particular, lines that -start with 4 or more blanks following a "thinking" output line are -treated as continuation lines, and get concatenated into a 512-byte -buffer with no checking for overflow. Generally we need a lot more -care to avoid buffer overflows inside both xboard and WinBoard. -[Note: changed the buffers to be 5120 bytes as a band-aid.] - -Guido Flohr expands on this bug: - - The problem is easy to reproduce, simply write a program/script that - spits out lines of more than 8192 bytes (INPUT_SOURCE_BUF_SIZE) and - connect it as a chess engine to xboard. No surprise, xboard cannot - handle such long lines, but the resulting behavior is really weird: - - The program enters DoInputCallback() in xboard.c, reads the first - 8192 bytes, searches for a linefeed in vain, then closes its eyes, - sets the member "unused" of the InputSource to is->buf + 8192 and - waits for more input although the buffer is already full. - - The next time it calls the same function, is->unused is exactly - these 8192 bytes away from is->buf, xboard computes the amount of - bytes to read in this round, which sums up to 0 nothing. It then - calls read(2) with a bufsize argument of 0, and then assumes end - of file when the kernel call returns 0 (which is the documented - behavior). - - For local engines, we now jump into backend.c, ReceiveFromProgram(), - and this function reports that the engine has exited unexpectedly. - In fact the engine is still very vivid, which is good, because in - spite of xboard's assumption that its child has died, it still - sends "force", "ping N", and "quit" to the false dead. If the child - was really dead, the alert boxes "error writing to ... engine" - would hide the first alert box "... has exited unexpectedly". - - From xboard's side, it is not exactly clean to call read(2) with - a zero bufsize argument. In my opinion, a sane solution would be - to eat the INPUT_SOURCE_BUF_SIZE bytes, and when they contain no - linefeed, print the partial line to standard error (in debug mode) - and report something like »Maximum line size exceeded« (and then - kill the engine). - -**354. We currently let the user go directly from TwoMachines mode to -various other modes like MachineWhite or MachineBlack. This may -confuse the engine that was on move, since we don't have a way to -force it to stop before it makes the move it was thinking about. -(use ping/pong to know when the engine has stopped) - -355. Idea from LiveAndLetDie: have Zippy specially log games where it -loses to a substantially lower-rated player. Such a game could -indicate an xboard bug, engine bug, or perhaps a computer-using -cheater. - -356. Colorization for FICS tourney tells? They look like this (ugh): -:DChessmaster [tourney #4]: -:hi - -357. A few reports of WinBoard pieces being drawn incorrectly at -certain sizes. I haven't reproduced this. [Maybe worked around in -4.2.0. Or is/was this the same as 194f? I don't recall the details.] - -358. One report of WinBoard colorization not working, even after -restart, until the computer was rebooted. Weird. - -362. Running a very long automated match (/mg option) seems to crash -WinBoard eventually, usually after 300 to 500 games, sometimes later. -Reported by Josh Haglund. Gets a "WINBOARD caused an invalid page -fault in module KERNEL32.DLL" dialog box from Windows. See messages -from Josh for examples of the registers and stack dump. - -362a. A few people have reported WinBoard crashing upon exit. - -363. Maybe xboard should not set the window geometry for new popups, -or at least not the position. The default positions aren't very good, -and setting them programmatically keeps knowledgeable X users from -customizing the positions with X resources. - -366. Feature to let an engine observe an ICS game and run analysis -mode on the moves, perhaps whispering or channel-telling the results. -It's a little too easy to cheat with this feature or I might have -added it long ago. [Added in 4.2.8 and 4.4] - -369. Optionally send a periodic keepalive command to ICS. Can be -used to defeat autologout, so should probably not be on by default. -Also should be useful to help Zippy notice more reliably when its -connection has hung, so that it can exit and a shell script (batch -file) can restart it. - -370. One user requested a local noplay list for his computer player -because the FICS limit of 50 is too small. He wants several hundred so -that he can noplay everyone who disconnects in a lost position. - -374. Would be good to have a way to change engines without restarting -the interface. - -376. WinBoard is said to crash or "lock up" when loading enormous PGN -files, like a 98 MB file that comes with (??) Crafty. Win32 (at least -in the Win95 lineage) has a limit of 32,767 items in a list box -widget. That might explain this problem. - -376a. xboard exceeds limits in X and/or Xaw if a PGN file has too many -games. (The virtual window that the list box can scroll through -becomes too many pixels high.) This has odd effects; the window -height of the game list seems to get reduced mod 2^16 or something. -Maybe detect this and do something nicer about it, like stop loading -when the window is full and pop up a warning. - -378. One Solaris user didn't have the "strip" program, so the -install-sh script used by xboard "make install" failed. Check for -this? Yuck. - -381. "Illegal move: post" is apparently not handled. Should it be? - -382. The UI for entering Training mode is a bit obscure: you must -first select Load Game, then Training becomes enabled in the upper (!) -part of the Mode menu and you can select it. You can then select it -again to toggle it off. This mode is something like Analyze File -(which has a problematic UI too, but somewhat less so); both should -probably use a similar UI style. I consider disabling the -step-forward button to be overkill, and I think you need to manually -turn off auto-step when loading a game (?). One user expected it to -work with .epd files that give a position and a recommended move. -That seems reasonable, but doing it would require quite different code -from the current pgn-game training mode. - -383. Premove piece drop for bughouse/crazyhouse. - -384. Pre-first-move for xboard. I don't much like the fill-in field -method used in winboard. Maybe allow a move to be made for white -before the game starts (in both xboard and winboard). If you get -black, it's cancelled. Black can already premove after the game -starts, during white's first move think time, so I don't see that a -black pre-first-move is needed. - -**387. Have winboard draw opaque details on black pieces too. -Hmm, this should probably be optional, and the detail colors should -be selectable instead of hardwired to the opposite piece color. -[The 4.3 -allWhite option goes in this direction. Details always -in black, though.] - -**387a. Add "no piece border" option to WinBoard. See code from -Robert Jurjevic sent 4/9/2001. - -391. I have a bug report from Stefan Zipproth about engines sometimes -failing to make their first move in an engine-engine match. So far I -can't reproduce it. This might be fixed by the Sleep(500) voodoo in 4.2.4. - -394. See about tightening matching for the "request" event. Right now -it matches on help files a bit too often. (e.g. FICS "help sr_info") -**Also clarify documentation on what the request event is. - -396. xboard's -size defaulting code for bitmaps unfortunately always -picks a size from the built-in list, even if you gave the --bitmapDirectory option. It would be more user-friendly to have some -extra code that lists the directory and considers exactly the sizes -that are found there, as the pixmap code does. - -397. It would be nice to be able to configure xboard with bitmap -pieces as the default without having to disable xpm support entirely. -This should be a pretty simple mod to configure.in (and xboard.c). - -397a. It would be very nice to be able to compile in both the bitmap -and pixmap pieces. This would allow us to automatically switch to bitmap -pieces in -mono mode, including when -mono mode was automatically selected -because too few colors were available. - -398. It would be nice to have the new .xpm pieces in .xim format too, -since I restrained myself from ripping out the .xim support. - -399. It would be nice to have a configure option to change the -directory where the default piece set is taken from. Slightly nicer -than having to rename the desired directory to "bitmaps" or "pixmaps" -as at present. - -400. TypeinMove should be grayed in ICS mode, or should raise the -console window, or something. - -402. Internationalization. It probably isn't practical to retrofit -this into the current code base. [4.2.8 and 4.4 have international- -ization of xboard.] - -409. One user requested a way to put a time delay in the middle of -sending zippyGameEnd commands. This would (for example) let the -computer do a seek only if its opponent doesn't accept a rematch -within 10 seconds. Nontrivial because Zippy has to continue to listen -to input during the delay; it can't simply call sleep(). Maybe -ScheduleDelayedEvent is OK, but I think it may already be in use in -this situation, and it only supports one event at a time. - -411. Add zippyKibitzThinking and zippyWhisperThinking features? -[4.3 has an -autoKibitz option] - -412. Maybe optimize setting the move list in the case where only the -current move number changes; avoid slow XawListChange. - -**413. Add movelist window to WinBoard too. Wilkin Ng submitted a -patch that I believe includes this; need to integrate and test it. - -**415. It was suggested that a few common options that many chess -engines need be promoted to xboard/WinBoard options so that the user -can set them from the GUI in a uniform way. In particular: hash size, -directory name for endgame tables. [4.3 has extended WB protocol -with a memory, egtpath and cores command.] - -**416. Can we avoid dying when xboard is in 8-bit mode, pixmap pieces -are chosen (by default), and we can't get enough colors? Ugh. - -**419. It was suggested that stat01 be generated/accepted during normal -play with "post" on, not just during analysis mode. This would need -to be a "feature" command option. - -422. Track FICS change to details of how timeseal works; is this -implemented at FICS yet? - -423. When locally stepping through an ICS game that is over, it would -be nice to display the historical clock times at each move. - -424. DAV at Thu Nov 9, 01:20 CST 2000: any chance on winboard/xboard -of a key press and a move executing draw ? that way you at least -have a chance of claiming a draw in 1 0. - -**426. DAV says, in xboard: If you are not on clock and you hover a -piece over a square where your opponent then moves to and then move -the piece away the piece the opp moved or part of it has not been -drawn. [Duplicate of bug 241?] - -429a. Check whether more support is needed for WinBoard to work with -scroll wheel mice in the absence of special mouse drivers that generate -scroll bar events directly. - -431. People find Analyze File confusing; they think it should do -Crafty's relatively new Annotate function. Also, it's somewhat -superfluous now that you can enter Analysis mode and then load the -file, or vice versa. - -**436. WinBoard is said to crash if started while WinBoard.debug is -being tail -f'ed. - -**441. Can I prevent an undo after new in the odd case where it can -happen now? See mail from Bob Hyatt. - -450. Suggested: an option to let an engine keep pondering while an ICC -game is adjourned. This seems a bit difficult. - -451. Suggested: support SuperMamer messages on FICS, aka qtells. See -http://www.freechess.org/SuperMamer/parsing.html. - -452. Suggested: a way to say "prompt for the password" in a login.ini file. -See 510 instead. - -**454. Add a way to claim a draw together with making a move, as can -be needed for draw by repetition (creating the 3rd repetition with the -move) and by the 50 move rule (the move is the 50th). Add to -protocol, and implement using the individual methods on FICS and ICC. -Need to be sure it's really a FICS that has the feature (somehow). -[Fixed in 4.3 by usng 'offer draw' for this purpose] - -455. Suggested: Add the epdkit commands such as epdpfga to the -protocol, since Crafty and "many" (which?) other engines include the -epdkit. - -**456. Bob Hyatt suggests: "feature match=1" which says "send match -requests to the engine and let it decide on who to play next". -I.e., maybe send an abbreviated but fixed format message like this: -match time inc R/U. The engine would use "tellics -accept " to accept. Add as feature to protover 3. - -**457. Standardize on the meaning of scores (e.g. in stat01 responses). -Is positive good for white or good for the engine? Do certain scores -mean forced (tablebase) draw, or forced mate in N? This should align -with the EPD spec. Maybe a feature command should indicate that the -engine matches this part of the spec, but then again, it's not clear -what we can do about it if the engine doesn't give that command, so -maybe there is no point. See discussion on chess-engines list. -[Winboard_x adds an argument to tell WinBoard an egine uses absolute -scores] - -458. Bug: xboard will try to use an engine to play normal chess even -if the engine has given the feature variant command and did not -include "normal" on the list. Crafty 18.1 inadvertently relies on -this bug, so it probably can't be fixed right away. - -**468. Need to look at Wilkin Ng's contributions! - -**469. Look at Zippy's behavior if the operator observes, follows, -examines, etc. Some bugs in this area have been fixed, but it's -received very little testing, as Zippy was never meant to be used that -way. Noted later: Examining in -zp mode definitely has problems. If -you go forward one move at a time, moves are sent to the engine -correctly. If you go backward one move, "undo" is not sent to engine -as it needs to be. Going forward or back by more than one move at a -time needs to be looked at too. - -**471. Look at 3/17/2001 message from Laszlo Vecsey about crashes when -exiting on Win ME while data is coming in from the server. - -**473. Visual low-time indicator. See patch in Brian Mays message of -3/27/2001. - -**474. Crash reported when sending certain 8-bit characters through -WinBoard (180, 167, others). I'm almost certain this is a FICS -timeseal issue and nothing to do with WinBoard itself. - -**475. Look at Laszlo Vecsey's mousewheel patch of 4/10/2001. - -476. For some reason (I guess some GUI supports them), most WinBoard -engines now have a graphical logo, 100x50 pixels in Windows .bmp -format. It's been requested that WinBoard have a place to show the -logo. [4.3.16 supports logos] - -477. Implement the "book engine" idea I proposed in the protover 3 -discussions. Some folks have offered to write them (e.g., Bruce -Morland). [4.3.15 supports a GUI book, which is another way to -acheive the same, as the only thing that would distinguish book -engines is their book, not what they do.] - -478. Recognize URLs in the WinBoard ics interaction window and make -them work as hyperlinks (firing up your browser). - -**479. Possibly use Scott Gasch's 7 May 2001 patch to delay accepting -challenges when ping > pong instead of declining them. Bug: if you -get more than one challenge, Scott's patch forgets about all but the -last one. If that guy then withdraws his challenge, the others are -left in limbo, neither accepted nor declined. I suppose we could -decline challenges when there is one waiting. However, if we make the -change to optionally pass match requests through to the engine, Bruce -Moreland would like us to queue up challenges and pass them all on. - -481. 8 May 2001, Bob Hyatt "matchscore" feature suggestion could go in -protover 3: "matchscore A B C D E says we are in a match, this is game -A of B games. The current match score is I have won C, drawn D, and -lost E games in this match. This would give the engine a chance to -adjust the draw score as needed to try to win the match rather than -just trying to win a single game." - -**482. Suggestion from Bruce Moreland: if the user goes into ICS -examine mode while -zp is active, and the engine supports analyze, -then put it into analyze mode and let it work on the examined game. I -guess this could work for observed games too. Should it be optional -or always done? [4.2.8 and 4.4 support analysis in zippy mode, but -as yet only while observing games.] - -483. It would be nice if the KingShine 3D board could be integrated -as an alternative xboard GUI rendering. - -**484. Add -feature1 and -feature2 options to pretend the engine sent -us those feature commands. Useful kludge for certain buggy engines. - -485. Add "reset" to protover 3. (Clear the hash tables and other such -info; used to put the engine into a known state before running a -test/benchmark position.) [the WB 'memory' command could be defined -to have this side effect? Normally we would have to clear the hash -table when changing its size.] - -486. Other protover 3 features listed in my 6/21/2001 message to -chess-engines list. Write a full protover 3 draft for comment. -[Note that 4.3 already uses protocol extensions that differ from -the v3 specs.] - -487. Adjudicate non-ICS games as a draw when there is insufficient -mating material on both sides, especially engine/engine games. Well, -maybe. I argued against this in a 6/26/2001 message to chess-engines. -[Added in 4.3] - -487a. Probably also adjudicate when we detect checkmate or stalemate, -before bothering to notice whether the engine detected this. [Added -in 4.3] - -487b. Note: Do not adjudicate 50 move rule or 3x repetition since those -must be claimed by a player -- at least not by default. It would be -OK to have a flag to do this someday when we are smart enough to -notice it. Would definitely be good to be smart enough to notice an -incorrect draw claim by an engine. [In 4.3 you can set the number of -moves or repeats after which draw is adjudicated] - -487c. Another request: allow the operator to adjudicate engine/engine games. -[Winboard_x provided menu items for this.] - -488. Option to suppress tags popup on game load? This has been -requested a few times, and I received one partial implementation (not -enough to be useful). Needs to be on the options menu, etc. Note -conflict with 298 above. - -488a. Also option to suppress comment popups. - -489. Maybe have Zippy use xtell for tells to avoid redefining "." if -the operator is also doing tells. Do all ICSes support xtell, though? - -490. Bruce Moreland request: a way to turn Zippy auto-accept on and -off dynamically. - -491. Bruce Moreland request: a defined way to turn on/off PV (etc.) -kibitzing from the engine dynamically. I had thought it would be -better to make the GUI able to relay thinking output as kibitzing on -its own (and be able to turn this on/off dynamically), but Bruce -points out that what engine authors want to send as kibitzing output -usually includes more than the PV thinking output. [Note that engines -can put whatever info they want in the PV field of the thinking -output]. - -492. One user reports that GNU Chess 5 crashes if you start a game, -play far enough to get GNU Chess out of book, select Reset, and play -e3 in the new game. This is probably a GNU Chess 5.00 bug, unrelated -to WinBoard. Can't reproduce on Linux; didn't try yet on Windows. -Need to see if 5.02 fixes it. - -493. DAV suggests stripping off first arguments that are obviously -not the name of the engine when trying to parse out the engine name -from its command line -- things like nice, nohup, sh, csh, bash, etc. -Ugh, but I suppose it would be helpful sometimes. - -494. Internationalization. A couple of people have done (or told me -they were doing) partial conversions of WinBoard to German or Spanish -by manually translating the messages. I think it would be much better -(but a big job) to use GNU gettext. I haven't looked into the details -of that at all. [4.2.8 and 4.4 have gettext support.] - -495. JamesBaud points out that FEN is not sufficient to correctly -represent a crazyhouse position (or bughouse, for that matter), -because it does not distinguish promoted pawns that will revert when -captured from real pieces. ICS style 12 also does not give us this -information. I really don't know what I could do about this -- take -the lead in proposing an extension to FEN and to style 12 with new -piece letters, I suppose. I don't really have time or motivation for -that. If you always use PGN, not FEN, to save Crazyhouse, that works -around the problem. [4.3 uses bFENs which fix this, but not in ICS -mode] - -**496. DAV sent some code to save a screen shot in xboard. Look at -merging this in. [4.3 has an option to save the board display (but -not the entire window) as bitmap.] - -**497. Igor Eged reports: I make a move on opponents time using -premove. Right in the time I am holding another piece in case of -unexpected check that I can have other possibility. But then the piece -hangs in the void and its invalid move, what means often loss in 1 0 -lightning. - -498. It would be nice for Zippy to be able to play ICC wild 20 and 21 -(the types where loadgame is allowed). Presumably there would have to -be an option to either send the loadgame command with a specified -position, or to deal with an opponent sending it. I'm not sure how -this should work exactly, or how to prevent opponents from cheating in -various ways. - -499. It would be nice for Zippy to be able to switch amongst several -different engines depending on which variant type is being played. - -500. It would be nice if Zippy could have an option to accept -takebacks. Hmmm, also, the operator might want to manually offer a -takeback; it would be good if that worked. - -501. People would like to be able to add more bot functionality to -Zippy without C programming. I don't have any ideas on how to do that. - -502. One user requests the ability to have a game list file open for -more than one PGN file at a time. - -503. We don't do protover 2 feature negotiation properly when -restarting an engine due to -xreuse mode. The timeout and done=0/1 -features don't work on the restart; instead we basically assume that -all the features will be the same as last time and that the engine -will be ready to accept commands immediately. This probably doesn't -cause a lot of problems, but if you try to replace the engine with one -that sets different features, the changes might not be noticed before -the first move, and the defaults will be the values from the old -engine, not the documented defaults. Also, if the engine takes time -to initialize and wants us to wait to send commands until it says -done=1, we fail to wait. However, we do send commands in the right -order and use ping, so most engines should work fine. - -506. One user wants a board size even smaller than Tiny. - -507. Suggested: have the cursor change to a gripping hand while moving -pieces. Currently in WinBoard it's always an arrow, while in xboard -it's always a hand with pointing finger while over the board and an -arrow elsewhere. - -508. It would be nice to make -xclock work with -ics, just for -orthogonality, though it's not terribly useful. - -509. It would be nice to make -clock work with -st. Perhaps each -player's clock should start with the specified time on each move and -count down until he moves. - -**510. A FICS service rep tells me that many users expect an autologin -feature in winboard (other than the non-user-friendly login.ini file). -Seems easy enough to add such a thing. - -512. Some users dislike the clocks counting in tenths when below 10 -seconds, as it's distracting, and would like this to be configurable. -(From the Debian bug tracking system.) - -513. Perhaps have Alt+P and Alt+C as synonyms for Pause in WinBoard, -since the P or C on the button makes it look like that should be the -shortcut. I suppose Alt+< and Alt+>, and the same with Shift for << -and >>, would also be a good idea. Oops, but Alt+C is already -CopyGame, so maybe this is a bad idea. - -514. Gian-Carlo Pascutto reports: "when pasting a FEN/EPD position -into WinBoard, and selecting analysis mode, the engine analyses the -starting position instead of the pasted one. Re-pasting fixes this." - -515. Troy Edwards suggests: "It would be nice to have the option to -'wrap text' in the comment window." - -516. DAV says: "FICS now supports the setting and the making clocks -tick using unpause/pause in examine mode. It seems either the clocks -don't tick or are not present when using xboard. Is it possible to -change the policy and base things upon the clock is paused flag in -style 12?" - -517. Clarify in engine-intf.html that "sd" is an extra dumbing-down -feature, not a time control. Some text: - -In the protocol, the "sd" command isn't a time control. It doesn't -say that your engine has unlimited time but must search to exactly the -given depth. It says that you should pay attention to the time -control as normal, but cut off the search at the specified depth even -if you have time to search deeper. If you don't have time to search -to the specified depth, given your normal time management algorithm, -then you will want to stop sooner than the given depth. - -The "new" command should set the search depth back to unlimited. This -is already stated in the spec. The "level" command should not affect -the search depth. As it happens, xboard/WinBoard currently always -sends sd (if needed) right after level, but that isn't part of the -spec. [Added to the specs that go with 4.4] - -518. Warn in doc that -initString is a dangerous feature. Also move -doc of dalogs for sending commands directly to the engine out of the -protocol spec and into the man page and help file, but warn they are -dangerous too. - -519. In engine-intf.html, change "st" description to not use the word -"exact", which is misleading. Make sure it says this is the maximum -time per move (and does not accumulate). - -520. Check whether Alt+C (CopyGame) works in XP. One user says it -gives an error message. - -522. engine-intf.html should really be rewritten to describe the -protocol as a state machine (on each end), with every command -precisely defined as to what it does in each state (including perhaps -being illegal). - -523. Figure out what, if anything, to do with the FICS "iset singleboard". -I lean toward not bothering to set it, as it only disables functionality, -but maybe I'm confused. - -524. theblob at Mon Mar 4, 23:23 PST 2002: it'd be nice in the xboard -interaction window if control-w and control-u respectively erased the -line and word, even in a Windows environment. At least, I think it'd -be nice. - -525. Support a 64-bit node counter in analysis mode when compiled with -something that has 64-bit integer support. Both gcc and msvc++ have -this, though under different names. [Done in 4.2.8 and 4.4] - -526. "-initialMode analysis -lgf -" doesn't get the engine into -analysis mode properly. "-initialMode analyzeFile" is a workaround, -but bug should be fixed. - -527. Clarify ICS.ini more in the doc, if possible. Some sample words: -> You should create this file in -> WinBoard's directory (usually C:\Program Files\WinBoard) using a plain -> text editor such as Notepad. Make sure that Notepad doesn't decide to -> call the file ICS.ini.txt for you -- you may have to select "All -> Files" instead of "Text Files" in the Notepad save dialog. -> -> The file is simply sent to the chess server, just as if you had typed it. -> So if your username is foo and password is bar, the file would look -> like what is between ==== below, without the ===='s: -> -> ==== -> foo -> bar -> iset movecase 1 -> ==== - -528. Check on updates/revisions to PGN from Steven Edwards and others. -Any support needed? - -529. Protover 3 needs a prefix character that says "this is debug -output" and prevents the GUI from parsing that line (say ";"). -[4.3 uses '#' for this purpose, when the engine sets feature debug=1] - -530. The undocumented (?) checking for rsh error messages tripped up -one engine author who had a "not found" in a message. Tighten this -up. - -531. Do we always wait for pongs to catch up with pings before -starting the engine's clock? I suppose we should. - -532. On FICS the clock does not start until after the first move has -been made. So perhaps we don't need the "not ready, try again soon" -response from Zippy there. What if Zippy is black, does black's clock -also not start until he makes his first move? - -533. theblob at Mon Jun 24, 20:05 PDT 2002: here's a suggestion for -xboard -- give priority to fitting in amounts of material in the title -bar, and truncate names instead, e.g., use "tyrionsAp...(50) vs. woden -(51)" rather than "TyrionsApprentice (50) vs. woden..." -- it's much -more important to see the material than the full names, especially -when you're playing. - -534. Steffen Jakob reports: "I use xboard 4.2.6. Yesterday I played -some bullet games at ICC. In one game I lost on time. In the last move -I already clicked on my queen and wanted it to move to its destination -square when I forfeited on time. After that my mouse pointer was the -queen piece. I couldnt drop it to any square." - -535. For protover 3, the "st" command in the protocol could be -extended to allow for smaller units, not just seconds. - -537. Clarify in the protocol that "force" while searching means you -should stop the search as soon as you can. (Isn't this clear -already?) - -538. Need a way for the user to adjust the clocks. This is important -for WCCC and other computer competitions, where xboard/winboard's -clock is not the master. I was going to do it in time for the July -2002 WCCC. Oops. [4.3 allows adjusting the clocks by clicking them -in 'edit game' mode, in steps of 1 minute] - -541. Related to #327, John Iverson says, "It would be nice to have the -coordinates shown outside of the board along the edges, rather than in -the squares where they are hard to see and give a cluttered -appearance, especially on smaller board sizes. (The coordinates can -be handy in certain situations, such as posting a screenshot of xboard -showing an email game in progress, with the view flipped.)" - -542. If you start xboard with the -geometry NxM option, it will -dutifully make the window exactly that size, but it doesn't choose a --size option that fits into such a window size, so the board is cut -off or has a lot of whitespace around it. In fact, the layout is -generally messed up because the code doesn't expect the window to be -the wrong size for the layout. We should at least ignore the size -part of the -geometry option if we aren't going to do something -sensible with it. How is that done with Xt? - -543. See the patches and extensions on -http://www.tim-mann.org/extensions.html#patches and integrate those -that are worthwhile into the main code base. (Some are also mentioned -elsewhere in this ToDo list.) They are pretty much all over 15 lines, -so copyright assignment from their authors is needed. Unfortunately -some of the authors may be hard to reach. - -544. Possibly rework looking_at pattern matching to have a "match at -beginning of line" character (perhaps ^). It looks like this may -actually be useful after all. The historical cases where you could -get a board or other output that needs parsing on the same line as a -prompt *may* have been fixed. Confirming this would need testing on -all the ICSes that are in use. - -546. Odd bug reported by travelGirl. The last line of a multi-line -macro from the ICS context menu sometimes "sticks" at the bottom of -the ICS interaction window. New text gets inserted before instead of -after it. This started when she upgraded to win2k. See mail. - -548. Guido Flohr reports: - -Another "not really a bug" problem: When xboard forks in order to -start a second chess engine, it is only concerned about duplicating -the descriptors for the standard channels in the child. This is -very interesting for the second chess engine, since it inherits the -pipes to its opponent, and can use them for sending commands like -"sd 2", "easy", or even for feeding a bogus FEN string into the -first engine (exchanging the opponent's queen with a bishop looks -really attractive to me). A very interesting feature, but not exactly -what you intended? ;-) - -Closing the other descriptors after the fork will not completely -avoid the problem, since - at least under Solaris and Linux - it -is still possible to peek and write into xboard's open descriptors via the -/proc pseudo file system (unless you make xboard setuid root), but -leaving them open, makes this cheat very obvious. - -549. "Ron" (no last name given) reports that when compiling WinBoard -under VC++ 6.0, there are many warnings. These ought to be looked at. - -551. "Miguel" (no last name given) reports "When you make a premove in -Winboard 4.2.6, and then opponent move and premove is illegal, then -and you try to make a legal move but you cannot, because piece are -erased and you have to replace your move again, move twice... in -lightining this is annoying." I'm not really sure what that means or -if it is the same bug as 497. - -552. Get rid of the need for proprietary tools to build WinBoard. -It's already possible to compile winboard.exe using the Cygwin -toolchain. You can even compile it with -mno-cygwin to avoid the need -for cygwin1.dll. However: - -552a. The Help file needs Microsoft Word to edit the source file -winboard.rtf and the Microsoft Help Compiler to compile it into -winboard.hlp. I tried using OpenOffice.org on the RTF file, but the -result was missing some formatting that the help compiler needs. The -help compiler itself is a free-as-in-beer download, but it's still -proprietary software. Perhaps the help could be converted to vanilla -HTML, at the cost of losing the index and search capability. - -552b. The WinBoard installer package is built with InstallShield. - Possible replacements: - Inno Setup (http://www.jrsoftware.org/isinfo.php) - looks best - NSIS (http://nsis.sourceforge.net/site/index.php) - Cygwin setup (http://www.cygwin.com) - a long shot - -552c. Although the cygwin resource compiler works on winboard.rc, it's -a pain to create new dialogs by editing the text file. The original -ones were all created using the graphical dialog editor in MSVC 5. - -553. It would be nice for xboard's ICS Input box to have a history -feature similar to WinBoard's ICS Interaction window. Actually it -would be nice for xboard to have its own ICS Interaction window with -all the bells and whistles that WinBoard's has instead of limping -along using an xterm for interaction. - -**554. Port evaluation-graph window to XBoard. - -555. Split x/wengineoutput.c in a front-end and common backend file. - -556. Fix -stickyWindows option under XP and Vista, and port to XBoard. - -557. Port display of engine logos to XBoard. - -558. Device a smart way for -autoLogo to select logos in other modes -than Two Machines. - - - -* * * - -Before each release: -- make sure both xboard and winboard build and are up to date with each other -- run zippy with new version as a shakedown -- be sure gnu5 binary is up to date in winboard, and gnu5 patch (if needed) - is included in both xboard and winboard kits -- recheck cygwin compiling winboard -- make sure ChangeLog is complete -- test changes - -*** up to date with mail received through 5 Nov 2003, except -for the "protover 3" discussions on the chess-engines mailing list *** diff --git a/args.h b/args.h deleted file mode 100644 index 8d07b20..0000000 --- a/args.h +++ /dev/null @@ -1,1703 +0,0 @@ -/* - * args.c -- Option parsing and saving for X and Windows versions of XBoard - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. - * - * Enhancements Copyright 2005 Alessandro Scotti - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. -*/ - -// Note: this file is not a normal header, but contains executable code -// for #inclusion in winboard.c and xboard.c, rather than separate compilation, -// so that it can make use of the proper context of #defined symbols and -// declarations in those files. - -typedef enum { - ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, - ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, - ArgSettingsFilename, ArgBackupSettingsFile, ArgTwo, ArgInstall, ArgMaster, - ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window -} ArgType; - -typedef void *ArgIniType; - -#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */ -#define MAX_ARG_LEN 128*1024 /* [AS] For Roger Brown's very long list! */ - -typedef struct { - char *argName; - ArgType argType; - /*** - union { - String *pString; // ArgString - int *pInt; // ArgInt - float *pFloat; // ArgFloat - Boolean *pBoolean; // ArgBoolean - COLORREF *pColor; // ArgColor - ColorClass cc; // ArgAttribs - String *pFilename; // ArgFilename - BoardSize *pBoardSize; // ArgBoardSize - int whichFont; // ArgFont - DCB *pDCB; // ArgCommSettings - String *pFilename; // ArgSettingsFilename - } argLoc; - ***/ - void *argLoc; - Boolean save; - ArgIniType defaultValue; -} ArgDescriptor; - -typedef struct { - char *item; - char *command; - Boolean getname; - Boolean immediate; -} IcsTextMenuEntry; - -IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; -char dataDir[MSG_SIZ] = DATADIR; - -int junk; -int saveDate; -int dateStamp; -Boolean singleList; -Boolean autoClose; -char *homeDir; -char *firstEngineLine; -char *secondEngineLine; -char *icsNick; -char *theme; - -void EnsureOnScreen(int *x, int *y, int minX, int minY); -char StringGet(void *getClosure); -void ParseFont(char *name, int number); -void SetFontDefaults(); -void CreateFonts(); -void ParseColor(int n, char *name); -void ParseTextAttribs(ColorClass cc, char *s); -void ParseBoardSize(void * addr, char *name); -void ParseCommPortSettings(char *name); -void LoadAllSounds(); -void SetCommPortDefaults(); -void SaveFontArg(FILE *f, ArgDescriptor *ad); -void ExportSounds(); -void SaveAttribsArg(FILE *f, ArgDescriptor *ad); -void SaveColor(FILE *f, ArgDescriptor *ad); -void SaveBoardSize(FILE *f, char *name, void *addr); -void PrintCommPortSettings(FILE *f, char *name); -void GetWindowCoords(); -int MainWindowUp(); -void PopUpStartupDialog(); -typedef char GetFunc(void *getClosure); -void ParseArgs(GetFunc get, void *cl); - -// [HGM] this is an exact duplicate of something in winboard.c. Move to backend.c? -char *defaultTextAttribs[] = -{ - COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, - COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, - "#000000" -}; - -ArgDescriptor argDescriptors[] = { - /* positional arguments */ - { "opt", ArgSettingsFilename, (void *) NULL, FALSE, INVALID }, - { "loadPositionFile", ArgFilename, (void *) &appData.loadPositionFile, FALSE, INVALID }, - { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, INVALID }, - { "is", ArgString, (void *) &icsNick, FALSE, INVALID }, - { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID }, - { "", ArgNone, NULL, FALSE, INVALID }, - /* keyword arguments */ - { "saveDate", ArgInt, (void *) &saveDate, TRUE, 0 }, - { "date", ArgInt, (void *) &dateStamp, FALSE, 0 }, - { "autoClose", ArgTrue, (void *) &autoClose, FALSE, FALSE }, - JAWS_ARGS - { "whitePieceColor", ArgColor, (void *) 0, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, - { "wpc", ArgColor, (void *) 0, FALSE, INVALID }, - { "blackPieceColor", ArgColor, (void *) 1, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, - { "bpc", ArgColor, (void *) 1, FALSE, INVALID }, - { "lightSquareColor", ArgColor, (void *) 2, TRUE, (ArgIniType) LIGHT_SQUARE_COLOR }, - { "lsc", ArgColor, (void *) 2, FALSE, INVALID }, - { "darkSquareColor", ArgColor, (void *) 3, TRUE, (ArgIniType) DARK_SQUARE_COLOR }, - { "dsc", ArgColor, (void *) 3, FALSE, INVALID }, - { "highlightSquareColor", ArgColor, (void *) 4, TRUE, (ArgIniType) HIGHLIGHT_SQUARE_COLOR }, - { "hsc", ArgColor, (void *) 4, FALSE, INVALID }, - { "premoveHighlightColor", ArgColor, (void *) 5, TRUE, (ArgIniType) PREMOVE_HIGHLIGHT_COLOR }, - { "phc", ArgColor, (void *) 5, FALSE, INVALID }, - { "movesPerSession", ArgInt, (void *) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION }, - { "mps", ArgInt, (void *) &appData.movesPerSession, FALSE, INVALID }, - { "initString", ArgString, (void *) &appData.firstInitString, FALSE, INVALID }, - { "firstInitString", ArgString, (void *) &appData.firstInitString, FALSE, (ArgIniType) INIT_STRING }, - { "secondInitString", ArgString, (void *) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING }, - { "firstComputerString", ArgString, (void *) &appData.firstComputerString, - FALSE, (ArgIniType) COMPUTER_STRING }, - { "secondComputerString", ArgString, (void *) &appData.secondComputerString, - FALSE, (ArgIniType) COMPUTER_STRING }, - { "firstChessProgram", ArgFilename, (void *) &appData.firstChessProgram, - FALSE, (ArgIniType) FIRST_CHESS_PROGRAM }, - { "fcp", ArgFilename, (void *) &appData.firstChessProgram, FALSE, INVALID }, - { "secondChessProgram", ArgFilename, (void *) &appData.secondChessProgram, - FALSE, (ArgIniType) SECOND_CHESS_PROGRAM }, - { "scp", ArgFilename, (void *) &appData.secondChessProgram, FALSE, INVALID }, - { "fe", ArgString, (void *) &firstEngineLine, FALSE, "" }, - { "se", ArgString, (void *) &secondEngineLine, FALSE, "" }, - { "firstPlaysBlack", ArgBoolean, (void *) &appData.firstPlaysBlack, FALSE, FALSE }, - { "fb", ArgTrue, (void *) &appData.firstPlaysBlack, FALSE, FALSE }, - { "xfb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID }, - { "-fb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID }, - { "noChessProgram", ArgBoolean, (void *) &appData.noChessProgram, FALSE, FALSE }, - { "ncp", ArgTrue, (void *) &appData.noChessProgram, FALSE, INVALID }, - { "xncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID }, - { "-ncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID }, - { "firstHost", ArgString, (void *) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST }, - { "fh", ArgString, (void *) &appData.firstHost, FALSE, INVALID }, - { "secondHost", ArgString, (void *) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST }, - { "sh", ArgString, (void *) &appData.secondHost, FALSE, INVALID }, - { "firstDirectory", ArgFilename, (void *) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY }, - { "fd", ArgFilename, (void *) &appData.firstDirectory, FALSE, INVALID }, - { "secondDirectory", ArgFilename, (void *) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY }, - { "sd", ArgFilename, (void *) &appData.secondDirectory, FALSE, INVALID }, - { "variations", ArgBoolean, (void *) &appData.variations, TRUE, (ArgIniType) FALSE }, - { "appendPV", ArgBoolean, (void *) &appData.autoExtend, TRUE, (ArgIniType) FALSE }, - { "theme", ArgString, (void *) &theme, FALSE, (ArgIniType) "" }, - - /* some options only used by the XBoard front end, and ignored in WinBoard */ - /* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */ - { "internetChessServerInputBox", ArgBoolean, (void *) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE }, - { "icsinput", ArgTrue, (void *) &appData.icsInputBox, FALSE, INVALID }, - { "xicsinput", ArgFalse, (void *) &appData.icsInputBox, FALSE, INVALID }, - { "cmail", ArgString, (void *) &appData.cmailGameName, FALSE, (ArgIniType) "" }, - { "soundProgram", ArgFilename, (void *) &appData.soundProgram, XBOARD, (ArgIniType) "play" }, - { "fontSizeTolerance", ArgInt, (void *) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 }, - { "lowTimeWarningColor", ArgColor, (void *) 6, XBOARD, (ArgIniType) LOWTIMEWARNING_COLOR }, - { "lowTimeWarning", ArgBoolean, (void *) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE }, - { "titleInWindow", ArgBoolean, (void *) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE }, - { "title", ArgTrue, (void *) &appData.titleInWindow, FALSE, INVALID }, - { "xtitle", ArgFalse, (void *) &appData.titleInWindow, FALSE, INVALID }, - { "flashCount", ArgInt, (void *) &appData.flashCount, XBOARD, INVALID }, // let X handle this - { "flashRate", ArgInt, (void *) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE }, - { "pieceImageDirectory", ArgFilename, (void *) &appData.pieceDirectory, TRUE, (ArgIniType) "" }, - { "pid", ArgFilename, (void *) &appData.pieceDirectory, FALSE, INVALID }, - { "trueColors", ArgBoolean, (void *) &appData.trueColors, TRUE, (ArgIniType) FALSE }, - { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" }, - { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, - { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, - - { "dropMenu", ArgBoolean, (void *) &appData.dropMenu, TRUE, (ArgIniType) FALSE }, - { "pieceMenu", ArgBoolean, (void *) &appData.pieceMenu, TRUE, (ArgIniType) TRUE }, - { "sweepPromotions", ArgBoolean, (void *) &appData.sweepSelect, TRUE, (ArgIniType) FALSE }, - { "monoMouse", ArgBoolean, (void *) &appData.monoMouse, XBOARD, (ArgIniType) FALSE }, - { "remoteShell", ArgFilename, (void *) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL }, - { "rsh", ArgFilename, (void *) &appData.remoteShell, FALSE, INVALID }, - { "remoteUser", ArgString, (void *) &appData.remoteUser, FALSE, (ArgIniType) "" }, - { "ruser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID }, - { "timeDelay", ArgFloat, (void *) &appData.timeDelay, TRUE, INVALID }, - { "td", ArgFloat, (void *) &appData.timeDelay, FALSE, INVALID }, - { "timeControl", ArgString, (void *) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL }, - { "tc", ArgString, (void *) &appData.timeControl, FALSE, INVALID }, - { "timeIncrement", ArgFloat, (void *) &appData.timeIncrement, FALSE, INVALID }, - { "inc", ArgFloat, (void *) &appData.timeIncrement, FALSE, INVALID }, - { "internetChessServerMode", ArgBoolean, (void *) &appData.icsActive, FALSE, INVALID }, - { "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE }, - { "xics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID }, - { "-ics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID }, - { "is", ArgString, (void *) &icsNick, FALSE, "" }, - { "internetChessServerHost", ArgString, (void *) &appData.icsHost, FALSE, (ArgIniType) "" }, - { "icshost", ArgString, (void *) &appData.icsHost, FALSE, INVALID }, - { "internetChessServerPort", ArgString, (void *) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT }, - { "icsport", ArgString, (void *) &appData.icsPort, FALSE, INVALID }, - { "internetChessServerCommPort", ArgString, (void *) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT }, - { "icscomm", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, - { "internetChessServerComPort", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, - { "icscom", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, - { "internetChessServerLogonScript", ArgFilename, (void *) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON }, - { "icslogon", ArgFilename, (void *) &appData.icsLogon, FALSE, INVALID }, - { "useTelnet", ArgBoolean, (void *) &appData.useTelnet, FALSE, INVALID }, - { "telnet", ArgTrue, (void *) &appData.useTelnet, FALSE, INVALID }, - { "xtelnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID }, - { "-telnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID }, - { "telnetProgram", ArgFilename, (void *) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM }, - { "internetChessserverHelper", ArgFilename, (void *) &appData.icsHelper, - FALSE, INVALID }, // for XB - { "icshelper", ArgFilename, (void *) &appData.icsHelper, FALSE, (ArgIniType) "" }, - { "seekGraph", ArgBoolean, (void *) &appData.seekGraph, TRUE, (ArgIniType) FALSE }, - { "sg", ArgTrue, (void *) &appData.seekGraph, FALSE, INVALID }, - { "autoRefresh", ArgBoolean, (void *) &appData.autoRefresh, TRUE, (ArgIniType) FALSE }, - { "autoBox", ArgBoolean, (void *) &appData.autoBox, XBOARD, (ArgIniType) TRUE }, - { "gateway", ArgString, (void *) &appData.gateway, FALSE, (ArgIniType) "" }, - { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, (ArgIniType) "" }, - { "lgf", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID }, - { "loadGameIndex", ArgInt, (void *) &appData.loadGameIndex, FALSE, (ArgIniType) 0 }, - { "lgi", ArgInt, (void *) &appData.loadGameIndex, FALSE, INVALID }, - { "saveGameFile", ArgFilename, (void *) &appData.saveGameFile, TRUE, (ArgIniType) "" }, - { "sgf", ArgFilename, (void *) &appData.saveGameFile, FALSE, INVALID }, - { "autoSaveGames", ArgBoolean, (void *) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE }, - { "autosave", ArgTrue, (void *) &appData.autoSaveGames, FALSE, INVALID }, - { "xautosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID }, - { "-autosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID }, - { "onlyOwnGames", ArgBoolean, (void *) &appData.onlyOwn, TRUE, (ArgIniType) FALSE }, - { "loadPositionFile", ArgFilename, (void *) &appData.loadPositionFile, FALSE, (ArgIniType) "" }, - { "lpf", ArgFilename, (void *) &appData.loadPositionFile, FALSE, INVALID }, - { "loadPositionIndex", ArgInt, (void *) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 }, - { "lpi", ArgInt, (void *) &appData.loadPositionIndex, FALSE, INVALID }, - { "positionDir", ArgFilename, (void *) &appData.positionDir, FALSE, (ArgIniType) "" }, - { "savePositionFile", ArgFilename, (void *) &appData.savePositionFile, FALSE, (ArgIniType) "" }, - { "spf", ArgFilename, (void *) &appData.savePositionFile, FALSE, INVALID }, - { "matchMode", ArgBoolean, (void *) &appData.matchMode, FALSE, (ArgIniType) FALSE }, - { "mm", ArgTrue, (void *) &appData.matchMode, FALSE, INVALID }, - { "xmm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID }, - { "-mm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID }, - { "matchGames", ArgInt, (void *) &appData.matchGames, FALSE, (ArgIniType) 0 }, - { "mg", ArgInt, (void *) &appData.matchGames, FALSE, INVALID }, - { "monoMode", ArgBoolean, (void *) &appData.monoMode, TRUE, (ArgIniType) FALSE }, - { "mono", ArgTrue, (void *) &appData.monoMode, FALSE, INVALID }, - { "xmono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID }, - { "-mono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID }, - { "debugMode", ArgBoolean, (void *) &appData.debugMode, FALSE, (ArgIniType) FALSE }, - { "debug", ArgTrue, (void *) &appData.debugMode, FALSE, INVALID }, - { "xdebug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID }, - { "-debug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID }, - { "clockMode", ArgBoolean, (void *) &appData.clockMode, FALSE, (ArgIniType) TRUE }, - { "clock", ArgTrue, (void *) &appData.clockMode, FALSE, INVALID }, - { "xclock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID }, - { "-clock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID }, - { "searchTime", ArgString, (void *) &appData.searchTime, FALSE, (ArgIniType) "" }, - { "st", ArgString, (void *) &appData.searchTime, FALSE, INVALID }, - { "searchDepth", ArgInt, (void *) &appData.searchDepth, FALSE, (ArgIniType) 0 }, - { "depth", ArgInt, (void *) &appData.searchDepth, FALSE, INVALID }, - { "showCoords", ArgBoolean, (void *) &appData.showCoords, TRUE, (ArgIniType) FALSE }, - { "coords", ArgTrue, (void *) &appData.showCoords, FALSE, INVALID }, - { "xcoords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID }, - { "-coords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID }, - { "showThinking", ArgBoolean, (void *) &appData.showThinking, TRUE, (ArgIniType) FALSE }, - { "thinking", ArgTrue, (void *) &appData.showThinking, FALSE, INVALID }, - { "xthinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID }, - { "-thinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID }, - { "ponderNextMove", ArgBoolean, (void *) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE }, - { "ponder", ArgTrue, (void *) &appData.ponderNextMove, FALSE, INVALID }, - { "xponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID }, - { "-ponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID }, - { "periodicUpdates", ArgBoolean, (void *) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE }, - { "periodic", ArgTrue, (void *) &appData.periodicUpdates, FALSE, INVALID }, - { "xperiodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID }, - { "-periodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID }, - { "popupExitMessage", ArgBoolean, (void *) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE }, - { "exit", ArgTrue, (void *) &appData.popupExitMessage, FALSE, INVALID }, - { "xexit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID }, - { "-exit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID }, - { "popupMoveErrors", ArgBoolean, (void *) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE }, - { "popup", ArgTrue, (void *) &appData.popupMoveErrors, FALSE, INVALID }, - { "xpopup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID }, - { "-popup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID }, - { "popUpErrors", ArgBoolean, (void *) &appData.popupMoveErrors, - FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */ - { "clockFont", ArgFont, (void *) CLOCK_FONT, TRUE, INVALID }, - { "messageFont", ArgFont, (void *) MESSAGE_FONT, TRUE, INVALID }, - { "font", ArgFont, (void *) MESSAGE_FONT, FALSE, INVALID }, /* only so that old .xboardrc files will parse. -font does not work from the command line because it is captured by the X libraries. */ - { "coordFont", ArgFont, (void *) COORD_FONT, TRUE, INVALID }, - { "tagsFont", ArgFont, (void *) EDITTAGS_FONT, TRUE, INVALID }, - { "commentFont", ArgFont, (void *) COMMENT_FONT, TRUE, INVALID }, - { "icsFont", ArgFont, (void *) CONSOLE_FONT, TRUE, INVALID }, - { "moveHistoryFont", ArgFont, (void *) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */ - { "gameListFont", ArgFont, (void *) GAMELIST_FONT, TRUE, INVALID }, /* [HGM] */ - { "boardSize", ArgBoardSize, (void *) &boardSize, - TRUE, (ArgIniType) -1 }, /* must come after all fonts */ - { "size", ArgBoardSize, (void *) &boardSize, FALSE, INVALID }, - { "ringBellAfterMoves", ArgBoolean, (void *) &appData.ringBellAfterMoves, - FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */ - { "bell", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "xbell", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "movesound", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "xmovesound", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "alwaysOnTop", ArgBoolean, (void *) &alwaysOnTop, TRUE, INVALID }, - { "top", ArgTrue, (void *) &alwaysOnTop, FALSE, INVALID }, - { "xtop", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID }, - { "-top", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID }, - { "autoCallFlag", ArgBoolean, (void *) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE }, - { "autoflag", ArgTrue, (void *) &appData.autoCallFlag, FALSE, INVALID }, - { "xautoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID }, - { "-autoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID }, - { "autoComment", ArgBoolean, (void *) &appData.autoComment, TRUE, (ArgIniType) FALSE }, - { "autocomm", ArgTrue, (void *) &appData.autoComment, FALSE, INVALID }, - { "xautocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID }, - { "-autocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID }, - { "autoCreateLogon", ArgBoolean, (void *) &appData.autoCreateLogon, TRUE, (ArgIniType) FALSE }, - { "autoObserve", ArgBoolean, (void *) &appData.autoObserve, TRUE, (ArgIniType) FALSE }, - { "autobs", ArgTrue, (void *) &appData.autoObserve, FALSE, INVALID }, - { "xautobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID }, - { "-autobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID }, - { "flipView", ArgBoolean, (void *) &appData.flipView, FALSE, (ArgIniType) FALSE }, - { "flip", ArgTrue, (void *) &appData.flipView, FALSE, INVALID }, - { "xflip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID }, - { "-flip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID }, - { "autoFlipView", ArgBoolean, (void *) &appData.autoFlipView, TRUE, (ArgIniType) TRUE }, - { "autoflip", ArgTrue, (void *) &appData.autoFlipView, FALSE, INVALID }, - { "xautoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID }, - { "-autoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID }, - { "autoRaiseBoard", ArgBoolean, (void *) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE }, - { "autoraise", ArgTrue, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, - { "xautoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, - { "-autoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, - { "alwaysPromoteToQueen", ArgBoolean, (void *) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE }, - { "queen", ArgTrue, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "xqueen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "-queen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "oldSaveStyle", ArgBoolean, (void *) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE }, - { "oldsave", ArgTrue, (void *) &appData.oldSaveStyle, FALSE, INVALID }, - { "xoldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID }, - { "-oldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID }, - { "quietPlay", ArgBoolean, (void *) &appData.quietPlay, TRUE, (ArgIniType) FALSE }, - { "quiet", ArgTrue, (void *) &appData.quietPlay, FALSE, INVALID }, - { "xquiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID }, - { "-quiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID }, - { "getMoveList", ArgBoolean, (void *) &appData.getMoveList, TRUE, (ArgIniType) TRUE }, - { "moves", ArgTrue, (void *) &appData.getMoveList, FALSE, INVALID }, - { "xmoves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID }, - { "-moves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID }, - { "testLegality", ArgBoolean, (void *) &appData.testLegality, TRUE, (ArgIniType) TRUE }, - { "legal", ArgTrue, (void *) &appData.testLegality, FALSE, INVALID }, - { "xlegal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID }, - { "-legal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID }, - { "premove", ArgBoolean, (void *) &appData.premove, TRUE, (ArgIniType) TRUE }, - { "pre", ArgTrue, (void *) &appData.premove, FALSE, INVALID }, - { "xpre", ArgFalse, (void *) &appData.premove, FALSE, INVALID }, - { "-pre", ArgFalse, (void *) &appData.premove, FALSE, INVALID }, - { "premoveWhite", ArgBoolean, (void *) &appData.premoveWhite, TRUE, (ArgIniType) FALSE }, - { "prewhite", ArgTrue, (void *) &appData.premoveWhite, FALSE, INVALID }, - { "xprewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID }, - { "-prewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID }, - { "premoveWhiteText", ArgString, (void *) &appData.premoveWhiteText, TRUE, (ArgIniType) "" }, - { "premoveBlack", ArgBoolean, (void *) &appData.premoveBlack, TRUE, (ArgIniType) FALSE }, - { "preblack", ArgTrue, (void *) &appData.premoveBlack, FALSE, INVALID }, - { "xpreblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID }, - { "-preblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID }, - { "premoveBlackText", ArgString, (void *) &appData.premoveBlackText, TRUE, (ArgIniType) "" }, - { "icsAlarm", ArgBoolean, (void *) &appData.icsAlarm, TRUE, (ArgIniType) TRUE}, - { "alarm", ArgTrue, (void *) &appData.icsAlarm, FALSE}, - { "xalarm", ArgFalse, (void *) &appData.icsAlarm, FALSE}, - { "-alarm", ArgFalse, (void *) &appData.icsAlarm, FALSE}, - { "icsAlarmTime", ArgInt, (void *) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000}, - { "localLineEditing", ArgBoolean, (void *) &appData.localLineEditing, FALSE, (ArgIniType) TRUE}, - { "edit", ArgTrue, (void *) &appData.localLineEditing, FALSE, INVALID }, - { "xedit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID }, - { "-edit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID }, - { "animateMoving", ArgBoolean, (void *) &appData.animate, TRUE, (ArgIniType) TRUE }, - { "animate", ArgTrue, (void *) &appData.animate, FALSE, INVALID }, - { "xanimate", ArgFalse, (void *) &appData.animate, FALSE, INVALID }, - { "-animate", ArgFalse, (void *) &appData.animate, FALSE, INVALID }, - { "animateSpeed", ArgInt, (void *) &appData.animSpeed, TRUE, (ArgIniType) 10 }, - { "animateDragging", ArgBoolean, (void *) &appData.animateDragging, TRUE, (ArgIniType) TRUE }, - { "drag", ArgTrue, (void *) &appData.animateDragging, FALSE, INVALID }, - { "xdrag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID }, - { "-drag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID }, - { "blindfold", ArgBoolean, (void *) &appData.blindfold, TRUE, (ArgIniType) FALSE }, - { "blind", ArgTrue, (void *) &appData.blindfold, FALSE, INVALID }, - { "xblind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID }, - { "-blind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID }, - { "highlightLastMove", ArgBoolean, - (void *) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE }, - { "highlight", ArgTrue, (void *) &appData.highlightLastMove, FALSE, INVALID }, - { "xhighlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID }, - { "-highlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID }, - { "highlightDragging", ArgBoolean, - (void *) &appData.highlightDragging, !XBOARD, (ArgIniType) TRUE }, - { "highdrag", ArgTrue, (void *) &appData.highlightDragging, FALSE, INVALID }, - { "xhighdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID }, - { "-highdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID }, - { "colorizeMessages", ArgBoolean, (void *) &appData.colorize, TRUE, (ArgIniType) TRUE }, - { "colorize", ArgTrue, (void *) &appData.colorize, FALSE, INVALID }, - { "xcolorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID }, - { "-colorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID }, - { "colorShout", ArgAttribs, (void *) ColorShout, TRUE, INVALID }, - { "colorSShout", ArgAttribs, (void *) ColorSShout, TRUE, INVALID }, - { "colorCShout", ArgAttribs, (void *) ColorSShout, FALSE, INVALID }, // for XB - { "colorChannel1", ArgAttribs, (void *) ColorChannel1, TRUE, INVALID }, - { "colorChannel", ArgAttribs, (void *) ColorChannel, TRUE, INVALID }, - { "colorKibitz", ArgAttribs, (void *) ColorKibitz, TRUE, INVALID }, - { "colorTell", ArgAttribs, (void *) ColorTell, TRUE, INVALID }, - { "colorChallenge", ArgAttribs, (void *) ColorChallenge, TRUE, INVALID }, - { "colorRequest", ArgAttribs, (void *) ColorRequest, TRUE, INVALID }, - { "colorSeek", ArgAttribs, (void *) ColorSeek, TRUE, INVALID }, - { "colorNormal", ArgAttribs, (void *) ColorNormal, TRUE, INVALID }, - { "colorBackground", ArgColor, (void *) 7, TRUE, COLOR_BKGD }, - { "soundShout", ArgFilename, (void *) &appData.soundShout, TRUE, (ArgIniType) "" }, - { "soundSShout", ArgFilename, (void *) &appData.soundSShout, TRUE, (ArgIniType) "" }, - { "soundCShout", ArgFilename, (void *) &appData.soundSShout, FALSE, (ArgIniType) "" }, // for XB - { "soundChannel1", ArgFilename, (void *) &appData.soundChannel1, TRUE, (ArgIniType) "" }, - { "soundChannel", ArgFilename, (void *) &appData.soundChannel, TRUE, (ArgIniType) "" }, - { "soundKibitz", ArgFilename, (void *) &appData.soundKibitz, TRUE, (ArgIniType) "" }, - { "soundTell", ArgFilename, (void *) &appData.soundTell, TRUE, (ArgIniType) "" }, - { "soundChallenge", ArgFilename, (void *) &appData.soundChallenge, TRUE, (ArgIniType) "" }, - { "soundRequest", ArgFilename, (void *) &appData.soundRequest, TRUE, (ArgIniType) "" }, - { "soundSeek", ArgFilename, (void *) &appData.soundSeek, TRUE, (ArgIniType) "" }, - { "soundMove", ArgFilename, (void *) &appData.soundMove, TRUE, (ArgIniType) "" }, - { "soundBell", ArgFilename, (void *) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL }, - { "soundRoar", ArgFilename, (void *) &appData.soundRoar, TRUE, (ArgIniType) "" }, - { "soundIcsWin", ArgFilename, (void *) &appData.soundIcsWin, TRUE, (ArgIniType) "" }, - { "soundIcsLoss", ArgFilename, (void *) &appData.soundIcsLoss, TRUE, (ArgIniType) "" }, - { "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" }, - { "soundIcsUnfinished", ArgFilename, (void *) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" }, - { "soundIcsAlarm", ArgFilename, (void *) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" }, - { "disguisePromotedPieces", ArgBoolean, (void *) &appData.disguise, TRUE, (ArgIniType) TRUE }, - { "reuseFirst", ArgBoolean, (void *) &appData.reuseFirst, FALSE, (ArgIniType) TRUE }, - { "reuse", ArgTrue, (void *) &appData.reuseFirst, FALSE, INVALID }, - { "xreuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID }, - { "-reuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID }, - { "reuseChessPrograms", ArgBoolean, - (void *) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */ - { "reuseSecond", ArgBoolean, (void *) &appData.reuseSecond, FALSE, (ArgIniType) TRUE }, - { "reuse2", ArgTrue, (void *) &appData.reuseSecond, FALSE, INVALID }, - { "xreuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID }, - { "-reuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID }, - { "comPortSettings", ArgCommSettings, (void *) /*&dcb*/ 0, TRUE, INVALID }, - { "settingsFile", ArgSettingsFilename, (void *) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE }, - { "ini", ArgSettingsFilename, (void *) &settingsFileName, FALSE, INVALID }, - { "at", ArgSettingsFilename, (void *) NULL, FALSE, INVALID }, - { "opt", ArgSettingsFilename, (void *) NULL, FALSE, INVALID }, - { "saveSettingsFile", ArgFilename, (void *) &settingsFileName, FALSE, INVALID }, - { "backupSettingsFile", ArgBackupSettingsFile, (void *) &settingsFileName, FALSE, INVALID }, - { "saveSettingsOnExit", ArgBoolean, (void *) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE }, - { "chessProgram", ArgBoolean, (void *) &chessProgram, FALSE, (ArgIniType) FALSE }, - { "cp", ArgTrue, (void *) &chessProgram, FALSE, INVALID }, - { "xcp", ArgFalse, (void *) &chessProgram, FALSE, INVALID }, - { "-cp", ArgFalse, (void *) &chessProgram, FALSE, INVALID }, - { "icsMenu", ArgString, (void *) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT }, - { "icsNames", ArgString, (void *) &icsNames, TRUE, (ArgIniType) ICS_NAMES }, - { "singleEngineList", ArgBoolean, (void *) &singleList, !XBOARD, (ArgIniType) FALSE }, - { "recentEngines", ArgInt, (void *) &appData.recentEngines, TRUE, (ArgIniType) 6 }, - { "recentEngineList", ArgString, (void *) &appData.recentEngineList, TRUE, (ArgIniType) "" }, - { "firstChessProgramNames", ArgString, (void *) &firstChessProgramNames, - TRUE, (ArgIniType) FCP_NAMES }, - { "secondChessProgramNames", ArgString, (void *) &secondChessProgramNames, - !XBOARD, (ArgIniType) SCP_NAMES }, - { "themeNames", ArgString, (void *) &appData.themeNames, TRUE, (ArgIniType) "native -upf false -ub false -ubt false -pid \"\"\n" }, - { "addMasterOption", ArgMaster, NULL, FALSE, INVALID }, - { "installEngine", ArgInstall, (void *) &firstChessProgramNames, FALSE, (ArgIniType) "" }, - { "installTheme", ArgInstall, (void *) &appData.themeNames, FALSE, (ArgIniType) "" }, - { "initialMode", ArgString, (void *) &appData.initialMode, FALSE, (ArgIniType) "" }, - { "mode", ArgString, (void *) &appData.initialMode, FALSE, INVALID }, - { "variant", ArgString, (void *) &appData.variant, FALSE, (ArgIniType) "normal" }, - { "firstProtocolVersion", ArgInt, (void *) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER }, - { "secondProtocolVersion", ArgInt, (void *) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER }, - { "showButtonBar", ArgBoolean, (void *) &appData.showButtonBar, TRUE, (ArgIniType) TRUE }, - { "buttons", ArgTrue, (void *) &appData.showButtonBar, FALSE, INVALID }, - { "xbuttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID }, - { "-buttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID }, - - /* [AS] New features */ - { "firstScoreAbs", ArgBoolean, (void *) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, - { "secondScoreAbs", ArgBoolean, (void *) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, - { "pgnExtendedInfo", ArgBoolean, (void *) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE }, - { "hideThinkingFromHuman", ArgBoolean, (void *) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE }, - { "liteBackTextureFile", ArgFilename, (void *) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" }, - { "lbtf", ArgFilename, (void *) &appData.liteBackTextureFile, FALSE, INVALID }, - { "darkBackTextureFile", ArgFilename, (void *) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" }, - { "dbtf", ArgFilename, (void *) &appData.darkBackTextureFile, FALSE, INVALID }, - { "liteBackTextureMode", ArgInt, (void *) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, - { "lbtm", ArgInt, (void *) &appData.liteBackTextureMode, FALSE, INVALID }, - { "darkBackTextureMode", ArgInt, (void *) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, - { "dbtm", ArgInt, (void *) &appData.darkBackTextureMode, FALSE, INVALID }, - { "renderPiecesWithFont", ArgString, (void *) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" }, - { "pf", ArgString, (void *) &appData.renderPiecesWithFont, FALSE, INVALID }, - { "fontPieceToCharTable", ArgString, (void *) &appData.fontToPieceTable, TRUE, (ArgIniType) "" }, - { "fptc", ArgString, (void *) &appData.fontToPieceTable, FALSE, INVALID }, - { "fontPieceBackColorWhite", ArgColor, (void *) 8, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, - { "fontPieceForeColorWhite", ArgColor, (void *) 9, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, - { "fontPieceBackColorBlack", ArgColor, (void *) 10, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, - { "fontPieceForeColorBlack", ArgColor, (void *) 11, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, - { "fpfcw", ArgColor, (void *) 9, FALSE, INVALID }, - { "fpbcb", ArgColor, (void *) 10, FALSE, INVALID }, - { "fontPieceSize", ArgInt, (void *) &appData.fontPieceSize, TRUE, (ArgIniType) 80 }, - { "overrideLineGap", ArgInt, (void *) &appData.overrideLineGap, TRUE, (ArgIniType) 1 }, - { "adjudicateLossThreshold", ArgInt, (void *) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 }, - { "delayBeforeQuit", ArgInt, (void *) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 }, - { "delayAfterQuit", ArgInt, (void *) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 }, - { "nameOfDebugFile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, (ArgIniType) DEBUG_FILE }, - { "debugfile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, INVALID }, - { "pgnEventHeader", ArgString, (void *) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" }, - { "defaultFrcPosition", ArgInt, (void *) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 }, - { "shuffleOpenings", ArgTrue, (void *) &shuffleOpenings, FALSE, INVALID }, - { "fischerCastling", ArgTrue, (void *) &appData.fischerCastling, FALSE, INVALID }, - { "gameListTags", ArgString, (void *) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS }, - { "saveOutOfBookInfo", ArgBoolean, (void *) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE }, - { "showEvalInMoveHistory", ArgBoolean, (void *) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE }, - { "evalHistColorWhite", ArgColor, (void *) 12, TRUE, (ArgIniType) "#FFFFB0" }, - { "evalHistColorBlack", ArgColor, (void *) 13, TRUE, (ArgIniType) "#AD5D3D" }, - { "highlightMoveWithArrow", ArgBoolean, (void *) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE }, - { "highlightArrowColor", ArgColor, (void *) 14, TRUE, (ArgIniType) "#FFFF80" }, - { "stickyWindows", ArgBoolean, (void *) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE }, - { "adjudicateDrawMoves", ArgInt, (void *) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) 0 }, - { "autoDisplayComment", ArgBoolean, (void *) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE }, - { "autoDisplayTags", ArgBoolean, (void *) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE }, - { "firstIsUCI", ArgBoolean, (void *) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE }, - { "fUCI", ArgTrue, (void *) &appData.firstIsUCI, FALSE, INVALID }, - { "firstUCI", ArgTrue, (void *) &appData.firstIsUCI, FALSE, INVALID }, - { "secondIsUCI", ArgBoolean, (void *) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE }, - { "secondUCI", ArgTrue, (void *) &appData.secondIsUCI, FALSE, INVALID }, - { "sUCI", ArgTrue, (void *) &appData.secondIsUCI, FALSE, INVALID }, - { "fUCCI", ArgTwo, (void *) &appData.firstIsUCI, FALSE, INVALID }, - { "sUCCI", ArgTwo, (void *) &appData.secondIsUCI, FALSE, INVALID }, - { "fUSI", ArgTwo, (void *) &appData.firstIsUCI, FALSE, INVALID }, - { "sUSI", ArgTwo, (void *) &appData.secondIsUCI, FALSE, INVALID }, - { "firstHasOwnBookUCI", ArgBoolean, (void *) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, - { "fNoOwnBookUCI", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID }, - { "firstXBook", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID }, - { "secondHasOwnBookUCI", ArgBoolean, (void *) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, - { "sNoOwnBookUCI", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID }, - { "secondXBook", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID }, - { "adapterCommand", ArgFilename, (void *) &appData.adapterCommand, TRUE, (ArgIniType) "polyglot -noini -ec \"%fcp\" -ed \"%fd\"" }, - { "uxiAdapter", ArgFilename, (void *) &appData.ucciAdapter, TRUE, (ArgIniType) "" }, - { "polyglotDir", ArgFilename, (void *) &appData.polyglotDir, TRUE, (ArgIniType) "" }, - { "usePolyglotBook", ArgBoolean, (void *) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE }, - { "polyglotBook", ArgFilename, (void *) &appData.polyglotBook, TRUE, (ArgIniType) "" }, - { "bookDepth", ArgInt, (void *) &appData.bookDepth, TRUE, (ArgIniType) 12 }, - { "bookVariation", ArgInt, (void *) &appData.bookStrength, TRUE, (ArgIniType) 50 }, - { "discourageOwnBooks", ArgBoolean, (void *) &appData.defNoBook, TRUE, (ArgIniType) FALSE }, - { "mcBookMode", ArgTrue, (void *) &mcMode, FALSE, (ArgIniType) FALSE }, - { "defaultHashSize", ArgInt, (void *) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, - { "defaultCacheSizeEGTB", ArgInt, (void *) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 }, - { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" }, - { "language", ArgFilename, (void *) &appData.language, TRUE, (ArgIniType) "" }, - { "userFileDirectory", ArgFilename, (void *) &homeDir, FALSE, (ArgIniType) installDir }, - { "usePieceFont", ArgBoolean, (void *) &appData.useFont, TRUE, (ArgIniType) FALSE }, - { "upf", ArgBoolean, (void *) &appData.useFont, FALSE, INVALID }, - { "useBoardTexture", ArgBoolean, (void *) &appData.useBitmaps, TRUE, (ArgIniType) FALSE }, - { "ubt", ArgBoolean, (void *) &appData.useBitmaps, FALSE, INVALID }, - { "useBorder", ArgBoolean, (void *) &appData.useBorder, TRUE, (ArgIniType) FALSE }, - { "ub", ArgBoolean, (void *) &appData.useBorder, FALSE, INVALID }, - { "border", ArgFilename, (void *) &appData.border, TRUE, (ArgIniType) "" }, - { "finger", ArgFilename, (void *) &appData.finger, FALSE, (ArgIniType) "" }, - { "epd", ArgTrue, (void *) &appData.epd, FALSE, INVALID }, - { "inscriptions", ArgString, (void *) &appData.inscriptions, FALSE, (ArgIniType) "" }, - { "autoInstall", ArgString, (void *) &appData.autoInstall, XBOARD, (ArgIniType) "" }, - { "fixedSize", ArgBoolean, (void *) &appData.fixedSize, TRUE, (ArgIniType) FALSE }, - - // [HGM] tournament options - { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" }, - { "tf", ArgFilename, (void *) &appData.tourneyFile, FALSE, INVALID }, - { "participants", ArgString, (void *) &appData.participants, FALSE, (ArgIniType) "" }, - { "tourneyType", ArgInt, (void *) &appData.tourneyType, FALSE, (ArgIniType) 0 }, - { "tt", ArgInt, (void *) &appData.tourneyType, FALSE, INVALID }, - { "tourneyCycles", ArgInt, (void *) &appData.tourneyCycles, FALSE, (ArgIniType) 1 }, - { "cy", ArgInt, (void *) &appData.tourneyCycles, FALSE, INVALID }, - { "results", ArgString, (void *) &appData.results, FALSE, (ArgIniType) "" }, - { "syncAfterRound", ArgBoolean, (void *) &appData.roundSync, FALSE, (ArgIniType) FALSE }, - { "syncAfterCycle", ArgBoolean, (void *) &appData.cycleSync, FALSE, (ArgIniType) TRUE }, - { "seedBase", ArgInt, (void *) &appData.seedBase, FALSE, (ArgIniType) 1 }, - { "pgnNumberTag", ArgBoolean, (void *) &appData.numberTag, TRUE, (ArgIniType) FALSE }, - { "afterGame", ArgString, (void *) &appData.afterGame, FALSE, INVALID }, - { "afterTourney", ArgString, (void *) &appData.afterTourney, FALSE, INVALID }, - - /* [HGM] board-size, adjudication and misc. options */ - { "oneClickMove", ArgBoolean, (void *) &appData.oneClick, TRUE, (ArgIniType) FALSE }, - { "boardWidth", ArgInt, (void *) &appData.NrFiles, FALSE, (ArgIniType) -1 }, - { "boardHeight", ArgInt, (void *) &appData.NrRanks, FALSE, (ArgIniType) -1 }, - { "rankOffset", ArgInt, (void *) &appData.rankOffset, FALSE, (ArgIniType) 0 }, - { "holdingsSize", ArgInt, (void *) &appData.holdingsSize, FALSE, (ArgIniType) -1 }, - { "defaultMatchGames", ArgInt, (void *) &appData.defaultMatchGames, TRUE, (ArgIniType) 10 }, - { "matchPause", ArgInt, (void *) &appData.matchPause, TRUE, (ArgIniType) 10000 }, - { "pieceToCharTable", ArgString, (void *) &appData.pieceToCharTable, FALSE, INVALID }, - { "pieceNickNames", ArgString, (void *) &appData.pieceNickNames, FALSE, INVALID }, - { "colorNickNames", ArgString, (void *) &appData.colorNickNames, FALSE, INVALID }, - { "flipBlack", ArgBoolean, (void *) &appData.upsideDown, FALSE, (ArgIniType) FALSE }, - { "allWhite", ArgBoolean, (void *) &appData.allWhite, FALSE, (ArgIniType) FALSE }, - { "alphaRank", ArgBoolean, (void *) &appData.alphaRank, FALSE, (ArgIniType) FALSE }, - { "firstAlphaRank", ArgBoolean, (void *) &first.alphaRank, FALSE, (ArgIniType) FALSE }, - { "secondAlphaRank", ArgBoolean, (void *) &second.alphaRank, FALSE, (ArgIniType) FALSE }, - { "testClaims", ArgBoolean, (void *) &appData.testClaims, TRUE, (ArgIniType) FALSE }, - { "checkMates", ArgBoolean, (void *) &appData.checkMates, TRUE, (ArgIniType) FALSE }, - { "materialDraws", ArgBoolean, (void *) &appData.materialDraws, TRUE, (ArgIniType) FALSE }, - { "trivialDraws", ArgBoolean, (void *) &appData.trivialDraws, TRUE, (ArgIniType) FALSE }, - { "ruleMoves", ArgInt, (void *) &appData.ruleMoves, TRUE, (ArgIniType) 51 }, - { "repeatsToDraw", ArgInt, (void *) &appData.drawRepeats, TRUE, (ArgIniType) 6 }, - { "backgroundObserve", ArgBoolean, (void *) &appData.bgObserve, TRUE, (ArgIniType) FALSE }, - { "dualBoard", ArgBoolean, (void *) &appData.dualBoard, TRUE, (ArgIniType) FALSE }, - { "autoKibitz", ArgTrue, (void *) &appData.autoKibitz, FALSE, INVALID }, - { "engineDebugOutput", ArgInt, (void *) &appData.engineComments, FALSE, (ArgIniType) 1 }, - { "userName", ArgString, (void *) &appData.userName, FALSE, INVALID }, - { "rewindIndex", ArgInt, (void *) &appData.rewindIndex, FALSE, INVALID }, - { "sameColorGames", ArgInt, (void *) &appData.sameColorGames, FALSE, INVALID }, - { "smpCores", ArgInt, (void *) &appData.smpCores, TRUE, (ArgIniType) 1 }, - { "egtFormats", ArgString, (void *) &appData.egtFormats, TRUE, (ArgIniType) "" }, - { "niceEngines", ArgInt, (void *) &appData.niceEngines, TRUE, INVALID }, - { "logoSize", ArgInt, (void *) &appData.logoSize, XBOARD, INVALID }, - { "logoDir", ArgFilename, (void *) &appData.logoDir, XBOARD, (ArgIniType) "." }, - { "firstLogo", ArgFilename, (void *) &appData.firstLogo, FALSE, (ArgIniType) "" }, - { "secondLogo", ArgFilename, (void *) &appData.secondLogo, FALSE, (ArgIniType) "" }, - { "autoLogo", ArgBoolean, (void *) &appData.autoLogo, TRUE, INVALID }, - { "firstOptions", ArgString, (void *) &appData.firstOptions, FALSE, (ArgIniType) "" }, - { "secondOptions", ArgString, (void *) &appData.secondOptions, FALSE, (ArgIniType) "" }, - { "firstFeatures", ArgString, (void *) &appData.features[0], FALSE, (ArgIniType) "" }, - { "secondFeatures", ArgString, (void *) &appData.features[1], FALSE, (ArgIniType) "" }, - { "featureDefaults", ArgString, (void *) &appData.featureDefaults, TRUE, (ArgIniType) "" }, - { "firstNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride1, FALSE, (ArgIniType) NULL }, - { "secondNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride2, FALSE, (ArgIniType) NULL }, - { "keepAlive", ArgInt, (void *) &appData.keepAlive, FALSE, INVALID }, - { "icstype", ArgInt, (void *) &ics_type, FALSE, INVALID }, - { "forceIllegalMoves", ArgTrue, (void *) &appData.forceIllegal, FALSE, INVALID }, - { "showTargetSquares", ArgBoolean, (void *) &appData.markers, TRUE, (ArgIniType) FALSE }, - { "firstPgnName", ArgString, (void *) &appData.pgnName[0], FALSE, (ArgIniType) "" }, - { "fn", ArgString, (void *) &appData.pgnName[0], FALSE, INVALID }, - { "secondPgnName", ArgString, (void *) &appData.pgnName[1], FALSE, (ArgIniType) "" }, - { "sn", ArgString, (void *) &appData.pgnName[1], FALSE, INVALID }, - { "absoluteAnalysisScores", ArgBoolean, (void *) &appData.whitePOV, TRUE, FALSE }, - { "scoreWhite", ArgBoolean, (void *) &appData.scoreWhite, TRUE, FALSE }, - { "evalZoom", ArgInt, (void *) &appData.zoom, TRUE, (ArgIniType) 1 }, - { "evalThreshold", ArgInt, (void *) &appData.evalThreshold, TRUE, (ArgIniType) 25 }, - { "firstPseudo", ArgTrue, (void *) &appData.pseudo[0], FALSE, FALSE }, - { "secondPseudo", ArgTrue, (void *) &appData.pseudo[1], FALSE, FALSE }, - { "fSAN", ArgTrue, (void *) &appData.pvSAN[0], FALSE, FALSE }, - { "sSAN", ArgTrue, (void *) &appData.pvSAN[1], FALSE, FALSE }, - { "pairingEngine", ArgFilename, (void *) &appData.pairingEngine, TRUE, "" }, - { "defaultTourneyName", ArgFilename, (void *) &appData.defName, TRUE, "" }, - { "eloThresholdAny", ArgInt, (void *) &appData.eloThreshold1, FALSE, (ArgIniType) 0 }, - { "eloThresholdBoth", ArgInt, (void *) &appData.eloThreshold2, FALSE, (ArgIniType) 0 }, - { "dateThreshold", ArgInt, (void *) &appData.dateThreshold, FALSE, (ArgIniType) 0 }, - { "searchMode", ArgInt, (void *) &appData.searchMode, FALSE, (ArgIniType) 1 }, - { "stretch", ArgInt, (void *) &appData.stretch, FALSE, (ArgIniType) 1 }, - { "ignoreColors", ArgBoolean, (void *) &appData.ignoreColors, FALSE, FALSE }, - { "findMirrorImage", ArgBoolean, (void *) &appData.findMirror, FALSE, FALSE }, - { "viewer", ArgTrue, (void *) &appData.viewer, FALSE, FALSE }, - { "viewerOptions", ArgString, (void *) &appData.viewerOptions, TRUE, (ArgIniType) "-ncp -engineOutputUp false -saveSettingsOnExit false" }, - { "tourneyOptions", ArgString, (void *) &appData.tourneyOptions, TRUE, (ArgIniType) "-ncp -mm -saveSettingsOnExit false" }, - { "autoCopyPV", ArgBoolean, (void *) &appData.autoCopyPV, TRUE, FALSE }, - { "topLevel", ArgBoolean, (void *) &appData.topLevel, XBOARD, (ArgIniType) TOPLEVEL }, - { "dialogColor", ArgString, (void *) &appData.dialogColor, XBOARD, (ArgIniType) "" }, - { "buttonColor", ArgString, (void *) &appData.buttonColor, XBOARD, (ArgIniType) "" }, - { "firstDrawDepth", ArgInt, (void *) &appData.drawDepth[0], FALSE, (ArgIniType) 0 }, - { "secondDrawDepth", ArgInt, (void *) &appData.drawDepth[1], FALSE, (ArgIniType) 0 }, - { "memoHeaders", ArgBoolean, (void *) &appData.headers, TRUE, (ArgIniType) FALSE }, - { "startupMessage", ArgString, (void *) &appData.message, FALSE, (ArgIniType) "" }, - { "messageSuppress", ArgString, (void *) &appData.suppress, XBOARD, (ArgIniType) "" }, - { "fen", ArgString, (void *) &appData.fen, FALSE, (ArgIniType) "" }, - { "men", ArgString, (void *) &appData.men, FALSE, (ArgIniType) "" }, - { "analysisBell", ArgInt, (void *) &appData.analysisBell, TRUE, (ArgIniType) 0 }, - -#if ZIPPY - { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, - { "zt", ArgTrue, (void *) &appData.zippyTalk, FALSE, INVALID }, - { "xzt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID }, - { "-zt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID }, - { "zippyPlay", ArgBoolean, (void *) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY }, - { "zp", ArgTrue, (void *) &appData.zippyPlay, FALSE, INVALID }, - { "xzp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID }, - { "-zp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID }, - { "zippyLines", ArgFilename, (void *) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES }, - { "zippyPinhead", ArgString, (void *) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD }, - { "zippyPassword", ArgString, (void *) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD }, - { "zippyPassword2", ArgString, (void *) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 }, - { "zippyWrongPassword", ArgString, (void *) &appData.zippyWrongPassword, - FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD }, - { "zippyAcceptOnly", ArgString, (void *) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY }, - { "zippyUseI", ArgBoolean, (void *) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I }, - { "zui", ArgTrue, (void *) &appData.zippyUseI, FALSE, INVALID }, - { "xzui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID }, - { "-zui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID }, - { "zippyBughouse", ArgInt, (void *) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE }, - { "zippyNoplayCrafty", ArgBoolean, (void *) &appData.zippyNoplayCrafty, - FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY }, - { "znc", ArgTrue, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "xznc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "-znc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "zippyGameEnd", ArgString, (void *) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END }, - { "zippyGameStart", ArgString, (void *) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START }, - { "zippyAdjourn", ArgBoolean, (void *) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN }, - { "zadj", ArgTrue, (void *) &appData.zippyAdjourn, FALSE, INVALID }, - { "xzadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID }, - { "-zadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID }, - { "zippyAbort", ArgBoolean, (void *) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT }, - { "zab", ArgTrue, (void *) &appData.zippyAbort, FALSE, INVALID }, - { "xzab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID }, - { "-zab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID }, - { "zippyVariants", ArgString, (void *) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS }, - { "zippyMaxGames", ArgInt, (void *)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES}, - { "zippyReplayTimeout", ArgInt, (void *)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT }, - { "zippyShortGame", ArgInt, (void *)&appData.zippyShortGame, FALSE, INVALID }, - /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ - { "zippyReplyTimeout", ArgInt, (void *)&junk, FALSE, INVALID }, -#endif - /* [HGM] options for broadcasting and time odds */ - { "chatBoxes", ArgString, (void *) &appData.chatBoxes, !XBOARD, (ArgIniType) NULL }, - { "serverMoves", ArgString, (void *) &appData.serverMovesName, FALSE, (ArgIniType) NULL }, - { "serverFile", ArgString, (void *) &appData.serverFileName, FALSE, (ArgIniType) NULL }, - { "suppressLoadMoves", ArgBoolean, (void *) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE }, - { "serverPause", ArgInt, (void *) &appData.serverPause, FALSE, (ArgIniType) 15 }, - { "firstTimeOdds", ArgInt, (void *) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 }, - { "secondTimeOdds", ArgInt, (void *) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 }, - { "timeOddsMode", ArgInt, (void *) &appData.timeOddsMode, TRUE, INVALID }, - { "firstAccumulateTC", ArgInt, (void *) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 }, - { "secondAccumulateTC", ArgInt, (void *) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 }, - { "firstNPS", ArgInt, (void *) &appData.firstNPS, FALSE, (ArgIniType) -1 }, - { "secondNPS", ArgInt, (void *) &appData.secondNPS, FALSE, (ArgIniType) -1 }, - { "noGUI", ArgTrue, (void *) &appData.noGUI, FALSE, INVALID }, - { "keepLineBreaksICS", ArgBoolean, (void *) &appData.noJoin, TRUE, INVALID }, - { "wrapContinuationSequence", ArgString, (void *) &appData.wrapContSeq, FALSE, INVALID }, - { "useInternalWrap", ArgTrue, (void *) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */ - { "openCommand", ArgString, (void *) &appData.sysOpen, FALSE, "xdg-open" }, - - // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others - { "minX", ArgZ, (void *) &minX, FALSE, INVALID }, // [HGM] placement: to make sure auxiliary windows can be placed - { "minY", ArgZ, (void *) &minY, FALSE, INVALID }, - { "winWidth", ArgInt, (void *) &wpMain.width, TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom - { "winHeight", ArgInt, (void *) &wpMain.height, TRUE, INVALID }, // for attaching auxiliary windows to them - { "x", ArgInt, (void *) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "y", ArgInt, (void *) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsUp", ArgBoolean, (void *) &wpConsole.visible, XBOARD, (ArgIniType) FALSE }, - { "icsX", ArgX, (void *) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsY", ArgY, (void *) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsW", ArgInt, (void *) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsH", ArgInt, (void *) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentX", ArgX, (void *) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentY", ArgY, (void *) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentW", ArgInt, (void *) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentH", ArgInt, (void *) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsX", ArgX, (void *) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsY", ArgY, (void *) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsW", ArgInt, (void *) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsH", ArgInt, (void *) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListX", ArgX, (void *) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListY", ArgY, (void *) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListW", ArgInt, (void *) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListH", ArgInt, (void *) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT }, -#if XBOARD - { "slaveX", ArgX, (void *) &wpDualBoard.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "slaveY", ArgY, (void *) &wpDualBoard.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "slaveW", ArgInt, (void *) &wpDualBoard.width, FALSE, (ArgIniType) CW_USEDEFAULT }, - { "slaveH", ArgInt, (void *) &wpDualBoard.height, FALSE, (ArgIniType) CW_USEDEFAULT }, -#endif - /* [AS] Layout stuff */ - { "moveHistoryUp", ArgBoolean, (void *) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE }, - { "moveHistoryX", ArgX, (void *) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryY", ArgY, (void *) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryW", ArgInt, (void *) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryH", ArgInt, (void *) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { "evalGraphUp", ArgBoolean, (void *) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE }, - { "evalGraphX", ArgX, (void *) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphY", ArgY, (void *) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphW", ArgInt, (void *) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphH", ArgInt, (void *) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { "engineOutputUp", ArgBoolean, (void *) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE }, - { "engineOutputX", ArgX, (void *) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputY", ArgY, (void *) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputW", ArgInt, (void *) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputH", ArgInt, (void *) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { NULL, ArgNone, NULL, FALSE, INVALID } -}; - - -/* Kludge for indirection files on command line */ -char* lastIndirectionFilename; -ArgDescriptor argDescriptorIndirection = -{ "", ArgSettingsFilename, (void *) NULL, FALSE }; - -void -ExitArgError(char *msg, char *badArg, Boolean quit) -{ - char buf[MSG_SIZ]; - int len; - - len = snprintf(buf, MSG_SIZ, msg, badArg); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "ExitArgError: buffer truncated. Input: msg=%s badArg=%s\n", msg, badArg); - - if(!quit) { printf(_("%s in settings file\n"), buf); return; } // DisplayError does not work yet at this stage... - DisplayFatalError(buf, 0, 2); - exit(2); -} - -void -AppendToSettingsFile (char *line) -{ - char buf[MSG_SIZ]; - FILE *f; - int c; - if(f = fopen(SETTINGS_FILE, "r")) { - do { - int i = 0; - while((buf[i] = c = fgetc(f)) != '\n' && c != EOF) if(i < MSG_SIZ-1) i++; - buf[i] = NULLCHAR; - if(!strcmp(line, buf)) return; // line occurs - } while(c != EOF); - // line did not occur; add it - fclose(f); - if(f = fopen(SETTINGS_FILE, "a")) { - TimeMark now; - GetTimeMark(&now); - fprintf(f, "-date %10lu\n%s\n", now.sec, line); - fclose(f); - } - } -} - -int -ValidateInt(char *s) -{ - char *p = s; - if(*p == '-' || *p == '+') p++; - while(*p) if(!isdigit(*p++)) ExitArgError(_("Bad integer value %s"), s, TRUE); - return atoi(s); -} - -char -StringGet(void *getClosure) -{ - char **p = (char **) getClosure; - return *((*p)++); -} - -char -FileGet(void *getClosure) -{ - int c; - FILE* f = (FILE*) getClosure; - - c = getc(f); - if (c == '\r') c = getc(f); // work around DOS format files by bypassing the '\r' completely - if (c == EOF) - return NULLCHAR; - else - return (char) c; -} - -/* Parse settings file named "name". If file found, return the - full name in fullname and return TRUE; else return FALSE */ -Boolean -ParseSettingsFile(char *name, char **addr) -{ - FILE *f; - int ok,len; - char buf[MSG_SIZ], fullname[MSG_SIZ]; - - - ok = MySearchPath(installDir, name, fullname); - if(!ok && strchr(name, '.') == NULL) - { // append default file-name extension '.ini' when needed - len = snprintf(buf,MSG_SIZ, "%s.ini", name); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "ParseSettingsFile: buffer truncated. Input: name=%s \n",name); - - ok = MySearchPath(installDir, buf, fullname); - } - if (ok) { - f = fopen(fullname, "r"); -#ifdef DATADIR - if(f == NULL && *fullname != '/' && !addr) { // when a relative name did not work - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "~/.xboard/themes/conf/%s", name); - MySearchPath(installDir, buf, fullname); // first look in user's own files - f = fopen(fullname, "r"); - if(f == NULL) { - snprintf(buf, MSG_SIZ, "%s/themes/conf", dataDir); - MySearchPath(buf, name, fullname); // also look in standard place - f = fopen(fullname, "r"); - } - } -#endif - if (f != NULL) { - if (addr != NULL) { - ASSIGN(*addr, fullname); - } - ParseArgs(FileGet, f); - fclose(f); - return TRUE; - } - } - return FALSE; -} - -void -ParseArgs(GetFunc get, void *cl) -{ - char argName[MAX_ARG_LEN]; - char argValue[MAX_ARG_LEN]; - ArgDescriptor *ad; - char start; - char *q; - int i, octval; - char ch; - int posarg = 4; // default is game file - - ch = get(cl); - for (;;) { - int posflag = 0; - while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR) break; - if (ch == ';') { - /* Comment to end of line */ - ch = get(cl); - while (ch != '\n' && ch != NULLCHAR) ch = get(cl); - continue; - } else if (ch == SLASH || ch == '-') { - /* Switch */ - q = argName; - while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR && - ch != '\n' && ch != '\t') { - *q++ = ch; - ch = get(cl); - } - *q = NULLCHAR; - for (ad = argDescriptors; ad->argName != NULL; ad++) - if (strcmp(ad->argName, argName + 1) == 0) break; - if (ad->argName == NULL) { - char endChar = (ch && ch != '\n' && (ch = get(cl)) == '{' ? '}' : '\n'); - ExitArgError(_("Unrecognized argument %s"), argName, get != &FileGet); // [HGM] make unknown argument non-fatal - while (ch != endChar && ch != NULLCHAR) ch = get(cl); // but skip rest of line it is on (or until closing '}' ) - if(ch == '}') ch = get(cl); - continue; // so that when it is in a settings file, it is the only setting that will be purged from it - } - } else if (ch == '@') { - /* Indirection file */ - ad = &argDescriptorIndirection; - ch = get(cl); - } else { - /* Positional argument */ - ad = &argDescriptors[posarg++]; - posflag++; - strncpy(argName, ad->argName,sizeof(argName)/sizeof(argName[0])); - } - - if (ad->argType == ArgTwo) { // [HGM] kludgey arg type, not suitable for saving - *(Boolean *) ad->argLoc = 2; - continue; - } - if (ad->argType == ArgTrue) { - *(Boolean *) ad->argLoc = TRUE; - continue; - } - if (ad->argType == ArgFalse) { - *(Boolean *) ad->argLoc = FALSE; - continue; - } - - while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR || ch == '\n') { - ExitArgError(_("No value provided for argument %s"), argName, TRUE); - } - q = argValue; - if (ch == '{') { - // Quoting with { }. No characters have to (or can) be escaped. - // Thus the string cannot contain a '}' character. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - case '}': - ch = get(cl); - start = NULLCHAR; - break; - - default: - *q++ = ch; - ch = get(cl); - break; - } - } - } else if (ch == '\'' || ch == '"') { - // Quoting with ' ' or " ", with \ as escape character. - // Inconvenient for long strings that may contain Windows filenames. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - default: - not_special: - *q++ = ch; - ch = get(cl); - break; - - case '\'': - case '\"': - if (ch == start) { - ch = get(cl); - start = NULLCHAR; - break; - } else { - goto not_special; - } - - case '\\': - if (ad->argType == ArgFilename - || ad->argType == ArgSettingsFilename) { - goto not_special; - } - ch = get(cl); - switch (ch) { - case NULLCHAR: - ExitArgError(_("Incomplete \\ escape in value for %s"), argName, TRUE); - break; - case 'n': - *q++ = '\n'; - ch = get(cl); - break; - case 'r': - *q++ = '\r'; - ch = get(cl); - break; - case 't': - *q++ = '\t'; - ch = get(cl); - break; - case 'b': - *q++ = '\b'; - ch = get(cl); - break; - case 'f': - *q++ = '\f'; - ch = get(cl); - break; - default: - octval = 0; - for (i = 0; i < 3; i++) { - if (ch >= '0' && ch <= '7') { - octval = octval*8 + (ch - '0'); - ch = get(cl); - } else { - break; - } - } - if (i > 0) { - *q++ = (char) octval; - } else { - *q++ = ch; - ch = get(cl); - } - break; - } - break; - } - } - } else { - while ((ch != ' ' || posflag) && ch != NULLCHAR && ch != '\t' && ch != '\n') { // space allowed in positional arg - *q++ = ch; - ch = get(cl); - } - } - *q = NULLCHAR; - - if(posflag) { // positional argument: the argName was implied, and per default set as -lgf - int len = strlen(argValue) - 4; // start of filename extension - if(len < 0) len = 0; - if(!StrCaseCmp(argValue + len, ".trn")) { - ad = &argDescriptors[2]; // correct implied type to -tf - appData.tourney = TRUE; // let it parse -tourneyOptions later - } else if(!StrCaseCmp(argValue + len, ".fen") || !StrCaseCmp(argValue + len, ".epd")) { - ad = &argDescriptors[1]; // correct implied type to -lpf - appData.viewer = TRUE; - } else if(!StrCaseCmp(argValue + len, ".ini") || !StrCaseCmp(argValue + len, ".xop")) { - ad = &argDescriptors[0]; // correct implied type to -opt - } else if(GetEngineLine(argValue, 11)) { - ad = &argDescriptors[3]; // correct implied type to -is - } else { // keep default -lgf, but let it imply viewer mode as well - appData.viewer = TRUE; - } - strncpy(argName, ad->argName,sizeof(argName)/sizeof(argName[0])); - } - - switch (ad->argType) { - case ArgInt: - *(int *) ad->argLoc = ValidateInt(argValue); - break; - - case ArgX: - *(int *) ad->argLoc = ValidateInt(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute - break; - - case ArgY: - *(int *) ad->argLoc = ValidateInt(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...) - break; - - case ArgZ: - *(int *) ad->argLoc = ValidateInt(argValue); - EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); - break; - - case ArgFloat: - *(float *) ad->argLoc = (float) atof(argValue); - break; - - case ArgString: - case ArgFilename: - if(argValue[0] == '~' && argValue[1] == '~') { - char buf[4*MSG_SIZ]; // expand ~~ - snprintf(buf, 4*MSG_SIZ, "%s%s", dataDir, argValue+2); - ASSIGN(*(char **) ad->argLoc, buf); - break; - } - ASSIGN(*(char **) ad->argLoc, argValue); - break; - - case ArgBackupSettingsFile: // no-op if non-default settings-file already successfully read - if(strcmp(*(char**)ad->argLoc, SETTINGS_FILE)) break; - case ArgSettingsFilename: - { - if (ParseSettingsFile(argValue, (char**)ad->argLoc)) { - } else { - if (ad->argLoc != NULL) { - } else { - ExitArgError(_("Failed to open indirection file %s"), argValue, TRUE); - } - } - } - break; - - case ArgBoolean: - switch (argValue[0]) { - case 't': - case 'T': - *(Boolean *) ad->argLoc = TRUE; - break; - case 'f': - case 'F': - *(Boolean *) ad->argLoc = FALSE; - break; - default: - ExitArgError(_("Unrecognized boolean argument value %s"), argValue, TRUE); - break; - } - break; - - case ArgColor: - ParseColor((int)(intptr_t)ad->argLoc, argValue); - break; - - case ArgAttribs: { - ColorClass cc = (ColorClass)ad->argLoc; - ParseTextAttribs(cc, argValue); // [HGM] wrapper for platform independency - } - break; - - case ArgBoardSize: - ParseBoardSize(ad->argLoc, argValue); - break; - - case ArgFont: - ParseFont(argValue, (int)(intptr_t)ad->argLoc); - break; - - case ArgCommSettings: - ParseCommPortSettings(argValue); - break; - - case ArgMaster: - AppendToSettingsFile(argValue); - break; - - case ArgInstall: - q = *(char **) ad->argLoc; - if((saveDate == 0 || saveDate - dateStamp < 0) && !strstr(q, argValue) ) { - int l = strlen(q) + strlen(argValue); - *(char **) ad->argLoc = malloc(l+2); - snprintf(*(char **) ad->argLoc, l+2, "%s%s\n", q, argValue); - free(q); - } - break; - - case ArgNone: - ExitArgError(_("Unrecognized argument %s"), argValue, TRUE); - break; - case ArgTwo: - case ArgTrue: - case ArgFalse: ; - } - } -} - -void -ParseArgsFromString(char *p) -{ - ParseArgs(StringGet, &p); -} - -void -ParseArgsFromFile(FILE *f) -{ - ParseArgs(FileGet, f); -} - -void -ParseIcsTextMenu(char *icsTextMenuString) -{ -// int flags = 0; - IcsTextMenuEntry *e = icsTextMenuEntry; - char *p = icsTextMenuString; - while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - free(e->item); - e->item = NULL; - if (e->command != NULL) { - free(e->command); - e->command = NULL; - } - e++; - } - e = icsTextMenuEntry; - while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - if (*p == ';' || *p == '\n') { - e->item = strdup("-"); - e->command = NULL; - p++; - } else if (*p == '-') { - e->item = strdup("-"); - e->command = NULL; - p++; - if (*p) p++; - } else { - char *q, *r, *s, *t; - char c; - q = strchr(p, ','); - if (q == NULL) break; - *q = NULLCHAR; - r = strchr(q + 1, ','); - if (r == NULL) break; - *r = NULLCHAR; - s = strchr(r + 1, ','); - if (s == NULL) break; - *s = NULLCHAR; - c = ';'; - t = strchr(s + 1, c); - if (t == NULL) { - c = '\n'; - t = strchr(s + 1, c); - } - if (t != NULL) *t = NULLCHAR; - e->item = strdup(p); - e->command = strdup(q + 1); - e->getname = *(r + 1) != '0'; - e->immediate = *(s + 1) != '0'; - *q = ','; - *r = ','; - *s = ','; - if (t == NULL) break; - *t = c; - p = t + 1; - } - e++; - } -} - -void -SetDefaultTextAttribs() -{ - ColorClass cc; - for (cc = (ColorClass)0; cc < ColorNone; cc++) { - ParseTextAttribs(cc, defaultTextAttribs[cc]); - } -} - -void -SetDefaultsFromList() -{ // [HGM] ini: take defaults from argDescriptor list - int i; - - for(i=0; argDescriptors[i].argName != NULL; i++) { - if(argDescriptors[i].defaultValue != INVALID) - switch(argDescriptors[i].argType) { - case ArgBoolean: - case ArgTwo: - case ArgTrue: - case ArgFalse: - *(Boolean *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue; - break; - case ArgInt: - case ArgX: - case ArgY: - case ArgZ: - *(int *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue; - break; - case ArgString: - case ArgFilename: - case ArgSettingsFilename: - if((char *)argDescriptors[i].defaultValue) - *(char **) argDescriptors[i].argLoc = strdup((char *)argDescriptors[i].defaultValue); - break; - case ArgBoardSize: - *(int *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue; - break; - case ArgColor: - ParseColor((int)(intptr_t)argDescriptors[i].argLoc, (char*)argDescriptors[i].defaultValue); - break; - case ArgFloat: // floats cannot be casted to int without precision loss - default: ; // some arg types cannot be initialized through table - } - } -} - -void -InitAppData(char *lpCmdLine) -{ - int i; - char buf[MAX_ARG_LEN], currDir[MSG_SIZ]; - char *p; - - /* Initialize to defaults */ - SetDefaultsFromList(); // this sets most defaults - - // some parameters for which there are no options! - appData.Iconic = FALSE; /*unused*/ - appData.icsEngineAnalyze = FALSE; - - // float: casting to int is not harmless, so default cannot be contained in table - appData.timeDelay = TIME_DELAY; - appData.timeIncrement = -314159; - - // some complex, platform-dependent stuff that could not be handled from table - SetDefaultTextAttribs(); - SetFontDefaults(); - SetCommPortDefaults(); - - /* Parse default settings file if any */ - ParseSettingsFile(settingsFileName, &settingsFileName); - - /* Parse command line */ - ParseArgs(StringGet, &lpCmdLine); - - if(appData.viewer && appData.viewerOptions[0]) ParseArgsFromString(appData.viewerOptions); - if(appData.tourney && appData.tourneyOptions[0]) ParseArgsFromString(appData.tourneyOptions); - chessProgram |= GetEngineLine(firstEngineLine, 0) || GetEngineLine(secondEngineLine, 1); - appData.icsActive |= GetEngineLine(icsNick, 10); - - /* [HGM] make sure board size is acceptable */ - if(appData.NrFiles > BOARD_FILES || - appData.NrRanks > BOARD_RANKS ) - DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2); - - if(!*appData.secondChessProgram) { // [HGM] scp defaults to fcp - ASSIGN(appData.secondChessProgram, appData.firstChessProgram); - ASSIGN(appData.secondDirectory, appData.firstDirectory); - appData.secondIsUCI = appData.firstIsUCI; // copy type too! - } - - /* [HGM] After parsing the options from the .ini file, and overruling them - * with options from the command line, we now make an even higher priority - * overrule by WB options attached to the engine command line. This so that - * tournament managers can use WB options (such as /timeOdds) that follow - * the engines. - */ - if(appData.firstChessProgram != NULL) { - char *p = StrStr(appData.firstChessProgram, "WBopt"); - static char *f = "first"; - char buf[MSG_SIZ], *q = buf; - int len; - - if(p != NULL) - { // engine command line contains WinBoard options - len = snprintf(buf, MSG_SIZ, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitAppData: buffer truncated.\n"); - - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - // now do same for second chess program - if(appData.secondChessProgram != NULL) { - char *p = StrStr(appData.secondChessProgram, "WBopt"); - static char *s = "second"; - char buf[MSG_SIZ], *q = buf; - int len; - - if(p != NULL) - { // engine command line contains WinBoard options - len = snprintf(buf,MSG_SIZ, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitAppData: buffer truncated.\n"); - - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - - /* Propagate options that affect others */ - if (appData.matchMode || appData.matchGames) chessProgram = TRUE; - if (appData.icsActive || appData.noChessProgram) { - chessProgram = FALSE; /* not local chess program mode */ - } - if(appData.timeIncrement == -314159) { // new storage mechanism of (mps,inc) in use and no -inc on command line - if(appData.movesPerSession <= 0) { // new encoding of incremental mode - appData.timeIncrement = -appData.movesPerSession/1000.; - } else appData.timeIncrement = -1; - } - if(appData.movesPerSession <= 0) appData.movesPerSession = MOVES_PER_SESSION; // mps <= 0 is invalid in any case - if(*appData.defaultPathEGTB) { // append value of deprecated -defaultPathEGTB to -egtFormats - snprintf(buf, MAX_ARG_LEN, "%s%snalimov:%s", appData.egtFormats, (*appData.egtFormats ?"," : ""), appData.defaultPathEGTB); - ASSIGN(appData.egtFormats, buf); - ASSIGN(appData.defaultPathEGTB, ""); - } - - /* Open startup dialog if needed */ - if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || - (appData.icsActive && *appData.icsHost == NULLCHAR) || - (chessProgram && (*appData.firstChessProgram == NULLCHAR || - *appData.secondChessProgram == NULLCHAR))) - PopUpStartupDialog(); - - /* Make sure save files land in the right (?) directory */ - if (MyGetFullPathName(appData.saveGameFile, buf)) { - appData.saveGameFile = strdup(buf); - } - if (MyGetFullPathName(appData.savePositionFile, buf)) { - appData.savePositionFile = strdup(buf); - } - - if(autoClose) { // was called for updating settingsfile only - if(saveSettingsOnExit) SaveSettings(settingsFileName); - exit(0); - } - - /* Finish initialization for fonts and sounds */ - CreateFonts(); - - GetCurrentDirectory(MSG_SIZ, currDir); - SetCurrentDirectory(installDir); - LoadAllSounds(); - SetCurrentDirectory(currDir); - - p = icsTextMenuString; - if (p[0] == '@') { - FILE* f = fopen(p + 1, "r"); - if (f == NULL) { - DisplayFatalError(p + 1, errno, 2); - return; - } - i = fread(buf, 1, sizeof(buf)-1, f); - fclose(f); - buf[i] = NULLCHAR; - p = buf; - } - ParseIcsTextMenu(strdup(p)); -} - -void -SaveSettings(char* name) -{ - FILE *f; - ArgDescriptor *ad; - char dir[MSG_SIZ], buf[MSG_SIZ]; - int mps = appData.movesPerSession; - TimeMark now; - - if (!MainWindowUp() && !autoClose) return; - - GetTimeMark(&now); saveDate = now.sec; - - GetCurrentDirectory(MSG_SIZ, dir); - if(MySearchPath(installDir, name, buf)) { - f = fopen(buf, "w"); - } else { - SetCurrentDirectory(installDir); - f = fopen(name, "w"); - SetCurrentDirectory(dir); - } - if (f == NULL) { - DisplayError(name, errno); - return; - } - - fprintf(f, ";\n"); - fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING); - fprintf(f, ";\n"); - fprintf(f, "; You can edit the values of options that are already set in this file,\n"); - fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n"); - fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n"); - fprintf(f, ";\n"); - - GetWindowCoords(); - - /* [AS] Move history */ - wpMoveHistory.visible = MoveHistoryIsUp(); - - /* [AS] Eval graph */ - wpEvalGraph.visible = EvalGraphIsUp(); - - /* [AS] Engine output */ - wpEngineOutput.visible = EngineOutputIsUp(); - - // [HGM] in WB we have to copy sound names to appData first - ExportSounds(); - - if(appData.timeIncrement >= 0) appData.movesPerSession = -1000*appData.timeIncrement; // kludge to store mps & inc as one - - for (ad = argDescriptors; ad->argName != NULL; ad++) { - if (!ad->save) continue; - switch (ad->argType) { - case ArgString: - { - char *p = *(char **)ad->argLoc; - if(p == NULL) break; // just in case - if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { - /* Quote multiline values or \-containing values - with { } if possible */ - fprintf(f, OPTCHAR "%s" SEPCHAR "{%s}\n", ad->argName, p); - } else { - /* Else quote with " " */ - fprintf(f, OPTCHAR "%s" SEPCHAR "\"", ad->argName); - while (*p) { - if (*p == '\n') fprintf(f, "\n"); - else if (*p == '\r') fprintf(f, "\\r"); - else if (*p == '\t') fprintf(f, "\\t"); - else if (*p == '\b') fprintf(f, "\\b"); - else if (*p == '\f') fprintf(f, "\\f"); - else if (*p < ' ') fprintf(f, "\\%03o", *p); - else if (*p == '\"') fprintf(f, "\\\""); - else if (*p == '\\') fprintf(f, "\\\\"); - else putc(*p, f); - p++; - } - fprintf(f, "\"\n"); - } - } - break; - case ArgInt: - case ArgZ: - fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc); - break; - case ArgX: - fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: store relative value - break; - case ArgY: - fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y); - break; - case ArgFloat: - fprintf(f, OPTCHAR "%s" SEPCHAR "%g\n", ad->argName, *(float *)ad->argLoc); - break; - case ArgBoolean: - fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, - (*(Boolean *)ad->argLoc) ? "true" : "false"); - break; - case ArgTrue: - if (*(Boolean *)ad->argLoc) fprintf(f, OPTCHAR "%s\n", ad->argName); - break; - case ArgFalse: - if (!*(Boolean *)ad->argLoc) fprintf(f, OPTCHAR "%s\n", ad->argName); - break; - case ArgColor: - SaveColor(f, ad); - break; - case ArgAttribs: - SaveAttribsArg(f, ad); - break; - case ArgFilename: - if(*(char**)ad->argLoc == NULL) break; // just in case - { char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%s", *(char**)ad->argLoc); -#ifdef OSXAPP - if(strstr(buf, dataDir) == buf) - snprintf(buf, MSG_SIZ, "~~%s", *(char**)ad->argLoc + strlen(dataDir)); -#endif - if (strchr(buf, '\"')) { - fprintf(f, OPTCHAR "%s" SEPCHAR "'%s'\n", ad->argName, buf); - } else { - fprintf(f, OPTCHAR "%s" SEPCHAR "\"%s\"\n", ad->argName, buf); - } - } - break; - case ArgBoardSize: - SaveBoardSize(f, ad->argName, ad->argLoc); - break; - case ArgFont: - SaveFontArg(f, ad); - break; - case ArgCommSettings: - PrintCommPortSettings(f, ad->argName); - case ArgTwo: - case ArgNone: - case ArgBackupSettingsFile: - case ArgSettingsFilename: ; - case ArgMaster: ; - case ArgInstall: ; - } - } - fclose(f); - appData.movesPerSession = mps; -} - -Boolean -GetArgValue(char *name) -{ // retrieve (as text) current value of string or int argument given by name - // (this is used for maing the values available in the adapter command) - ArgDescriptor *ad; - int len; - - for (ad = argDescriptors; ad->argName != NULL; ad++) - if (strcmp(ad->argName, name) == 0) break; - - if (ad->argName == NULL) return FALSE; - - switch(ad->argType) { - case ArgString: - case ArgFilename: - strncpy(name, *(char**) ad->argLoc, MSG_SIZ); - - return TRUE; - case ArgInt: - len = snprintf(name, MSG_SIZ, "%d", *(int*) ad->argLoc); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "GetArgValue: buffer truncated.\n"); - - return TRUE; - case ArgBoolean: - len = snprintf(name, MSG_SIZ, "%s", *(Boolean*) ad->argLoc ? "true" : "false"); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "GetArgValue: buffer truncated.\n"); - - return TRUE; - default: ; - } - - return FALSE; -} diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 82260c8..0000000 --- a/autogen.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh - -# This file is part of GNU XBoard. -# -# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free -# Software Foundation, Inc. -# -# GNU XBoard is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or (at -# your option) any later version. -# -# GNU XBoard is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -# See the file ChangeLog for a revision history. - -autopoint \ -&& aclocal -I m4 \ -&& autoheader \ -&& automake --add-missing \ -&& autoconf diff --git a/backend.c b/backend.c deleted file mode 100644 index ac29d58..0000000 --- a/backend.c +++ /dev/null @@ -1,19075 +0,0 @@ -/* - * backend.c -- Common back end for X and Windows NT versions of - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * Enhancements Copyright 2005 Alessandro Scotti - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -/* [AS] Also useful here for debugging */ -#ifdef WIN32 -#include - - int flock(int f, int code); -# define LOCK_EX 2 -# define SLASH '\\' - -# ifdef ARC_64BIT -# define EGBB_NAME "egbbdll64.dll" -# else -# define EGBB_NAME "egbbdll.dll" -# endif - -#else - -# include -# define SLASH '/' - -# include -# ifdef ARC_64BIT -# define EGBB_NAME "egbbso64.so" -# else -# define EGBB_NAME "egbbso.so" -# endif - // kludge to allow Windows code in back-end by converting it to corresponding Linux code -# define CDECL -# define HMODULE void * -# define LoadLibrary(x) dlopen(x, RTLD_LAZY) -# define GetProcAddress dlsym - -#endif - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -# include -#else /* not STDC_HEADERS */ -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if HAVE_SYS_FCNTL_H -# include -#else /* not HAVE_SYS_FCNTL_H */ -# if HAVE_FCNTL_H -# include -# endif /* HAVE_FCNTL_H */ -#endif /* not HAVE_SYS_FCNTL_H */ - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#if defined(_amigados) && !defined(__GNUC__) -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; -extern int gettimeofday(struct timeval *, struct timezone *); -#endif - -#if HAVE_UNISTD_H -# include -#endif - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "parser.h" -#include "moves.h" -#if ZIPPY -# include "zippy.h" -#endif -#include "backendz.h" -#include "evalgraph.h" -#include "engineoutput.h" -#include "gettext.h" - -#ifdef ENABLE_NLS -# define _(s) gettext (s) -# define N_(s) gettext_noop (s) -# define T_(s) gettext(s) -#else -# ifdef WIN32 -# define _(s) T_(s) -# define N_(s) s -# else -# define _(s) (s) -# define N_(s) s -# define T_(s) s -# endif -#endif - - -int establish P((void)); -void read_from_player P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); -void read_from_ics P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); -void SendToICS P((char *s)); -void SendToICSDelayed P((char *s, long msdelay)); -void SendMoveToICS P((ChessMove moveType, int fromX, int fromY, int toX, int toY, char promoChar)); -void HandleMachineMove P((char *message, ChessProgramState *cps)); -int AutoPlayOneMove P((void)); -int LoadGameOneMove P((ChessMove readAhead)); -int LoadGameFromFile P((char *filename, int n, char *title, int useList)); -int LoadPositionFromFile P((char *filename, int n, char *title)); -int SavePositionToFile P((char *filename)); -void MakeMove P((int fromX, int fromY, int toX, int toY, int promoChar)); -void ShowMove P((int fromX, int fromY, int toX, int toY)); -int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, - /*char*/int promoChar)); -void BackwardInner P((int target)); -void ForwardInner P((int target)); -int Adjudicate P((ChessProgramState *cps)); -void GameEnds P((ChessMove result, char *resultDetails, int whosays)); -void EditPositionDone P((Boolean fakeRights)); -void PrintOpponents P((FILE *fp)); -void PrintPosition P((FILE *fp, int move)); -void SendToProgram P((char *message, ChessProgramState *cps)); -void SendMoveToProgram P((int moveNum, ChessProgramState *cps)); -void ReceiveFromProgram P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); -void SendTimeControl P((ChessProgramState *cps, - int mps, long tc, int inc, int sd, int st)); -char *TimeControlTagValue P((void)); -void Attention P((ChessProgramState *cps)); -void FeedMovesToProgram P((ChessProgramState *cps, int upto)); -int ResurrectChessProgram P((void)); -void DisplayComment P((int moveNumber, char *text)); -void DisplayMove P((int moveNumber)); - -void ParseGameHistory P((char *game)); -void ParseBoard12 P((char *string)); -void KeepAlive P((void)); -void StartClocks P((void)); -void SwitchClocks P((int nr)); -void StopClocks P((void)); -void ResetClocks P((void)); -char *PGNDate P((void)); -void SetGameInfo P((void)); -int RegisterMove P((void)); -void MakeRegisteredMove P((void)); -void TruncateGame P((void)); -int looking_at P((char *, int *, char *)); -void CopyPlayerNameIntoFileName P((char **, char *)); -char *SavePart P((char *)); -int SaveGameOldStyle P((FILE *)); -int SaveGamePGN P((FILE *)); -int CheckFlags P((void)); -long NextTickLength P((long)); -void CheckTimeControl P((void)); -void show_bytes P((FILE *, char *, int)); -int string_to_rating P((char *str)); -void ParseFeatures P((char* args, ChessProgramState *cps)); -void InitBackEnd3 P((void)); -void FeatureDone P((ChessProgramState* cps, int val)); -void InitChessProgram P((ChessProgramState *cps, int setup)); -void OutputKibitz(int window, char *text); -int PerpetualChase(int first, int last); -int EngineOutputIsUp(); -void InitDrawingSizes(int x, int y); -void NextMatchGame P((void)); -int NextTourneyGame P((int nr, int *swap)); -int Pairing P((int nr, int nPlayers, int *w, int *b, int *sync)); -FILE *WriteTourneyFile P((char *results, FILE *f)); -void DisplayTwoMachinesTitle P(()); -static void ExcludeClick P((int index)); -void ToggleSecond P((void)); -void PauseEngine P((ChessProgramState *cps)); -static int NonStandardBoardSize P((VariantClass v, int w, int h, int s)); - -#ifdef WIN32 - extern void ConsoleCreate(); -#endif - -ChessProgramState *WhitePlayer(); -int VerifyDisplayMode P(()); - -char *GetInfoFromComment( int, char * ); // [HGM] PV time: returns stripped comment -void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); // [HGM] moved here from winboard.c -char *ProbeBook P((int moveNr, char *book)); // [HGM] book: returns a book move -char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book -void ics_update_width P((int new_width)); -extern char installDir[MSG_SIZ]; -VariantClass startVariant; /* [HGM] nicks: initial variant */ -Boolean abortMatch; - -extern int tinyLayout, smallLayout; -ChessProgramStats programStats; -char lastPV[2][2*MSG_SIZ]; /* [HGM] pv: last PV in thinking output of each engine */ -int endPV = -1; -static int exiting = 0; /* [HGM] moved to top */ -static int setboardSpoiledMachineBlack = 0 /*, errorExitFlag = 0*/; -int startedFromPositionFile = FALSE; Board filePosition; /* [HGM] loadPos */ -Board partnerBoard; /* [HGM] bughouse: for peeking at partner game */ -int partnerHighlight[2]; -Boolean partnerBoardValid = 0; -char partnerStatus[MSG_SIZ]; -Boolean partnerUp; -Boolean originalFlip; -Boolean twoBoards = 0; -char endingGame = 0; /* [HGM] crash: flag to prevent recursion of GameEnds() */ -int whiteNPS, blackNPS; /* [HGM] nps: for easily making clocks aware of NPS */ -VariantClass currentlyInitializedVariant; /* [HGM] variantswitch */ -int lastIndex = 0; /* [HGM] autoinc: last game/position used in match mode */ -Boolean connectionAlive;/* [HGM] alive: ICS connection status from probing */ -int opponentKibitzes; -int lastSavedGame; /* [HGM] save: ID of game */ -char chatPartner[MAX_CHAT][MSG_SIZ]; /* [HGM] chat: list of chatting partners */ -extern int chatCount; -int chattingPartner; -char marker[BOARD_RANKS][BOARD_FILES]; /* [HGM] marks for target squares */ -char legal[BOARD_RANKS][BOARD_FILES]; /* [HGM] legal target squares */ -char lastMsg[MSG_SIZ]; -char lastTalker[MSG_SIZ]; -ChessSquare pieceSweep = EmptySquare; -ChessSquare promoSweep = EmptySquare, defaultPromoChoice; -int promoDefaultAltered; -int keepInfo = 0; /* [HGM] to protect PGN tags in auto-step game analysis */ -static int initPing = -1; -int border; /* [HGM] width of board rim, needed to size seek graph */ -char bestMove[MSG_SIZ], avoidMove[MSG_SIZ]; -int solvingTime, totalTime; - -/* States for ics_getting_history */ -#define H_FALSE 0 -#define H_REQUESTED 1 -#define H_GOT_REQ_HEADER 2 -#define H_GOT_UNREQ_HEADER 3 -#define H_GETTING_MOVES 4 -#define H_GOT_UNWANTED_HEADER 5 - -/* whosays values for GameEnds */ -#define GE_ICS 0 -#define GE_ENGINE 1 -#define GE_PLAYER 2 -#define GE_FILE 3 -#define GE_XBOARD 4 -#define GE_ENGINE1 5 -#define GE_ENGINE2 6 - -/* Maximum number of games in a cmail message */ -#define CMAIL_MAX_GAMES 20 - -/* Different types of move when calling RegisterMove */ -#define CMAIL_MOVE 0 -#define CMAIL_RESIGN 1 -#define CMAIL_DRAW 2 -#define CMAIL_ACCEPT 3 - -/* Different types of result to remember for each game */ -#define CMAIL_NOT_RESULT 0 -#define CMAIL_OLD_RESULT 1 -#define CMAIL_NEW_RESULT 2 - -/* Telnet protocol constants */ -#define TN_WILL 0373 -#define TN_WONT 0374 -#define TN_DO 0375 -#define TN_DONT 0376 -#define TN_IAC 0377 -#define TN_ECHO 0001 -#define TN_SGA 0003 -#define TN_PORT 23 - -char* -safeStrCpy (char *dst, const char *src, size_t count) -{ // [HGM] made safe - int i; - assert( dst != NULL ); - assert( src != NULL ); - assert( count > 0 ); - - for(i=0; i=10) -ChessSquare ShogiArray[2][BOARD_FILES] = { - { WhiteQueen, WhiteKnight, WhiteFerz, WhiteWazir, - WhiteKing, WhiteWazir, WhiteFerz, WhiteKnight, WhiteQueen }, - { BlackQueen, BlackKnight, BlackFerz, BlackWazir, - BlackKing, BlackWazir, BlackFerz, BlackKnight, BlackQueen } -}; - -ChessSquare XiangqiArray[2][BOARD_FILES] = { - { WhiteRook, WhiteKnight, WhiteAlfil, WhiteFerz, - WhiteWazir, WhiteFerz, WhiteAlfil, WhiteKnight, WhiteRook }, - { BlackRook, BlackKnight, BlackAlfil, BlackFerz, - BlackWazir, BlackFerz, BlackAlfil, BlackKnight, BlackRook } -}; - -ChessSquare CapablancaArray[2][BOARD_FILES] = { - { WhiteRook, WhiteKnight, WhiteAngel, WhiteBishop, WhiteQueen, - WhiteKing, WhiteBishop, WhiteMarshall, WhiteKnight, WhiteRook }, - { BlackRook, BlackKnight, BlackAngel, BlackBishop, BlackQueen, - BlackKing, BlackBishop, BlackMarshall, BlackKnight, BlackRook } -}; - -ChessSquare GreatArray[2][BOARD_FILES] = { - { WhiteDragon, WhiteKnight, WhiteAlfil, WhiteGrasshopper, WhiteKing, - WhiteSilver, WhiteCardinal, WhiteAlfil, WhiteKnight, WhiteDragon }, - { BlackDragon, BlackKnight, BlackAlfil, BlackGrasshopper, BlackKing, - BlackSilver, BlackCardinal, BlackAlfil, BlackKnight, BlackDragon }, -}; - -ChessSquare JanusArray[2][BOARD_FILES] = { - { WhiteRook, WhiteAngel, WhiteKnight, WhiteBishop, WhiteKing, - WhiteQueen, WhiteBishop, WhiteKnight, WhiteAngel, WhiteRook }, - { BlackRook, BlackAngel, BlackKnight, BlackBishop, BlackKing, - BlackQueen, BlackBishop, BlackKnight, BlackAngel, BlackRook } -}; - -ChessSquare GrandArray[2][BOARD_FILES] = { - { EmptySquare, WhiteKnight, WhiteBishop, WhiteQueen, WhiteKing, - WhiteMarshall, WhiteAngel, WhiteBishop, WhiteKnight, EmptySquare }, - { EmptySquare, BlackKnight, BlackBishop, BlackQueen, BlackKing, - BlackMarshall, BlackAngel, BlackBishop, BlackKnight, EmptySquare } -}; - -ChessSquare ChuChessArray[2][BOARD_FILES] = { - { WhiteMan, WhiteKnight, WhiteBishop, WhiteCardinal, WhiteLion, - WhiteQueen, WhiteDragon, WhiteBishop, WhiteKnight, WhiteMan }, - { BlackMan, BlackKnight, BlackBishop, BlackDragon, BlackQueen, - BlackLion, BlackCardinal, BlackBishop, BlackKnight, BlackMan } -}; - -#ifdef GOTHIC -ChessSquare GothicArray[2][BOARD_FILES] = { - { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, WhiteMarshall, - WhiteKing, WhiteAngel, WhiteBishop, WhiteKnight, WhiteRook }, - { BlackRook, BlackKnight, BlackBishop, BlackQueen, BlackMarshall, - BlackKing, BlackAngel, BlackBishop, BlackKnight, BlackRook } -}; -#else // !GOTHIC -#define GothicArray CapablancaArray -#endif // !GOTHIC - -#ifdef FALCON -ChessSquare FalconArray[2][BOARD_FILES] = { - { WhiteRook, WhiteKnight, WhiteBishop, WhiteFalcon, WhiteQueen, - WhiteKing, WhiteFalcon, WhiteBishop, WhiteKnight, WhiteRook }, - { BlackRook, BlackKnight, BlackBishop, BlackFalcon, BlackQueen, - BlackKing, BlackFalcon, BlackBishop, BlackKnight, BlackRook } -}; -#else // !FALCON -#define FalconArray CapablancaArray -#endif // !FALCON - -#else // !(BOARD_FILES>=10) -#define XiangqiPosition FIDEArray -#define CapablancaArray FIDEArray -#define GothicArray FIDEArray -#define GreatArray FIDEArray -#endif // !(BOARD_FILES>=10) - -#if (BOARD_FILES>=12) -ChessSquare CourierArray[2][BOARD_FILES] = { - { WhiteRook, WhiteKnight, WhiteAlfil, WhiteBishop, WhiteMan, WhiteKing, - WhiteFerz, WhiteWazir, WhiteBishop, WhiteAlfil, WhiteKnight, WhiteRook }, - { BlackRook, BlackKnight, BlackAlfil, BlackBishop, BlackMan, BlackKing, - BlackFerz, BlackWazir, BlackBishop, BlackAlfil, BlackKnight, BlackRook } -}; -ChessSquare ChuArray[6][BOARD_FILES] = { - { WhiteLance, WhiteUnicorn, WhiteMan, WhiteFerz, WhiteWazir, WhiteKing, - WhiteAlfil, WhiteWazir, WhiteFerz, WhiteMan, WhiteUnicorn, WhiteLance }, - { BlackLance, BlackUnicorn, BlackMan, BlackFerz, BlackWazir, BlackAlfil, - BlackKing, BlackWazir, BlackFerz, BlackMan, BlackUnicorn, BlackLance }, - { WhiteCannon, EmptySquare, WhiteBishop, EmptySquare, WhiteNightrider, WhiteMarshall, - WhiteAngel, WhiteNightrider, EmptySquare, WhiteBishop, EmptySquare, WhiteCannon }, - { BlackCannon, EmptySquare, BlackBishop, EmptySquare, BlackNightrider, BlackAngel, - BlackMarshall, BlackNightrider, EmptySquare, BlackBishop, EmptySquare, BlackCannon }, - { WhiteFalcon, WhiteSilver, WhiteRook, WhiteCardinal, WhiteDragon, WhiteLion, - WhiteQueen, WhiteDragon, WhiteCardinal, WhiteRook, WhiteSilver, WhiteFalcon }, - { BlackFalcon, BlackSilver, BlackRook, BlackCardinal, BlackDragon, BlackQueen, - BlackLion, BlackDragon, BlackCardinal, BlackRook, BlackSilver, BlackFalcon } -}; -#else // !(BOARD_FILES>=12) -#define CourierArray CapablancaArray -#define ChuArray CapablancaArray -#endif // !(BOARD_FILES>=12) - - -Board initialPosition; - - -/* Convert str to a rating. Checks for special cases of "----", - - "++++", etc. Also strips ()'s */ -int -string_to_rating (char *str) -{ - while(*str && !isdigit(*str)) ++str; - if (!*str) - return 0; /* One of the special "no rating" cases */ - else - return atoi(str); -} - -void -ClearProgramStats () -{ - /* Init programStats */ - programStats.movelist[0] = 0; - programStats.depth = 0; - programStats.nr_moves = 0; - programStats.moves_left = 0; - programStats.nodes = 0; - programStats.time = -1; // [HGM] PGNtime: make invalid to recognize engine output - programStats.score = 0; - programStats.got_only_move = 0; - programStats.got_fail = 0; - programStats.line_is_book = 0; -} - -void -CommonEngineInit () -{ // [HGM] moved some code here from InitBackend1 that has to be done after both engines have contributed their settings - if (appData.firstPlaysBlack) { - first.twoMachinesColor = "black\n"; - second.twoMachinesColor = "white\n"; - } else { - first.twoMachinesColor = "white\n"; - second.twoMachinesColor = "black\n"; - } - - first.other = &second; - second.other = &first; - - { float norm = 1; - if(appData.timeOddsMode) { - norm = appData.timeOdds[0]; - if(norm > appData.timeOdds[1]) norm = appData.timeOdds[1]; - } - first.timeOdds = appData.timeOdds[0]/norm; - second.timeOdds = appData.timeOdds[1]/norm; - } - - if(programVersion) free(programVersion); - if (appData.noChessProgram) { - programVersion = (char*) malloc(5 + strlen(PACKAGE_STRING)); - sprintf(programVersion, "%s", PACKAGE_STRING); - } else { - /* [HGM] tidy: use tidy name, in stead of full pathname (which was probably a bug due to / vs \ ) */ - programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy)); - sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy); - } -} - -void -UnloadEngine (ChessProgramState *cps) -{ - /* Kill off first chess program */ - if (cps->isr != NULL) - RemoveInputSource(cps->isr); - cps->isr = NULL; - - if (cps->pr != NoProc) { - ExitAnalyzeMode(); - DoSleep( appData.delayBeforeQuit ); - SendToProgram("quit\n", cps); - DestroyChildProcess(cps->pr, 4 + cps->useSigterm); - } - cps->pr = NoProc; - if(appData.debugMode) fprintf(debugFP, "Unload %s\n", cps->which); -} - -void -ClearOptions (ChessProgramState *cps) -{ - int i; - cps->nrOptions = cps->comboCnt = 0; - for(i=0; ioption[i].min = cps->option[i].max = cps->option[i].value = 0; - cps->option[i].textValue = 0; - } -} - -char *engineNames[] = { - /* TRANSLATORS: "first" is the first of possible two chess engines. It is inserted into strings - such as "%s engine" / "%s chess program" / "%s machine" - all meaning the same thing */ -N_("first"), - /* TRANSLATORS: "second" is the second of possible two chess engines. It is inserted into strings - such as "%s engine" / "%s chess program" / "%s machine" - all meaning the same thing */ -N_("second") -}; - -void -InitEngine (ChessProgramState *cps, int n) -{ // [HGM] all engine initialiation put in a function that does one engine - - ClearOptions(cps); - - cps->which = engineNames[n]; - cps->maybeThinking = FALSE; - cps->pr = NoProc; - cps->isr = NULL; - cps->sendTime = 2; - cps->sendDrawOffers = 1; - - cps->program = appData.chessProgram[n]; - cps->host = appData.host[n]; - cps->dir = appData.directory[n]; - cps->initString = appData.engInitString[n]; - cps->computerString = appData.computerString[n]; - cps->useSigint = TRUE; - cps->useSigterm = TRUE; - cps->reuse = appData.reuse[n]; - cps->nps = appData.NPS[n]; // [HGM] nps: copy nodes per second - cps->useSetboard = FALSE; - cps->useSAN = FALSE; - cps->usePing = FALSE; - cps->lastPing = 0; - cps->lastPong = 0; - cps->usePlayother = FALSE; - cps->useColors = TRUE; - cps->useUsermove = FALSE; - cps->sendICS = FALSE; - cps->sendName = appData.icsActive; - cps->sdKludge = FALSE; - cps->stKludge = FALSE; - if(cps->tidy == NULL) cps->tidy = (char*) malloc(MSG_SIZ); - TidyProgramName(cps->program, cps->host, cps->tidy); - cps->matchWins = 0; - ASSIGN(cps->variants, appData.noChessProgram ? "" : appData.variant); - cps->analysisSupport = 2; /* detect */ - cps->analyzing = FALSE; - cps->initDone = FALSE; - cps->reload = FALSE; - cps->pseudo = appData.pseudo[n]; - - /* New features added by Tord: */ - cps->useFEN960 = FALSE; - cps->useOOCastle = TRUE; - /* End of new features added by Tord. */ - cps->fenOverride = appData.fenOverride[n]; - - /* [HGM] time odds: set factor for each machine */ - cps->timeOdds = appData.timeOdds[n]; - - /* [HGM] secondary TC: how to handle sessions that do not fit in 'level'*/ - cps->accumulateTC = appData.accumulateTC[n]; - cps->maxNrOfSessions = 1; - - /* [HGM] debug */ - cps->debug = FALSE; - - cps->drawDepth = appData.drawDepth[n]; - cps->supportsNPS = UNKNOWN; - cps->memSize = FALSE; - cps->maxCores = FALSE; - ASSIGN(cps->egtFormats, ""); - - /* [HGM] options */ - cps->optionSettings = appData.engOptions[n]; - - cps->scoreIsAbsolute = appData.scoreIsAbsolute[n]; /* [AS] */ - cps->isUCI = appData.isUCI[n]; /* [AS] */ - cps->hasOwnBookUCI = appData.hasOwnBookUCI[n]; /* [AS] */ - cps->highlight = 0; - - if (appData.protocolVersion[n] > PROTOVER - || appData.protocolVersion[n] < 1) - { - char buf[MSG_SIZ]; - int len; - - len = snprintf(buf, MSG_SIZ, _("protocol version %d not supported"), - appData.protocolVersion[n]); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitBackEnd1: buffer truncated.\n"); - - DisplayFatalError(buf, 0, 2); - } - else - { - cps->protocolVersion = appData.protocolVersion[n]; - } - - InitEngineUCI( installDir, cps ); // [HGM] moved here from winboard.c, to make available in xboard - ParseFeatures(appData.featureDefaults, cps); -} - -ChessProgramState *savCps; - -GameMode oldMode; - -void -LoadEngine () -{ - int i; - if(WaitForEngine(savCps, LoadEngine)) return; - CommonEngineInit(); // recalculate time odds - if(gameInfo.variant != StringToVariant(appData.variant)) { - // we changed variant when loading the engine; this forces us to reset - Reset(TRUE, savCps != &first); - oldMode = BeginningOfGame; // to prevent restoring old mode - } - InitChessProgram(savCps, FALSE); - if(gameMode == EditGame) SendToProgram("force\n", savCps); // in EditGame mode engine must be in force mode - DisplayMessage("", ""); - if (startedFromSetupPosition) SendBoard(savCps, backwardMostMove); - for (i = backwardMostMove; i < currentMove; i++) SendMoveToProgram(i, savCps); - ThawUI(); - SetGNUMode(); - if(oldMode == AnalyzeMode) AnalyzeModeEvent(); -} - -void -ReplaceEngine (ChessProgramState *cps, int n) -{ - oldMode = gameMode; // remember mode, so it can be restored after loading sequence is complete - keepInfo = 1; - if(oldMode != BeginningOfGame) EditGameEvent(); - keepInfo = 0; - UnloadEngine(cps); - appData.noChessProgram = FALSE; - appData.clockMode = TRUE; - InitEngine(cps, n); - UpdateLogos(TRUE); - if(n) return; // only startup first engine immediately; second can wait - savCps = cps; // parameter to LoadEngine passed as globals, to allow scheduled calling :-( - LoadEngine(); -} - -extern char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params; -extern Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick; - -static char resetOptions[] = - "-reuse -firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 " - "-firstInitString \"" INIT_STRING "\" -firstComputerString \"" COMPUTER_STRING "\" " - "-firstFeatures \"\" -firstLogo \"\" -firstAccumulateTC 1 -fd \".\" " - "-firstOptions \"\" -firstNPS -1 -fn \"\" -firstScoreAbs false"; - -void -FloatToFront(char **list, char *engineLine) -{ - char buf[MSG_SIZ], tidy[MSG_SIZ], *p = buf, *q, *r = buf; - int i=0; - if(appData.recentEngines <= 0) return; - TidyProgramName(engineLine, "localhost", tidy+1); - tidy[0] = buf[0] = '\n'; strcat(tidy, "\n"); - strncpy(buf+1, *list, MSG_SIZ-50); - if(p = strstr(buf, tidy)) { // tidy name appears in list - q = strchr(++p, '\n'); if(q == NULL) return; // malformed, don't touch - while(*p++ = *++q); // squeeze out - } - strcat(tidy, buf+1); // put list behind tidy name - p = tidy + 1; while(q = strchr(p, '\n')) i++, r = p, p = q + 1; // count entries in new list - if(i > appData.recentEngines) *r = NULLCHAR; // if maximum rached, strip off last - ASSIGN(*list, tidy+1); -} - -char *insert, *wbOptions; // point in ChessProgramNames were we should insert new engine - -void -Load (ChessProgramState *cps, int i) -{ - char *p, *q, buf[MSG_SIZ], command[MSG_SIZ], buf2[MSG_SIZ], buf3[MSG_SIZ], jar; - if(engineLine && engineLine[0]) { // an engine was selected from the combo box - snprintf(buf, MSG_SIZ, "-fcp %s", engineLine); - SwapEngines(i); // kludge to parse -f* / -first* like it is -s* / -second* - ParseArgsFromString(resetOptions); appData.pvSAN[0] = FALSE; - FREE(appData.fenOverride[0]); appData.fenOverride[0] = NULL; - appData.firstProtocolVersion = PROTOVER; - ParseArgsFromString(buf); - SwapEngines(i); - ReplaceEngine(cps, i); - FloatToFront(&appData.recentEngineList, engineLine); - if(gameMode == BeginningOfGame) Reset(TRUE, TRUE); - return; - } - p = engineName; - while(q = strchr(p, SLASH)) p = q+1; - if(*p== NULLCHAR) { DisplayError(_("You did not specify the engine executable"), 0); return; } - if(engineDir[0] != NULLCHAR) { - ASSIGN(appData.directory[i], engineDir); p = engineName; - } else if(p != engineName) { // derive directory from engine path, when not given - p[-1] = 0; - ASSIGN(appData.directory[i], engineName); - p[-1] = SLASH; - if(SLASH == '/' && p - engineName > 1) *(p -= 2) = '.'; // for XBoard use ./exeName as command after split! - } else { ASSIGN(appData.directory[i], "."); } - jar = (strstr(p, ".jar") == p + strlen(p) - 4); - if(params[0]) { - if(strchr(p, ' ') && !strchr(p, '"')) snprintf(buf2, MSG_SIZ, "\"%s\"", p), p = buf2; // quote if it contains spaces - snprintf(command, MSG_SIZ, "%s %s", p, params); - p = command; - } - if(jar) { snprintf(buf3, MSG_SIZ, "java -jar %s", p); p = buf3; } - ASSIGN(appData.chessProgram[i], p); - appData.isUCI[i] = isUCI; - appData.protocolVersion[i] = v1 ? 1 : PROTOVER; - appData.hasOwnBookUCI[i] = hasBook; - if(!nickName[0]) useNick = FALSE; - if(useNick) ASSIGN(appData.pgnName[i], nickName); - if(addToList) { - int len; - char quote; - q = firstChessProgramNames; - if(nickName[0]) snprintf(buf, MSG_SIZ, "\"%s\" -fcp ", nickName); else buf[0] = NULLCHAR; - quote = strchr(p, '"') ? '\'' : '"'; // use single quotes around engine command if it contains double quotes - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), "%c%s%c -fd \"%s\"%s%s%s%s%s%s%s%s\n", - quote, p, quote, appData.directory[i], - useNick ? " -fn \"" : "", - useNick ? nickName : "", - useNick ? "\"" : "", - v1 ? " -firstProtocolVersion 1" : "", - hasBook ? "" : " -fNoOwnBookUCI", - isUCI ? (isUCI == TRUE ? " -fUCI" : gameInfo.variant == VariantShogi ? " -fUSI" : " -fUCCI") : "", - storeVariant ? " -variant " : "", - storeVariant ? VariantName(gameInfo.variant) : ""); - if(wbOptions && wbOptions[0]) snprintf(buf+strlen(buf)-1, MSG_SIZ-strlen(buf), " %s\n", wbOptions); - firstChessProgramNames = malloc(len = strlen(q) + strlen(buf) + 1); - if(insert != q) insert[-1] = NULLCHAR; - snprintf(firstChessProgramNames, len, "%s\n%s%s", q, buf, insert); - if(q) free(q); - FloatToFront(&appData.recentEngineList, buf); - } - ReplaceEngine(cps, i); -} - -void -InitTimeControls () -{ - int matched, min, sec; - /* - * Parse timeControl resource - */ - if (!ParseTimeControl(appData.timeControl, appData.timeIncrement, - appData.movesPerSession)) { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), _("bad timeControl option %s"), appData.timeControl); - DisplayFatalError(buf, 0, 2); - } - - /* - * Parse searchTime resource - */ - if (*appData.searchTime != NULLCHAR) { - matched = sscanf(appData.searchTime, "%d:%d", &min, &sec); - if (matched == 1) { - searchTime = min * 60; - } else if (matched == 2) { - searchTime = min * 60 + sec; - } else { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), _("bad searchTime option %s"), appData.searchTime); - DisplayFatalError(buf, 0, 2); - } - } -} - -void -InitBackEnd1 () -{ - - ShowThinkingEvent(); // [HGM] thinking: make sure post/nopost state is set according to options - startVariant = StringToVariant(appData.variant); // [HGM] nicks: remember original variant - - GetTimeMark(&programStartTime); - srandom((programStartTime.ms + 1000*programStartTime.sec)*0x1001001); // [HGM] book: makes sure random is unpredictabe to msec level - appData.seedBase = random() + (random()<<15); - pauseStart = programStartTime; pauseStart.sec -= 100; // [HGM] matchpause: fake a pause that has long since ended - - ClearProgramStats(); - programStats.ok_to_send = 1; - programStats.seen_stat = 0; - - /* - * Initialize game list - */ - ListNew(&gameList); - - - /* - * Internet chess server status - */ - if (appData.icsActive) { - appData.matchMode = FALSE; - appData.matchGames = 0; -#if ZIPPY - appData.noChessProgram = !appData.zippyPlay; -#else - appData.zippyPlay = FALSE; - appData.zippyTalk = FALSE; - appData.noChessProgram = TRUE; -#endif - if (*appData.icsHelper != NULLCHAR) { - appData.useTelnet = TRUE; - appData.telnetProgram = appData.icsHelper; - } - } else { - appData.zippyTalk = appData.zippyPlay = FALSE; - } - - /* [AS] Initialize pv info list [HGM] and game state */ - { - int i, j; - - for( i=0; i<=framePtr; i++ ) { - pvInfoList[i].depth = -1; - boards[i][EP_STATUS] = EP_NONE; - for( j=0; j= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitBackEnd1: buffer truncated.\n"); - - DisplayFatalError(buf, 0, 2); - return; - - case VariantUnknown: - case VariantLoadable: - case Variant29: - case Variant30: - case Variant31: - case Variant32: - case Variant33: - case Variant34: - case Variant35: - case Variant36: - default: - len = snprintf(buf, MSG_SIZ, _("Unknown variant name %s"), appData.variant); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitBackEnd1: buffer truncated.\n"); - - DisplayFatalError(buf, 0, 2); - return; - - case VariantNormal: /* definitely works! */ - if(strcmp(appData.variant, "normal") && !appData.noChessProgram) { // [HGM] hope this is an engine-defined variant - safeStrCpy(engineVariant, appData.variant, MSG_SIZ); - return; - } - case VariantXiangqi: /* [HGM] repetition rules not implemented */ - case VariantFairy: /* [HGM] TestLegality definitely off! */ - case VariantGothic: /* [HGM] should work */ - case VariantCapablanca: /* [HGM] should work */ - case VariantCourier: /* [HGM] initial forced moves not implemented */ - case VariantShogi: /* [HGM] could still mate with pawn drop */ - case VariantChu: /* [HGM] experimental */ - case VariantKnightmate: /* [HGM] should work */ - case VariantCylinder: /* [HGM] untested */ - case VariantFalcon: /* [HGM] untested */ - case VariantCrazyhouse: /* holdings not shown, ([HGM] fixed that!) - offboard interposition not understood */ - case VariantWildCastle: /* pieces not automatically shuffled */ - case VariantNoCastle: /* pieces not automatically shuffled */ - case VariantFischeRandom: /* [HGM] works and shuffles pieces */ - case VariantLosers: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantSuicide: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantGiveaway: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantTwoKings: /* should work */ - case VariantAtomic: /* should work except for win condition */ - case Variant3Check: /* should work except for win condition */ - case VariantShatranj: /* should work except for all win conditions */ - case VariantMakruk: /* should work except for draw countdown */ - case VariantASEAN : /* should work except for draw countdown */ - case VariantBerolina: /* might work if TestLegality is off */ - case VariantCapaRandom: /* should work */ - case VariantJanus: /* should work */ - case VariantSuper: /* experimental */ - case VariantGreat: /* experimental, requires legality testing to be off */ - case VariantSChess: /* S-Chess, should work */ - case VariantGrand: /* should work */ - case VariantSpartan: /* should work */ - case VariantLion: /* should work */ - case VariantChuChess: /* should work */ - break; - } - } - -} - -int -NextIntegerFromString (char ** str, long * value) -{ - int result = -1; - char * s = *str; - - while( *s == ' ' || *s == '\t' ) { - s++; - } - - *value = 0; - - if( *s >= '0' && *s <= '9' ) { - while( *s >= '0' && *s <= '9' ) { - *value = *value * 10 + (*s - '0'); - s++; - } - - result = 0; - } - - *str = s; - - return result; -} - -int -NextTimeControlFromString (char ** str, long * value) -{ - long temp; - int result = NextIntegerFromString( str, &temp ); - - if( result == 0 ) { - *value = temp * 60; /* Minutes */ - if( **str == ':' ) { - (*str)++; - result = NextIntegerFromString( str, &temp ); - *value += temp; /* Seconds */ - } - } - - return result; -} - -int -NextSessionFromString (char ** str, int *moves, long * tc, long *inc, int *incType) -{ /* [HGM] routine added to read '+moves/time' for secondary time control. */ - int result = -1, type = 0; long temp, temp2; - - if(**str != ':') return -1; // old params remain in force! - (*str)++; - if(**str == '*') type = *(*str)++, temp = 0; // sandclock TC - if( NextIntegerFromString( str, &temp ) ) return -1; - if(type) { *moves = 0; *tc = temp * 500; *inc = temp * 1000; *incType = '*'; return 0; } - - if(**str != '/') { - /* time only: incremental or sudden-death time control */ - if(**str == '+') { /* increment follows; read it */ - (*str)++; - if(**str == '!') type = *(*str)++; // Bronstein TC - if(result = NextIntegerFromString( str, &temp2)) return -1; - *inc = temp2 * 1000; - if(**str == '.') { // read fraction of increment - char *start = ++(*str); - if(result = NextIntegerFromString( str, &temp2)) return -1; - temp2 *= 1000; - while(start++ < *str) temp2 /= 10; - *inc += temp2; - } - } else *inc = 0; - *moves = 0; *tc = temp * 1000; *incType = type; - return 0; - } - - (*str)++; /* classical time control */ - result = NextIntegerFromString( str, &temp2); // NOTE: already converted to seconds by ParseTimeControl() - - if(result == 0) { - *moves = temp; - *tc = temp2 * 1000; - *inc = 0; - *incType = type; - } - return result; -} - -int -GetTimeQuota (int movenr, int lastUsed, char *tcString) -{ /* [HGM] get time to add from the multi-session time-control string */ - int incType, moves=1; /* kludge to force reading of first session */ - long time, increment; - char *s = tcString; - - if(!s || !*s) return 0; // empty TC string means we ran out of the last sudden-death version - do { - if(moves) NextSessionFromString(&s, &moves, &time, &increment, &incType); - nextSession = s; suddenDeath = moves == 0 && increment == 0; - if(movenr == -1) return time; /* last move before new session */ - if(incType == '*') increment = 0; else // for sandclock, time is added while not thinking - if(incType == '!' && lastUsed < increment) increment = lastUsed; - if(!moves) return increment; /* current session is incremental */ - if(movenr >= 0) movenr -= moves; /* we already finished this session */ - } while(movenr >= -1); /* try again for next session */ - - return 0; // no new time quota on this move -} - -int -ParseTimeControl (char *tc, float ti, int mps) -{ - long tc1; - long tc2; - char buf[MSG_SIZ], buf2[MSG_SIZ], *mytc = tc; - int min, sec=0; - - if(ti >= 0 && !strchr(tc, '+') && !strchr(tc, '/') ) mps = 0; - if(!strchr(tc, '+') && !strchr(tc, '/') && sscanf(tc, "%d:%d", &min, &sec) >= 1) - sprintf(mytc=buf2, "%d", 60*min+sec); // convert 'classical' min:sec tc string to seconds - if(ti > 0) { - - if(mps) - snprintf(buf, MSG_SIZ, ":%d/%s+%g", mps, mytc, ti); - else - snprintf(buf, MSG_SIZ, ":%s+%g", mytc, ti); - } else { - if(mps) - snprintf(buf, MSG_SIZ, ":%d/%s", mps, mytc); - else - snprintf(buf, MSG_SIZ, ":%s", mytc); - } - fullTimeControlString = StrSave(buf); // this should now be in PGN format - - if( NextTimeControlFromString( &tc, &tc1 ) != 0 ) { - return FALSE; - } - - if( *tc == '/' ) { - /* Parse second time control */ - tc++; - - if( NextTimeControlFromString( &tc, &tc2 ) != 0 ) { - return FALSE; - } - - if( tc2 == 0 ) { - return FALSE; - } - - timeControl_2 = tc2 * 1000; - } - else { - timeControl_2 = 0; - } - - if( tc1 == 0 ) { - return FALSE; - } - - timeControl = tc1 * 1000; - - if (ti >= 0) { - timeIncrement = ti * 1000; /* convert to ms */ - movesPerSession = 0; - } else { - timeIncrement = 0; - movesPerSession = mps; - } - return TRUE; -} - -void -InitBackEnd2 () -{ - if (appData.debugMode) { -# ifdef __GIT_VERSION - fprintf(debugFP, "Version: %s (%s)\n", programVersion, __GIT_VERSION); -# else - fprintf(debugFP, "Version: %s\n", programVersion); -# endif - } - ASSIGN(currentDebugFile, appData.nameOfDebugFile); // [HGM] debug split: remember initial name in use - - set_cont_sequence(appData.wrapContSeq); - if (appData.matchGames > 0) { - appData.matchMode = TRUE; - } else if (appData.matchMode) { - appData.matchGames = 1; - } - if(appData.matchMode && appData.sameColorGames > 0) /* [HGM] alternate: overrule matchGames */ - appData.matchGames = appData.sameColorGames; - if(appData.rewindIndex > 1) { /* [HGM] autoinc: rewind implies auto-increment and overrules given index */ - if(appData.loadPositionIndex >= 0) appData.loadPositionIndex = -1; - if(appData.loadGameIndex >= 0) appData.loadGameIndex = -1; - } - Reset(TRUE, FALSE); - if (appData.noChessProgram || first.protocolVersion == 1) { - InitBackEnd3(); - } else { - /* kludge: allow timeout for initial "feature" commands */ - FreezeUI(); - DisplayMessage("", _("Starting chess program")); - ScheduleDelayedEvent(InitBackEnd3, FEATURE_TIMEOUT); - } -} - -int -CalculateIndex (int index, int gameNr) -{ // [HGM] autoinc: absolute way to determine load index from game number (taking auto-inc and rewind into account) - int res; - if(index > 0) return index; // fixed nmber - if(index == 0) return 1; - res = (index == -1 ? gameNr : (gameNr-1)/2 + 1); // autoinc - if(appData.rewindIndex > 0) res = (res-1) % appData.rewindIndex + 1; // rewind - return res; -} - -int -LoadGameOrPosition (int gameNr) -{ // [HGM] taken out of MatchEvent and NextMatchGame (to combine it) - if (*appData.loadGameFile != NULLCHAR) { - if (!LoadGameFromFile(appData.loadGameFile, - CalculateIndex(appData.loadGameIndex, gameNr), - appData.loadGameFile, FALSE)) { - DisplayFatalError(_("Bad game file"), 0, 1); - return 0; - } - } else if (*appData.loadPositionFile != NULLCHAR) { - if (!LoadPositionFromFile(appData.loadPositionFile, - CalculateIndex(appData.loadPositionIndex, gameNr), - appData.loadPositionFile)) { - DisplayFatalError(_("Bad position file"), 0, 1); - return 0; - } - } - return 1; -} - -void -ReserveGame (int gameNr, char resChar) -{ - FILE *tf = fopen(appData.tourneyFile, "r+"); - char *p, *q, c, buf[MSG_SIZ]; - if(tf == NULL) { nextGame = appData.matchGames + 1; return; } // kludge to terminate match - safeStrCpy(buf, lastMsg, MSG_SIZ); - DisplayMessage(_("Pick new game"), ""); - flock(fileno(tf), LOCK_EX); // lock the tourney file while we are messing with it - ParseArgsFromFile(tf); - p = q = appData.results; - if(appData.debugMode) { - char *r = appData.participants; - fprintf(debugFP, "results = '%s'\n", p); - while(*r) fprintf(debugFP, *r >= ' ' ? "%c" : "\\%03o", *r), r++; - fprintf(debugFP, "\n"); - } - while(*q && *q != ' ') q++; // get first un-played game (could be beyond end!) - nextGame = q - p; - q = malloc(strlen(p) + 2); // could be arbitrary long, but allow to extend by one! - safeStrCpy(q, p, strlen(p) + 2); - if(gameNr >= 0) q[gameNr] = resChar; // replace '*' with result - if(appData.debugMode) fprintf(debugFP, "pick next game from '%s': %d\n", q, nextGame); - if(nextGame <= appData.matchGames && resChar != ' ' && !abortMatch) { // reserve next game if tourney not yet done - if(q[nextGame] == NULLCHAR) q[nextGame+1] = NULLCHAR; // append one char - q[nextGame] = '*'; - } - fseek(tf, -(strlen(p)+4), SEEK_END); - c = fgetc(tf); - if(c != '"') // depending on DOS or Unix line endings we can be one off - fseek(tf, -(strlen(p)+2), SEEK_END); - else fseek(tf, -(strlen(p)+3), SEEK_END); - fprintf(tf, "%s\"\n", q); fclose(tf); // update, and flush by closing - DisplayMessage(buf, ""); - free(p); appData.results = q; - if(nextGame <= appData.matchGames && resChar != ' ' && !abortMatch && - (gameNr < 0 || nextGame / appData.defaultMatchGames != gameNr / appData.defaultMatchGames)) { - int round = appData.defaultMatchGames * appData.tourneyType; - if(gameNr < 0 || appData.tourneyType < 1 || // gauntlet engine can always stay loaded as first engine - appData.tourneyType > 1 && nextGame/round != gameNr/round) // in multi-gauntlet change only after round - UnloadEngine(&first); // next game belongs to other pairing; - UnloadEngine(&second); // already unload the engines, so TwoMachinesEvent will load new ones. - } - if(appData.debugMode) fprintf(debugFP, "Reserved, next=%d, nr=%d\n", nextGame, gameNr); -} - -void -MatchEvent (int mode) -{ // [HGM] moved out of InitBackend3, to make it callable when match starts through menu - int dummy; - if(matchMode) { // already in match mode: switch it off - abortMatch = TRUE; - if(!appData.tourneyFile[0]) appData.matchGames = matchGame; // kludge to let match terminate after next game. - return; - } -// if(gameMode != BeginningOfGame) { -// DisplayError(_("You can only start a match from the initial position."), 0); -// return; -// } - abortMatch = FALSE; - if(mode == 2) appData.matchGames = appData.defaultMatchGames; - /* Set up machine vs. machine match */ - nextGame = 0; - NextTourneyGame(-1, &dummy); // sets appData.matchGames if this is tourney, to make sure ReserveGame knows it - if(appData.tourneyFile[0]) { - ReserveGame(-1, 0); - if(nextGame > appData.matchGames) { - char buf[MSG_SIZ]; - if(strchr(appData.results, '*') == NULL) { - FILE *f; - appData.tourneyCycles++; - if(f = WriteTourneyFile(appData.results, NULL)) { // make a tourney file with increased number of cycles - fclose(f); - NextTourneyGame(-1, &dummy); - ReserveGame(-1, 0); - if(nextGame <= appData.matchGames) { - DisplayNote(_("You restarted an already completed tourney.\nOne more cycle will now be added to it.\nGames commence in 10 sec.")); - matchMode = mode; - ScheduleDelayedEvent(NextMatchGame, 10000); - return; - } - } - } - snprintf(buf, MSG_SIZ, _("All games in tourney '%s' are already played or playing"), appData.tourneyFile); - DisplayError(buf, 0); - appData.tourneyFile[0] = 0; - return; - } - } else - if (appData.noChessProgram) { // [HGM] in tourney engines are loaded automatically - DisplayFatalError(_("Can't have a match with no chess programs"), - 0, 2); - return; - } - matchMode = mode; - matchGame = roundNr = 1; - first.matchWins = second.matchWins = totalTime = 0; // [HGM] match: needed in later matches - NextMatchGame(); -} - -char *comboLine = NULL; // [HGM] recent: WinBoard's first-engine combobox line - -void -InitBackEnd3 P((void)) -{ - GameMode initialMode; - char buf[MSG_SIZ]; - int err, len; - - if(!appData.icsActive && !appData.noChessProgram && !appData.matchMode && // mode involves only first engine - !strcmp(appData.variant, "normal") && // no explicit variant request - appData.NrRanks == -1 && appData.NrFiles == -1 && appData.holdingsSize == -1 && // no size overrides requested - !SupportedVariant(first.variants, VariantNormal, 8, 8, 0, first.protocolVersion, "") && // but 'normal' won't work with engine - !SupportedVariant(first.variants, VariantFischeRandom, 8, 8, 0, first.protocolVersion, "") ) { // nor will Chess960 - char c, *q = first.variants, *p = strchr(q, ','); - if(p) *p = NULLCHAR; - if(StringToVariant(q) != VariantUnknown) { // the engine can play a recognized variant, however - int w, h, s; - if(sscanf(q, "%dx%d+%d_%c", &w, &h, &s, &c) == 4) // get size overrides the engine needs with it (if any) - appData.NrFiles = w, appData.NrRanks = h, appData.holdingsSize = s, q = strchr(q, '_') + 1; - ASSIGN(appData.variant, q); // fake user requested the first variant played by the engine - Reset(TRUE, FALSE); // and re-initialize - } - if(p) *p = ','; - } - - InitChessProgram(&first, startedFromSetupPosition); - - if(!appData.noChessProgram) { /* [HGM] tidy: redo program version to use name from myname feature */ - free(programVersion); - programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy)); - sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy); - FloatToFront(&appData.recentEngineList, comboLine ? comboLine : appData.firstChessProgram); - } - - if (appData.icsActive) { -#ifdef WIN32 - /* [DM] Make a console window if needed [HGM] merged ifs */ - ConsoleCreate(); -#endif - err = establish(); - if (err != 0) - { - if (*appData.icsCommPort != NULLCHAR) - len = snprintf(buf, MSG_SIZ, _("Could not open comm port %s"), - appData.icsCommPort); - else - len = snprintf(buf, MSG_SIZ, _("Could not connect to host %s, port %s"), - appData.icsHost, appData.icsPort); - - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitBackEnd3: buffer truncated.\n"); - - DisplayFatalError(buf, err, 1); - return; - } - SetICSMode(); - telnetISR = - AddInputSource(icsPR, FALSE, read_from_ics, &telnetISR); - fromUserISR = - AddInputSource(NoProc, FALSE, read_from_player, &fromUserISR); - if(appData.keepAlive) // [HGM] alive: schedule sending of dummy 'date' command - ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000); - } else if (appData.noChessProgram) { - SetNCPMode(); - } else { - SetGNUMode(); - } - - if (*appData.cmailGameName != NULLCHAR) { - SetCmailMode(); - OpenLoopback(&cmailPR); - cmailISR = - AddInputSource(cmailPR, FALSE, CmailSigHandlerCallBack, &cmailISR); - } - - ThawUI(); - DisplayMessage("", ""); - if (StrCaseCmp(appData.initialMode, "") == 0) { - initialMode = BeginningOfGame; - if(!appData.icsActive && appData.noChessProgram) { // [HGM] could be fall-back - gameMode = MachinePlaysBlack; // "Machine Black" might have been implicitly highlighted - ModeHighlight(); // make sure XBoard knows it is highlighted, so it will un-highlight it - gameMode = BeginningOfGame; // in case BeginningOfGame now means "Edit Position" - ModeHighlight(); - } - } else if (StrCaseCmp(appData.initialMode, "TwoMachines") == 0) { - initialMode = TwoMachinesPlay; - } else if (StrCaseCmp(appData.initialMode, "AnalyzeFile") == 0) { - initialMode = AnalyzeFile; - } else if (StrCaseCmp(appData.initialMode, "Analysis") == 0) { - initialMode = AnalyzeMode; - } else if (StrCaseCmp(appData.initialMode, "MachineWhite") == 0) { - initialMode = MachinePlaysWhite; - } else if (StrCaseCmp(appData.initialMode, "MachineBlack") == 0) { - initialMode = MachinePlaysBlack; - } else if (StrCaseCmp(appData.initialMode, "EditGame") == 0) { - initialMode = EditGame; - } else if (StrCaseCmp(appData.initialMode, "EditPosition") == 0) { - initialMode = EditPosition; - } else if (StrCaseCmp(appData.initialMode, "Training") == 0) { - initialMode = Training; - } else { - len = snprintf(buf, MSG_SIZ, _("Unknown initialMode %s"), appData.initialMode); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "InitBackEnd3: buffer truncated.\n"); - - DisplayFatalError(buf, 0, 2); - return; - } - - if (appData.matchMode) { - if(appData.tourneyFile[0]) { // start tourney from command line - FILE *f; - if(f = fopen(appData.tourneyFile, "r")) { - ParseArgsFromFile(f); // make sure tourney parmeters re known - fclose(f); - appData.clockMode = TRUE; - SetGNUMode(); - } else appData.tourneyFile[0] = NULLCHAR; // for now ignore bad tourney file - } - MatchEvent(TRUE); - } else if (*appData.cmailGameName != NULLCHAR) { - /* Set up cmail mode */ - ReloadCmailMsgEvent(TRUE); - } else { - /* Set up other modes */ - if (initialMode == AnalyzeFile) { - if (*appData.loadGameFile == NULLCHAR) { - DisplayFatalError(_("AnalyzeFile mode requires a game file"), 0, 1); - return; - } - } - if (*appData.loadGameFile != NULLCHAR) { - (void) LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, - appData.loadGameFile, TRUE); - } else if (*appData.loadPositionFile != NULLCHAR) { - (void) LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, - appData.loadPositionFile); - /* [HGM] try to make self-starting even after FEN load */ - /* to allow automatic setup of fairy variants with wtm */ - if(initialMode == BeginningOfGame && !blackPlaysFirst) { - gameMode = BeginningOfGame; - setboardSpoiledMachineBlack = 1; - } - /* [HGM] loadPos: make that every new game uses the setup */ - /* from file as long as we do not switch variant */ - if(!blackPlaysFirst) { - startedFromPositionFile = TRUE; - CopyBoard(filePosition, boards[0]); - CopyBoard(initialPosition, boards[0]); - } - } else if(*appData.fen != NULLCHAR) { - if(ParseFEN(filePosition, &blackPlaysFirst, appData.fen, TRUE) && !blackPlaysFirst) { - startedFromPositionFile = TRUE; - Reset(TRUE, TRUE); - } - } - if (initialMode == AnalyzeMode) { - if (appData.noChessProgram) { - DisplayFatalError(_("Analysis mode requires a chess engine"), 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("Analysis mode does not work with ICS mode"),0,2); - return; - } - AnalyzeModeEvent(); - } else if (initialMode == AnalyzeFile) { - appData.showThinking = TRUE; // [HGM] thinking: moved out of ShowThinkingEvent - ShowThinkingEvent(); - AnalyzeFileEvent(); - AnalysisPeriodicEvent(1); - } else if (initialMode == MachinePlaysWhite) { - if (appData.noChessProgram) { - DisplayFatalError(_("MachineWhite mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("MachineWhite mode does not work with ICS mode"), - 0, 2); - return; - } - MachineWhiteEvent(); - } else if (initialMode == MachinePlaysBlack) { - if (appData.noChessProgram) { - DisplayFatalError(_("MachineBlack mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("MachineBlack mode does not work with ICS mode"), - 0, 2); - return; - } - MachineBlackEvent(); - } else if (initialMode == TwoMachinesPlay) { - if (appData.noChessProgram) { - DisplayFatalError(_("TwoMachines mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("TwoMachines mode does not work with ICS mode"), - 0, 2); - return; - } - TwoMachinesEvent(); - } else if (initialMode == EditGame) { - EditGameEvent(); - } else if (initialMode == EditPosition) { - EditPositionEvent(); - } else if (initialMode == Training) { - if (*appData.loadGameFile == NULLCHAR) { - DisplayFatalError(_("Training mode requires a game file"), 0, 2); - return; - } - TrainingEvent(); - } - } -} - -void -HistorySet (char movelist[][2*MOVE_LEN], int first, int last, int current) -{ - DisplayBook(current+1); - - MoveHistorySet( movelist, first, last, current, pvInfoList ); - - EvalGraphSet( first, last, current, pvInfoList ); - - MakeEngineOutputTitle(); -} - -/* - * Establish will establish a contact to a remote host.port. - * Sets icsPR to a ProcRef for a process (or pseudo-process) - * used to talk to the host. - * Returns 0 if okay, error code if not. - */ -int -establish () -{ - char buf[MSG_SIZ]; - - if (*appData.icsCommPort != NULLCHAR) { - /* Talk to the host through a serial comm port */ - return OpenCommPort(appData.icsCommPort, &icsPR); - - } else if (*appData.gateway != NULLCHAR) { - if (*appData.remoteShell == NULLCHAR) { - /* Use the rcmd protocol to run telnet program on a gateway host */ - snprintf(buf, sizeof(buf), "%s %s %s", - appData.telnetProgram, appData.icsHost, appData.icsPort); - return OpenRcmd(appData.gateway, appData.remoteUser, buf, &icsPR); - - } else { - /* Use the rsh program to run telnet program on a gateway host */ - if (*appData.remoteUser == NULLCHAR) { - snprintf(buf, sizeof(buf), "%s %s %s %s %s", appData.remoteShell, - appData.gateway, appData.telnetProgram, - appData.icsHost, appData.icsPort); - } else { - snprintf(buf, sizeof(buf), "%s %s -l %s %s %s %s", - appData.remoteShell, appData.gateway, - appData.remoteUser, appData.telnetProgram, - appData.icsHost, appData.icsPort); - } - return StartChildProcess(buf, "", &icsPR); - - } - } else if (appData.useTelnet) { - return OpenTelnet(appData.icsHost, appData.icsPort, &icsPR); - - } else { - /* TCP socket interface differs somewhat between - Unix and NT; handle details in the front end. - */ - return OpenTCP(appData.icsHost, appData.icsPort, &icsPR); - } -} - -void -EscapeExpand (char *p, char *q) -{ // [HGM] initstring: routine to shape up string arguments - while(*p++ = *q++) if(p[-1] == '\\') - switch(*q++) { - case 'n': p[-1] = '\n'; break; - case 'r': p[-1] = '\r'; break; - case 't': p[-1] = '\t'; break; - case '\\': p[-1] = '\\'; break; - case 0: *p = 0; return; - default: p[-1] = q[-1]; break; - } -} - -void -show_bytes (FILE *fp, char *buf, int count) -{ - while (count--) { - if (*buf < 040 || *(unsigned char *) buf > 0177) { - fprintf(fp, "\\%03o", *buf & 0xff); - } else { - putc(*buf, fp); - } - buf++; - } - fflush(fp); -} - -/* Returns an errno value */ -int -OutputMaybeTelnet (ProcRef pr, char *message, int count, int *outError) -{ - char buf[8192], *p, *q, *buflim; - int left, newcount, outcount; - - if (*appData.icsCommPort != NULLCHAR || appData.useTelnet || - *appData.gateway != NULLCHAR) { - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, message, count); - fprintf(debugFP, "\n"); - } - return OutputToProcess(pr, message, count, outError); - } - - buflim = &buf[sizeof(buf)-1]; /* allow 1 byte for expanding last char */ - p = message; - q = buf; - left = count; - newcount = 0; - while (left) { - if (q >= buflim) { - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, buf, newcount); - fprintf(debugFP, "\n"); - } - outcount = OutputToProcess(pr, buf, newcount, outError); - if (outcount < newcount) return -1; /* to be sure */ - q = buf; - newcount = 0; - } - if (*p == '\n') { - *q++ = '\r'; - newcount++; - } else if (((unsigned char) *p) == TN_IAC) { - *q++ = (char) TN_IAC; - newcount ++; - } - *q++ = *p++; - newcount++; - left--; - } - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, buf, newcount); - fprintf(debugFP, "\n"); - } - outcount = OutputToProcess(pr, buf, newcount, outError); - if (outcount < newcount) return -1; /* to be sure */ - return count; -} - -void -read_from_player (InputSourceRef isr, VOIDSTAR closure, char *message, int count, int error) -{ - int outError, outCount; - static int gotEof = 0; - static FILE *ini; - - /* Pass data read from player on to ICS */ - if (count > 0) { - gotEof = 0; - outCount = OutputMaybeTelnet(icsPR, message, count, &outError); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } - if(have_sent_ICS_logon == 2) { - if(ini = fopen(appData.icsLogon, "w")) { // save first two lines (presumably username & password) on init script file - fprintf(ini, "%s", message); - have_sent_ICS_logon = 3; - } else - have_sent_ICS_logon = 1; - } else if(have_sent_ICS_logon == 3) { - fprintf(ini, "%s", message); - fclose(ini); - have_sent_ICS_logon = 1; - } - } else if (count < 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Error reading from keyboard"), error, 1); - } else if (gotEof++ > 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Got end of file from keyboard"), 0, 666); // [HGM] 666 is kludge to alert front end - } -} - -void -KeepAlive () -{ // [HGM] alive: periodically send dummy (date) command to ICS to prevent time-out - if(!connectionAlive) DisplayFatalError("No response from ICS", 0, 1); - connectionAlive = FALSE; // only sticks if no response to 'date' command. - SendToICS("date\n"); - if(appData.keepAlive) ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000); -} - -/* added routine for printf style output to ics */ -void -ics_printf (char *format, ...) -{ - char buffer[MSG_SIZ]; - va_list args; - - va_start(args, format); - vsnprintf(buffer, sizeof(buffer), format, args); - buffer[sizeof(buffer)-1] = '\0'; - SendToICS(buffer); - va_end(args); -} - -void -SendToICS (char *s) -{ - int count, outCount, outError; - - if (icsPR == NoProc) return; - - count = strlen(s); - outCount = OutputMaybeTelnet(icsPR, s, count, &outError); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } -} - -/* This is used for sending logon scripts to the ICS. Sending - without a delay causes problems when using timestamp on ICC - (at least on my machine). */ -void -SendToICSDelayed (char *s, long msdelay) -{ - int count, outCount, outError; - - if (icsPR == NoProc) return; - - count = strlen(s); - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, s, count); - fprintf(debugFP, "\n"); - } - outCount = OutputToProcessDelayed(icsPR, s, count, &outError, - msdelay); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } -} - - -/* Remove all highlighting escape sequences in s - Also deletes any suffix starting with '(' - */ -char * -StripHighlightAndTitle (char *s) -{ - static char retbuf[MSG_SIZ]; - char *p = retbuf; - - while (*s != NULLCHAR) { - while (*s == '\033') { - while (*s != NULLCHAR && !isalpha(*s)) s++; - if (*s != NULLCHAR) s++; - } - while (*s != NULLCHAR && *s != '\033') { - if (*s == '(' || *s == '[') { - *p = NULLCHAR; - return retbuf; - } - *p++ = *s++; - } - } - *p = NULLCHAR; - return retbuf; -} - -/* Remove all highlighting escape sequences in s */ -char * -StripHighlight (char *s) -{ - static char retbuf[MSG_SIZ]; - char *p = retbuf; - - while (*s != NULLCHAR) { - while (*s == '\033') { - while (*s != NULLCHAR && !isalpha(*s)) s++; - if (*s != NULLCHAR) s++; - } - while (*s != NULLCHAR && *s != '\033') { - *p++ = *s++; - } - } - *p = NULLCHAR; - return retbuf; -} - -char engineVariant[MSG_SIZ]; -char *variantNames[] = VARIANT_NAMES; -char * -VariantName (VariantClass v) -{ - if(v == VariantUnknown || *engineVariant) return engineVariant; - return variantNames[v]; -} - - -/* Identify a variant from the strings the chess servers use or the - PGN Variant tag names we use. */ -VariantClass -StringToVariant (char *e) -{ - char *p; - int wnum = -1; - VariantClass v = VariantNormal; - int i, found = FALSE; - char buf[MSG_SIZ], c; - int len; - - if (!e) return v; - - /* [HGM] skip over optional board-size prefixes */ - if( sscanf(e, "%dx%d_%c", &i, &i, &c) == 3 || - sscanf(e, "%dx%d+%d_%c", &i, &i, &i, &c) == 4 ) { - while( *e++ != '_'); - } - - if(StrCaseStr(e, "misc/")) { // [HGM] on FICS, misc/shogi is not shogi - v = VariantNormal; - found = TRUE; - } else - for (i=0; i= VariantShogi && (p != e && !appData.icsActive || isalpha(p[strlen(variantNames[i])]))) continue; - v = (VariantClass) i; - found = TRUE; - break; - } - } - - if (!found) { - if ((StrCaseStr(e, "fischer") && StrCaseStr(e, "random")) - || StrCaseStr(e, "wild/fr") - || StrCaseStr(e, "frc") || StrCaseStr(e, "960")) { - v = VariantFischeRandom; - } else if ((i = 4, p = StrCaseStr(e, "wild")) || - (i = 1, p = StrCaseStr(e, "w"))) { - p += i; - while (*p && (isspace(*p) || *p == '(' || *p == '/')) p++; - if (isdigit(*p)) { - wnum = atoi(p); - } else { - wnum = -1; - } - switch (wnum) { - case 0: /* FICS only, actually */ - case 1: - /* Castling legal even if K starts on d-file */ - v = VariantWildCastle; - break; - case 2: - case 3: - case 4: - /* Castling illegal even if K & R happen to start in - normal positions. */ - v = VariantNoCastle; - break; - case 5: - case 7: - case 8: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 18: - case 19: - /* Castling legal iff K & R start in normal positions */ - v = VariantNormal; - break; - case 6: - case 20: - case 21: - /* Special wilds for position setup; unclear what to do here */ - v = VariantLoadable; - break; - case 9: - /* Bizarre ICC game */ - v = VariantTwoKings; - break; - case 16: - v = VariantKriegspiel; - break; - case 17: - v = VariantLosers; - break; - case 22: - v = VariantFischeRandom; - break; - case 23: - v = VariantCrazyhouse; - break; - case 24: - v = VariantBughouse; - break; - case 25: - v = Variant3Check; - break; - case 26: - /* Not quite the same as FICS suicide! */ - v = VariantGiveaway; - break; - case 27: - v = VariantAtomic; - break; - case 28: - v = VariantShatranj; - break; - - /* Temporary names for future ICC types. The name *will* change in - the next xboard/WinBoard release after ICC defines it. */ - case 29: - v = Variant29; - break; - case 30: - v = Variant30; - break; - case 31: - v = Variant31; - break; - case 32: - v = Variant32; - break; - case 33: - v = Variant33; - break; - case 34: - v = Variant34; - break; - case 35: - v = Variant35; - break; - case 36: - v = Variant36; - break; - case 37: - v = VariantShogi; - break; - case 38: - v = VariantXiangqi; - break; - case 39: - v = VariantCourier; - break; - case 40: - v = VariantGothic; - break; - case 41: - v = VariantCapablanca; - break; - case 42: - v = VariantKnightmate; - break; - case 43: - v = VariantFairy; - break; - case 44: - v = VariantCylinder; - break; - case 45: - v = VariantFalcon; - break; - case 46: - v = VariantCapaRandom; - break; - case 47: - v = VariantBerolina; - break; - case 48: - v = VariantJanus; - break; - case 49: - v = VariantSuper; - break; - case 50: - v = VariantGreat; - break; - case -1: - /* Found "wild" or "w" in the string but no number; - must assume it's normal chess. */ - v = VariantNormal; - break; - default: - len = snprintf(buf, MSG_SIZ, _("Unknown wild type %d"), wnum); - if( (len >= MSG_SIZ) && appData.debugMode ) - fprintf(debugFP, "StringToVariant: buffer truncated.\n"); - - DisplayError(buf, 0); - v = VariantUnknown; - break; - } - } - } - if (appData.debugMode) { - fprintf(debugFP, "recognized '%s' (%d) as variant %s\n", - e, wnum, VariantName(v)); - } - return v; -} - -static int leftover_start = 0, leftover_len = 0; -char star_match[STAR_MATCH_N][MSG_SIZ]; - -/* Test whether pattern is present at &buf[*index]; if so, return TRUE, - advance *index beyond it, and set leftover_start to the new value of - *index; else return FALSE. If pattern contains the character '*', it - matches any sequence of characters not containing '\r', '\n', or the - character following the '*' (if any), and the matched sequence(s) are - copied into star_match. - */ -int -looking_at ( char *buf, int *index, char *pattern) -{ - char *bufp = &buf[*index], *patternp = pattern; - int star_count = 0; - char *matchp = star_match[0]; - - for (;;) { - if (*patternp == NULLCHAR) { - *index = leftover_start = bufp - buf; - *matchp = NULLCHAR; - return TRUE; - } - if (*bufp == NULLCHAR) return FALSE; - if (*patternp == '*') { - if (*bufp == *(patternp + 1)) { - *matchp = NULLCHAR; - matchp = star_match[++star_count]; - patternp += 2; - bufp++; - continue; - } else if (*bufp == '\n' || *bufp == '\r') { - patternp++; - if (*patternp == NULLCHAR) - continue; - else - return FALSE; - } else { - *matchp++ = *bufp++; - continue; - } - } - if (*patternp != *bufp) return FALSE; - patternp++; - bufp++; - } -} - -void -SendToPlayer (char *data, int length) -{ - int error, outCount; - outCount = OutputToProcess(NoProc, data, length, &error); - if (outCount < length) { - DisplayFatalError(_("Error writing to display"), error, 1); - } -} - -void -PackHolding (char packed[], char *holding) -{ - char *p = holding; - char *q = packed; - int runlength = 0; - int curr = 9999; - do { - if (*p == curr) { - runlength++; - } else { - switch (runlength) { - case 0: - break; - case 1: - *q++ = curr; - break; - case 2: - *q++ = curr; - *q++ = curr; - break; - default: - sprintf(q, "%d", runlength); - while (*q) q++; - *q++ = curr; - break; - } - runlength = 1; - curr = *p; - } - } while (*p++); - *q = NULLCHAR; -} - -/* Telnet protocol requests from the front end */ -void -TelnetRequest (unsigned char ddww, unsigned char option) -{ - unsigned char msg[3]; - int outCount, outError; - - if (*appData.icsCommPort != NULLCHAR || appData.useTelnet) return; - - if (appData.debugMode) { - char buf1[8], buf2[8], *ddwwStr, *optionStr; - switch (ddww) { - case TN_DO: - ddwwStr = "DO"; - break; - case TN_DONT: - ddwwStr = "DONT"; - break; - case TN_WILL: - ddwwStr = "WILL"; - break; - case TN_WONT: - ddwwStr = "WONT"; - break; - default: - ddwwStr = buf1; - snprintf(buf1,sizeof(buf1)/sizeof(buf1[0]), "%d", ddww); - break; - } - switch (option) { - case TN_ECHO: - optionStr = "ECHO"; - break; - default: - optionStr = buf2; - snprintf(buf2,sizeof(buf2)/sizeof(buf2[0]), "%d", option); - break; - } - fprintf(debugFP, ">%s %s ", ddwwStr, optionStr); - } - msg[0] = TN_IAC; - msg[1] = ddww; - msg[2] = option; - outCount = OutputToProcess(icsPR, (char *)msg, 3, &outError); - if (outCount < 3) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } -} - -void -DoEcho () -{ - if (!appData.icsActive) return; - TelnetRequest(TN_DO, TN_ECHO); -} - -void -DontEcho () -{ - if (!appData.icsActive) return; - TelnetRequest(TN_DONT, TN_ECHO); -} - -void -CopyHoldings (Board board, char *holdings, ChessSquare lowestPiece) -{ - /* put the holdings sent to us by the server on the board holdings area */ - int i, j, holdingsColumn, holdingsStartRow, direction, countsColumn; - char p; - ChessSquare piece; - - if(gameInfo.holdingsWidth < 2) return; - if(gameInfo.variant != VariantBughouse && board[HOLDINGS_SET]) - return; // prevent overwriting by pre-board holdings - - if( (int)lowestPiece >= BlackPawn ) { - holdingsColumn = 0; - countsColumn = 1; - holdingsStartRow = BOARD_HEIGHT-1; - direction = -1; - } else { - holdingsColumn = BOARD_WIDTH-1; - countsColumn = BOARD_WIDTH-2; - holdingsStartRow = 0; - direction = 1; - } - - for(i=0; i= gameInfo.holdingsSize) continue; /* ignore pieces that do not fit */ - if(j < 0) continue; /* should not happen */ - piece = (ChessSquare) ( (int)piece + (int)lowestPiece ); - board[holdingsStartRow+j*direction][holdingsColumn] = piece; - board[holdingsStartRow+j*direction][countsColumn]++; - } -} - - -void -VariantSwitch (Board board, VariantClass newVariant) -{ - int newHoldingsWidth, newWidth = 8, newHeight = 8, i, j; - static Board oldBoard; - - startedFromPositionFile = FALSE; - if(gameInfo.variant == newVariant) return; - - /* [HGM] This routine is called each time an assignment is made to - * gameInfo.variant during a game, to make sure the board sizes - * are set to match the new variant. If that means adding or deleting - * holdings, we shift the playing board accordingly - * This kludge is needed because in ICS observe mode, we get boards - * of an ongoing game without knowing the variant, and learn about the - * latter only later. This can be because of the move list we requested, - * in which case the game history is refilled from the beginning anyway, - * but also when receiving holdings of a crazyhouse game. In the latter - * case we want to add those holdings to the already received position. - */ - - - if (appData.debugMode) { - fprintf(debugFP, "Switch board from %s to %s\n", - VariantName(gameInfo.variant), VariantName(newVariant)); - setbuf(debugFP, NULL); - } - shuffleOpenings = 0; /* [HGM] shuffle */ - gameInfo.holdingsSize = 5; /* [HGM] prepare holdings */ - switch(newVariant) - { - case VariantShogi: - newWidth = 9; newHeight = 9; - gameInfo.holdingsSize = 7; - case VariantBughouse: - case VariantCrazyhouse: - newHoldingsWidth = 2; break; - case VariantGreat: - newWidth = 10; - case VariantSuper: - newHoldingsWidth = 2; - gameInfo.holdingsSize = 8; - break; - case VariantGothic: - case VariantCapablanca: - case VariantCapaRandom: - newWidth = 10; - default: - newHoldingsWidth = gameInfo.holdingsSize = 0; - }; - - if(newWidth != gameInfo.boardWidth || - newHeight != gameInfo.boardHeight || - newHoldingsWidth != gameInfo.holdingsWidth ) { - - /* shift position to new playing area, if needed */ - if(newHoldingsWidth > gameInfo.holdingsWidth) { - for(i=0; i=BOARD_LEFT; j--) - board[i][j+newHoldingsWidth-gameInfo.holdingsWidth] = - board[i][j]; - for(i=0; i=0 ) r = minRating+100; - if(r > maxRating) r = maxRating; - if(tc < 1.f) tc = 1.f; - if(tc > 95.f) tc = 95.f; - x = (w-hMargin-squareSize/8-7)* log(tc)/log(95.) + hMargin; - y = ((double)r - minRating)/(maxRating - minRating) - * (h-vMargin-squareSize/8-1) + vMargin; - if(ratingList[i] < 0) y = vMargin + squareSize/4; - if(strstr(seekAdList[i], " u ")) color = 1; - if(!strstr(seekAdList[i], "lightning") && // for now all wilds same color - !strstr(seekAdList[i], "bullet") && - !strstr(seekAdList[i], "blitz") && - !strstr(seekAdList[i], "standard") ) color = 2; - if(strstr(seekAdList[i], "(C) ")) color |= SQUARE; // plot computer seeks as squares - DrawSeekDot(xList[i]=x+3*(color&~SQUARE), yList[i]=h-1-y, colorList[i]=color); -} - -void -PlotSingleSeekAd (int i) -{ - PlotSeekAd(i); -} - -void -AddAd (char *handle, char *rating, int base, int inc, char rated, char *type, int nr, Boolean plot) -{ - char buf[MSG_SIZ], *ext = ""; - VariantClass v = StringToVariant(type); - if(strstr(type, "wild")) { - ext = type + 4; // append wild number - if(v == VariantFischeRandom) type = "chess960"; else - if(v == VariantLoadable) type = "setup"; else - type = VariantName(v); - } - snprintf(buf, MSG_SIZ, "%s (%s) %d %d %c %s%s", handle, rating, base, inc, rated, type, ext); - if(nrOfSeekAds < MAX_SEEK_ADS-1) { - if(seekAdList[nrOfSeekAds]) free(seekAdList[nrOfSeekAds]); - ratingList[nrOfSeekAds] = -1; // for if seeker has no rating - sscanf(rating, "%d", &ratingList[nrOfSeekAds]); - tcList[nrOfSeekAds] = base + (2./3.)*inc; - seekNrList[nrOfSeekAds] = nr; - zList[nrOfSeekAds] = 0; - seekAdList[nrOfSeekAds++] = StrSave(buf); - if(plot) PlotSingleSeekAd(nrOfSeekAds-1); - } -} - -void -EraseSeekDot (int i) -{ - int x = xList[i], y = yList[i], d=squareSize/4, k; - DrawSeekBackground(x-squareSize/8, y-squareSize/8, x+squareSize/8+1, y+squareSize/8+1); - if(x < hMargin+d) DrawSeekAxis(hMargin, y-squareSize/8, hMargin, y+squareSize/8+1); - // now replot every dot that overlapped - for(k=0; k x-d && yy <= y+d && yy > y-d) - DrawSeekDot(xx, yy, colorList[k]); - } -} - -void -RemoveSeekAd (int nr) -{ - int i; - for(i=0; i=minRating && i40 ? i%20 : i%10) == 0) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%d", i); - DrawSeekText(buf, xx-2-3*(i>9), h-1-vMargin/2); - } - } - for(i=0; i0) zList[i] *= 0.8; // age priority - } - if(dist < 120) { - char buf[MSG_SIZ]; - second = (second > 1); - if(displayed != closest || second != lastSecond) { - DisplayMessage(second ? "!" : "", seekAdList[closest]); - lastSecond = second; displayed = closest; - } - if(click == Press) { - if(moving == 2) zList[closest] = 100; // right-click; push to back on press - lastDown = closest; - return TRUE; - } // on press 'hit', only show info - if(moving == 2) return TRUE; // ignore right up-clicks on dot - snprintf(buf, MSG_SIZ, "play %d\n", seekNrList[closest]); - SendToICS(ics_prefix); - SendToICS(buf); - return TRUE; // let incoming board of started game pop down the graph - } else if(click == Release) { // release 'miss' is ignored - zList[lastDown] = 100; // make future selection of the rejected ad more difficult - if(moving == 2) { // right up-click - nrOfSeekAds = 0; // refresh graph - soughtPending = TRUE; - SendToICS(ics_prefix); - SendToICS("sought\n"); // should this be "sought all"? - } - return TRUE; - } else if(moving) { if(displayed >= 0) DisplayMessage("", ""); displayed = -1; return TRUE; } - // press miss or release hit 'pop down' seek graph - seekGraphUp = FALSE; - DrawPosition(TRUE, NULL); - } - return TRUE; -} - -void -read_from_ics (InputSourceRef isr, VOIDSTAR closure, char *data, int count, int error) -{ -#define BUF_SIZE (16*1024) /* overflowed at 8K with "inchannel 1" on FICS? */ -#define STARTED_NONE 0 -#define STARTED_MOVES 1 -#define STARTED_BOARD 2 -#define STARTED_OBSERVE 3 -#define STARTED_HOLDINGS 4 -#define STARTED_CHATTER 5 -#define STARTED_COMMENT 6 -#define STARTED_MOVES_NOHIDE 7 - - static int started = STARTED_NONE; - static char parse[20000]; - static int parse_pos = 0; - static char buf[BUF_SIZE + 1]; - static int firstTime = TRUE, intfSet = FALSE; - static ColorClass prevColor = ColorNormal; - static int savingComment = FALSE; - static int cmatch = 0; // continuation sequence match - char *bp; - char str[MSG_SIZ]; - int i, oldi; - int buf_len; - int next_out; - int tkind; - int backup; /* [DM] For zippy color lines */ - char *p; - char talker[MSG_SIZ]; // [HGM] chat - int channel, collective=0; - - connectionAlive = TRUE; // [HGM] alive: I think, therefore I am... - - if (appData.debugMode) { - if (!error) { - fprintf(debugFP, " 0) { - /* If last read ended with a partial line that we couldn't parse, - prepend it to the new read and try again. */ - if (leftover_len > 0) { - for (i=0; i= 3 && (unsigned char) buf[i] == TN_IAC) { - static int remoteEchoOption = FALSE; /* telnet ECHO option */ - unsigned char option; - oldi = i; - switch ((unsigned char) buf[++i]) { - case TN_WILL: - if (appData.debugMode) - fprintf(debugFP, "\n next_out) - SendToPlayer(&buf[next_out], oldi - next_out); - if (++i > next_out) - next_out = i; - continue; - } - - /* OK, this at least will *usually* work */ - if (!loggedOn && looking_at(buf, &i, "ics%")) { - loggedOn = TRUE; - } - - if (loggedOn && !intfSet) { - if (ics_type == ICS_ICC) { - snprintf(str, MSG_SIZ, - "/set-quietly interface %s\n/set-quietly style 12\n", - programVersion); - if(appData.seekGraph && appData.autoRefresh) // [HGM] seekgraph - strcat(str, "/set-2 51 1\n/set seek 1\n"); - } else if (ics_type == ICS_CHESSNET) { - snprintf(str, MSG_SIZ, "/style 12\n"); - } else { - safeStrCpy(str, "alias $ @\n$set interface ", sizeof(str)/sizeof(str[0])); - strcat(str, programVersion); - strcat(str, "\n$iset startpos 1\n$iset ms 1\n"); - if(appData.seekGraph && appData.autoRefresh) // [HGM] seekgraph - strcat(str, "$iset seekremove 1\n$set seek 1\n"); -#ifdef WIN32 - strcat(str, "$iset nohighlight 1\n"); -#endif - strcat(str, "$iset lock 1\n$style 12\n"); - } - SendToICS(str); - NotifyFrontendLogin(); - intfSet = TRUE; - } - - if (started == STARTED_COMMENT) { - /* Accumulate characters in comment */ - parse[parse_pos++] = buf[i]; - if (buf[i] == '\n') { - parse[parse_pos] = NULLCHAR; - if(chattingPartner>=0) { - char mess[MSG_SIZ]; - snprintf(mess, MSG_SIZ, "%s%s", talker, parse); - OutputChatMessage(chattingPartner, mess); - if(collective == 1) { // broadcasted talk also goes to private chatbox of talker - int p; - talker[strlen(talker+1)-1] = NULLCHAR; // strip closing delimiter - for(p=0; p MSG_SIZ - 30) // defuse unreasonably long input - { parse_pos = MSG_SIZ-30; parse[parse_pos - 1] = '\n'; } - parse[parse_pos] = NULLCHAR; - // try to be smart: if it does not look like search info, it should go to - // ICS interaction window after all, not to engine-output window. - for(j=0; j= '0' && parse[j] <= '9'); - nrAlph += (parse[j] >= 'a' && parse[j] <= 'z'); - nrAlph += (parse[j] >= 'A' && parse[j] <= 'Z'); - } - if(nrAlph < 9*nrDigit) { // if more than 10% digit we assume search info - int depth=0; float score; - if(sscanf(parse, "!!! %f/%d", &score, &depth) == 2 && depth>0) { - // [HGM] kibitz: save kibitzed opponent info for PGN and eval graph - pvInfoList[forwardMostMove-1].depth = depth; - pvInfoList[forwardMostMove-1].score = 100*score; - } - OutputKibitz(suppressKibitz, parse); - } else { - char tmp[MSG_SIZ]; - if(gameMode == IcsObserving) // restore original ICS messages - /* TRANSLATORS: to 'kibitz' is to send a message to all players and the game observers */ - snprintf(tmp, MSG_SIZ, "%s kibitzes: %s", star_match[0], parse); - else - /* TRANSLATORS: to 'kibitz' is to send a message to all players and the game observers */ - snprintf(tmp, MSG_SIZ, _("your opponent kibitzes: %s"), parse); - SendToPlayer(tmp, strlen(tmp)); - } - next_out = i+1; // [HGM] suppress printing in ICS window - } - started = STARTED_NONE; - } else { - /* Don't match patterns against characters in comment */ - i++; - continue; - } - } - if (started == STARTED_CHATTER) { - if (buf[i] != '\n') { - /* Don't match patterns against characters in chatter */ - i++; - continue; - } - started = STARTED_NONE; - if(suppressKibitz) next_out = i+1; - } - - /* Kludge to deal with rcmd protocol */ - if (firstTime && looking_at(buf, &i, "\001*")) { - DisplayFatalError(&buf[1], 0, 1); - continue; - } else { - firstTime = FALSE; - } - - if (!loggedOn && looking_at(buf, &i, "chessclub.com")) { - ics_type = ICS_ICC; - ics_prefix = "/"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - if (!loggedOn && looking_at(buf, &i, "freechess.org")) { - ics_type = ICS_FICS; - ics_prefix = "$"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - if (!loggedOn && looking_at(buf, &i, "chess.net")) { - ics_type = ICS_CHESSNET; - ics_prefix = "/"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - - if (!loggedOn && - (looking_at(buf, &i, "\"*\" is *a registered name") || - looking_at(buf, &i, "Logging you in as \"*\"") || - looking_at(buf, &i, "will be \"*\""))) { - safeStrCpy(ics_handle, star_match[0], sizeof(ics_handle)/sizeof(ics_handle[0])); - continue; - } - - if (loggedOn && !have_set_title && ics_handle[0] != NULLCHAR) { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), "%s@%s", ics_handle, appData.icsHost); - DisplayIcsInteractionTitle(buf); - have_set_title = TRUE; - } - - /* skip finger notes */ - if (started == STARTED_NONE && - ((buf[i] == ' ' && isdigit(buf[i+1])) || - (buf[i] == '1' && buf[i+1] == '0')) && - buf[i+2] == ':' && buf[i+3] == ' ') { - started = STARTED_CHATTER; - i += 3; - continue; - } - - oldi = i; - // [HGM] seekgraph: recognize sought lines and end-of-sought message - if(appData.seekGraph) { - if(soughtPending && MatchSoughtLine(buf+i)) { - i = strstr(buf+i, "rated") - buf; - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - next_out = leftover_start = i; - started = STARTED_CHATTER; - suppressKibitz = TRUE; - continue; - } - if((gameMode == IcsIdle || gameMode == BeginningOfGame) - && looking_at(buf, &i, "* ads displayed")) { - soughtPending = FALSE; - seekGraphUp = TRUE; - DrawSeekGraph(); - continue; - } - if(appData.autoRefresh) { - if(looking_at(buf, &i, "* (*) seeking * * * * *\"play *\" to respond)\n")) { - int s = (ics_type == ICS_ICC); // ICC format differs - if(seekGraphUp) - AddAd(star_match[0], star_match[1], atoi(star_match[2+s]), atoi(star_match[3+s]), - star_match[4+s][0], star_match[5-3*s], atoi(star_match[7]), TRUE); - looking_at(buf, &i, "*% "); // eat prompt - if(oldi > 0 && buf[oldi-1] == '\n') oldi--; // suppress preceding LF, if any - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - next_out = i; // suppress - continue; - } - if(looking_at(buf, &i, "\nAds removed: *\n") || looking_at(buf, &i, "\031(51 * *\031)")) { - char *p = star_match[0]; - while(*p) { - if(seekGraphUp) RemoveSeekAd(atoi(p)); - while(*p && *p++ != ' '); // next - } - looking_at(buf, &i, "*% "); // eat prompt - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - next_out = i; - continue; - } - } - } - - /* skip formula vars */ - if (started == STARTED_NONE && - buf[i] == 'f' && isdigit(buf[i+1]) && buf[i+2] == ':') { - started = STARTED_CHATTER; - i += 3; - continue; - } - - // [HGM] kibitz: try to recognize opponent engine-score kibitzes, to divert them to engine-output window - if (appData.autoKibitz && started == STARTED_NONE && - !appData.icsEngineAnalyze && // [HGM] [DM] ICS analyze - (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || gameMode == IcsObserving)) { - if((looking_at(buf, &i, "\n* kibitzes: ") || looking_at(buf, &i, "\n* whispers: ") || - looking_at(buf, &i, "* kibitzes: ") || looking_at(buf, &i, "* whispers: ")) && - (StrStr(star_match[0], gameInfo.white) == star_match[0] || - StrStr(star_match[0], gameInfo.black) == star_match[0] )) { // kibitz of self or opponent - suppressKibitz = TRUE; - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - next_out = i; - if((StrStr(star_match[0], gameInfo.white) == star_match[0] - && (gameMode == IcsPlayingWhite)) || - (StrStr(star_match[0], gameInfo.black) == star_match[0] - && (gameMode == IcsPlayingBlack)) ) // opponent kibitz - started = STARTED_CHATTER; // own kibitz we simply discard - else { - started = STARTED_COMMENT; // make sure it will be collected in parse[] - parse_pos = 0; parse[0] = NULLCHAR; - savingComment = TRUE; - suppressKibitz = gameMode != IcsObserving ? 2 : - (StrStr(star_match[0], gameInfo.white) == NULL) + 1; - } - continue; - } else - if((looking_at(buf, &i, "\nkibitzed to *\n") || looking_at(buf, &i, "kibitzed to *\n") || - looking_at(buf, &i, "\n(kibitzed to *\n") || looking_at(buf, &i, "(kibitzed to *\n")) - && atoi(star_match[0])) { - // suppress the acknowledgements of our own autoKibitz - char *p; - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - if(p = strchr(star_match[0], ' ')) p[1] = NULLCHAR; // clip off "players)" on FICS - SendToPlayer(star_match[0], strlen(star_match[0])); - if(looking_at(buf, &i, "*% ")) // eat prompt - suppressKibitz = FALSE; - next_out = i; - continue; - } - } // [HGM] kibitz: end of patch - - if(looking_at(buf, &i, "* rating adjustment: * --> *\n")) continue; - - // [HGM] chat: intercept tells by users for which we have an open chat window - channel = -1; - if(started == STARTED_NONE && (looking_at(buf, &i, "* tells you:") || looking_at(buf, &i, "* says:") || - looking_at(buf, &i, "* whispers:") || - looking_at(buf, &i, "* kibitzes:") || - looking_at(buf, &i, "* shouts:") || - looking_at(buf, &i, "* c-shouts:") || - looking_at(buf, &i, "--> * ") || - looking_at(buf, &i, "*(*):") && (sscanf(star_match[1], "%d", &channel),1) || - looking_at(buf, &i, "*(*)(*):") && (sscanf(star_match[2], "%d", &channel),1) || - looking_at(buf, &i, "*(*)(*)(*):") && (sscanf(star_match[3], "%d", &channel),1) || - looking_at(buf, &i, "*(*)(*)(*)(*):") && sscanf(star_match[4], "%d", &channel) == 1 )) { - int p; - sscanf(star_match[0], "%[^(]", talker+1); // strip (C) or (U) off ICS handle - chattingPartner = -1; collective = 0; - - if(channel >= 0) // channel broadcast; look if there is a chatbox for this channel - for(p=0; p= '0' && chatPartner[p][0] <= '9' && channel == atoi(chatPartner[p])) { - talker[0] = '['; strcat(talker, "] "); - Colorize((channel == 1 ? ColorChannel1 : ColorChannel), FALSE); - chattingPartner = p; break; - } - } else - if(buf[i-3] == 'e') // kibitz; look if there is a KIBITZ chatbox - for(p=0; p') {// shout, c-shout or it; look if there is a 'shouts' chatbox - if(buf[i-8] == '-' && buf[i-3] == 't') - for(p=0; p') { talker[0] = '<'; strcat(talker, "> "); Colorize(ColorShout, FALSE); } - else if(buf[i-8] == '-') { talker[0] = '('; strcat(talker, ") "); Colorize(ColorSShout, FALSE); } - else { talker[0] = '['; strcat(talker, "] "); Colorize(ColorShout, FALSE); } - chattingPartner = p; break; - } - } - } - if(chattingPartner<0) // if not, look if there is a chatbox for this indivdual - for(p=0; p 0 && buf[oldi-1] == '\n') oldi--; - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); - continue; - } - } - } // [HGM] chat: end of patch - - backup = i; - if (appData.zippyTalk || appData.zippyPlay) { - /* [DM] Backup address for color zippy lines */ -#if ZIPPY - if (loggedOn == TRUE) - if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || - (appData.zippyPlay && ZippyMatch(buf, &backup))) - ; -#endif - } // [DM] 'else { ' deleted - if ( - /* Regular tells and says */ - (tkind = 1, looking_at(buf, &i, "* tells you: ")) || - looking_at(buf, &i, "* (your partner) tells you: ") || - looking_at(buf, &i, "* says: ") || - /* Don't color "message" or "messages" output */ - (tkind = 5, looking_at(buf, &i, "*. * (*:*): ")) || - looking_at(buf, &i, "*. * at *:*: ") || - looking_at(buf, &i, "--* (*:*): ") || - /* Message notifications (same color as tells) */ - looking_at(buf, &i, "* has left a message ") || - looking_at(buf, &i, "* just sent you a message:\n") || - /* Whispers and kibitzes */ - (tkind = 2, looking_at(buf, &i, "* whispers: ")) || - looking_at(buf, &i, "* kibitzes: ") || - /* Channel tells */ - (tkind = 3, looking_at(buf, &i, "*(*: "))) { - - if (tkind == 1 && strchr(star_match[0], ':')) { - /* Avoid "tells you:" spoofs in channels */ - tkind = 3; - } - if (star_match[0][0] == NULLCHAR || - strchr(star_match[0], ' ') || - (tkind == 3 && strchr(star_match[1], ' '))) { - /* Reject bogus matches */ - i = oldi; - } else { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - switch (tkind) { - case 1: - Colorize(ColorTell, FALSE); - curColor = ColorTell; - break; - case 2: - Colorize(ColorKibitz, FALSE); - curColor = ColorKibitz; - break; - case 3: - p = strrchr(star_match[1], '('); - if (p == NULL) { - p = star_match[1]; - } else { - p++; - } - if (atoi(p) == 1) { - Colorize(ColorChannel1, FALSE); - curColor = ColorChannel1; - } else { - Colorize(ColorChannel, FALSE); - curColor = ColorChannel; - } - break; - case 5: - curColor = ColorNormal; - break; - } - } - if (started == STARTED_NONE && appData.autoComment && - (gameMode == IcsObserving || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack)) { - parse_pos = i - oldi; - memcpy(parse, &buf[oldi], parse_pos); - parse[parse_pos] = NULLCHAR; - started = STARTED_COMMENT; - savingComment = TRUE; - } else if(collective != 3) { - started = STARTED_CHATTER; - savingComment = FALSE; - } - loggedOn = TRUE; - continue; - } - } - - if (looking_at(buf, &i, "* s-shouts: ") || - looking_at(buf, &i, "* c-shouts: ")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorSShout, FALSE); - curColor = ColorSShout; - } - loggedOn = TRUE; - started = STARTED_CHATTER; - continue; - } - - if (looking_at(buf, &i, "--->")) { - loggedOn = TRUE; - continue; - } - - if (looking_at(buf, &i, "* shouts: ") || - looking_at(buf, &i, "--> ")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorShout, FALSE); - curColor = ColorShout; - } - loggedOn = TRUE; - started = STARTED_CHATTER; - continue; - } - - if (looking_at( buf, &i, "Challenge:")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorChallenge, FALSE); - curColor = ColorChallenge; - } - loggedOn = TRUE; - continue; - } - - if (looking_at(buf, &i, "* offers you") || - looking_at(buf, &i, "* offers to be") || - looking_at(buf, &i, "* would like to") || - looking_at(buf, &i, "* requests to") || - looking_at(buf, &i, "Your opponent offers") || - looking_at(buf, &i, "Your opponent requests")) { - - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorRequest, FALSE); - curColor = ColorRequest; - } - continue; - } - - if (looking_at(buf, &i, "* (*) seeking")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorSeek, FALSE); - curColor = ColorSeek; - } - continue; - } - - if(i < backup) { i = backup; continue; } // [HGM] for if ZippyControl matches, but the colorie code doesn't - - if (looking_at(buf, &i, "\\ ")) { - if (prevColor != ColorNormal) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(prevColor, TRUE); - curColor = prevColor; - } - if (savingComment) { - parse_pos = i - oldi; - memcpy(parse, &buf[oldi], parse_pos); - parse[parse_pos] = NULLCHAR; - started = STARTED_COMMENT; - if(savingComment >= 3) // [HGM] chat: continuation of line for chat box - chattingPartner = savingComment - 3; // kludge to remember the box - } else { - started = STARTED_CHATTER; - } - continue; - } - - if (looking_at(buf, &i, "Black Strength :") || - looking_at(buf, &i, "<<< style 10 board >>>") || - looking_at(buf, &i, "<10>") || - looking_at(buf, &i, "#@#")) { - /* Wrong board style */ - loggedOn = TRUE; - SendToICS(ics_prefix); - SendToICS("set style 12\n"); - SendToICS(ics_prefix); - SendToICS("refresh\n"); - continue; - } - - if (looking_at(buf, &i, "login:")) { - if (!have_sent_ICS_logon) { - if(ICSInitScript()) - have_sent_ICS_logon = 1; - else // no init script was found - have_sent_ICS_logon = (appData.autoCreateLogon ? 2 : 1); // flag that we should capture username + password - } else { // we have sent (or created) the InitScript, but apparently the ICS rejected it - have_sent_ICS_logon = (appData.autoCreateLogon ? 2 : 1); // request creation of a new script - } - continue; - } - - if (ics_getting_history != H_GETTING_MOVES /*smpos kludge*/ && - (looking_at(buf, &i, "\n<12> ") || - looking_at(buf, &i, "<12> "))) { - loggedOn = TRUE; - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - next_out = i; - started = STARTED_BOARD; - parse_pos = 0; - continue; - } - - if ((started == STARTED_NONE && looking_at(buf, &i, "\n ")) || - looking_at(buf, &i, " ")) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - next_out = i; - started = STARTED_HOLDINGS; - parse_pos = 0; - continue; - } - - if (looking_at(buf, &i, "* *vs. * *--- *")) { - loggedOn = TRUE; - /* Header for a move list -- first line */ - - switch (ics_getting_history) { - case H_FALSE: - switch (gameMode) { - case IcsIdle: - case BeginningOfGame: - /* User typed "moves" or "oldmoves" while we - were idle. Pretend we asked for these - moves and soak them up so user can step - through them and/or save them. - */ - Reset(FALSE, TRUE); - gameMode = IcsObserving; - ModeHighlight(); - ics_gamenum = -1; - ics_getting_history = H_GOT_UNREQ_HEADER; - break; - case EditGame: /*?*/ - case EditPosition: /*?*/ - /* Should above feature work in these modes too? */ - /* For now it doesn't */ - ics_getting_history = H_GOT_UNWANTED_HEADER; - break; - default: - ics_getting_history = H_GOT_UNWANTED_HEADER; - break; - } - break; - case H_REQUESTED: - /* Is this the right one? */ - if (gameInfo.white && gameInfo.black && - strcmp(gameInfo.white, star_match[0]) == 0 && - strcmp(gameInfo.black, star_match[2]) == 0) { - /* All is well */ - ics_getting_history = H_GOT_REQ_HEADER; - } - break; - case H_GOT_REQ_HEADER: - case H_GOT_UNREQ_HEADER: - case H_GOT_UNWANTED_HEADER: - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: two headers"), 0); - ics_getting_history = H_FALSE; - break; - } - - /* Save player ratings into gameInfo if needed */ - if ((ics_getting_history == H_GOT_REQ_HEADER || - ics_getting_history == H_GOT_UNREQ_HEADER) && - (gameInfo.whiteRating == -1 || - gameInfo.blackRating == -1)) { - - gameInfo.whiteRating = string_to_rating(star_match[1]); - gameInfo.blackRating = string_to_rating(star_match[3]); - if (appData.debugMode) - fprintf(debugFP, "Ratings from header: W %d, B %d\n", - gameInfo.whiteRating, gameInfo.blackRating); - } - continue; - } - - if (looking_at(buf, &i, - "* * match, initial time: * minute*, increment: * second")) { - /* Header for a move list -- second line */ - /* Initial board will follow if this is a wild game */ - if (gameInfo.event != NULL) free(gameInfo.event); - snprintf(str, MSG_SIZ, "ICS %s %s match", star_match[0], star_match[1]); - gameInfo.event = StrSave(str); - /* [HGM] we switched variant. Translate boards if needed. */ - VariantSwitch(boards[currentMove], StringToVariant(gameInfo.event)); - continue; - } - - if (looking_at(buf, &i, "Move ")) { - /* Beginning of a move list */ - switch (ics_getting_history) { - case H_FALSE: - /* Normally should not happen */ - /* Maybe user hit reset while we were parsing */ - break; - case H_REQUESTED: - /* Happens if we are ignoring a move list that is not - * the one we just requested. Common if the user - * tries to observe two games without turning off - * getMoveList */ - break; - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: nested"), 0); - ics_getting_history = H_FALSE; - break; - case H_GOT_REQ_HEADER: - ics_getting_history = H_GETTING_MOVES; - started = STARTED_MOVES; - parse_pos = 0; - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - break; - case H_GOT_UNREQ_HEADER: - ics_getting_history = H_GETTING_MOVES; - started = STARTED_MOVES_NOHIDE; - parse_pos = 0; - break; - case H_GOT_UNWANTED_HEADER: - ics_getting_history = H_FALSE; - break; - } - continue; - } - - if (looking_at(buf, &i, "% ") || - ((started == STARTED_MOVES || started == STARTED_MOVES_NOHIDE) - && looking_at(buf, &i, "}*"))) { char *bookHit = NULL; // [HGM] book - if(soughtPending && nrOfSeekAds) { // [HGM] seekgraph: on ICC sought-list has no termination line - soughtPending = FALSE; - seekGraphUp = TRUE; - DrawSeekGraph(); - } - if(suppressKibitz) next_out = i; - savingComment = FALSE; - suppressKibitz = 0; - switch (started) { - case STARTED_MOVES: - case STARTED_MOVES_NOHIDE: - memcpy(&parse[parse_pos], &buf[oldi], i - oldi); - parse[parse_pos + i - oldi] = NULLCHAR; - ParseGameHistory(parse); -#if ZIPPY - if (appData.zippyPlay && first.initDone) { - FeedMovesToProgram(&first, forwardMostMove); - if (gameMode == IcsPlayingWhite) { - if (WhiteOnMove(forwardMostMove)) { - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); - } - SendTimeRemaining(&first, TRUE); - } - if (first.useColors) { - SendToProgram("white\n", &first); // [HGM] book: made sending of "go\n" book dependent - } - bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: probe book for initial pos - first.maybeThinking = TRUE; - } else { - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, TRUE); - } - SendToProgram("playother\n", &first); - firstMove = FALSE; - } else { - firstMove = TRUE; - } - } - } else if (gameMode == IcsPlayingBlack) { - if (!WhiteOnMove(forwardMostMove)) { - if (first.sendTime) { - if (first.useColors) { - SendToProgram("white\n", &first); - } - SendTimeRemaining(&first, FALSE); - } - if (first.useColors) { - SendToProgram("black\n", &first); - } - bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); - first.maybeThinking = TRUE; - } else { - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, FALSE); - } - SendToProgram("playother\n", &first); - firstMove = FALSE; - } else { - firstMove = TRUE; - } - } - } - } -#endif - if (gameMode == IcsObserving && ics_gamenum == -1) { - /* Moves came from oldmoves or moves command - while we weren't doing anything else. - */ - currentMove = forwardMostMove; - ClearHighlights();/*!!could figure this out*/ - flipView = appData.flipView; - DrawPosition(TRUE, boards[currentMove]); - DisplayBothClocks(); - snprintf(str, MSG_SIZ, "%s %s %s", - gameInfo.white, _("vs."), gameInfo.black); - DisplayTitle(str); - gameMode = IcsIdle; - } else { - /* Moves were history of an active game */ - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - } - HistorySet(parseList, backwardMostMove, - forwardMostMove, currentMove-1); - DisplayMove(currentMove - 1); - if (started == STARTED_MOVES) next_out = i; - started = STARTED_NONE; - ics_getting_history = H_FALSE; - break; - - case STARTED_OBSERVE: - started = STARTED_NONE; - SendToICS(ics_prefix); - SendToICS("refresh\n"); - break; - - default: - break; - } - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } - continue; - } - - if ((started == STARTED_MOVES || started == STARTED_BOARD || - started == STARTED_HOLDINGS || - started == STARTED_MOVES_NOHIDE) && i >= leftover_len) { - /* Accumulate characters in move list or board */ - parse[parse_pos++] = buf[i]; - } - - /* Start of game messages. Mostly we detect start of game - when the first board image arrives. On some versions - of the ICS, though, we need to do a "refresh" after starting - to observe in order to get the current board right away. */ - if (looking_at(buf, &i, "Adding game * to observation list")) { - started = STARTED_OBSERVE; - continue; - } - - /* Handle auto-observe */ - if (appData.autoObserve && - (gameMode == IcsIdle || gameMode == BeginningOfGame) && - looking_at(buf, &i, "Game notification: * (*) vs. * (*)")) { - char *player; - /* Choose the player that was highlighted, if any. */ - if (star_match[0][0] == '\033' || - star_match[1][0] != '\033') { - player = star_match[0]; - } else { - player = star_match[2]; - } - snprintf(str, MSG_SIZ, "%sobserve %s\n", - ics_prefix, StripHighlightAndTitle(player)); - SendToICS(str); - - /* Save ratings from notify string */ - safeStrCpy(player1Name, star_match[0], sizeof(player1Name)/sizeof(player1Name[0])); - player1Rating = string_to_rating(star_match[1]); - safeStrCpy(player2Name, star_match[2], sizeof(player2Name)/sizeof(player2Name[0])); - player2Rating = string_to_rating(star_match[3]); - - if (appData.debugMode) - fprintf(debugFP, - "Ratings from 'Game notification:' %s %d, %s %d\n", - player1Name, player1Rating, - player2Name, player2Rating); - - continue; - } - - /* Deal with automatic examine mode after a game, - and with IcsObserving -> IcsExamining transition */ - if (looking_at(buf, &i, "Entering examine mode for game *") || - looking_at(buf, &i, "has made you an examiner of game *")) { - - int gamenum = atoi(star_match[0]); - if ((gameMode == IcsIdle || gameMode == IcsObserving) && - gamenum == ics_gamenum) { - /* We were already playing or observing this game; - no need to refetch history */ - gameMode = IcsExamining; - if (pausing) { - pauseExamForwardMostMove = forwardMostMove; - } else if (currentMove < forwardMostMove) { - ForwardInner(forwardMostMove); - } - } else { - /* I don't think this case really can happen */ - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } - continue; - } - - /* Error messages */ -// if (ics_user_moved) { - if (1) { // [HGM] old way ignored error after move type in; ics_user_moved is not set then! - if (looking_at(buf, &i, "Illegal move") || - looking_at(buf, &i, "Not a legal move") || - looking_at(buf, &i, "Your king is in check") || - looking_at(buf, &i, "It isn't your turn") || - looking_at(buf, &i, "It is not your move")) { - /* Illegal move */ - if (ics_user_moved && forwardMostMove > backwardMostMove) { // only backup if we already moved - currentMove = forwardMostMove-1; - DisplayMove(currentMove - 1); /* before DMError */ - DrawPosition(FALSE, boards[currentMove]); - SwitchClocks(forwardMostMove-1); // [HGM] race - DisplayBothClocks(); - } - DisplayMoveError(_("Illegal move (rejected by ICS)")); // [HGM] but always relay error msg - ics_user_moved = 0; - continue; - } - } - - if (looking_at(buf, &i, "still have time") || - looking_at(buf, &i, "not out of time") || - looking_at(buf, &i, "either player is out of time") || - looking_at(buf, &i, "has timeseal; checking")) { - /* We must have called his flag a little too soon */ - whiteFlag = blackFlag = FALSE; - continue; - } - - if (looking_at(buf, &i, "added * seconds to") || - looking_at(buf, &i, "seconds were added to")) { - /* Update the clocks */ - SendToICS(ics_prefix); - SendToICS("refresh\n"); - continue; - } - - if (!ics_clock_paused && looking_at(buf, &i, "clock paused")) { - ics_clock_paused = TRUE; - StopClocks(); - continue; - } - - if (ics_clock_paused && looking_at(buf, &i, "clock resumed")) { - ics_clock_paused = FALSE; - StartClocks(); - continue; - } - - /* Grab player ratings from the Creating: message. - Note we have to check for the special case when - the ICS inserts things like [white] or [black]. */ - if (looking_at(buf, &i, "Creating: * (*)* * (*)") || - looking_at(buf, &i, "Creating: * (*) [*] * (*)")) { - /* star_matches: - 0 player 1 name (not necessarily white) - 1 player 1 rating - 2 empty, white, or black (IGNORED) - 3 player 2 name (not necessarily black) - 4 player 2 rating - - The names/ratings are sorted out when the game - actually starts (below). - */ - safeStrCpy(player1Name, StripHighlightAndTitle(star_match[0]), sizeof(player1Name)/sizeof(player1Name[0])); - player1Rating = string_to_rating(star_match[1]); - safeStrCpy(player2Name, StripHighlightAndTitle(star_match[3]), sizeof(player2Name)/sizeof(player2Name[0])); - player2Rating = string_to_rating(star_match[4]); - - if (appData.debugMode) - fprintf(debugFP, - "Ratings from 'Creating:' %s %d, %s %d\n", - player1Name, player1Rating, - player2Name, player2Rating); - - continue; - } - - /* Improved generic start/end-of-game messages */ - if ((tkind=0, looking_at(buf, &i, "{Game * (* vs. *) *}*")) || - (tkind=1, looking_at(buf, &i, "{Game * (*(*) vs. *(*)) *}*"))){ - /* If tkind == 0: */ - /* star_match[0] is the game number */ - /* [1] is the white player's name */ - /* [2] is the black player's name */ - /* For end-of-game: */ - /* [3] is the reason for the game end */ - /* [4] is a PGN end game-token, preceded by " " */ - /* For start-of-game: */ - /* [3] begins with "Creating" or "Continuing" */ - /* [4] is " *" or empty (don't care). */ - int gamenum = atoi(star_match[0]); - char *whitename, *blackname, *why, *endtoken; - ChessMove endtype = EndOfFile; - - if (tkind == 0) { - whitename = star_match[1]; - blackname = star_match[2]; - why = star_match[3]; - endtoken = star_match[4]; - } else { - whitename = star_match[1]; - blackname = star_match[3]; - why = star_match[5]; - endtoken = star_match[6]; - } - - /* Game start messages */ - if (strncmp(why, "Creating ", 9) == 0 || - strncmp(why, "Continuing ", 11) == 0) { - gs_gamenum = gamenum; - safeStrCpy(gs_kind, strchr(why, ' ') + 1,sizeof(gs_kind)/sizeof(gs_kind[0])); - if(ics_gamenum == -1) // [HGM] only if we are not already involved in a game (because gin=1 sends us such messages) - VariantSwitch(boards[currentMove], StringToVariant(gs_kind)); // [HGM] variantswitch: even before we get first board -#if ZIPPY - if (appData.zippyPlay) { - ZippyGameStart(whitename, blackname); - } -#endif /*ZIPPY*/ - partnerBoardValid = FALSE; // [HGM] bughouse - continue; - } - - /* Game end messages */ - if (gameMode == IcsIdle || gameMode == BeginningOfGame || - ics_gamenum != gamenum) { - continue; - } - while (endtoken[0] == ' ') endtoken++; - switch (endtoken[0]) { - case '*': - default: - endtype = GameUnfinished; - break; - case '0': - endtype = BlackWins; - break; - case '1': - if (endtoken[1] == '/') - endtype = GameIsDrawn; - else - endtype = WhiteWins; - break; - } - GameEnds(endtype, why, GE_ICS); -#if ZIPPY - if (appData.zippyPlay && first.initDone) { - ZippyGameEnd(endtype, why); - if (first.pr == NoProc) { - /* Start the next process early so that we'll - be ready for the next challenge */ - StartChessProgram(&first); - } - /* Send "new" early, in case this command takes - a long time to finish, so that we'll be ready - for the next challenge. */ - gameInfo.variant = VariantNormal; // [HGM] variantswitch: suppress sending of 'variant' - Reset(TRUE, TRUE); - } -#endif /*ZIPPY*/ - if(appData.bgObserve && partnerBoardValid) DrawPosition(TRUE, partnerBoard); - continue; - } - - if (looking_at(buf, &i, "Removing game * from observation") || - looking_at(buf, &i, "no longer observing game *") || - looking_at(buf, &i, "Game * (*) has no examiners")) { - if (gameMode == IcsObserving && - atoi(star_match[0]) == ics_gamenum) - { - /* icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - } - StopClocks(); - gameMode = IcsIdle; - ics_gamenum = -1; - ics_user_moved = FALSE; - } - continue; - } - - if (looking_at(buf, &i, "no longer examining game *")) { - if (gameMode == IcsExamining && - atoi(star_match[0]) == ics_gamenum) - { - gameMode = IcsIdle; - ics_gamenum = -1; - ics_user_moved = FALSE; - } - continue; - } - - /* Advance leftover_start past any newlines we find, - so only partial lines can get reparsed */ - if (looking_at(buf, &i, "\n")) { - prevColor = curColor; - if (curColor != ColorNormal) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorNormal, FALSE); - curColor = ColorNormal; - } - if (started == STARTED_BOARD) { - started = STARTED_NONE; - parse[parse_pos] = NULLCHAR; - ParseBoard12(parse); - ics_user_moved = 0; - - /* Send premove here */ - if (appData.premove) { - char str[MSG_SIZ]; - if (currentMove == 0 && - gameMode == IcsPlayingWhite && - appData.premoveWhite) { - snprintf(str, MSG_SIZ, "%s\n", appData.premoveWhiteText); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - SendToICS(str); - } else if (currentMove == 1 && - gameMode == IcsPlayingBlack && - appData.premoveBlack) { - snprintf(str, MSG_SIZ, "%s\n", appData.premoveBlackText); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - SendToICS(str); - } else if (gotPremove) { - int oldFMM = forwardMostMove; - gotPremove = 0; - ClearPremoveHighlights(); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - UserMoveEvent(premoveFromX, premoveFromY, - premoveToX, premoveToY, - premovePromoChar); - if(forwardMostMove == oldFMM) { // premove was rejected, highlight last opponent move - if(moveList[oldFMM-1][1] != '@') - SetHighlights(moveList[oldFMM-1][0]-AAA, moveList[oldFMM-1][1]-ONE, - moveList[oldFMM-1][2]-AAA, moveList[oldFMM-1][3]-ONE); - else // (drop) - SetHighlights(-1, -1, moveList[oldFMM-1][2]-AAA, moveList[oldFMM-1][3]-ONE); - } - } - } - - /* Usually suppress following prompt */ - if (!(forwardMostMove == 0 && gameMode == IcsExamining)) { - while(looking_at(buf, &i, "\n")); // [HGM] skip empty lines - if (looking_at(buf, &i, "*% ")) { - savingComment = FALSE; - suppressKibitz = 0; - } - } - next_out = i; - } else if (started == STARTED_HOLDINGS) { - int gamenum; - char new_piece[MSG_SIZ]; - started = STARTED_NONE; - parse[parse_pos] = NULLCHAR; - if (appData.debugMode) - fprintf(debugFP, "Parsing holdings: %s, currentMove = %d\n", - parse, currentMove); - if (sscanf(parse, " game %d", &gamenum) == 1) { - if(gamenum == ics_gamenum) { // [HGM] bughouse: old code if part of foreground game - if (gameInfo.variant == VariantNormal) { - /* [HGM] We seem to switch variant during a game! - * Presumably no holdings were displayed, so we have - * to move the position two files to the right to - * create room for them! - */ - VariantClass newVariant; - switch(gameInfo.boardWidth) { // base guess on board width - case 9: newVariant = VariantShogi; break; - case 10: newVariant = VariantGreat; break; - default: newVariant = VariantCrazyhouse; break; - } - VariantSwitch(boards[currentMove], newVariant); /* temp guess */ - /* Get a move list just to see the header, which - will tell us whether this is really bug or zh */ - if (ics_getting_history == H_FALSE) { - ics_getting_history = H_REQUESTED; - snprintf(str, MSG_SIZ, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } - new_piece[0] = NULLCHAR; - sscanf(parse, "game %d white [%s black [%s <- %s", - &gamenum, white_holding, black_holding, - new_piece); - white_holding[strlen(white_holding)-1] = NULLCHAR; - black_holding[strlen(black_holding)-1] = NULLCHAR; - /* [HGM] copy holdings to board holdings area */ - CopyHoldings(boards[forwardMostMove], white_holding, WhitePawn); - CopyHoldings(boards[forwardMostMove], black_holding, BlackPawn); - boards[forwardMostMove][HOLDINGS_SET] = 1; // flag holdings as set -#if ZIPPY - if (appData.zippyPlay && first.initDone) { - ZippyHoldings(white_holding, black_holding, - new_piece); - } -#endif /*ZIPPY*/ - if (tinyLayout || smallLayout) { - char wh[16], bh[16]; - PackHolding(wh, white_holding); - PackHolding(bh, black_holding); - snprintf(str, MSG_SIZ, "[%s-%s] %s-%s", wh, bh, - gameInfo.white, gameInfo.black); - } else { - snprintf(str, MSG_SIZ, "%s [%s] %s %s [%s]", - gameInfo.white, white_holding, _("vs."), - gameInfo.black, black_holding); - } - if(!partnerUp) // [HGM] bughouse: when peeking at partner game we already know what he captured... - DrawPosition(FALSE, boards[currentMove]); - DisplayTitle(str); - } else if(appData.bgObserve) { // [HGM] bughouse: holdings of other game => background - sscanf(parse, "game %d white [%s black [%s <- %s", - &gamenum, white_holding, black_holding, - new_piece); - white_holding[strlen(white_holding)-1] = NULLCHAR; - black_holding[strlen(black_holding)-1] = NULLCHAR; - /* [HGM] copy holdings to partner-board holdings area */ - CopyHoldings(partnerBoard, white_holding, WhitePawn); - CopyHoldings(partnerBoard, black_holding, BlackPawn); - if(twoBoards) { partnerUp = 1; flipView = !flipView; } // [HGM] dual: always draw - if(partnerUp) DrawPosition(FALSE, partnerBoard); - if(twoBoards) { partnerUp = 0; flipView = !flipView; } - } - } - /* Suppress following prompt */ - if (looking_at(buf, &i, "*% ")) { - if(strchr(star_match[0], 7)) SendToPlayer("\007", 1); // Bell(); // FICS fuses bell for next board with prompt in zh captures - savingComment = FALSE; - suppressKibitz = 0; - } - next_out = i; - } - continue; - } - - i++; /* skip unparsed character and loop back */ - } - - if (started != STARTED_MOVES && started != STARTED_BOARD && !suppressKibitz && // [HGM] kibitz -// started != STARTED_HOLDINGS && i > next_out) { // [HGM] should we compare to leftover_start in stead of i? -// SendToPlayer(&buf[next_out], i - next_out); - started != STARTED_HOLDINGS && leftover_start > next_out) { - SendToPlayer(&buf[next_out], leftover_start - next_out); - next_out = i; - } - - leftover_len = buf_len - leftover_start; - /* if buffer ends with something we couldn't parse, - reparse it after appending the next read */ - - } else if (count == 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Connection closed by ICS"), 0, 0); - } else { - DisplayFatalError(_("Error reading from ICS"), error, 1); - } -} - - -/* Board style 12 looks like this: - - <12> r-b---k- pp----pp ---bP--- ---p---- q------- ------P- P--Q--BP -----R-K W -1 0 0 0 0 0 0 paf MaxII 0 2 12 21 25 234 174 24 Q/d7-a4 (0:06) Qxa4 0 0 - - * The "<12> " is stripped before it gets to this routine. The two - * trailing 0's (flip state and clock ticking) are later addition, and - * some chess servers may not have them, or may have only the first. - * Additional trailing fields may be added in the future. - */ - -#define PATTERN "%c%d%d%d%d%d%d%d%s%s%d%d%d%d%d%d%d%d%s%s%s%d%d" - -#define RELATION_OBSERVING_PLAYED 0 -#define RELATION_OBSERVING_STATIC -2 /* examined, oldmoves, or smoves */ -#define RELATION_PLAYING_MYMOVE 1 -#define RELATION_PLAYING_NOTMYMOVE -1 -#define RELATION_EXAMINING 2 -#define RELATION_ISOLATED_BOARD -3 -#define RELATION_STARTING_POSITION -4 /* FICS only */ - -void -ParseBoard12 (char *string) -{ -#if ZIPPY - int i, takeback; - char *bookHit = NULL; // [HGM] book -#endif - GameMode newGameMode; - int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0; - int j, k, n, moveNum, white_stren, black_stren, white_time, black_time; - int double_push, castle_ws, castle_wl, castle_bs, castle_bl, irrev_count; - char to_play, board_chars[200]; - char move_str[MSG_SIZ], str[MSG_SIZ], elapsed_time[MSG_SIZ]; - char black[32], white[32]; - Board board; - int prevMove = currentMove; - int ticking = 2; - ChessMove moveType; - int fromX, fromY, toX, toY; - char promoChar; - int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ - Boolean weird = FALSE, reqFlag = FALSE; - - fromX = fromY = toX = toY = -1; - - newGame = FALSE; - - if (appData.debugMode) - fprintf(debugFP, "Parsing board: %s\n", string); - - move_str[0] = NULLCHAR; - elapsed_time[0] = NULLCHAR; - { /* [HGM] figure out how many ranks and files the board has, for ICS extension used by Capablanca server */ - int i = 0, j; - while(i < 199 && (string[i] != ' ' || string[i+2] != ' ')) { - if(string[i] == ' ') { ranks++; files = 0; } - else files++; - if(!strchr(" -pnbrqkPNBRQK" , string[i])) weird = TRUE; // test for fairies - i++; - } - for(j = 0; j framePtr) { // [HGM] vari: do not run into saved variations - DisplayFatalError(_("Game too long; increase MAX_MOVES and recompile"), - 0, 1); - return; - } - - switch (relation) { - case RELATION_OBSERVING_PLAYED: - case RELATION_OBSERVING_STATIC: - if (gamenum == -1) { - /* Old ICC buglet */ - relation = RELATION_OBSERVING_STATIC; - } - newGameMode = IcsObserving; - break; - case RELATION_PLAYING_MYMOVE: - case RELATION_PLAYING_NOTMYMOVE: - newGameMode = - ((relation == RELATION_PLAYING_MYMOVE) == (to_play == 'W')) ? - IcsPlayingWhite : IcsPlayingBlack; - soughtPending =FALSE; // [HGM] seekgraph: solve race condition - break; - case RELATION_EXAMINING: - newGameMode = IcsExamining; - break; - case RELATION_ISOLATED_BOARD: - default: - /* Just display this board. If user was doing something else, - we will forget about it until the next board comes. */ - newGameMode = IcsIdle; - break; - case RELATION_STARTING_POSITION: - newGameMode = gameMode; - break; - } - - if((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || - gameMode == IcsObserving && appData.dualBoard) // also allow use of second board for observing two games - && newGameMode == IcsObserving && gamenum != ics_gamenum && appData.bgObserve) { - // [HGM] bughouse: don't act on alien boards while we play. Just parse the board and save it */ - int fac = strchr(elapsed_time, '.') ? 1 : 1000; - static int lastBgGame = -1; - char *toSqr; - for (k = 0; k < ranks; k++) { - for (j = 0; j < files; j++) - board[k][j+gameInfo.holdingsWidth] = CharToPiece(board_chars[(ranks-1-k)*(files+1) + j]); - if(gameInfo.holdingsWidth > 1) { - board[k][0] = board[k][BOARD_WIDTH-1] = EmptySquare; - board[k][1] = board[k][BOARD_WIDTH-2] = (ChessSquare) 0;; - } - } - CopyBoard(partnerBoard, board); - if(toSqr = strchr(str, '/')) { // extract highlights from long move - partnerBoard[EP_STATUS-3] = toSqr[1] - AAA; // kludge: hide highlighting info in board - partnerBoard[EP_STATUS-4] = toSqr[2] - ONE; - } else partnerBoard[EP_STATUS-4] = partnerBoard[EP_STATUS-3] = -1; - if(toSqr = strchr(str, '-')) { - partnerBoard[EP_STATUS-1] = toSqr[1] - AAA; - partnerBoard[EP_STATUS-2] = toSqr[2] - ONE; - } else partnerBoard[EP_STATUS-1] = partnerBoard[EP_STATUS-2] = -1; - if(appData.dualBoard && !twoBoards) { twoBoards = 1; InitDrawingSizes(-2,0); } - if(twoBoards) { partnerUp = 1; flipView = !flipView; } // [HGM] dual - if(partnerUp) DrawPosition(FALSE, partnerBoard); - if(twoBoards) { - DisplayWhiteClock(white_time*fac, to_play == 'W'); - DisplayBlackClock(black_time*fac, to_play != 'W'); - activePartner = to_play; - if(gamenum != lastBgGame) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%s %s %s", white, _("vs."), black); - DisplayTitle(buf); - } - lastBgGame = gamenum; - activePartnerTime = to_play == 'W' ? white_time*fac : black_time*fac; - partnerUp = 0; flipView = !flipView; } // [HGM] dual - snprintf(partnerStatus, MSG_SIZ,"W: %d:%02d B: %d:%02d (%d-%d) %c", white_time*fac/60000, (white_time*fac%60000)/1000, - (black_time*fac/60000), (black_time*fac%60000)/1000, white_stren, black_stren, to_play); - if(!twoBoards) DisplayMessage(partnerStatus, ""); - partnerBoardValid = TRUE; - return; - } - - if(appData.dualBoard && appData.bgObserve) { - if((newGameMode == IcsPlayingWhite || newGameMode == IcsPlayingBlack) && moveNum == 1) - SendToICS(ics_prefix), SendToICS("pobserve\n"); - else if(newGameMode == IcsObserving && (gameMode == BeginningOfGame || gameMode == IcsIdle)) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%spobserve %s\n", ics_prefix, white); - SendToICS(buf); - } - } - - /* Modify behavior for initial board display on move listing - of wild games. - */ - switch (ics_getting_history) { - case H_FALSE: - case H_REQUESTED: - break; - case H_GOT_REQ_HEADER: - case H_GOT_UNREQ_HEADER: - /* This is the initial position of the current game */ - gamenum = ics_gamenum; - moveNum = 0; /* old ICS bug workaround */ - if (to_play == 'B') { - startedFromSetupPosition = TRUE; - blackPlaysFirst = TRUE; - moveNum = 1; - if (forwardMostMove == 0) forwardMostMove = 1; - if (backwardMostMove == 0) backwardMostMove = 1; - if (currentMove == 0) currentMove = 1; - } - newGameMode = gameMode; - relation = RELATION_STARTING_POSITION; /* ICC needs this */ - break; - case H_GOT_UNWANTED_HEADER: - /* This is an initial board that we don't want */ - return; - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: extra board"), 0); - ics_getting_history = H_FALSE; - return; - } - - if (gameInfo.boardHeight != ranks || gameInfo.boardWidth != files || - move_str[1] == '@' && !gameInfo.holdingsWidth || - weird && (int)gameInfo.variant < (int)VariantShogi) { - /* [HGM] We seem to have switched variant unexpectedly - * Try to guess new variant from board size - */ - VariantClass newVariant = VariantFairy; // if 8x8, but fairies present - if(ranks == 8 && files == 10) newVariant = VariantCapablanca; else - if(ranks == 10 && files == 9) newVariant = VariantXiangqi; else - if(ranks == 8 && files == 12) newVariant = VariantCourier; else - if(ranks == 9 && files == 9) newVariant = VariantShogi; else - if(ranks == 10 && files == 10) newVariant = VariantGrand; else - if(!weird) newVariant = move_str[1] == '@' ? VariantCrazyhouse : VariantNormal; - VariantSwitch(boards[currentMove], newVariant); /* temp guess */ - /* Get a move list just to see the header, which - will tell us whether this is really bug or zh */ - if (ics_getting_history == H_FALSE) { - ics_getting_history = H_REQUESTED; reqFlag = TRUE; - snprintf(str, MSG_SIZ, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } - - /* Take action if this is the first board of a new game, or of a - different game than is currently being displayed. */ - if (gamenum != ics_gamenum || newGameMode != gameMode || - relation == RELATION_ISOLATED_BOARD) { - - /* Forget the old game and get the history (if any) of the new one */ - if (gameMode != BeginningOfGame) { - Reset(TRUE, TRUE); - } - newGame = TRUE; - if (appData.autoRaiseBoard) BoardToTop(); - prevMove = -3; - if (gamenum == -1) { - newGameMode = IcsIdle; - } else if ((moveNum > 0 || newGameMode == IcsObserving) && newGameMode != IcsIdle && - appData.getMoveList && !reqFlag) { - /* Need to get game history */ - ics_getting_history = H_REQUESTED; - snprintf(str, MSG_SIZ, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - - /* Initially flip the board to have black on the bottom if playing - black or if the ICS flip flag is set, but let the user change - it with the Flip View button. */ - flipView = appData.autoFlipView ? - (newGameMode == IcsPlayingBlack) || ics_flip : - appData.flipView; - - /* Done with values from previous mode; copy in new ones */ - gameMode = newGameMode; - ModeHighlight(); - ics_gamenum = gamenum; - if (gamenum == gs_gamenum) { - int klen = strlen(gs_kind); - if (gs_kind[klen - 1] == '.') gs_kind[klen - 1] = NULLCHAR; - snprintf(str, MSG_SIZ, "ICS %s", gs_kind); - gameInfo.event = StrSave(str); - } else { - gameInfo.event = StrSave("ICS game"); - } - gameInfo.site = StrSave(appData.icsHost); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(white); - gameInfo.black = StrSave(black); - timeControl = basetime * 60 * 1000; - timeControl_2 = 0; - timeIncrement = increment * 1000; - movesPerSession = 0; - gameInfo.timeControl = TimeControlTagValue(); - VariantSwitch(boards[currentMove], StringToVariant(gameInfo.event) ); - if (appData.debugMode) { - fprintf(debugFP, "ParseBoard says variant = '%s'\n", gameInfo.event); - fprintf(debugFP, "recognized as %s\n", VariantName(gameInfo.variant)); - setbuf(debugFP, NULL); - } - - gameInfo.outOfBook = NULL; - - /* Do we have the ratings? */ - if (strcmp(player1Name, white) == 0 && - strcmp(player2Name, black) == 0) { - if (appData.debugMode) - fprintf(debugFP, "Remembered ratings: W %d, B %d\n", - player1Rating, player2Rating); - gameInfo.whiteRating = player1Rating; - gameInfo.blackRating = player2Rating; - } else if (strcmp(player2Name, white) == 0 && - strcmp(player1Name, black) == 0) { - if (appData.debugMode) - fprintf(debugFP, "Remembered ratings: W %d, B %d\n", - player2Rating, player1Rating); - gameInfo.whiteRating = player2Rating; - gameInfo.blackRating = player1Rating; - } - player1Name[0] = player2Name[0] = NULLCHAR; - - /* Silence shouts if requested */ - if (appData.quietPlay && - (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack)) { - SendToICS(ics_prefix); - SendToICS("set shout 0\n"); - } - } - - /* Deal with midgame name changes */ - if (!newGame) { - if (!gameInfo.white || strcmp(gameInfo.white, white) != 0) { - if (gameInfo.white) free(gameInfo.white); - gameInfo.white = StrSave(white); - } - if (!gameInfo.black || strcmp(gameInfo.black, black) != 0) { - if (gameInfo.black) free(gameInfo.black); - gameInfo.black = StrSave(black); - } - } - - /* Throw away game result if anything actually changes in examine mode */ - if (gameMode == IcsExamining && !newGame) { - gameInfo.result = GameUnfinished; - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - } - - /* In pausing && IcsExamining mode, we ignore boards coming - in if they are in a different variation than we are. */ - if (pauseExamInvalid) return; - if (pausing && gameMode == IcsExamining) { - if (moveNum <= pauseExamForwardMostMove) { - pauseExamInvalid = TRUE; - forwardMostMove = pauseExamForwardMostMove; - return; - } - } - - if (appData.debugMode) { - fprintf(debugFP, "load %dx%d board\n", files, ranks); - } - /* Parse the board */ - for (k = 0; k < ranks; k++) { - for (j = 0; j < files; j++) - board[k][j+gameInfo.holdingsWidth] = CharToPiece(board_chars[(ranks-1-k)*(files+1) + j]); - if(gameInfo.holdingsWidth > 1) { - board[k][0] = board[k][BOARD_WIDTH-1] = EmptySquare; - board[k][1] = board[k][BOARD_WIDTH-2] = (ChessSquare) 0;; - } - } - if(moveNum==0 && gameInfo.variant == VariantSChess) { - board[5][BOARD_RGHT+1] = WhiteAngel; - board[6][BOARD_RGHT+1] = WhiteMarshall; - board[1][0] = BlackMarshall; - board[2][0] = BlackAngel; - board[1][1] = board[2][1] = board[5][BOARD_RGHT] = board[6][BOARD_RGHT] = 1; - } - CopyBoard(boards[moveNum], board); - boards[moveNum][HOLDINGS_SET] = 0; // [HGM] indicate holdings not set - if (moveNum == 0) { - startedFromSetupPosition = - !CompareBoards(board, initialPosition); - if(startedFromSetupPosition) - initialRulePlies = irrev_count; /* [HGM] 50-move counter offset */ - } - - /* [HGM] Set castling rights. Take the outermost Rooks, - to make it also work for FRC opening positions. Note that board12 - is really defective for later FRC positions, as it has no way to - indicate which Rook can castle if they are on the same side of King. - For the initial position we grant rights to the outermost Rooks, - and remember thos rights, and we then copy them on positions - later in an FRC game. This means WB might not recognize castlings with - Rooks that have moved back to their original position as illegal, - but in ICS mode that is not its job anyway. - */ - if(moveNum == 0 || gameInfo.variant != VariantFischeRandom) - { int i, j; ChessSquare wKing = WhiteKing, bKing = BlackKing; - - for(i=BOARD_LEFT, j=NoRights; i=BOARD_LEFT; i--) - if(board[0][i] == WhiteRook) j = i; - initialRights[1] = boards[moveNum][CASTLING][1] = (castle_wl == 0 && gameInfo.variant != VariantFischeRandom ? NoRights : j); - for(i=BOARD_LEFT, j=NoRights; i=BOARD_LEFT; i--) - if(board[BOARD_HEIGHT-1][i] == BlackRook) j = i; - initialRights[4] = boards[moveNum][CASTLING][4] = (castle_bl == 0 && gameInfo.variant != VariantFischeRandom ? NoRights : j); - - boards[moveNum][CASTLING][2] = boards[moveNum][CASTLING][5] = NoRights; - if(gameInfo.variant == VariantKnightmate) { wKing = WhiteUnicorn; bKing = BlackUnicorn; } - for(k=BOARD_LEFT; k forwardMostMove; - - if (newGame) { - forwardMostMove = backwardMostMove = currentMove = moveNum; - if (gameMode == IcsExamining && moveNum == 0) { - /* Workaround for ICS limitation: we are not told the wild - type when starting to examine a game. But if we ask for - the move list, the move list header will tell us */ - ics_getting_history = H_REQUESTED; - snprintf(str, MSG_SIZ, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } else if (moveNum == forwardMostMove + 1 || moveNum == forwardMostMove - || (moveNum < forwardMostMove && moveNum >= backwardMostMove)) { -#if ZIPPY - /* [DM] If we found takebacks during icsEngineAnalyze try send to engine */ - /* [HGM] applied this also to an engine that is silently watching */ - if (appData.zippyPlay && moveNum < forwardMostMove && first.initDone && - (gameMode == IcsObserving || gameMode == IcsExamining) && - gameInfo.variant == currentlyInitializedVariant) { - takeback = forwardMostMove - moveNum; - for (i = 0; i < takeback; i++) { - if (appData.debugMode) fprintf(debugFP, "take back move\n"); - SendToProgram("undo\n", &first); - } - } -#endif - - forwardMostMove = moveNum; - if (!pausing || currentMove > forwardMostMove) - currentMove = forwardMostMove; - } else { - /* New part of history that is not contiguous with old part */ - if (pausing && gameMode == IcsExamining) { - pauseExamInvalid = TRUE; - forwardMostMove = pauseExamForwardMostMove; - return; - } - if (gameMode == IcsExamining && moveNum > 0 && appData.getMoveList) { -#if ZIPPY - if(appData.zippyPlay && forwardMostMove > 0 && first.initDone) { - // [HGM] when we will receive the move list we now request, it will be - // fed to the engine from the first move on. So if the engine is not - // in the initial position now, bring it there. - InitChessProgram(&first, 0); - } -#endif - ics_getting_history = H_REQUESTED; - snprintf(str, MSG_SIZ, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - forwardMostMove = backwardMostMove = currentMove = moveNum; - } - - /* Update the clocks */ - if (strchr(elapsed_time, '.')) { - /* Time is in ms */ - timeRemaining[0][moveNum] = whiteTimeRemaining = white_time; - timeRemaining[1][moveNum] = blackTimeRemaining = black_time; - } else { - /* Time is in seconds */ - timeRemaining[0][moveNum] = whiteTimeRemaining = white_time * 1000; - timeRemaining[1][moveNum] = blackTimeRemaining = black_time * 1000; - } - - -#if ZIPPY - if (appData.zippyPlay && newGame && - gameMode != IcsObserving && gameMode != IcsIdle && - gameMode != IcsExamining) - ZippyFirstBoard(moveNum, basetime, increment); -#endif - - /* Put the move on the move list, first converting - to canonical algebraic form. */ - if (moveNum > 0) { - if (appData.debugMode) { - int f = forwardMostMove; - fprintf(debugFP, "parseboard %d, castling = %d %d %d %d %d %d\n", f, - boards[f][CASTLING][0],boards[f][CASTLING][1],boards[f][CASTLING][2], - boards[f][CASTLING][3],boards[f][CASTLING][4],boards[f][CASTLING][5]); - fprintf(debugFP, "accepted move %s from ICS, parse it.\n", move_str); - fprintf(debugFP, "moveNum = %d\n", moveNum); - fprintf(debugFP, "board = %d-%d x %d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT); - setbuf(debugFP, NULL); - } - if (moveNum <= backwardMostMove) { - /* We don't know what the board looked like before - this move. Punt. */ - safeStrCpy(parseList[moveNum - 1], move_str, sizeof(parseList[moveNum - 1])/sizeof(parseList[moveNum - 1][0])); - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - moveList[moveNum - 1][0] = NULLCHAR; - } else if (strcmp(move_str, "none") == 0) { - // [HGM] long SAN: swapped order; test for 'none' before parsing move - /* Again, we don't know what the board looked like; - this is really the start of the game. */ - parseList[moveNum - 1][0] = NULLCHAR; - moveList[moveNum - 1][0] = NULLCHAR; - backwardMostMove = moveNum; - startedFromSetupPosition = TRUE; - fromX = fromY = toX = toY = -1; - } else { - // [HGM] long SAN: if legality-testing is off, disambiguation might not work or give wrong move. - // So we parse the long-algebraic move string in stead of the SAN move - int valid; char buf[MSG_SIZ], *prom; - - if(gameInfo.variant == VariantShogi && !strchr(move_str, '=') && !strchr(move_str, '@')) - strcat(move_str, "="); // if ICS does not say 'promote' on non-drop, we defer. - // str looks something like "Q/a1-a2"; kill the slash - if(str[1] == '/') - snprintf(buf, MSG_SIZ,"%c%s", str[0], str+2); - else safeStrCpy(buf, str, sizeof(buf)/sizeof(buf[0])); // might be castling - if((prom = strstr(move_str, "=")) && !strstr(buf, "=")) - strcat(buf, prom); // long move lacks promo specification! - if(!appData.testLegality && move_str[1] != '@') { // drops never ambiguous (parser chokes on long form!) - if(appData.debugMode) - fprintf(debugFP, "replaced ICS move '%s' by '%s'\n", move_str, buf); - safeStrCpy(move_str, buf, MSG_SIZ); - } - valid = ParseOneMove(move_str, moveNum - 1, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar) - || ParseOneMove(buf, moveNum - 1, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar); - // end of long SAN patch - if (valid) { - (void) CoordsToAlgebraic(boards[moveNum - 1], - PosFlags(moveNum - 1), - fromY, fromX, toY, toX, promoChar, - parseList[moveNum-1]); - switch (MateTest(boards[moveNum], PosFlags(moveNum)) ) { - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - if(!IS_SHOGI(gameInfo.variant)) - strcat(parseList[moveNum - 1], "+"); - break; - case MT_CHECKMATE: - case MT_STAINMATE: // [HGM] xq: for notation stalemate that wins counts as checkmate - strcat(parseList[moveNum - 1], "#"); - break; - } - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - /* currentMoveString is set as a side-effect of ParseOneMove */ - if(gameInfo.variant == VariantShogi && currentMoveString[4]) currentMoveString[4] = '^'; - safeStrCpy(moveList[moveNum - 1], currentMoveString, sizeof(moveList[moveNum - 1])/sizeof(moveList[moveNum - 1][0])); - strcat(moveList[moveNum - 1], "\n"); - - if(gameInfo.holdingsWidth && !appData.disguise && gameInfo.variant != VariantSuper && gameInfo.variant != VariantGreat - && gameInfo.variant != VariantGrand&& gameInfo.variant != VariantSChess) // inherit info that ICS does not give from previous board - for(k=0; k= BlackPawn && old < BlackCannon) - boards[moveNum][k][j] = PROMOTED(old); // choose correct type of Gold in promotion - else boards[moveNum][k][j] = old; // preserve type of Gold - } else if((old == WhitePawn || old == BlackPawn) && new != EmptySquare) // Pawn promotions (but not e.p.capture!) - boards[moveNum][k][j] = PROMOTED(new); // use non-primordial representation of chosen piece - } - } else { - /* Move from ICS was illegal!? Punt. */ - if (appData.debugMode) { - fprintf(debugFP, "Illegal move from ICS '%s'\n", move_str); - fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); - } - safeStrCpy(parseList[moveNum - 1], move_str, sizeof(parseList[moveNum - 1])/sizeof(parseList[moveNum - 1][0])); - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - moveList[moveNum - 1][0] = NULLCHAR; - fromX = fromY = toX = toY = -1; - } - } - if (appData.debugMode) { - fprintf(debugFP, "Move parsed to '%s'\n", parseList[moveNum - 1]); - setbuf(debugFP, NULL); - } - -#if ZIPPY - /* Send move to chess program (BEFORE animating it). */ - if (appData.zippyPlay && !newGame && newMove && - (!appData.getMoveList || backwardMostMove == 0) && first.initDone) { - - if ((gameMode == IcsPlayingWhite && WhiteOnMove(moveNum)) || - (gameMode == IcsPlayingBlack && !WhiteOnMove(moveNum))) { - if (moveList[moveNum - 1][0] == NULLCHAR) { - snprintf(str, MSG_SIZ, _("Couldn't parse move \"%s\" from ICS"), - move_str); - DisplayError(str, 0); - } else { - if (first.sendTime) { - SendTimeRemaining(&first, gameMode == IcsPlayingWhite); - } - bookHit = SendMoveToBookUser(moveNum - 1, &first, FALSE); // [HGM] book - if (firstMove && !bookHit) { - firstMove = FALSE; - if (first.useColors) { - SendToProgram(gameMode == IcsPlayingWhite ? - "white\ngo\n" : - "black\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - first.maybeThinking = TRUE; - } - } - } else if (gameMode == IcsObserving || gameMode == IcsExamining) { - if (moveList[moveNum - 1][0] == NULLCHAR) { - snprintf(str, MSG_SIZ, _("Couldn't parse move \"%s\" from ICS"), move_str); - DisplayError(str, 0); - } else { - if(gameInfo.variant == currentlyInitializedVariant) // [HGM] refrain sending moves engine can't understand! - SendMoveToProgram(moveNum - 1, &first); - } - } - } -#endif - } - - if (moveNum > 0 && !gotPremove && !appData.noGUI) { - /* If move comes from a remote source, animate it. If it - isn't remote, it will have already been animated. */ - if (!pausing && !ics_user_moved && prevMove == moveNum - 1) { - AnimateMove(boards[moveNum - 1], fromX, fromY, toX, toY); - } - if (!pausing && appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - - /* Start the clocks */ - whiteFlag = blackFlag = FALSE; - appData.clockMode = !(basetime == 0 && increment == 0); - if (ticking == 0) { - ics_clock_paused = TRUE; - StopClocks(); - } else if (ticking == 1) { - ics_clock_paused = FALSE; - } - if (gameMode == IcsIdle || - relation == RELATION_OBSERVING_STATIC || - relation == RELATION_EXAMINING || - ics_clock_paused) - DisplayBothClocks(); - else - StartClocks(); - - /* Display opponents and material strengths */ - if (gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse && !appData.noGUI) { - if (tinyLayout || smallLayout) { - if(gameInfo.variant == VariantNormal) - snprintf(str, MSG_SIZ, "%s(%d) %s(%d) {%d %d}", - gameInfo.white, white_stren, gameInfo.black, black_stren, - basetime, increment); - else - snprintf(str, MSG_SIZ, "%s(%d) %s(%d) {%d %d w%d}", - gameInfo.white, white_stren, gameInfo.black, black_stren, - basetime, increment, (int) gameInfo.variant); - } else { - if(gameInfo.variant == VariantNormal) - snprintf(str, MSG_SIZ, "%s (%d) %s %s (%d) {%d %d}", - gameInfo.white, white_stren, _("vs."), gameInfo.black, black_stren, - basetime, increment); - else - snprintf(str, MSG_SIZ, "%s (%d) %s %s (%d) {%d %d %s}", - gameInfo.white, white_stren, _("vs."), gameInfo.black, black_stren, - basetime, increment, VariantName(gameInfo.variant)); - } - DisplayTitle(str); - if (appData.debugMode) { - fprintf(debugFP, "Display title '%s, gameInfo.variant = %d'\n", str, gameInfo.variant); - } - } - - - /* Display the board */ - if (!pausing && !appData.noGUI) { - - if (appData.premove) - if (!gotPremove || - ((gameMode == IcsPlayingWhite) && (WhiteOnMove(currentMove))) || - ((gameMode == IcsPlayingBlack) && (!WhiteOnMove(currentMove)))) - ClearPremoveHighlights(); - - j = seekGraphUp; seekGraphUp = FALSE; // [HGM] seekgraph: when we draw a board, it overwrites the seek graph - if(partnerUp) { flipView = originalFlip; partnerUp = FALSE; j = TRUE; } // [HGM] bughouse: restore view - DrawPosition(j, boards[currentMove]); - - DisplayMove(moveNum - 1); - if (appData.ringBellAfterMoves && /*!ics_user_moved*/ // [HGM] use absolute method to recognize own move - !((gameMode == IcsPlayingWhite) && (!WhiteOnMove(moveNum)) || - (gameMode == IcsPlayingBlack) && (WhiteOnMove(moveNum)) ) ) { - if(newMove) RingBell(); else PlayIcsUnfinishedSound(); - } - } - - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); -#if ZIPPY - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } -#endif -} - -void -GetMoveListEvent () -{ - char buf[MSG_SIZ]; - if (appData.icsActive && gameMode != IcsIdle && ics_gamenum > 0) { - ics_getting_history = H_REQUESTED; - snprintf(buf, MSG_SIZ, "%smoves %d\n", ics_prefix, ics_gamenum); - SendToICS(buf); - } -} - -void -SendToBoth (char *msg) -{ // to make it easy to keep two engines in step in dual analysis - SendToProgram(msg, &first); - if(second.analyzing) SendToProgram(msg, &second); -} - -void -AnalysisPeriodicEvent (int force) -{ - if (((programStats.ok_to_send == 0 || programStats.line_is_book) - && !force) || !appData.periodicUpdates) - return; - - /* Send . command to Crafty to collect stats */ - SendToBoth(".\n"); - - /* Don't send another until we get a response (this makes - us stop sending to old Crafty's which don't understand - the "." command (sending illegal cmds resets node count & time, - which looks bad)) */ - programStats.ok_to_send = 0; -} - -void -ics_update_width (int new_width) -{ - ics_printf("set width %d\n", new_width); -} - -void -SendMoveToProgram (int moveNum, ChessProgramState *cps) -{ - char buf[MSG_SIZ]; - - if(moveList[moveNum][1] == '@' && moveList[moveNum][0] == '@') { - if(gameInfo.variant == VariantLion || gameInfo.variant == VariantChuChess || gameInfo.variant == VariantChu) { - sprintf(buf, "%s@@@@\n", cps->useUsermove ? "usermove " : ""); - SendToProgram(buf, cps); - return; - } - // null move in variant where engine does not understand it (for analysis purposes) - SendBoard(cps, moveNum + 1); // send position after move in stead. - return; - } - if (cps->useUsermove) { - SendToProgram("usermove ", cps); - } - if (cps->useSAN) { - char *space; - if ((space = strchr(parseList[moveNum], ' ')) != NULL) { - int len = space - parseList[moveNum]; - memcpy(buf, parseList[moveNum], len); - buf[len++] = '\n'; - buf[len] = NULLCHAR; - } else { - snprintf(buf, MSG_SIZ,"%s\n", parseList[moveNum]); - } - SendToProgram(buf, cps); - } else { - if(cps->alphaRank) { /* [HGM] shogi: temporarily convert to shogi coordinates before sending */ - AlphaRank(moveList[moveNum], 4); - SendToProgram(moveList[moveNum], cps); - AlphaRank(moveList[moveNum], 4); // and back - } else - /* Added by Tord: Send castle moves in "O-O" in FRC games if required by - * the engine. It would be nice to have a better way to identify castle - * moves here. */ - if(appData.fischerCastling && cps->useOOCastle) { - int fromX = moveList[moveNum][0] - AAA; - int fromY = moveList[moveNum][1] - ONE; - int toX = moveList[moveNum][2] - AAA; - int toY = moveList[moveNum][3] - ONE; - if((boards[moveNum][fromY][fromX] == WhiteKing - && boards[moveNum][toY][toX] == WhiteRook) - || (boards[moveNum][fromY][fromX] == BlackKing - && boards[moveNum][toY][toX] == BlackRook)) { - if(toX > fromX) SendToProgram("O-O\n", cps); - else SendToProgram("O-O-O\n", cps); - } - else SendToProgram(moveList[moveNum], cps); - } else - if(moveList[moveNum][4] == ';') { // [HGM] lion: move is double-step over intermediate square - char *m = moveList[moveNum]; - static char c[2]; - *c = m[7]; // promoChar - if((boards[moveNum][m[6]-ONE][m[5]-AAA] < BlackPawn) == (boards[moveNum][m[1]-ONE][m[0]-AAA] < BlackPawn)) // move is kludge to indicate castling - snprintf(buf, MSG_SIZ, "%c%d%c%d,%c%d%c%d\n", m[0], m[1] - '0', // convert to two moves - m[2], m[3] - '0', - m[5], m[6] - '0', - m[2] + (m[0] > m[5] ? 1 : -1), m[3] - '0'); - else if(*c && m[8]) { // kill square followed by 2 characters: 2nd kill square rather than promo suffix - *c = m[9]; - snprintf(buf, MSG_SIZ, "%c%d%c%d,%c%d%c%d,%c%d%c%d%s\n", m[0], m[1] - '0', // convert to three moves - m[7], m[8] - '0', - m[7], m[8] - '0', - m[5], m[6] - '0', - m[5], m[6] - '0', - m[2], m[3] - '0', c); - } else - snprintf(buf, MSG_SIZ, "%c%d%c%d,%c%d%c%d%s\n", m[0], m[1] - '0', // convert to two moves - m[5], m[6] - '0', - m[5], m[6] - '0', - m[2], m[3] - '0', c); - SendToProgram(buf, cps); - } else - if(BOARD_HEIGHT > 10) { // [HGM] big: convert ranks to double-digit where needed - if(moveList[moveNum][1] == '@' && (BOARD_HEIGHT < 16 || moveList[moveNum][0] <= 'Z')) { // drop move - if(moveList[moveNum][0]== '@') snprintf(buf, MSG_SIZ, "@@@@\n"); else - snprintf(buf, MSG_SIZ, "%c@%c%d%s", moveList[moveNum][0], - moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); - } else - snprintf(buf, MSG_SIZ, "%c%d%c%d%s", moveList[moveNum][0], moveList[moveNum][1] - '0', - moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); - SendToProgram(buf, cps); - } - else SendToProgram(moveList[moveNum], cps); - /* End of additions by Tord */ - } - - /* [HGM] setting up the opening has brought engine in force mode! */ - /* Send 'go' if we are in a mode where machine should play. */ - if( (moveNum == 0 && setboardSpoiledMachineBlack && cps == &first) && - (gameMode == TwoMachinesPlay || -#if ZIPPY - gameMode == IcsPlayingBlack || gameMode == IcsPlayingWhite || -#endif - gameMode == MachinePlaysBlack || gameMode == MachinePlaysWhite) ) { - SendToProgram("go\n", cps); - if (appData.debugMode) { - fprintf(debugFP, "(extra)\n"); - } - } - setboardSpoiledMachineBlack = 0; -} - -void -SendMoveToICS (ChessMove moveType, int fromX, int fromY, int toX, int toY, char promoChar) -{ - char user_move[MSG_SIZ]; - char suffix[4]; - - if(gameInfo.variant == VariantSChess && promoChar) { - snprintf(suffix, 4, "=%c", toX == BOARD_WIDTH<<1 ? ToUpper(promoChar) : ToLower(promoChar)); - if(moveType == NormalMove) moveType = WhitePromotion; // kludge to do gating - } else suffix[0] = NULLCHAR; - - switch (moveType) { - default: - snprintf(user_move, MSG_SIZ, _("say Internal error; bad moveType %d (%d,%d-%d,%d)"), - (int)moveType, fromX, fromY, toX, toY); - DisplayError(user_move + strlen("say "), 0); - break; - case WhiteKingSideCastle: - case BlackKingSideCastle: - case WhiteQueenSideCastleWild: - case BlackQueenSideCastleWild: - /* PUSH Fabien */ - case WhiteHSideCastleFR: - case BlackHSideCastleFR: - /* POP Fabien */ - snprintf(user_move, MSG_SIZ, "o-o%s\n", suffix); - break; - case WhiteQueenSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case BlackKingSideCastleWild: - /* PUSH Fabien */ - case WhiteASideCastleFR: - case BlackASideCastleFR: - /* POP Fabien */ - snprintf(user_move, MSG_SIZ, "o-o-o%s\n",suffix); - break; - case WhiteNonPromotion: - case BlackNonPromotion: - sprintf(user_move, "%c%c%c%c==\n", AAA + fromX, ONE + fromY, AAA + toX, ONE + toY); - break; - case WhitePromotion: - case BlackPromotion: - if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || - gameInfo.variant == VariantMakruk) - snprintf(user_move, MSG_SIZ, "%c%c%c%c=%c\n", - AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, - PieceToChar(WhiteFerz)); - else if(gameInfo.variant == VariantGreat) - snprintf(user_move, MSG_SIZ,"%c%c%c%c=%c\n", - AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, - PieceToChar(WhiteMan)); - else - snprintf(user_move, MSG_SIZ, "%c%c%c%c=%c\n", - AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, - promoChar); - break; - case WhiteDrop: - case BlackDrop: - drop: - snprintf(user_move, MSG_SIZ, "%c@%c%c\n", - ToUpper(PieceToChar((ChessSquare) fromX)), - AAA + toX, ONE + toY); - break; - case IllegalMove: /* could be a variant we don't quite understand */ - if(fromY == DROP_RANK) goto drop; // We need 'IllegalDrop' move type? - case NormalMove: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - snprintf(user_move, MSG_SIZ,"%c%c%c%c\n", - AAA + fromX, ONE + fromY, AAA + toX, ONE + toY); - break; - } - SendToICS(user_move); - if(appData.keepAlive) // [HGM] alive: schedule sending of dummy 'date' command - ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000); -} - -void -UploadGameEvent () -{ // [HGM] upload: send entire stored game to ICS as long-algebraic moves. - int i, last = forwardMostMove; // make sure ICS reply cannot pre-empt us by clearing fmm - static char *castlingStrings[4] = { "none", "kside", "qside", "both" }; - if(gameMode == IcsObserving || gameMode == IcsPlayingBlack || gameMode == IcsPlayingWhite) { - DisplayError(_("You cannot do this while you are playing or observing"), 0); - return; - } - if(gameMode != IcsExamining) { // is this ever not the case? - char buf[MSG_SIZ], *p, *fen, command[MSG_SIZ], bsetup = 0; - - if(ics_type == ICS_ICC) { // on ICC match ourselves in applicable variant - snprintf(command,MSG_SIZ, "match %s", ics_handle); - } else { // on FICS we must first go to general examine mode - safeStrCpy(command, "examine\nbsetup", sizeof(command)/sizeof(command[0])); // and specify variant within it with bsetups - } - if(gameInfo.variant != VariantNormal) { - // try figure out wild number, as xboard names are not always valid on ICS - for(i=1; i<=36; i++) { - snprintf(buf, MSG_SIZ, "wild/%d", i); - if(StringToVariant(buf) == gameInfo.variant) break; - } - if(i<=36 && ics_type == ICS_ICC) snprintf(buf, MSG_SIZ,"%s w%d\n", command, i); - else if(i == 22) snprintf(buf,MSG_SIZ, "%s fr\n", command); - else snprintf(buf, MSG_SIZ,"%s %s\n", command, VariantName(gameInfo.variant)); - } else snprintf(buf, MSG_SIZ,"%s\n", ics_type == ICS_ICC ? command : "examine\n"); // match yourself or examine - SendToICS(ics_prefix); - SendToICS(buf); - if(startedFromSetupPosition || backwardMostMove != 0) { - fen = PositionToFEN(backwardMostMove, NULL, 1); - if(ics_type == ICS_ICC) { // on ICC we can simply send a complete FEN to set everything - snprintf(buf, MSG_SIZ,"loadfen %s\n", fen); - SendToICS(buf); - } else { // FICS: everything has to set by separate bsetup commands - p = strchr(fen, ' '); p[0] = NULLCHAR; // cut after board - snprintf(buf, MSG_SIZ,"bsetup fen %s\n", fen); - SendToICS(buf); - if(!WhiteOnMove(backwardMostMove)) { - SendToICS("bsetup tomove black\n"); - } - i = (strchr(p+3, 'K') != NULL) + 2*(strchr(p+3, 'Q') != NULL); - snprintf(buf, MSG_SIZ,"bsetup wcastle %s\n", castlingStrings[i]); - SendToICS(buf); - i = (strchr(p+3, 'k') != NULL) + 2*(strchr(p+3, 'q') != NULL); - snprintf(buf, MSG_SIZ, "bsetup bcastle %s\n", castlingStrings[i]); - SendToICS(buf); - i = boards[backwardMostMove][EP_STATUS]; - if(i >= 0) { // set e.p. - snprintf(buf, MSG_SIZ,"bsetup eppos %c\n", i+AAA); - SendToICS(buf); - } - bsetup++; - } - } - if(bsetup || ics_type != ICS_ICC && gameInfo.variant != VariantNormal) - SendToICS("bsetup done\n"); // switch to normal examining. - } - for(i = backwardMostMove; i= 0 && killY >= 0) { - sprintf(move+4, ";%c%c\n", AAA + killX, ONE + killY); - if(kill2X >= 0 && kill2Y >= 0) sprintf(move+7, "%c%c\n", AAA + kill2X, ONE + kill2Y); - } - } else { - sprintf(move, "%c%c%c%c%c\n", - AAA + ff, ONE + rf, AAA + ft, ONE + rt, promoChar); - if(killX >= 0 && killY >= 0) { - sprintf(move+4, ";%c%c\n", AAA + killX, ONE + killY); - if(kill2X >= 0 && kill2Y >= 0) sprintf(move+7, "%c%c%c\n", AAA + kill2X, ONE + kill2Y, promoChar); - } - } - } -} - -void -ProcessICSInitScript (FILE *f) -{ - char buf[MSG_SIZ]; - - while (fgets(buf, MSG_SIZ, f)) { - SendToICSDelayed(buf,(long)appData.msLoginDelay); - } - - fclose(f); -} - - -static int lastX, lastY, lastLeftX, lastLeftY, selectFlag; -int dragging; -static ClickType lastClickType; - -int -PieceInString (char *s, ChessSquare piece) -{ - char *p, ID = ToUpper(PieceToChar(piece)), suffix = PieceSuffix(piece); - while((p = strchr(s, ID))) { - if(!suffix || p[1] == suffix) return TRUE; - s = p; - } - return FALSE; -} - -int -Partner (ChessSquare *p) -{ // change piece into promotion partner if one shogi-promotes to the other - ChessSquare partner = promoPartner[*p]; - if(PieceToChar(*p) != '+' && PieceToChar(partner) != '+') return 0; - if(PieceToChar(*p) == '+') partner = boards[currentMove][fromY][fromX]; - *p = partner; - return 1; -} - -void -Sweep (int step) -{ - ChessSquare king = WhiteKing, pawn = WhitePawn, last = promoSweep; - static int toggleFlag; - if(gameInfo.variant == VariantKnightmate) king = WhiteUnicorn; - if(gameInfo.variant == VariantSuicide || gameInfo.variant == VariantGiveaway) king = EmptySquare; - if(promoSweep >= BlackPawn) king = WHITE_TO_BLACK king, pawn = WHITE_TO_BLACK pawn; - if(gameInfo.variant == VariantSpartan && pawn == BlackPawn) pawn = BlackLance, king = EmptySquare; - if(fromY != BOARD_HEIGHT-2 && fromY != 1 && gameInfo.variant != VariantChuChess) pawn = EmptySquare; - if(!step) toggleFlag = Partner(&last); // piece has shogi-promotion - do { - if(step && !(toggleFlag && Partner(&promoSweep))) promoSweep -= step; - if(promoSweep == EmptySquare) promoSweep = BlackPawn; // wrap - else if((int)promoSweep == -1) promoSweep = WhiteKing; - else if(promoSweep == BlackPawn && step < 0 && !toggleFlag) promoSweep = WhitePawn; - else if(promoSweep == WhiteKing && step > 0 && !toggleFlag) promoSweep = BlackKing; - if(!step) step = -1; - } while(PieceToChar(promoSweep) == '.' || PieceToChar(promoSweep) == '~' || - !toggleFlag && PieceToChar(promoSweep) == '+' || // skip promoted versions of other - promoRestrict[0] ? !PieceInString(promoRestrict, promoSweep) : // if choice set available, use it - promoSweep == pawn || - appData.testLegality && (promoSweep == king || gameInfo.variant != VariantChuChess && - (promoSweep == WhiteLion || promoSweep == BlackLion))); - if(toX >= 0) { - int victim = boards[currentMove][toY][toX]; - boards[currentMove][toY][toX] = promoSweep; - DrawPosition(FALSE, boards[currentMove]); - boards[currentMove][toY][toX] = victim; - } else - ChangeDragPiece(promoSweep); -} - -int -PromoScroll (int x, int y) -{ - int step = 0; - - if(promoSweep == EmptySquare || !appData.sweepSelect) return FALSE; - if(abs(x - lastX) < 25 && abs(y - lastY) < 25) return FALSE; - if( y > lastY + 2 ) step = -1; else if(y < lastY - 2) step = 1; - if(!step) return FALSE; - lastX = x; lastY = y; - if((promoSweep < BlackPawn) == flipView) step = -step; - if(step > 0) selectFlag = 1; - if(!selectFlag) Sweep(step); - return FALSE; -} - -void -NextPiece (int step) -{ - ChessSquare piece = boards[currentMove][toY][toX]; - do { - pieceSweep -= step; - if(pieceSweep == EmptySquare) pieceSweep = WhitePawn; // wrap - if((int)pieceSweep == -1) pieceSweep = BlackKing; - if(!step) step = -1; - } while(PieceToChar(pieceSweep) == '.'); - boards[currentMove][toY][toX] = pieceSweep; - DrawPosition(FALSE, boards[currentMove]); - boards[currentMove][toY][toX] = piece; -} -/* [HGM] Shogi move preprocessor: swap digits for letters, vice versa */ -void -AlphaRank (char *move, int n) -{ -// char *p = move, c; int x, y; - - if (appData.debugMode) { - fprintf(debugFP, "alphaRank(%s,%d)\n", move, n); - } - - if(move[1]=='*' && - move[2]>='0' && move[2]<='9' && - move[3]>='a' && move[3]<='x' ) { - move[1] = '@'; - move[2] = BOARD_RGHT -1 - (move[2]-'1') + AAA; - move[3] = BOARD_HEIGHT-1 - (move[3]-'a') + ONE; - } else - if(move[0]>='0' && move[0]<='9' && - move[1]>='a' && move[1]<='x' && - move[2]>='0' && move[2]<='9' && - move[3]>='a' && move[3]<='x' ) { - /* input move, Shogi -> normal */ - move[0] = BOARD_RGHT -1 - (move[0]-'1') + AAA; - move[1] = BOARD_HEIGHT-1 - (move[1]-'a') + ONE; - move[2] = BOARD_RGHT -1 - (move[2]-'1') + AAA; - move[3] = BOARD_HEIGHT-1 - (move[3]-'a') + ONE; - } else - if(move[1]=='@' && - move[3]>='0' && move[3]<='9' && - move[2]>='a' && move[2]<='x' ) { - move[1] = '*'; - move[2] = BOARD_RGHT - 1 - (move[2]-AAA) + '1'; - move[3] = BOARD_HEIGHT-1 - (move[3]-ONE) + 'a'; - } else - if( - move[0]>='a' && move[0]<='x' && - move[3]>='0' && move[3]<='9' && - move[2]>='a' && move[2]<='x' ) { - /* output move, normal -> Shogi */ - move[0] = BOARD_RGHT - 1 - (move[0]-AAA) + '1'; - move[1] = BOARD_HEIGHT-1 - (move[1]-ONE) + 'a'; - move[2] = BOARD_RGHT - 1 - (move[2]-AAA) + '1'; - move[3] = BOARD_HEIGHT-1 - (move[3]-ONE) + 'a'; - if(move[4] == PieceToChar(BlackQueen)) move[4] = '+'; - } - if (appData.debugMode) { - fprintf(debugFP, " out = '%s'\n", move); - } -} - -char yy_textstr[8000]; - -/* Parser for moves from gnuchess, ICS, or user typein box */ -Boolean -ParseOneMove (char *move, int moveNum, ChessMove *moveType, int *fromX, int *fromY, int *toX, int *toY, char *promoChar) -{ - *moveType = yylexstr(moveNum, move, yy_textstr, sizeof yy_textstr); - - switch (*moveType) { - case WhitePromotion: - case BlackPromotion: - case WhiteNonPromotion: - case BlackNonPromotion: - case NormalMove: - case FirstLeg: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - /* Code added by Tord: */ - case WhiteHSideCastleFR: - case WhiteASideCastleFR: - case BlackHSideCastleFR: - case BlackASideCastleFR: - /* End of code added by Tord */ - case IllegalMove: /* bug or odd chess variant */ - if(currentMoveString[1] == '@') { // illegal drop - *fromX = WhiteOnMove(moveNum) ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - goto drop; - } - *fromX = currentMoveString[0] - AAA; - *fromY = currentMoveString[1] - ONE; - *toX = currentMoveString[2] - AAA; - *toY = currentMoveString[3] - ONE; - *promoChar = currentMoveString[4]; - if(*promoChar == ';') *promoChar = currentMoveString[7 + 2*(currentMoveString[8] != 0)]; - if (*fromX < BOARD_LEFT || *fromX >= BOARD_RGHT || *fromY < 0 || *fromY >= BOARD_HEIGHT || - *toX < BOARD_LEFT || *toX >= BOARD_RGHT || *toY < 0 || *toY >= BOARD_HEIGHT) { - if (appData.debugMode) { - fprintf(debugFP, "Off-board move (%d,%d)-(%d,%d)%c, type = %d\n", *fromX, *fromY, *toX, *toY, *promoChar, *moveType); - } - *fromX = *fromY = *toX = *toY = 0; - return FALSE; - } - if (appData.testLegality) { - return (*moveType != IllegalMove); - } else { - return !(*fromX == *toX && *fromY == *toY && killX < 0) && boards[moveNum][*fromY][*fromX] != EmptySquare && - // [HGM] lion: if this is a double move we are less critical - WhiteOnMove(moveNum) == (boards[moveNum][*fromY][*fromX] < BlackPawn); - } - - case WhiteDrop: - case BlackDrop: - *fromX = *moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - drop: - *fromY = DROP_RANK; - *toX = currentMoveString[2] - AAA; - *toY = currentMoveString[3] - ONE; - *promoChar = NULLCHAR; - return TRUE; - - case AmbiguousMove: - case ImpossibleMove: - case EndOfFile: - case ElapsedTime: - case Comment: - case PGNTag: - case NAG: - case WhiteWins: - case BlackWins: - case GameIsDrawn: - default: - if (appData.debugMode) { - fprintf(debugFP, "Impossible move %s, type = %d\n", currentMoveString, *moveType); - } - /* bug? */ - *fromX = *fromY = *toX = *toY = 0; - *promoChar = NULLCHAR; - return FALSE; - } -} - -Boolean pushed = FALSE; -char *lastParseAttempt; - -void -ParsePV (char *pv, Boolean storeComments, Boolean atEnd) -{ // Parse a string of PV moves, and append to current game, behind forwardMostMove - int fromX, fromY, toX, toY; char promoChar; - ChessMove moveType; - Boolean valid; - int nr = 0; - - lastParseAttempt = pv; if(!*pv) return; // turns out we crash when we parse an empty PV - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && currentMove < forwardMostMove) { - PushInner(currentMove, forwardMostMove); // [HGM] engine might not be thinking on forwardMost position! - pushed = TRUE; - } - endPV = forwardMostMove; - do { - while(*pv == ' ' || *pv == '\n' || *pv == '\t') pv++; // must still read away whitespace - if(nr == 0 && !storeComments && *pv == '(') pv++; // first (ponder) move can be in parentheses - lastParseAttempt = pv; - valid = ParseOneMove(pv, endPV, &moveType, &fromX, &fromY, &toX, &toY, &promoChar); - if(!valid && nr == 0 && - ParseOneMove(pv, endPV-1, &moveType, &fromX, &fromY, &toX, &toY, &promoChar)){ - nr++; moveType = Comment; // First move has been played; kludge to make sure we continue - // Hande case where played move is different from leading PV move - CopyBoard(boards[endPV+1], boards[endPV-1]); // tentatively unplay last game move - CopyBoard(boards[endPV+2], boards[endPV-1]); // and play first move of PV - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[endPV+2]); - if(!CompareBoards(boards[endPV], boards[endPV+2])) { - endPV += 2; // if position different, keep this - moveList[endPV-1][0] = fromX + AAA; - moveList[endPV-1][1] = fromY + ONE; - moveList[endPV-1][2] = toX + AAA; - moveList[endPV-1][3] = toY + ONE; - parseList[endPV-1][0] = NULLCHAR; - safeStrCpy(moveList[endPV-2], "_0_0", sizeof(moveList[endPV-2])/sizeof(moveList[endPV-2][0])); // suppress premove highlight on takeback move - } - } - pv = strstr(pv, yy_textstr) + strlen(yy_textstr); // skip what we parsed - if(nr == 0 && !storeComments && *pv == ')') pv++; // closing parenthesis of ponder move; - if(moveType == Comment && storeComments) AppendComment(endPV, yy_textstr, FALSE); - if(moveType == Comment || moveType == NAG || moveType == ElapsedTime) { - valid++; // allow comments in PV - continue; - } - nr++; - if(endPV+1 > framePtr) break; // no space, truncate - if(!valid) break; - endPV++; - CopyBoard(boards[endPV], boards[endPV-1]); - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[endPV]); - CoordsToComputerAlgebraic(fromY, fromX, toY, toX, promoChar, moveList[endPV - 1]); - strncat(moveList[endPV-1], "\n", MOVE_LEN); - CoordsToAlgebraic(boards[endPV - 1], - PosFlags(endPV - 1), - fromY, fromX, toY, toX, promoChar, - parseList[endPV - 1]); - } while(valid); - if(atEnd == 2) return; // used hidden, for PV conversion - currentMove = (atEnd || endPV == forwardMostMove) ? endPV : forwardMostMove + 1; - if(currentMove == forwardMostMove) ClearPremoveHighlights(); else - SetPremoveHighlights(moveList[currentMove-1][0]-AAA, moveList[currentMove-1][1]-ONE, - moveList[currentMove-1][2]-AAA, moveList[currentMove-1][3]-ONE); - DrawPosition(TRUE, boards[currentMove]); -} - -int -MultiPV (ChessProgramState *cps, int kind) -{ // check if engine supports MultiPV, and if so, return the number of the option that sets it - int i; - for(i=0; inrOptions; i++) { - char *s = cps->option[i].name; - if((kind & 1) && !StrCaseCmp(s, "MultiPV") && cps->option[i].type == Spin) return i; - if((kind & 2) && StrCaseStr(s, "multi") && StrCaseStr(s, "PV") - && StrCaseStr(s, "margin") && cps->option[i].type == Spin) return -i-2; - } - return -1; -} - -Boolean extendGame; // signals to UnLoadPV() if walked part of PV has to be appended to game -static int multi, pv_margin; -static ChessProgramState *activeCps; - -Boolean -LoadMultiPV (int x, int y, char *buf, int index, int *start, int *end, int pane) -{ - int startPV, lineStart, origIndex = index; - char *p, buf2[MSG_SIZ]; - ChessProgramState *cps = (pane ? &second : &first); - - if(index < 0 || index >= strlen(buf)) return FALSE; // sanity - lastX = x; lastY = y; - while(index > 0 && buf[index-1] != '\n') index--; // beginning of line - lineStart = startPV = index; - while(buf[index] != '\n') if(buf[index++] == '\t') startPV = index; - if(index == startPV && (p = StrCaseStr(buf+index, "PV="))) startPV = p - buf + 3; - index = startPV; - do{ while(buf[index] && buf[index] != '\n') index++; - } while(buf[index] == '\n' && buf[index+1] == '\\' && buf[index+2] == ' ' && index++); // join kibitzed PV continuation line - buf[index] = 0; - if(lineStart == 0 && gameMode == AnalyzeMode) { - int n = 0; - if(origIndex > 17 && origIndex < 24) n--; else if(origIndex > index - 6) n++; - if(n == 0) { // click not on "fewer" or "more" - if((multi = -2 - MultiPV(cps, 2)) >= 0) { - pv_margin = cps->option[multi].value; - activeCps = cps; // non-null signals margin adjustment - } - } else if((multi = MultiPV(cps, 1)) >= 0) { - n += cps->option[multi].value; if(n < 1) n = 1; - snprintf(buf2, MSG_SIZ, "option MultiPV=%d\n", n); - if(cps->option[multi].value != n) SendToProgram(buf2, cps); - cps->option[multi].value = n; - *start = *end = 0; - return FALSE; - } - } else if(strstr(buf+lineStart, "exclude:") == buf+lineStart) { // exclude moves clicked - ExcludeClick(origIndex - lineStart); - return FALSE; - } else if(!strncmp(buf+lineStart, "dep\t", 4)) { // column headers clicked - Collapse(origIndex - lineStart); - return FALSE; - } - ParsePV(buf+startPV, FALSE, gameMode != AnalyzeMode); - *start = startPV; *end = index-1; - extendGame = (gameMode == AnalyzeMode && appData.autoExtend && origIndex - startPV < 5); - return TRUE; -} - -char * -PvToSAN (char *pv) -{ - static char buf[10*MSG_SIZ]; - int i, k=0, savedEnd=endPV, saveFMM = forwardMostMove; - *buf = NULLCHAR; - if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); // shelve PV of PV-walk - ParsePV(pv, FALSE, 2); // this appends PV to game, suppressing any display of it - for(i = forwardMostMove; ioption[multi].value) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "option %s=%d\n", "Multi-PV Margin", pv_margin); - SendToProgram(buf, activeCps); - activeCps->option[multi].value = pv_margin; - } - activeCps = NULL; - return; - } - if(endPV < 0) return; - if(appData.autoCopyPV) CopyFENToClipboard(); - endPV = -1; - if(extendGame && currentMove > forwardMostMove) { - Boolean saveAnimate = appData.animate; - if(pushed) { - if(shiftKey && storedGames < MAX_VARIATIONS-2) { // wants to start variation, and there is space - if(storedGames == 1) GreyRevert(FALSE); // we already pushed the tail, so just make it official - } else storedGames--; // abandon shelved tail of original game - } - pushed = FALSE; - forwardMostMove = currentMove; - currentMove = oldFMM; - appData.animate = FALSE; - ToNrEvent(forwardMostMove); - appData.animate = saveAnimate; - } - currentMove = forwardMostMove; - if(pushed) { PopInner(0); pushed = FALSE; } // restore shelved game continuation - ClearPremoveHighlights(); - DrawPosition(TRUE, boards[currentMove]); -} - -void -MovePV (int x, int y, int h) -{ // step through PV based on mouse coordinates (called on mouse move) - int margin = h>>3, step = 0, threshold = (pieceSweep == EmptySquare ? 10 : 15); - - if(activeCps) { // adjusting engine's multi-pv margin - if(x > lastX) pv_margin++; else - if(x < lastX) pv_margin -= (pv_margin > 0); - if(x != lastX) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "margin = %d", pv_margin); - DisplayMessage(buf, ""); - } - lastX = x; - return; - } - // we must somehow check if right button is still down (might be released off board!) - if(endPV < 0 && pieceSweep == EmptySquare) return; // needed in XBoard because lastX/Y is shared :-( - if(abs(x - lastX) < threshold && abs(y - lastY) < threshold) return; - if( y > lastY + 2 ) step = -1; else if(y < lastY - 2) step = 1; - if(!step) return; - lastX = x; lastY = y; - - if(pieceSweep != EmptySquare) { NextPiece(step); return; } - if(endPV < 0) return; - if(y < margin) step = 1; else - if(y > h - margin) step = -1; - if(currentMove + step > endPV || currentMove + step < forwardMostMove) step = 0; - currentMove += step; - if(currentMove == forwardMostMove) ClearPremoveHighlights(); else - SetPremoveHighlights(moveList[currentMove-1][0]-AAA, moveList[currentMove-1][1]-ONE, - moveList[currentMove-1][2]-AAA, moveList[currentMove-1][3]-ONE); - DrawPosition(FALSE, boards[currentMove]); -} - - -// [HGM] shuffle: a general way to suffle opening setups, applicable to arbitrary variants. -// All positions will have equal probability, but the current method will not provide a unique -// numbering scheme for arrays that contain 3 or more pieces of the same kind. -#define DARK 1 -#define LITE 2 -#define ANY 3 - -int squaresLeft[4]; -int piecesLeft[(int)BlackPawn]; -int seed, nrOfShuffles; - -void -GetPositionNumber () -{ // sets global variable seed - int i; - - seed = appData.defaultFrcPosition; - if(seed < 0) { // randomize based on time for negative FRC position numbers - for(i=0; i<50; i++) seed += random(); - seed = random() ^ random() >> 8 ^ random() << 8; - if(seed<0) seed = -seed; - } -} - -int -put (Board board, int pieceType, int rank, int n, int shade) -// put the piece on the (n-1)-th empty squares of the given shade -{ - int i; - - for(i=BOARD_LEFT; i= j) i -= j--; - j = n - 1 - j; i += j; - put(board, pieceType, rank, j, ANY); - put(board, pieceType, rank, i, ANY); -} - -void -SetUpShuffle (Board board, int number) -{ - int i, p, first=1; - - GetPositionNumber(); nrOfShuffles = 1; - - squaresLeft[DARK] = (BOARD_RGHT - BOARD_LEFT + 1)/2; - squaresLeft[ANY] = BOARD_RGHT - BOARD_LEFT; - squaresLeft[LITE] = squaresLeft[ANY] - squaresLeft[DARK]; - - for(p = 0; p<=(int)WhiteKing; p++) piecesLeft[p] = 0; - - for(i=BOARD_LEFT; i (int) WhitePawn; p--) { - if(p != (int) WhiteBishop && p != (int) WhiteFerz && p != (int) WhiteAlfil) continue; - while(piecesLeft[p] >= 2) { - AddOnePiece(board, p, 0, LITE); - AddOnePiece(board, p, 0, DARK); - } - // Odd color-bound pieces are shuffled with the rest (to not run out of paired squares) - } - - for(p = (int) WhiteKing - 2; p > (int) WhitePawn; p--) { - // Remaining pieces (non-colorbound, or odd color bound) can be put anywhere - // but we leave King and Rooks for last, to possibly obey FRC restriction - if(p == (int)WhiteRook) continue; - while(piecesLeft[p] >= 2) AddTwoPieces(board, p, 0); // add in pairs, for not counting permutations - if(piecesLeft[p]) AddOnePiece(board, p, 0, ANY); // add the odd piece - } - - // now everything is placed, except perhaps King (Unicorn) and Rooks - - if(PosFlags(0) & F_FRC_TYPE_CASTLING) { - // Last King gets castling rights - while(piecesLeft[(int)WhiteUnicorn]) { - i = put(board, WhiteUnicorn, 0, piecesLeft[(int)WhiteRook]/2, ANY); - initialRights[2] = initialRights[5] = board[CASTLING][2] = board[CASTLING][5] = i; - } - - while(piecesLeft[(int)WhiteKing]) { - i = put(board, WhiteKing, 0, piecesLeft[(int)WhiteRook]/2, ANY); - initialRights[2] = initialRights[5] = board[CASTLING][2] = board[CASTLING][5] = i; - } - - - } else { - while(piecesLeft[(int)WhiteKing]) AddOnePiece(board, WhiteKing, 0, ANY); - while(piecesLeft[(int)WhiteUnicorn]) AddOnePiece(board, WhiteUnicorn, 0, ANY); - } - - // Only Rooks can be left; simply place them all - while(piecesLeft[(int)WhiteRook]) { - i = put(board, WhiteRook, 0, 0, ANY); - if(PosFlags(0) & F_FRC_TYPE_CASTLING) { // first and last Rook get FRC castling rights - if(first) { - first=0; - initialRights[1] = initialRights[4] = board[CASTLING][1] = board[CASTLING][4] = i; - } - initialRights[0] = initialRights[3] = board[CASTLING][0] = board[CASTLING][3] = i; - } - } - for(i=BOARD_LEFT; i= 0) appData.defaultFrcPosition %= nrOfShuffles; // normalize -} - -int -ptclen (const char *s, char *escapes) -{ - int n = 0; - if(!*escapes) return strlen(s); - while(*s) n += (*s != '/' && *s != '-' && *s != '^' && *s != '*' && !strchr(escapes, *s)) - 2*(*s == '='), s++; - return n; -} - -int -SetCharTableEsc (unsigned char *table, const char * map, char * escapes) -/* [HGM] moved here from winboard.c because of its general usefulness */ -/* Basically a safe strcpy that uses the last character as King */ -{ - int result = FALSE; int NrPieces; - unsigned char partner[EmptySquare]; - - if( map != NULL && (NrPieces=ptclen(map, escapes)) <= (int) EmptySquare - && NrPieces >= 12 && !(NrPieces&1)) { - int i, ii, offs, j = 0; /* [HGM] Accept even length from 12 to 88 */ - - for( i=0; i<(int) EmptySquare; i++ ) table[i] = '.'; - for( i=offs=0; i= j); seed /= 3; - p = board[0][BOARD_LEFT+j]; board[0][BOARD_LEFT+j] = EmptySquare; k = PieceToNumber(p); - board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; - board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; - j = seed%3; seed /= 3; - p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); - board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; - board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; - j = seed%2 + (seed%2 >= j); seed /= 2; - p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); - board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; - board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; - j = seed%4; seed /= 4; put(board, exoPieces[3], 0, j, ANY); - j = seed%3; seed /= 3; put(board, exoPieces[2], 0, j, ANY); - j = seed%2; seed /= 2; put(board, exoPieces[1], 0, j, ANY); - put(board, exoPieces[0], 0, 0, ANY); - for(i=BOARD_LEFT; i>1; - initialPosition[CASTLING][3] = initialRights[3] = BOARD_RGHT-1; - initialPosition[CASTLING][4] = initialRights[4] = BOARD_LEFT; - initialPosition[CASTLING][5] = initialRights[5] =(BOARD_WIDTH-1)>>1; - break; - case VariantFalcon: - pieces = FalconArray; - gameInfo.boardWidth = 10; - SetCharTable(pieceToChar, "PNBRQ............FKpnbrq............fk"); - break; - case VariantXiangqi: - pieces = XiangqiArray; - gameInfo.boardWidth = 9; - gameInfo.boardHeight = 10; - nrCastlingRights = 0; - SetCharTable(pieceToChar, "PH.R.AE..K.C.ph.r.ae..k.c."); - break; - case VariantShogi: - pieces = ShogiArray; - gameInfo.boardWidth = 9; - gameInfo.boardHeight = 9; - gameInfo.holdingsSize = 7; - nrCastlingRights = 0; - SetCharTable(pieceToChar, "PNBRLS...G.++++++Kpnbrls...g.++++++k"); - break; - case VariantChu: - pieces = ChuArray; pieceRows = 3; - gameInfo.boardWidth = 12; - gameInfo.boardHeight = 12; - nrCastlingRights = 0; - SetCharTableEsc(pieceToChar, "P.BRQSEXOGCATHD.VMLIFN.........^T..^L......^A^H/^F^G^M.^E^X^O^I.^P.^B^R..^D^S^C^VK" - "p.brqsexogcathd.vmlifn.........^t..^l......^a^h/^f^g^m.^e^x^o^i.^p.^b^r..^d^s^c^vk", SUFFIXES); - break; - case VariantCourier: - pieces = CourierArray; - gameInfo.boardWidth = 12; - nrCastlingRights = 0; - SetCharTable(pieceToChar, "PNBR.FE..WMKpnbr.fe..wmk"); - break; - case VariantKnightmate: - pieces = KnightmateArray; - SetCharTable(pieceToChar, "P.BRQ.....M.........K.p.brq.....m.........k."); - break; - case VariantSpartan: - pieces = SpartanArray; - SetCharTable(pieceToChar, "PNBRQ................K......lwg.....c...h..k"); - break; - case VariantLion: - pieces = lionArray; - SetCharTable(pieceToChar, "PNBRQ................LKpnbrq................lk"); - break; - case VariantChuChess: - pieces = ChuChessArray; - gameInfo.boardWidth = 10; - gameInfo.boardHeight = 10; - SetCharTable(pieceToChar, "PNBRQ.....M.+++......LKpnbrq.....m.+++......lk"); - break; - case VariantFairy: - pieces = fairyArray; - SetCharTable(pieceToChar, "PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk"); - break; - case VariantGreat: - pieces = GreatArray; - gameInfo.boardWidth = 10; - SetCharTable(pieceToChar, "PN....E...S..HWGMKpn....e...s..hwgmk"); - gameInfo.holdingsSize = 8; - break; - case VariantSuper: - pieces = FIDEArray; - SetCharTable(pieceToChar, "PNBRQ..SE.......V.AKpnbrq..se.......v.ak"); - gameInfo.holdingsSize = 8; - startedFromSetupPosition = TRUE; - break; - case VariantCrazyhouse: - case VariantBughouse: - pieces = FIDEArray; - SetCharTable(pieceToChar, "PNBRQ.......~~~~Kpnbrq.......~~~~k"); - gameInfo.holdingsSize = 5; - break; - case VariantWildCastle: - pieces = FIDEArray; - /* !!?shuffle with kings guaranteed to be on d or e file */ - shuffleOpenings = 1; - break; - case VariantNoCastle: - pieces = FIDEArray; - nrCastlingRights = 0; - /* !!?unconstrained back-rank shuffle */ - shuffleOpenings = 1; - break; - } - - overrule = 0; - if(appData.NrFiles >= 0) { - if(gameInfo.boardWidth != appData.NrFiles) overrule++; - gameInfo.boardWidth = appData.NrFiles; - } - if(appData.NrRanks >= 0) { - gameInfo.boardHeight = appData.NrRanks; - } - if(appData.holdingsSize >= 0) { - i = appData.holdingsSize; - if(i > gameInfo.boardHeight) i = gameInfo.boardHeight; - gameInfo.holdingsSize = i; - } - if(gameInfo.holdingsSize) gameInfo.holdingsWidth = 2; - if(BOARD_HEIGHT > BOARD_RANKS || BOARD_WIDTH > BOARD_FILES) - DisplayFatalError(_("Recompile to support this BOARD_RANKS or BOARD_FILES!"), 0, 2); - - pawnRow = gameInfo.boardHeight - 7; /* seems to work in all common variants */ - if(pawnRow < 1) pawnRow = 1; - if(gameInfo.variant == VariantMakruk || gameInfo.variant == VariantASEAN || - gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess) pawnRow = 2; - if(gameInfo.variant == VariantChu) pawnRow = 3; - - /* User pieceToChar list overrules defaults */ - if(appData.pieceToCharTable != NULL) - SetCharTableEsc(pieceToChar, appData.pieceToCharTable, SUFFIXES); - - for( j=0; j= BOARD_RGHT || overrule) continue; - initialPosition[gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess][j] = pieces[0][j-gameInfo.holdingsWidth]; - initialPosition[pawnRow][j] = WhitePawn; - initialPosition[BOARD_HEIGHT-pawnRow-1][j] = gameInfo.variant == VariantSpartan ? BlackLance : BlackPawn; - if(gameInfo.variant == VariantXiangqi) { - if(j&1) { - initialPosition[pawnRow][j] = - initialPosition[BOARD_HEIGHT-pawnRow-1][j] = EmptySquare; - if(j==BOARD_LEFT+1 || j>=BOARD_RGHT-2) { - initialPosition[2][j] = WhiteCannon; - initialPosition[BOARD_HEIGHT-3][j] = BlackCannon; - } - } - } - if(gameInfo.variant == VariantChu) { - if(j == (BOARD_WIDTH-2)/3 || j == BOARD_WIDTH - (BOARD_WIDTH+1)/3) - initialPosition[pawnRow+1][j] = WhiteCobra, - initialPosition[BOARD_HEIGHT-pawnRow-2][j] = BlackCobra; - for(i=1; i=BOARD_RGHT-1) { - initialPosition[0][j] = WhiteRook; - initialPosition[BOARD_HEIGHT-1][j] = BlackRook; - } - } - initialPosition[BOARD_HEIGHT-1-(gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess)][j] = pieces[1][j-gameInfo.holdingsWidth]; - } - if(gameInfo.variant == VariantChuChess) initialPosition[0][BOARD_WIDTH/2] = WhiteKing, initialPosition[BOARD_HEIGHT-1][BOARD_WIDTH/2-1] = BlackKing; - if( (gameInfo.variant == VariantShogi) && !overrule ) { - - j=BOARD_LEFT+1; - initialPosition[1][j] = WhiteBishop; - initialPosition[BOARD_HEIGHT-2][j] = BlackRook; - j=BOARD_RGHT-2; - initialPosition[1][j] = WhiteRook; - initialPosition[BOARD_HEIGHT-2][j] = BlackBishop; - } - - if( nrCastlingRights == -1) { - /* [HGM] Build normal castling rights (must be done after board sizing!) */ - /* This sets default castling rights from none to normal corners */ - /* Variants with other castling rights must set them themselves above */ - nrCastlingRights = 6; - - initialPosition[CASTLING][0] = initialRights[0] = BOARD_RGHT-1; - initialPosition[CASTLING][1] = initialRights[1] = BOARD_LEFT; - initialPosition[CASTLING][2] = initialRights[2] = BOARD_WIDTH>>1; - initialPosition[CASTLING][3] = initialRights[3] = BOARD_RGHT-1; - initialPosition[CASTLING][4] = initialRights[4] = BOARD_LEFT; - initialPosition[CASTLING][5] = initialRights[5] = BOARD_WIDTH>>1; - } - - if(gameInfo.variant == VariantSuper) Prelude(initialPosition); - if(gameInfo.variant == VariantGreat) { // promotion commoners - initialPosition[PieceToNumber(WhiteMan)][BOARD_WIDTH-1] = WhiteMan; - initialPosition[PieceToNumber(WhiteMan)][BOARD_WIDTH-2] = 9; - initialPosition[BOARD_HEIGHT-1-PieceToNumber(WhiteMan)][0] = BlackMan; - initialPosition[BOARD_HEIGHT-1-PieceToNumber(WhiteMan)][1] = 9; - } - if( gameInfo.variant == VariantSChess ) { - initialPosition[1][0] = BlackMarshall; - initialPosition[2][0] = BlackAngel; - initialPosition[6][BOARD_WIDTH-1] = WhiteMarshall; - initialPosition[5][BOARD_WIDTH-1] = WhiteAngel; - initialPosition[1][1] = initialPosition[2][1] = - initialPosition[6][BOARD_WIDTH-2] = initialPosition[5][BOARD_WIDTH-2] = 1; - } - if (appData.debugMode) { - fprintf(debugFP, "shuffleOpenings = %d\n", shuffleOpenings); - } - if(shuffleOpenings) { - SetUpShuffle(initialPosition, appData.defaultFrcPosition); - startedFromSetupPosition = TRUE; - } - if(startedFromPositionFile) { - /* [HGM] loadPos: use PositionFile for every new game */ - CopyBoard(initialPosition, filePosition); - for(i=0; iuseSetboard) { - char* fen = PositionToFEN(moveNum, cps->fenOverride, 1); - snprintf(message, MSG_SIZ,"setboard %s\n", fen); - SendToProgram(message, cps); - free(fen); - - } else { - ChessSquare *bp; - int i, j, left=0, right=BOARD_WIDTH; - /* Kludge to set black to move, avoiding the troublesome and now - * deprecated "black" command. - */ - if (!WhiteOnMove(moveNum)) // [HGM] but better a deprecated command than an illegal move... - SendToProgram(boards[0][1][BOARD_LEFT] == WhitePawn ? "a2a3\n" : "black\n", cps); - - if(!cps->extendedEdit) left = BOARD_LEFT, right = BOARD_RGHT; // only board proper - - SendToProgram("edit\n", cps); - SendToProgram("#\n", cps); - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - bp = &boards[moveNum][i][left]; - for (j = left; j < right; j++, bp++) { - if(j == BOARD_LEFT-1 || j == BOARD_RGHT) continue; - if ((int) *bp < (int) BlackPawn) { - if(j == BOARD_RGHT+1) - snprintf(message, MSG_SIZ, "%c@%d\n", PieceToChar(*bp), bp[-1]); - else snprintf(message, MSG_SIZ, "%c%c%d\n", PieceToChar(*bp), AAA + j, ONE + i - '0'); - if(message[0] == '+' || message[0] == '~') { - snprintf(message, MSG_SIZ,"%c%c%d+\n", - PieceToChar((ChessSquare)(DEMOTED(*bp))), - AAA + j, ONE + i - '0'); - } - if(cps->alphaRank) { /* [HGM] shogi: translate coords */ - message[1] = BOARD_RGHT - 1 - j + '1'; - message[2] = BOARD_HEIGHT - 1 - i + 'a'; - } - SendToProgram(message, cps); - } - } - } - - SendToProgram("c\n", cps); - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - bp = &boards[moveNum][i][left]; - for (j = left; j < right; j++, bp++) { - if(j == BOARD_LEFT-1 || j == BOARD_RGHT) continue; - if (((int) *bp != (int) EmptySquare) - && ((int) *bp >= (int) BlackPawn)) { - if(j == BOARD_LEFT-2) - snprintf(message, MSG_SIZ, "%c@%d\n", ToUpper(PieceToChar(*bp)), bp[1]); - else snprintf(message,MSG_SIZ, "%c%c%d\n", ToUpper(PieceToChar(*bp)), - AAA + j, ONE + i - '0'); - if(message[0] == '+' || message[0] == '~') { - snprintf(message, MSG_SIZ,"%c%c%d+\n", - PieceToChar((ChessSquare)(DEMOTED(*bp))), - AAA + j, ONE + i - '0'); - } - if(cps->alphaRank) { /* [HGM] shogi: translate coords */ - message[1] = BOARD_RGHT - 1 - j + '1'; - message[2] = BOARD_HEIGHT - 1 - i + 'a'; - } - SendToProgram(message, cps); - } - } - } - - SendToProgram(".\n", cps); - } - setboardSpoiledMachineBlack = 0; /* [HGM] assume WB 4.2.7 already solves this after sending setboard */ -} - -char exclusionHeader[MSG_SIZ]; -int exCnt, excludePtr; -typedef struct { int ff, fr, tf, tr, pc, mark; } Exclusion; -static Exclusion excluTab[200]; -static char excludeMap[(BOARD_RANKS*BOARD_FILES*BOARD_RANKS*BOARD_FILES+7)/8]; // [HGM] exclude: bitmap for excluced moves - -static void -WriteMap (int s) -{ - int j; - for(j=0; j<(BOARD_RANKS*BOARD_FILES*BOARD_RANKS*BOARD_FILES+7)/8; j++) excludeMap[j] = s; - exclusionHeader[19] = s ? '-' : '+'; // update tail state -} - -static void -ClearMap () -{ - safeStrCpy(exclusionHeader, "exclude: none best +tail \n", MSG_SIZ); - excludePtr = 24; exCnt = 0; - WriteMap(0); -} - -static void -UpdateExcludeHeader (int fromY, int fromX, int toY, int toX, char promoChar, char state) -{ // search given move in table of header moves, to know where it is listed (and add if not there), and update state - char buf[2*MOVE_LEN], *p; - Exclusion *e = excluTab; - int i; - for(i=0; i>= 3; - if(state == '*') state = (excludeMap[k] & 1< 18) { // tail - if(exclusionHeader[19] == '-') { // tail was excluded - SendToBoth("include all\n"); - WriteMap(0); // clear map completely - // now re-exclude selected moves - for(i=0; i index) { - char *p=exclusionHeader + excluTab[i].mark; // do trust header more than map (promotions!) - ExcludeOneMove(e[i].fr, e[i].ff, e[i].tr, e[i].tf, e[i].pc, *p == '+' ? '-' : '+'); - break; - } - } -} - -ChessSquare -DefaultPromoChoice (int white) -{ - ChessSquare result; - if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || - gameInfo.variant == VariantMakruk) - result = WhiteFerz; // no choice - else if(gameInfo.variant == VariantASEAN) - result = WhiteRook; // no choice - else if(gameInfo.variant == VariantSuicide || gameInfo.variant == VariantGiveaway) - result= WhiteKing; // in Suicide Q is the last thing we want - else if(gameInfo.variant == VariantSpartan) - result = white ? WhiteQueen : WhiteAngel; - else result = WhiteQueen; - if(!white) result = WHITE_TO_BLACK result; - return result; -} - -static int autoQueen; // [HGM] oneclick - -int -HasPromotionChoice (int fromX, int fromY, int toX, int toY, char *promoChoice, int sweepSelect) -{ - /* [HGM] rewritten IsPromotion to only flag promotions that offer a choice */ - /* [HGM] add Shogi promotions */ - int promotionZoneSize=1, highestPromotingPiece = (int)WhitePawn; - ChessSquare piece, partner; - ChessMove moveType; - Boolean premove; - - if(fromX < BOARD_LEFT || fromX >= BOARD_RGHT) return FALSE; // drop - if(toX < BOARD_LEFT || toX >= BOARD_RGHT) return FALSE; // move into holdings - - if(gameMode == EditPosition || gameInfo.variant == VariantXiangqi || // no promotions - !(fromX >=0 && fromY >= 0 && toX >= 0 && toY >= 0) ) // invalid move - return FALSE; - - piece = boards[currentMove][fromY][fromX]; - if(gameInfo.variant == VariantChu) { - promotionZoneSize = BOARD_HEIGHT/3; - highestPromotingPiece = (PieceToChar(piece) == '+' || PieceToChar(CHUPROMOTED(piece)) != '+') ? WhitePawn : WhiteKing; - } else if(gameInfo.variant == VariantShogi) { - promotionZoneSize = BOARD_HEIGHT/3 +(BOARD_HEIGHT == 8); - highestPromotingPiece = (int)WhiteAlfil; - } else if(gameInfo.variant == VariantMakruk || gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess) { - promotionZoneSize = 3; - } - - // Treat Lance as Pawn when it is not representing Amazon or Lance - if(gameInfo.variant != VariantSuper && gameInfo.variant != VariantChu) { - if(piece == WhiteLance) piece = WhitePawn; else - if(piece == BlackLance) piece = BlackPawn; - } - - // next weed out all moves that do not touch the promotion zone at all - if((int)piece >= BlackPawn) { - if(toY >= promotionZoneSize && fromY >= promotionZoneSize) - return FALSE; - if(fromY < promotionZoneSize && gameInfo.variant == VariantChuChess) return FALSE; - highestPromotingPiece = WHITE_TO_BLACK highestPromotingPiece; - } else { - if( toY < BOARD_HEIGHT - promotionZoneSize && - fromY < BOARD_HEIGHT - promotionZoneSize) return FALSE; - if(fromY >= BOARD_HEIGHT - promotionZoneSize && gameInfo.variant == VariantChuChess) - return FALSE; - } - - if( (int)piece > highestPromotingPiece ) return FALSE; // non-promoting piece - - // weed out mandatory Shogi promotions - if(gameInfo.variant == VariantShogi) { - if(piece >= BlackPawn) { - if(toY == 0 && piece == BlackPawn || - toY == 0 && piece == BlackQueen || - toY <= 1 && piece == BlackKnight) { - *promoChoice = '+'; - return FALSE; - } - } else { - if(toY == BOARD_HEIGHT-1 && piece == WhitePawn || - toY == BOARD_HEIGHT-1 && piece == WhiteQueen || - toY >= BOARD_HEIGHT-2 && piece == WhiteKnight) { - *promoChoice = '+'; - return FALSE; - } - } - } - - // weed out obviously illegal Pawn moves - if(appData.testLegality && (piece == WhitePawn || piece == BlackPawn) ) { - if(toX > fromX+1 || toX < fromX-1) return FALSE; // wide - if(piece == WhitePawn && toY != fromY+1) return FALSE; // deep - if(piece == BlackPawn && toY != fromY-1) return FALSE; // deep - if(fromX != toX && gameInfo.variant == VariantShogi) return FALSE; - // note we are not allowed to test for valid (non-)capture, due to premove - } - - // we either have a choice what to promote to, or (in Shogi) whether to promote - if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || - gameInfo.variant == VariantMakruk) { - ChessSquare p=BlackFerz; // no choice - while(p < EmptySquare) { //but make sure we use piece that exists - *promoChoice = PieceToChar(p++); - if(*promoChoice != '.') break; - } - if(!*engineVariant) return FALSE; // if used as parent variant there might be promotion choice - } - // no sense asking what we must promote to if it is going to explode... - if(gameInfo.variant == VariantAtomic && boards[currentMove][toY][toX] != EmptySquare) { - *promoChoice = PieceToChar(BlackQueen); // Queen as good as any - return FALSE; - } - // give caller the default choice even if we will not make it - *promoChoice = ToLower(PieceToChar(defaultPromoChoice)); - partner = piece; // pieces can promote if the pieceToCharTable says so - if(IS_SHOGI(gameInfo.variant)) *promoChoice = (defaultPromoChoice == piece && sweepSelect ? '=' : '+'); // obsolete? - else if(Partner(&partner)) *promoChoice = (defaultPromoChoice == piece && sweepSelect ? NULLCHAR : '+'); - if( sweepSelect && gameInfo.variant != VariantGreat - && gameInfo.variant != VariantGrand - && gameInfo.variant != VariantSuper) return FALSE; - if(autoQueen) return FALSE; // predetermined - - // suppress promotion popup on illegal moves that are not premoves - premove = gameMode == IcsPlayingWhite && !WhiteOnMove(currentMove) || - gameMode == IcsPlayingBlack && WhiteOnMove(currentMove); - if(appData.testLegality && !premove) { - moveType = LegalityTest(boards[currentMove], PosFlags(currentMove), - fromY, fromX, toY, toX, IS_SHOGI(gameInfo.variant) || gameInfo.variant == VariantChuChess ? '+' : NULLCHAR); - if(moveType == IllegalMove) *promoChoice = NULLCHAR; // could be the fact we promoted was illegal - if(moveType != WhitePromotion && moveType != BlackPromotion) - return FALSE; - } - - return TRUE; -} - -int -InPalace (int row, int column) -{ /* [HGM] for Xiangqi */ - if( (row < 3 || row > BOARD_HEIGHT-4) && - column < (BOARD_WIDTH + 4)/2 && - column > (BOARD_WIDTH - 5)/2 ) return TRUE; - return FALSE; -} - -int -PieceForSquare (int x, int y) -{ - if (x < 0 || x >= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) - return -1; - else - return boards[currentMove][y][x]; -} - -int -OKToStartUserMove (int x, int y) -{ - ChessSquare from_piece; - int white_piece; - - if (matchMode) return FALSE; - if (gameMode == EditPosition) return TRUE; - - if (x >= 0 && y >= 0) - from_piece = boards[currentMove][y][x]; - else - from_piece = EmptySquare; - - if (from_piece == EmptySquare) return FALSE; - - white_piece = (int)from_piece >= (int)WhitePawn && - (int)from_piece < (int)BlackPawn; /* [HGM] can be > King! */ - - switch (gameMode) { - case AnalyzeFile: - case TwoMachinesPlay: - case EndOfGame: - return FALSE; - - case IcsObserving: - case IcsIdle: - return FALSE; - - case MachinePlaysWhite: - case IcsPlayingBlack: - if (appData.zippyPlay) return FALSE; - if (white_piece) { - DisplayMoveError(_("You are playing Black")); - return FALSE; - } - break; - - case MachinePlaysBlack: - case IcsPlayingWhite: - if (appData.zippyPlay) return FALSE; - if (!white_piece) { - DisplayMoveError(_("You are playing White")); - return FALSE; - } - break; - - case PlayFromGameFile: - if(!shiftKey || !appData.variations) return FALSE; // [HGM] allow starting variation in this mode - case EditGame: - case AnalyzeMode: - if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return FALSE; - } - if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return FALSE; - } - if (cmailMsgLoaded && (currentMove < cmailOldMove)) { - /* Editing correspondence game history */ - /* Could disallow this or prompt for confirmation */ - cmailOldMove = -1; - } - break; - - case BeginningOfGame: - if (appData.icsActive) return FALSE; - if (!appData.noChessProgram) { - if (!white_piece) { - DisplayMoveError(_("You are playing White")); - return FALSE; - } - } - break; - - case Training: - if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return FALSE; - } - if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return FALSE; - } - break; - - default: - case IcsExamining: - break; - } - if (currentMove != forwardMostMove && gameMode != AnalyzeMode - && gameMode != EditGame // [HGM] vari: treat as AnalyzeMode - && gameMode != PlayFromGameFile // [HGM] as EditGame, with protected main line - && gameMode != AnalyzeFile && gameMode != Training) { - DisplayMoveError(_("Displayed position is not current")); - return FALSE; - } - return TRUE; -} - -Boolean -OnlyMove (int *x, int *y, Boolean captures) -{ - DisambiguateClosure cl; - if (appData.zippyPlay || !appData.testLegality) return FALSE; - switch(gameMode) { - case MachinePlaysBlack: - case IcsPlayingWhite: - case BeginningOfGame: - if(!WhiteOnMove(currentMove)) return FALSE; - break; - case MachinePlaysWhite: - case IcsPlayingBlack: - if(WhiteOnMove(currentMove)) return FALSE; - break; - case EditGame: - break; - default: - return FALSE; - } - cl.pieceIn = EmptySquare; - cl.rfIn = *y; - cl.ffIn = *x; - cl.rtIn = -1; - cl.ftIn = -1; - cl.promoCharIn = NULLCHAR; - Disambiguate(boards[currentMove], PosFlags(currentMove), &cl); - if( cl.kind == NormalMove || - cl.kind == AmbiguousMove && captures && cl.captures == 1 || - cl.kind == WhitePromotion || cl.kind == BlackPromotion || - cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) { - fromX = cl.ff; - fromY = cl.rf; - *x = cl.ft; - *y = cl.rt; - return TRUE; - } - if(cl.kind != ImpossibleMove) return FALSE; - cl.pieceIn = EmptySquare; - cl.rfIn = -1; - cl.ffIn = -1; - cl.rtIn = *y; - cl.ftIn = *x; - cl.promoCharIn = NULLCHAR; - Disambiguate(boards[currentMove], PosFlags(currentMove), &cl); - if( cl.kind == NormalMove || - cl.kind == AmbiguousMove && captures && cl.captures == 1 || - cl.kind == WhitePromotion || cl.kind == BlackPromotion || - cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) { - fromX = cl.ff; - fromY = cl.rf; - *x = cl.ft; - *y = cl.rt; - autoQueen = TRUE; // act as if autoQueen on when we click to-square - return TRUE; - } - return FALSE; -} - -FILE *lastLoadGameFP = NULL, *lastLoadPositionFP = NULL; -int lastLoadGameNumber = 0, lastLoadPositionNumber = 0; -int lastLoadGameUseList = FALSE; -char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ]; -ChessMove lastLoadGameStart = EndOfFile; -int doubleClick; -Boolean addToBookFlag; -static Board rightsBoard, nullBoard; - -void -UserMoveEvent (int fromX, int fromY, int toX, int toY, int promoChar) -{ - ChessMove moveType; - ChessSquare pup; - int ff=fromX, rf=fromY, ft=toX, rt=toY; - - /* Check if the user is playing in turn. This is complicated because we - let the user "pick up" a piece before it is his turn. So the piece he - tried to pick up may have been captured by the time he puts it down! - Therefore we use the color the user is supposed to be playing in this - test, not the color of the piece that is currently on the starting - square---except in EditGame mode, where the user is playing both - sides; fortunately there the capture race can't happen. (It can - now happen in IcsExamining mode, but that's just too bad. The user - will get a somewhat confusing message in that case.) - */ - - switch (gameMode) { - case AnalyzeFile: - case TwoMachinesPlay: - case EndOfGame: - case IcsObserving: - case IcsIdle: - /* We switched into a game mode where moves are not accepted, - perhaps while the mouse button was down. */ - return; - - case MachinePlaysWhite: - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - break; - - case MachinePlaysBlack: - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - break; - - case PlayFromGameFile: - if(!shiftKey ||!appData.variations) return; // [HGM] only variations - case EditGame: - case IcsExamining: - case BeginningOfGame: - case AnalyzeMode: - case Training: - if(fromY == DROP_RANK) break; // [HGM] drop moves (entered through move type-in) are automatically assigned to side-to-move - if ((int) boards[currentMove][fromY][fromX] >= (int) BlackPawn && - (int) boards[currentMove][fromY][fromX] < (int) EmptySquare) { - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - } else { - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - } - break; - - case IcsPlayingBlack: - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - if (!appData.premove) { - DisplayMoveError(_("It is White's turn")); - } else if (toX >= 0 && toY >= 0) { - premoveToX = toX; - premoveToY = toY; - premoveFromX = fromX; - premoveFromY = fromY; - premovePromoChar = promoChar; - gotPremove = 1; - if (appData.debugMode) - fprintf(debugFP, "Got premove: fromX %d," - "fromY %d, toX %d, toY %d\n", - fromX, fromY, toX, toY); - } - DrawPosition(TRUE, boards[currentMove]); // [HGM] repair animation damage done by premove (in particular emptying from-square) - return; - } - break; - - case IcsPlayingWhite: - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - if (!appData.premove) { - DisplayMoveError(_("It is Black's turn")); - } else if (toX >= 0 && toY >= 0) { - premoveToX = toX; - premoveToY = toY; - premoveFromX = fromX; - premoveFromY = fromY; - premovePromoChar = promoChar; - gotPremove = 1; - if (appData.debugMode) - fprintf(debugFP, "Got premove: fromX %d," - "fromY %d, toX %d, toY %d\n", - fromX, fromY, toX, toY); - } - DrawPosition(TRUE, boards[currentMove]); - return; - } - break; - - default: - break; - - case EditPosition: - /* EditPosition, empty square, or different color piece; - click-click move is possible */ - if (toX == -2 || toY == -2) { - boards[0][fromY][fromX] = (boards[0][fromY][fromX] == EmptySquare ? DarkSquare : EmptySquare); - DrawPosition(FALSE, boards[currentMove]); - return; - } else if (toX >= 0 && toY >= 0) { - if(!appData.pieceMenu && toX == fromX && toY == fromY && boards[0][rf][ff] != EmptySquare) { - ChessSquare p = boards[0][rf][ff]; - if(PieceToChar(p) == '+') gatingPiece = CHUDEMOTED(p); else - if(PieceToChar(CHUPROMOTED(p)) =='+') gatingPiece = CHUPROMOTED(p); else - if(p == WhiteKing || p == BlackKing || p == WhiteRook || p == BlackRook || p == WhitePawn || p == BlackPawn) { - int n = rightsBoard[toY][toX] ^= 1; // toggle virginity of K or R - DisplayMessage("", n ? _("rights granted") : _("rights revoked")); - gatingPiece = p; - } - } else rightsBoard[toY][toX] = 0; // revoke rights on moving - boards[0][toY][toX] = boards[0][fromY][fromX]; - if(fromX == BOARD_LEFT-2) { // handle 'moves' out of holdings - if(boards[0][fromY][0] != EmptySquare) { - if(boards[0][fromY][1]) boards[0][fromY][1]--; - if(boards[0][fromY][1] == 0) boards[0][fromY][0] = EmptySquare; - } - } else - if(fromX == BOARD_RGHT+1) { - if(boards[0][fromY][BOARD_WIDTH-1] != EmptySquare) { - if(boards[0][fromY][BOARD_WIDTH-2]) boards[0][fromY][BOARD_WIDTH-2]--; - if(boards[0][fromY][BOARD_WIDTH-2] == 0) boards[0][fromY][BOARD_WIDTH-1] = EmptySquare; - } - } else - boards[0][fromY][fromX] = gatingPiece; - ClearHighlights(); - DrawPosition(FALSE, boards[currentMove]); - return; - } - return; - } - - if((toX < 0 || toY < 0) && (fromY != DROP_RANK || fromX != EmptySquare)) return; - pup = boards[currentMove][toY][toX]; - - /* [HGM] If move started in holdings, it means a drop. Convert to standard form */ - if( (fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) && fromY != DROP_RANK ) { - if( pup != EmptySquare ) return; - moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; - if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n", - moveType, currentMove, fromX, fromY, boards[currentMove][fromY][fromX]); - // holdings might not be sent yet in ICS play; we have to figure out which piece belongs here - if(fromX == 0) fromY = BOARD_HEIGHT-1 - fromY; // black holdings upside-down - fromX = fromX ? WhitePawn : BlackPawn; // first piece type in selected holdings - while(PieceToChar(fromX) == '.' || PieceToChar(fromX) == '+' || PieceToNumber(fromX) != fromY && fromX != (int) EmptySquare) fromX++; - fromY = DROP_RANK; - } - - /* [HGM] always test for legality, to get promotion info */ - moveType = LegalityTest(boards[currentMove], PosFlags(currentMove), - fromY, fromX, toY, toX, promoChar); - - if(fromY == DROP_RANK && fromX == EmptySquare && (gameMode == AnalyzeMode || gameMode == EditGame || PosFlags(0) & F_NULL_MOVE)) moveType = NormalMove; - - if(moveType == IllegalMove && legal[toY][toX] > 1) moveType = NormalMove; // someone explicitly told us this move is legal - - /* [HGM] but possibly ignore an IllegalMove result */ - if (appData.testLegality) { - if (moveType == IllegalMove || moveType == ImpossibleMove) { - DisplayMoveError(_("Illegal move")); - return; - } - } - - if(doubleClick && gameMode == AnalyzeMode) { // [HGM] exclude: move entered with double-click on from square is for exclusion, not playing - if(ExcludeOneMove(fromY, fromX, toY, toX, promoChar, '*')) // toggle - ClearPremoveHighlights(); // was included - else ClearHighlights(), SetPremoveHighlights(ff, rf, ft, rt); // exclusion indicated by premove highlights - DrawPosition(FALSE, NULL); - return; - } - - if(addToBookFlag) { // adding moves to book - char buf[MSG_SIZ], move[MSG_SIZ]; - CoordsToAlgebraic(boards[currentMove], PosFlags(currentMove), fromY, fromX, toY, toX, promoChar, move); - if(killX >= 0) snprintf(move, MSG_SIZ, "%c%dx%c%d-%c%d%c", fromX + AAA, fromY + ONE - '0', - killX + AAA, killY + ONE - '0', toX + AAA, toY + ONE - '0', promoChar); - snprintf(buf, MSG_SIZ, " 0.0%% 1 %s\n", move); - AddBookMove(buf); - addToBookFlag = FALSE; - ClearHighlights(); - return; - } - - FinishMove(moveType, fromX, fromY, toX, toY, promoChar); -} - -/* Common tail of UserMoveEvent and DropMenuEvent */ -int -FinishMove (ChessMove moveType, int fromX, int fromY, int toX, int toY, int promoChar) -{ - char *bookHit = 0; - - if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) && promoChar != NULLCHAR) { - // [HGM] superchess: suppress promotions to non-available piece (but P always allowed) - int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); - if(WhiteOnMove(currentMove)) { - if(!boards[currentMove][k][BOARD_WIDTH-2]) return 0; - } else { - if(!boards[currentMove][BOARD_HEIGHT-1-k][1]) return 0; - } - } - - /* [HGM] kludge to avoid having to know the exact promotion - move type in caller when we know the move is a legal promotion */ - if(moveType == NormalMove && promoChar) - moveType = WhiteOnMove(currentMove) ? WhitePromotion : BlackPromotion; - - /* [HGM] The following if has been moved here from - UserMoveEvent(). Because it seemed to belong here (why not allow - piece drops in training games?), and because it can only be - performed after it is known to what we promote. */ - if (gameMode == Training) { - /* compare the move played on the board to the next move in the - * game. If they match, display the move and the opponent's response. - * If they don't match, display an error message. - */ - int saveAnimate; - Board testBoard; - CopyBoard(testBoard, boards[currentMove]); - ApplyMove(fromX, fromY, toX, toY, promoChar, testBoard); - - if (CompareBoards(testBoard, boards[currentMove+1])) { - ForwardInner(currentMove+1); - - /* Autoplay the opponent's response. - * if appData.animate was TRUE when Training mode was entered, - * the response will be animated. - */ - saveAnimate = appData.animate; - appData.animate = animateTraining; - ForwardInner(currentMove+1); - appData.animate = saveAnimate; - - /* check for the end of the game */ - if (currentMove >= forwardMostMove) { - gameMode = PlayFromGameFile; - ModeHighlight(); - SetTrainingModeOff(); - DisplayInformation(_("End of game")); - } - } else { - DisplayError(_("Incorrect move"), 0); - } - return 1; - } - - /* Ok, now we know that the move is good, so we can kill - the previous line in Analysis Mode */ - if ((gameMode == AnalyzeMode || gameMode == EditGame || gameMode == PlayFromGameFile && appData.variations && shiftKey) - && currentMove < forwardMostMove) { - if(appData.variations && shiftKey) PushTail(currentMove, forwardMostMove); // [HGM] vari: save tail of game - else forwardMostMove = currentMove; - } - - ClearMap(); - - /* If we need the chess program but it's dead, restart it */ - ResurrectChessProgram(); - - /* A user move restarts a paused game*/ - if (pausing) - PauseEvent(); - - thinkOutput[0] = NULLCHAR; - - MakeMove(fromX, fromY, toX, toY, promoChar); /*updates forwardMostMove*/ - - if(Adjudicate(NULL)) { // [HGM] adjudicate: take care of automatic game end - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - return 1; - } - - if (gameMode == BeginningOfGame) { - if (appData.noChessProgram) { - gameMode = EditGame; - SetGameInfo(); - } else { - char buf[MSG_SIZ]; - gameMode = MachinePlaysBlack; - StartClocks(); - SetGameInfo(); - snprintf(buf, MSG_SIZ, "%s %s %s", gameInfo.white, _("vs."), gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - snprintf(buf, MSG_SIZ,"name %s\n", gameInfo.white); - SendToProgram(buf, &first); - } - StartClocks(); - } - ModeHighlight(); - } - - /* Relay move to ICS or chess engine */ - if (appData.icsActive) { - if (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || - gameMode == IcsExamining) { - if(userOfferedDraw && (signed char)boards[forwardMostMove][EP_STATUS] <= EP_DRAWS) { - SendToICS(ics_prefix); // [HGM] drawclaim: send caim and move on one line for FICS - SendToICS("draw "); - SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar); - } - // also send plain move, in case ICS does not understand atomic claims - SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar); - ics_user_moved = 1; - } - } else { - if (first.sendTime && (gameMode == BeginningOfGame || - gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack)) { - SendTimeRemaining(&first, gameMode != MachinePlaysBlack); - } - if (gameMode != EditGame && gameMode != PlayFromGameFile && gameMode != AnalyzeMode) { - // [HGM] book: if program might be playing, let it use book - bookHit = SendMoveToBookUser(forwardMostMove-1, &first, FALSE); - first.maybeThinking = TRUE; - } else if(fromY == DROP_RANK && fromX == EmptySquare) { - if(!first.useSetboard) SendToProgram("undo\n", &first); // kludge to change stm in engines that do not support setboard - SendBoard(&first, currentMove+1); - if(second.analyzing) { - if(!second.useSetboard) SendToProgram("undo\n", &second); - SendBoard(&second, currentMove+1); - } - } else { - SendMoveToProgram(forwardMostMove-1, &first); - if(second.analyzing) SendMoveToProgram(forwardMostMove-1, &second); - } - if (currentMove == cmailOldMove + 1) { - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } - - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - - switch (gameMode) { - case EditGame: - if(appData.testLegality) - switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - case MT_STAINMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_PLAYER); - } else { - GameEnds(WhiteWins, "White mates", GE_PLAYER); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); - break; - } - break; - - case MachinePlaysBlack: - case MachinePlaysWhite: - /* disable certain menu options while machine is thinking */ - SetMachineThinkingEnables(); - break; - - default: - break; - } - - userOfferedDraw = FALSE; // [HGM] drawclaim: after move made, and tested for claimable draw - promoDefaultAltered = FALSE; // [HGM] fall back on default choice - - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } - return 1; -} - -void -MarkByFEN(char *fen) -{ - int r, f; - if(!appData.markers || !appData.highlightDragging) return; - for(r=0; r= 'A' && *fen <= 'Z') legal[r][f] = 3; else - if(*fen >= 'a' && *fen <= 'z') *fen += 'A' - 'a'; - if(*fen == '/' && f > BOARD_LEFT) f = BOARD_LEFT, r--; else - if(*fen == 'T') marker[r][f++] = 0; else - if(*fen == 'Y') marker[r][f++] = 1; else - if(*fen == 'G') marker[r][f++] = 3; else - if(*fen == 'B') marker[r][f++] = 4; else - if(*fen == 'C') marker[r][f++] = 5; else - if(*fen == 'M') marker[r][f++] = 6; else - if(*fen == 'W') marker[r][f++] = 7; else - if(*fen == 'D') marker[r][f++] = 8; else - if(*fen == 'R') marker[r][f++] = 2; else { - while(*fen <= '9' && *fen >= '0') s = 10*s + *fen++ - '0'; - f += s; fen -= s>0; - } - while(f >= BOARD_RGHT) f -= BOARD_RGHT - BOARD_LEFT, r--; - if(r < 0) break; - fen++; - } - DrawPosition(TRUE, NULL); -} - -static char baseMarker[BOARD_RANKS][BOARD_FILES], baseLegal[BOARD_RANKS][BOARD_FILES]; - -void -Mark (Board board, int flags, ChessMove kind, int rf, int ff, int rt, int ft, VOIDSTAR closure) -{ - typedef char Markers[BOARD_RANKS][BOARD_FILES]; - Markers *m = (Markers *) closure; - if(rf == fromY && ff == fromX && (killX < 0 ? !(rt == rf && ft == ff) && legNr & 1 : - kill2X < 0 ? rt == killY && ft == killX || legNr & 2 : rt == killY && ft == killX || legNr & 4)) - (*m)[rt][ft] = 1 + (board[rt][ft] != EmptySquare - || kind == WhiteCapturesEnPassant - || kind == BlackCapturesEnPassant) + 3*(kind == FirstLeg && (killX < 0 & legNr || legNr & 2 && kill2X < 0)), legal[rt][ft] = 3; - else if(flags & F_MANDATORY_CAPTURE && board[rt][ft] != EmptySquare) (*m)[rt][ft] = 3, legal[rt][ft] = 3; -} - -static int hoverSavedValid; - -void -MarkTargetSquares (int clear) -{ - int x, y, sum=0; - if(clear) { // no reason to ever suppress clearing - for(x=0; x1) capt++; - if(capt) - for(x=0; x= BOARD_HEIGHT-1-zone || - piece == BlackLance && y <= zone || - piece == WhiteLance && y >= BOARD_HEIGHT-1-zone ); -} - -void -HoverEvent (int xPix, int yPix, int x, int y) -{ - static int oldX = -1, oldY = -1, oldFromX = -1, oldFromY = -1; - int r, f; - if(!first.highlight) return; - if(fromX != oldFromX || fromY != oldFromY) oldX = oldY = -1; // kludge to fake entry on from-click - if(x == oldX && y == oldY) return; // only do something if we enter new square - oldFromX = fromX; oldFromY = fromY; - if(oldX == -1 && oldY == -1 && x == fromX && y == fromY) { // record markings after from-change - for(r=0; r= 0) { - y = BOARD_HEIGHT - 1 - y; - } - if (flipView && x >= 0) { - x = BOARD_WIDTH - 1 - x; - } - - if(appData.monoMouse && gameMode == EditPosition && fromX < 0 && clickType == Press && boards[currentMove][y][x] == EmptySquare) { - static int dummy; - RightClick(clickType, xPix, yPix, &dummy, &dummy); - right = TRUE; - return; - } - - if(SeekGraphClick(clickType, xPix, yPix, 0)) return; - - prevClickTime = lastClickTime; GetTimeMark(&lastClickTime); - - if (clickType == Press) ErrorPopDown(); - lastClickType = clickType, lastLeftX = xPix, lastLeftY = yPix; // [HGM] alien: remember state - - if(promoSweep != EmptySquare) { // up-click during sweep-select of promo-piece - defaultPromoChoice = promoSweep; - promoSweep = EmptySquare; // terminate sweep - promoDefaultAltered = TRUE; - if(!selectFlag && !sweepSelecting && (x != toX || y != toY)) x = fromX, y = fromY; // and fake up-click on same square if we were still selecting - } - - if(promotionChoice) { // we are waiting for a click to indicate promotion piece - if(clickType == Release) return; // ignore upclick of click-click destination - promotionChoice = FALSE; // only one chance: if click not OK it is interpreted as cancel - if(appData.debugMode) fprintf(debugFP, "promotion click, x=%d, y=%d\n", x, y); - if(gameInfo.holdingsWidth && - (WhiteOnMove(currentMove) - ? x == BOARD_WIDTH-1 && y < gameInfo.holdingsSize && y >= 0 - : x == 0 && y >= BOARD_HEIGHT - gameInfo.holdingsSize && y < BOARD_HEIGHT) ) { - // click in right holdings, for determining promotion piece - ChessSquare p = boards[currentMove][y][x]; - if(appData.debugMode) fprintf(debugFP, "square contains %d\n", (int)p); - if(p == WhitePawn || p == BlackPawn) p = EmptySquare; // [HGM] Pawns could be valid as deferral - if(p != EmptySquare || gameInfo.variant == VariantGrand && toY != 0 && toY != BOARD_HEIGHT-1) { // [HGM] grand: empty square means defer - FinishMove(NormalMove, fromX, fromY, toX, toY, p==EmptySquare ? NULLCHAR : ToLower(PieceToChar(p))); - fromX = fromY = -1; - return; - } - } - DrawPosition(FALSE, boards[currentMove]); - return; - } - - /* [HGM] holdings: next 5 lines: ignore all clicks between board and holdings */ - if(clickType == Press - && ( x == BOARD_LEFT-1 || x == BOARD_RGHT - || x == BOARD_LEFT-2 && y < BOARD_HEIGHT-gameInfo.holdingsSize - || x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) ) - return; - - if(gotPremove && x == premoveFromX && y == premoveFromY && clickType == Release) { - // could be static click on premove from-square: abort premove - gotPremove = 0; - ClearPremoveHighlights(); - } - - if(clickType == Press && fromX == x && fromY == y && promoDefaultAltered && SubtractTimeMarks(&lastClickTime, &prevClickTime) >= 200) - fromX = fromY = -1; // second click on piece after altering default promo piece treated as first click - - if(!promoDefaultAltered) { // determine default promotion piece, based on the side the user is moving for - int side = (gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack || - gameMode != MachinePlaysWhite && gameMode != IcsPlayingBlack && WhiteOnMove(currentMove)); - defaultPromoChoice = DefaultPromoChoice(side); - } - - autoQueen = appData.alwaysPromoteToQueen; - - if (fromX == -1) { - int originalY = y; - gatingPiece = EmptySquare; - if (clickType != Press) { - if(dragging) { // [HGM] from-square must have been reset due to game end since last press - DragPieceEnd(xPix, yPix); dragging = 0; - DrawPosition(FALSE, NULL); - } - return; - } - doubleClick = FALSE; - if(gameMode == AnalyzeMode && (pausing || controlKey) && first.excludeMoves) { // use pause state to exclude moves - doubleClick = TRUE; gatingPiece = boards[currentMove][y][x]; - } - fromX = x; fromY = y; toX = toY = killX = killY = kill2X = kill2Y = -1; - if(!appData.oneClick || !OnlyMove(&x, &y, FALSE) || - // even if only move, we treat as normal when this would trigger a promotion popup, to allow sweep selection - appData.sweepSelect && CanPromote(boards[currentMove][fromY][fromX], fromY) && originalY != y) { - /* First square */ - if (OKToStartUserMove(fromX, fromY)) { - second = 0; - ReportClick("lift", x, y); - MarkTargetSquares(0); - if(gameMode == EditPosition && controlKey) gatingPiece = boards[currentMove][fromY][fromX]; - DragPieceBegin(xPix, yPix, FALSE); dragging = 1; - if(appData.sweepSelect && CanPromote(piece = boards[currentMove][fromY][fromX], fromY)) { - promoSweep = defaultPromoChoice; - selectFlag = 0; lastX = xPix; lastY = yPix; *promoRestrict = 0; - Sweep(0); // Pawn that is going to promote: preview promotion piece - DisplayMessage("", _("Pull pawn backwards to under-promote")); - } - if (appData.highlightDragging) { - SetHighlights(fromX, fromY, -1, -1); - } else { - ClearHighlights(); - } - } else fromX = fromY = -1; - return; - } - } - - /* fromX != -1 */ - if (clickType == Press && gameMode != EditPosition) { - ChessSquare fromP; - ChessSquare toP; - int frc; - - // ignore off-board to clicks - if(y < 0 || x < 0) return; - - /* Check if clicking again on the same color piece */ - fromP = boards[currentMove][fromY][fromX]; - toP = boards[currentMove][y][x]; - frc = appData.fischerCastling || gameInfo.variant == VariantSChess; - if( (killX < 0 || x != fromX || y != fromY) && // [HGM] lion: do not interpret igui as deselect! - marker[y][x] == 0 && // if engine told we can move to here, do it even if own piece - ((WhitePawn <= fromP && fromP <= WhiteKing && - WhitePawn <= toP && toP <= WhiteKing && - !(fromP == WhiteKing && toP == WhiteRook && frc) && - !(fromP == WhiteRook && toP == WhiteKing && frc)) || - (BlackPawn <= fromP && fromP <= BlackKing && - BlackPawn <= toP && toP <= BlackKing && - !(fromP == BlackRook && toP == BlackKing && frc) && // allow also RxK as FRC castling - !(fromP == BlackKing && toP == BlackRook && frc)))) { - /* Clicked again on same color piece -- changed his mind */ - second = (x == fromX && y == fromY); - killX = killY = kill2X = kill2Y = -1; - if(second && gameMode == AnalyzeMode && SubtractTimeMarks(&lastClickTime, &prevClickTime) < 200) { - second = FALSE; // first double-click rather than scond click - doubleClick = first.excludeMoves; // used by UserMoveEvent to recognize exclude moves - } - promoDefaultAltered = FALSE; - if(!second) MarkTargetSquares(1); - if(!(second && appData.oneClick && OnlyMove(&x, &y, TRUE))) { - if (appData.highlightDragging) { - SetHighlights(x, y, -1, -1); - } else { - ClearHighlights(); - } - if (OKToStartUserMove(x, y)) { - if(gameInfo.variant == VariantSChess && // S-Chess: back-rank piece selected after holdings means gating - (fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) && - y == (toP < BlackPawn ? 0 : BOARD_HEIGHT-1)) - gatingPiece = boards[currentMove][fromY][fromX]; - else gatingPiece = doubleClick ? fromP : EmptySquare; - fromX = x; - fromY = y; dragging = 1; - if(!second) ReportClick("lift", x, y); - MarkTargetSquares(0); - DragPieceBegin(xPix, yPix, FALSE); - if(appData.sweepSelect && CanPromote(piece = boards[currentMove][y][x], y)) { - promoSweep = defaultPromoChoice; - selectFlag = 0; lastX = xPix; lastY = yPix; *promoRestrict = 0; - Sweep(0); // Pawn that is going to promote: preview promotion piece - } - } - } - if(x == fromX && y == fromY) return; // if OnlyMove altered (x,y) we go on - second = FALSE; - } - // ignore clicks on holdings - if(x < BOARD_LEFT || x >= BOARD_RGHT) return; - } - - if(x == fromX && y == fromY && clickType == Press && gameMode == EditPosition && SubtractTimeMarks(&lastClickTime, &prevClickTime) < 200) { - gatingPiece = boards[currentMove][fromY][fromX]; // prepare to copy rather than move - DragPieceBegin(xPix, yPix, FALSE); dragging = 1; - return; - } - - if (clickType == Release && x == fromX && y == fromY && killX < 0 && !sweepSelecting) { - DragPieceEnd(xPix, yPix); dragging = 0; - if(clearFlag) { - // a deferred attempt to click-click move an empty square on top of a piece - boards[currentMove][y][x] = EmptySquare; - ClearHighlights(); - DrawPosition(FALSE, boards[currentMove]); - fromX = fromY = -1; clearFlag = 0; - return; - } - if (appData.animateDragging) { - /* Undo animation damage if any */ - DrawPosition(FALSE, NULL); - } - if (second) { - /* Second up/down in same square; just abort move */ - second = 0; - fromX = fromY = -1; - gatingPiece = EmptySquare; - ClearHighlights(); - gotPremove = 0; - ClearPremoveHighlights(); - MarkTargetSquares(-1); - DrawPosition(FALSE, NULL); // make user highlights are drawn (and deferred marker clearing) - } else { - /* First upclick in same square; start click-click mode */ - SetHighlights(x, y, -1, -1); - } - return; - } - - clearFlag = 0; - - if(gameMode != EditPosition && !appData.testLegality && !legal[y][x] && - fromX >= BOARD_LEFT && fromX < BOARD_RGHT && (x != killX || y != killY) && !sweepSelecting) { - if(dragging) DragPieceEnd(xPix, yPix), dragging = 0; - DisplayMessage(_("only marked squares are legal"),""); - DrawPosition(TRUE, NULL); - return; // ignore to-click - } - - /* we now have a different from- and (possibly off-board) to-square */ - /* Completed move */ - if(!sweepSelecting) { - toX = x; - toY = y; - } - - piece = boards[currentMove][fromY][fromX]; - - saveAnimate = appData.animate; - if (clickType == Press) { - if(gameInfo.variant == VariantChuChess && piece != WhitePawn && piece != BlackPawn) defaultPromoChoice = piece; - if(gameMode == EditPosition && boards[currentMove][fromY][fromX] == EmptySquare) { - // must be Edit Position mode with empty-square selected - fromX = x; fromY = y; DragPieceBegin(xPix, yPix, FALSE); dragging = 1; // consider this a new attempt to drag - if(x >= BOARD_LEFT && x < BOARD_RGHT) clearFlag = 1; // and defer click-click move of empty-square to up-click - return; - } - if(dragging == 2) { // [HGM] lion: just turn buttonless drag into normal drag, and let release to the job - return; - } - if(x == killX && y == killY) { // second click on this square, which was selected as first-leg target - killX = kill2X; killY = kill2Y; kill2X = kill2Y = -1; // this informs us no second leg is coming, so treat as to-click without intermediate - } else - if(marker[y][x] == 5) return; // [HGM] lion: to-click on cyan square; defer action to release - if(legal[y][x] == 2 || HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { - if(appData.sweepSelect) { - promoSweep = defaultPromoChoice; - if(gameInfo.variant != VariantChuChess && PieceToChar(CHUPROMOTED(piece)) == '+') promoSweep = CHUPROMOTED(piece); - selectFlag = 0; lastX = xPix; lastY = yPix; - ReportClick("put", x, y); // extra put to prompt engine for 'choice' command - saveFlash = appData.flashCount; appData.flashCount = 0; - Sweep(0); // Pawn that is going to promote: preview promotion piece - sweepSelecting = 1; - DisplayMessage("", _("Pull pawn backwards to under-promote")); - MarkTargetSquares(1); - } - return; // promo popup appears on up-click - } - /* Finish clickclick move */ - if (appData.animate || appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } - MarkTargetSquares(1); - } else if(sweepSelecting) { // this must be the up-click corresponding to the down-click that started the sweep - sweepSelecting = 0; appData.animate = FALSE; // do not animate, a selected piece already on to-square - *promoRestrict = 0; appData.flashCount = saveFlash; - if (appData.animate || appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } - MarkTargetSquares(1); - } else { -#if 0 -// [HGM] this must be done after the move is made, as with arrow it could lead to a board redraw with piece still on from square - /* Finish drag move */ - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } -#endif - if(PieceToChar(CHUPROMOTED(boards[currentMove][fromY][fromX])) == '+') - defaultPromoChoice = CHUPROMOTED(boards[currentMove][fromY][fromX]); - if(gameInfo.variant == VariantChuChess && piece != WhitePawn && piece != BlackPawn) defaultPromoChoice = piece; - if(marker[y][x] == 5) { // [HGM] lion: this was the release of a to-click or drag on a cyan square - dragging *= 2; // flag button-less dragging if we are dragging - MarkTargetSquares(1); - if(x == killX && y == killY) killX = kill2X, killY = kill2Y, kill2X = kill2Y = -1; // cancel last kill - else { - kill2X = killX; kill2Y = killY; - killX = x; killY = y; // remember this square as intermediate - ReportClick("put", x, y); // and inform engine - ReportClick("lift", x, y); - MarkTargetSquares(0); - return; - } - } - DragPieceEnd(xPix, yPix); dragging = 0; - /* Don't animate move and drag both */ - appData.animate = FALSE; - MarkTargetSquares(-1); // -1 defers displaying marker change to prevent piece reappearing on from-square! - } - - // moves into holding are invalid for now (except in EditPosition, adapting to-square) - if(x >= 0 && x < BOARD_LEFT || x >= BOARD_RGHT) { - ChessSquare piece = boards[currentMove][fromY][fromX]; - if(gameMode == EditPosition && piece != EmptySquare && - fromX >= BOARD_LEFT && fromX < BOARD_RGHT) { - int n; - - if(x == BOARD_LEFT-2 && piece >= BlackPawn) { - n = PieceToNumber(piece - (int)BlackPawn); - if(n >= gameInfo.holdingsSize) { n = 0; piece = BlackPawn; } - boards[currentMove][BOARD_HEIGHT-1 - n][0] = piece; - boards[currentMove][BOARD_HEIGHT-1 - n][1]++; - } else - if(x == BOARD_RGHT+1 && piece < BlackPawn) { - n = PieceToNumber(piece); - if(n >= gameInfo.holdingsSize) { n = 0; piece = WhitePawn; } - boards[currentMove][n][BOARD_WIDTH-1] = piece; - boards[currentMove][n][BOARD_WIDTH-2]++; - } - boards[currentMove][fromY][fromX] = EmptySquare; - } - ClearHighlights(); - fromX = fromY = -1; - MarkTargetSquares(1); - DrawPosition(TRUE, boards[currentMove]); - return; - } - - // off-board moves should not be highlighted - if(x < 0 || y < 0) ClearHighlights(); - else ReportClick("put", x, y); - - if(gatingPiece != EmptySquare && gameInfo.variant == VariantSChess) promoChoice = ToLower(PieceToChar(gatingPiece)); - - if(legal[toY][toX] == 2) promoChoice = ToLower(PieceToChar(defaultPromoChoice)); // highlight-induced promotion - - if (legal[toY][toX] == 2 && !appData.sweepSelect || HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, appData.sweepSelect)) { - SetHighlights(fromX, fromY, toX, toY); - MarkTargetSquares(1); - if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) { - // [HGM] super: promotion to captured piece selected from holdings - ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX]; - promotionChoice = TRUE; - // kludge follows to temporarily execute move on display, without promoting yet - boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank - boards[currentMove][toY][toX] = p; - DrawPosition(FALSE, boards[currentMove]); - boards[currentMove][fromY][fromX] = p; // take back, but display stays - boards[currentMove][toY][toX] = q; - DisplayMessage("Click in holdings to choose piece", ""); - return; - } - PromotionPopUp(promoChoice); - } else { - int oldMove = currentMove; - flashing = 1; // prevent recursive calling (by release of to-click) while flashing piece - UserMoveEvent(fromX, fromY, toX, toY, promoChoice); - if (!appData.highlightLastMove || gotPremove) ClearHighlights(); - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY), DrawPosition(FALSE, NULL); - if(saveAnimate && !appData.animate && currentMove != oldMove && // drag-move was performed - Explode(boards[currentMove-1], fromX, fromY, toX, toY)) - DrawPosition(TRUE, boards[currentMove]); - fromX = fromY = -1; - flashing = 0; - } - appData.animate = saveAnimate; - if (appData.animate || appData.animateDragging) { - /* Undo animation damage if needed */ -// DrawPosition(FALSE, NULL); - } -} - -int -RightClick (ClickType action, int x, int y, int *fromX, int *fromY) -{ // front-end-free part taken out of PieceMenuPopup - int whichMenu; int xSqr, ySqr; - - if(seekGraphUp) { // [HGM] seekgraph - if(action == Press) SeekGraphClick(Press, x, y, 2); // 2 indicates right-click: no pop-down on miss - if(action == Release) SeekGraphClick(Release, x, y, 2); // and no challenge on hit - return -2; - } - - if((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack) - && !appData.zippyPlay && appData.bgObserve) { // [HGM] bughouse: show background game - if(!partnerBoardValid) return -2; // suppress display of uninitialized boards - if( appData.dualBoard) return -2; // [HGM] dual: is already displayed - if(action == Press) { - originalFlip = flipView; - flipView = !flipView; // temporarily flip board to see game from partners perspective - DrawPosition(TRUE, partnerBoard); - DisplayMessage(partnerStatus, ""); - partnerUp = TRUE; - } else if(action == Release) { - flipView = originalFlip; - DrawPosition(TRUE, boards[currentMove]); - partnerUp = FALSE; - } - return -2; - } - - xSqr = EventToSquare(x, BOARD_WIDTH); - ySqr = EventToSquare(y, BOARD_HEIGHT); - if (action == Release) { - if(pieceSweep != EmptySquare) { - EditPositionMenuEvent(pieceSweep, toX, toY); - pieceSweep = EmptySquare; - } else UnLoadPV(); // [HGM] pv - } - if (action != Press) return -2; // return code to be ignored - switch (gameMode) { - case IcsExamining: - if(xSqr < BOARD_LEFT || xSqr >= BOARD_RGHT) return -1; - case EditPosition: - if (xSqr == BOARD_LEFT-1 || xSqr == BOARD_RGHT) return -1; - if (xSqr < 0 || ySqr < 0) return -1; - if(appData.pieceMenu) { whichMenu = 0; break; } // edit-position menu - pieceSweep = shiftKey ? BlackPawn : WhitePawn; // [HGM] sweep: prepare selecting piece by mouse sweep - toX = xSqr; toY = ySqr; lastX = x, lastY = y; - if(flipView) toX = BOARD_WIDTH - 1 - toX; else toY = BOARD_HEIGHT - 1 - toY; - NextPiece(0); - return 2; // grab - case IcsObserving: - if(!appData.icsEngineAnalyze) return -1; - case IcsPlayingWhite: - case IcsPlayingBlack: - if(!appData.zippyPlay) goto noZip; - case AnalyzeMode: - case AnalyzeFile: - case MachinePlaysWhite: - case MachinePlaysBlack: - case TwoMachinesPlay: // [HGM] pv: use for showing PV - if (!appData.dropMenu) { - LoadPV(x, y); - return 2; // flag front-end to grab mouse events - } - if(gameMode == TwoMachinesPlay || gameMode == AnalyzeMode || - gameMode == AnalyzeFile || gameMode == IcsObserving) return -1; - case EditGame: - noZip: - if (xSqr < 0 || ySqr < 0) return -1; - if (!appData.dropMenu || appData.testLegality && - gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse) return -1; - whichMenu = 1; // drop menu - break; - default: - return -1; - } - - if (((*fromX = xSqr) < 0) || - ((*fromY = ySqr) < 0)) { - *fromX = *fromY = -1; - return -1; - } - if (flipView) - *fromX = BOARD_WIDTH - 1 - *fromX; - else - *fromY = BOARD_HEIGHT - 1 - *fromY; - - return whichMenu; -} - -void -Wheel (int dir, int x, int y) -{ - if(gameMode == EditPosition) { - int xSqr = EventToSquare(x, BOARD_WIDTH); - int ySqr = EventToSquare(y, BOARD_HEIGHT); - if(ySqr < 0 || xSqr < BOARD_LEFT || xSqr >= BOARD_RGHT) return; - if(flipView) xSqr = BOARD_WIDTH - 1 - xSqr; else ySqr = BOARD_HEIGHT - 1 - ySqr; - do { - boards[currentMove][ySqr][xSqr] += dir; - if((int) boards[currentMove][ySqr][xSqr] < WhitePawn) boards[currentMove][ySqr][xSqr] = BlackKing; - if((int) boards[currentMove][ySqr][xSqr] > BlackKing) boards[currentMove][ySqr][xSqr] = WhitePawn; - } while(PieceToChar(boards[currentMove][ySqr][xSqr]) == '.'); - DrawPosition(FALSE, boards[currentMove]); - } else if(dir > 0) ForwardEvent(); else BackwardEvent(); -} - -void -SendProgramStatsToFrontend (ChessProgramState * cps, ChessProgramStats * cpstats) -{ -// char * hint = lastHint; - FrontEndProgramStats stats; - - stats.which = cps == &first ? 0 : 1; - stats.depth = cpstats->depth; - stats.nodes = cpstats->nodes; - stats.score = cpstats->score; - stats.time = cpstats->time; - stats.pv = cpstats->movelist; - stats.hint = lastHint; - stats.an_move_index = 0; - stats.an_move_count = 0; - - if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { - stats.hint = cpstats->move_name; - stats.an_move_index = cpstats->nr_moves - cpstats->moves_left; - stats.an_move_count = cpstats->nr_moves; - } - - if(stats.pv && stats.pv[0]) safeStrCpy(lastPV[stats.which], stats.pv, sizeof(lastPV[stats.which])/sizeof(lastPV[stats.which][0])); // [HGM] pv: remember last PV of each - - if( gameMode == AnalyzeMode && stats.pv && stats.pv[0] - && appData.analysisBell && stats.time >= 100*appData.analysisBell ) RingBell(); - - SetProgramStats( &stats ); -} - -void -ClearEngineOutputPane (int which) -{ - static FrontEndProgramStats dummyStats; - dummyStats.which = which; - dummyStats.pv = "#"; - SetProgramStats( &dummyStats ); -} - -#define MAXPLAYERS 500 - -char * -TourneyStandings (int display) -{ - int i, w, b, color, wScore, bScore, dummy, nr=0, nPlayers=0; - int score[MAXPLAYERS], ranking[MAXPLAYERS], points[MAXPLAYERS], games[MAXPLAYERS]; - char result, *p, *names[MAXPLAYERS]; - - if(appData.tourneyType < 0 && !strchr(appData.results, '*')) - return strdup(_("Swiss tourney finished")); // standings of Swiss yet TODO - names[0] = p = strdup(appData.participants); - while(p = strchr(p, '\n')) *p++ = NULLCHAR, names[++nPlayers] = p; // count participants - - for(i=0; i 0) nPlayers = appData.tourneyType; // in gauntlet, list only gauntlet engine(s) - for(w=0; w bScore) bScore = score[i], b = i; - ranking[w] = b; points[w] = bScore; score[b] = -2; - } - p = malloc(nPlayers*34+1); - for(w=0; w 2) return FALSE; // no trivial draws with more than 1 major - if(myPawns == 2 && nMine == 3) // KPP - return majorDefense || pCnt[BlackFerz-side] + pCnt[BlackAlfil-side] >= 3; - if(myPawns == 1 && nMine == 2) // KP - return majorDefense || pCnt[BlackFerz-side] + pCnt[BlackAlfil-side] + pCnt[BlackPawn-side] >= 1; - if(myPawns == 1 && nMine == 3 && pCnt[WhiteKnight+side]) // KHP - return majorDefense || pCnt[BlackFerz-side] + pCnt[BlackAlfil-side]*2 >= 5; - if(myPawns) return FALSE; - if(pCnt[WhiteRook+side]) - return pCnt[BlackRook-side] || - pCnt[BlackCannon-side] && (pCnt[BlackFerz-side] >= 2 || pCnt[BlackAlfil-side] >= 2) || - pCnt[BlackKnight-side] && pCnt[BlackFerz-side] + pCnt[BlackAlfil-side] > 2 || - pCnt[BlackFerz-side] + pCnt[BlackAlfil-side] >= 4; - if(pCnt[WhiteCannon+side]) { - if(pCnt[WhiteFerz+side] + myPawns == 0) return TRUE; // Cannon needs platform - return majorDefense || pCnt[BlackAlfil-side] >= 2; - } - if(pCnt[WhiteKnight+side]) - return majorDefense || pCnt[BlackFerz-side] >= 2 || pCnt[BlackAlfil-side] + pCnt[BlackPawn-side] >= 1; - return FALSE; -} - -int -MatingPotential (int pCnt[], int side, int nMine, int nHis, int stale, int bisColor) -{ - VariantClass v = gameInfo.variant; - - if(v == VariantShogi || v == VariantCrazyhouse || v == VariantBughouse) return TRUE; // drop games always winnable - if(v == VariantShatranj) return TRUE; // always winnable through baring - if(v == VariantLosers || v == VariantSuicide || v == VariantGiveaway) return TRUE; - if(v == Variant3Check || v == VariantAtomic) return nMine > 1; // can win through checking / exploding King - - if(v == VariantXiangqi) { - int majors = 5*pCnt[BlackKnight-side] + 7*pCnt[BlackCannon-side] + 7*pCnt[BlackRook-side]; - - nMine -= pCnt[WhiteFerz+side] + pCnt[WhiteAlfil+side] + stale; // discount defensive pieces and back-rank Pawns - if(nMine + stale == 1) return (pCnt[BlackFerz-side] > 1 && pCnt[BlackKnight-side] > 0); // bare K can stalemate KHAA (!) - if(nMine > 2) return TRUE; // if we don't have P, H or R, we must have CC - if(nMine == 2 && pCnt[WhiteCannon+side] == 0) return TRUE; // We have at least one P, H or R - // if we get here, we must have KC... or KP..., possibly with additional A, E or last-rank P - if(stale) // we have at least one last-rank P plus perhaps C - return majors // KPKX - || pCnt[BlackFerz-side] && pCnt[BlackFerz-side] + pCnt[WhiteCannon+side] + stale > 2; // KPKAA, KPPKA and KCPKA - else // KCA*E* - return pCnt[WhiteFerz+side] // KCAK - || pCnt[WhiteAlfil+side] && pCnt[BlackRook-side] + pCnt[BlackCannon-side] + pCnt[BlackFerz-side] // KCEKA, KCEKX (X!=H) - || majors + (12*pCnt[BlackFerz-side] | 6*pCnt[BlackAlfil-side]) > 16; // KCKAA, KCKAX, KCKEEX, KCKEXX (XX!=HH), KCKXXX - // TO DO: cases wih an unpromoted f-Pawn acting as platform for an opponent Cannon - - } else if(v == VariantKnightmate) { - if(nMine == 1) return FALSE; - if(nMine == 2 && nHis == 1 && pCnt[WhiteBishop+side] + pCnt[WhiteFerz+side] + pCnt[WhiteKnight+side]) return FALSE; // KBK is only draw - } else if(pCnt[WhiteKing] == 1 && pCnt[BlackKing] == 1) { // other variants with orthodox Kings - int nBishops = pCnt[WhiteBishop+side] + pCnt[WhiteFerz+side]; - - if(nMine == 1) return FALSE; // bare King - if(nBishops && bisColor == 3) return TRUE; // There must be a second B/A/F, which can either block (his) or attack (mine) the escape square - nMine += (nBishops > 0) - nBishops; // By now all Bishops (and Ferz) on like-colored squares, so count as one - if(nMine > 2 && nMine != pCnt[WhiteAlfil+side] + 1) return TRUE; // At least two pieces, not all Alfils - // by now we have King + 1 piece (or multiple Bishops on the same color) - if(pCnt[WhiteKnight+side]) - return (pCnt[BlackKnight-side] + pCnt[BlackBishop-side] + pCnt[BlackMan-side] + - pCnt[BlackWazir-side] + pCnt[BlackSilver-side] + bisColor // KNKN, KNKB, KNKF, KNKE, KNKW, KNKM, KNKS - || nHis > 3); // be sure to cover suffocation mates in corner (e.g. KNKQCA) - if(nBishops) - return (pCnt[BlackKnight-side]); // KBKN, KFKN - if(pCnt[WhiteAlfil+side]) - return (nHis > 2); // Alfils can in general not reach a corner square, but there might be edge (suffocation) mates - if(pCnt[WhiteWazir+side]) - return (pCnt[BlackKnight-side] + pCnt[BlackWazir-side] + pCnt[BlackAlfil-side]); // KWKN, KWKW, KWKE - } - - return TRUE; -} - -int -CompareWithRights (Board b1, Board b2) -{ - int rights = 0; - if(!CompareBoards(b1, b2)) return FALSE; - if(b1[EP_STATUS] != b2[EP_STATUS]) return FALSE; - /* compare castling rights */ - if( b1[CASTLING][2] != b2[CASTLING][2] && (b2[CASTLING][0] != NoRights || b2[CASTLING][1] != NoRights) ) - rights++; /* King lost rights, while rook still had them */ - if( b1[CASTLING][2] != NoRights ) { /* king has rights */ - if( b1[CASTLING][0] != b2[CASTLING][0] || b1[CASTLING][1] != b2[CASTLING][1] ) - rights++; /* but at least one rook lost them */ - } - if( b1[CASTLING][5] != b1[CASTLING][5] && (b2[CASTLING][3] != NoRights || b2[CASTLING][4] != NoRights) ) - rights++; - if( b1[CASTLING][5] != NoRights ) { - if( b1[CASTLING][3] != b2[CASTLING][3] || b1[CASTLING][4] != b2[CASTLING][4] ) - rights++; - } - return rights == 0; -} - -int -Adjudicate (ChessProgramState *cps) -{ // [HGM] some adjudications useful with buggy engines - // [HGM] adjudicate: made into separate routine, which now can be called after every move - // In any case it determnes if the game is a claimable draw (filling in EP_STATUS). - // Actually ending the game is now based on the additional internal condition canAdjudicate. - // Only when the game is ended, and the opponent is a computer, this opponent gets the move relayed. - int k, drop, count = 0; static int bare = 1; - ChessProgramState *engineOpponent = (gameMode == TwoMachinesPlay ? cps->other : (cps ? NULL : &first)); - Boolean canAdjudicate = !appData.icsActive; - - // most tests only when we understand the game, i.e. legality-checking on - if( appData.testLegality ) - { /* [HGM] Some more adjudications for obstinate engines */ - int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+2], i; - static int moveCount = 6; - ChessMove result; - char *reason = NULL; - - /* Count what is on board. */ - Count(boards[forwardMostMove], nr, &nrW, &nrB, &staleW, &staleB, &bishopColor); - - /* Some material-based adjudications that have to be made before stalemate test */ - if(gameInfo.variant == VariantAtomic && nr[WhiteKing] + nr[BlackKing] < 2) { - // [HGM] atomic: stm must have lost his King on previous move, as destroying own K is illegal - boards[forwardMostMove][EP_STATUS] = EP_CHECKMATE; // make claimable as if stm is checkmated - if(canAdjudicate && appData.checkMates) { - if(engineOpponent) - SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets move - GameEnds( WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins, - "Xboard adjudication: King destroyed", GE_XBOARD ); - return 1; - } - } - - /* Bare King in Shatranj (loses) or Losers (wins) */ - if( nrW == 1 || nrB == 1) { - if( gameInfo.variant == VariantLosers) { // [HGM] losers: bare King wins (stm must have it first) - boards[forwardMostMove][EP_STATUS] = EP_WINS; // mark as win, so it becomes claimable - if(canAdjudicate && appData.checkMates) { - if(engineOpponent) - SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets to see move - GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins, - "Xboard adjudication: Bare king", GE_XBOARD ); - return 1; - } - } else - if( gameInfo.variant == VariantShatranj && --bare < 0) - { /* bare King */ - boards[forwardMostMove][EP_STATUS] = EP_WINS; // make claimable as win for stm - if(canAdjudicate && appData.checkMates) { - /* but only adjudicate if adjudication enabled */ - if(engineOpponent) - SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets move - GameEnds( nrW > 1 ? WhiteWins : nrB > 1 ? BlackWins : GameIsDrawn, - "Xboard adjudication: Bare king", GE_XBOARD ); - return 1; - } - } - } else bare = 1; - - - // don't wait for engine to announce game end if we can judge ourselves - switch (MateTest(boards[forwardMostMove], PosFlags(forwardMostMove)) ) { - case MT_CHECK: - if(gameInfo.variant == Variant3Check) { // [HGM] 3check: when in check, test if 3rd time - int i, checkCnt = 0; // (should really be done by making nr of checks part of game state) - for(i=forwardMostMove-2; i>=backwardMostMove; i-=2) { - if(MateTest(boards[i], PosFlags(i)) == MT_CHECK) - checkCnt++; - if(checkCnt >= 2) { - reason = "Xboard adjudication: 3rd check"; - boards[forwardMostMove][EP_STATUS] = EP_CHECKMATE; - break; - } - } - } - case MT_NONE: - default: - break; - case MT_STEALMATE: - case MT_STALEMATE: - case MT_STAINMATE: - reason = "Xboard adjudication: Stalemate"; - if((signed char)boards[forwardMostMove][EP_STATUS] != EP_CHECKMATE) { // [HGM] don't touch win through baring or K-capt - boards[forwardMostMove][EP_STATUS] = EP_STALEMATE; // default result for stalemate is draw - if(gameInfo.variant == VariantLosers || gameInfo.variant == VariantGiveaway) // [HGM] losers: - boards[forwardMostMove][EP_STATUS] = EP_WINS; // in these variants stalemated is always a win - else if(gameInfo.variant == VariantSuicide) // in suicide it depends - boards[forwardMostMove][EP_STATUS] = nrW == nrB ? EP_STALEMATE : - ((nrW < nrB) != WhiteOnMove(forwardMostMove) ? - EP_CHECKMATE : EP_WINS); - else if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShogi) - boards[forwardMostMove][EP_STATUS] = EP_CHECKMATE; // and in these variants being stalemated loses - } - break; - case MT_CHECKMATE: - reason = "Xboard adjudication: Checkmate"; - boards[forwardMostMove][EP_STATUS] = (gameInfo.variant == VariantLosers ? EP_WINS : EP_CHECKMATE); - if(gameInfo.variant == VariantShogi) { - if(forwardMostMove > backwardMostMove - && moveList[forwardMostMove-1][1] == '@' - && CharToPiece(ToUpper(moveList[forwardMostMove-1][0])) == WhitePawn) { - reason = "XBoard adjudication: pawn-drop mate"; - boards[forwardMostMove][EP_STATUS] = EP_WINS; - } - } - break; - } - - switch(i = (signed char)boards[forwardMostMove][EP_STATUS]) { - case EP_STALEMATE: - result = GameIsDrawn; break; - case EP_CHECKMATE: - result = WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins; break; - case EP_WINS: - result = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins; break; - default: - result = EndOfFile; - } - if(canAdjudicate && appData.checkMates && result) { // [HGM] mates: adjudicate finished games if requested - if(engineOpponent) - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - GameEnds( result, reason, GE_XBOARD ); - return 1; - } - - /* Next absolutely insufficient mating material. */ - if(!MatingPotential(nr, WhitePawn, nrW, nrB, staleW, bishopColor) && - !MatingPotential(nr, BlackPawn, nrB, nrW, staleB, bishopColor)) - { /* includes KBK, KNK, KK of KBKB with like Bishops */ - - /* always flag draws, for judging claims */ - boards[forwardMostMove][EP_STATUS] = EP_INSUF_DRAW; - - if(canAdjudicate && appData.materialDraws) { - /* but only adjudicate them if adjudication enabled */ - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see last move */ - } - GameEnds( GameIsDrawn, "Xboard adjudication: Insufficient mating material", GE_XBOARD ); - return 1; - } - } - - /* Then some trivial draws (only adjudicate, cannot be claimed) */ - if(gameInfo.variant == VariantXiangqi ? - SufficientDefence(nr, WhitePawn, nrW, nrB) && SufficientDefence(nr, BlackPawn, nrB, nrW) - : nrW + nrB == 4 && - ( nr[WhiteRook] == 1 && nr[BlackRook] == 1 /* KRKR */ - || nr[WhiteQueen] && nr[BlackQueen]==1 /* KQKQ */ - || nr[WhiteKnight]==2 || nr[BlackKnight]==2 /* KNNK */ - || nr[WhiteKnight]+nr[WhiteBishop] == 1 && nr[BlackKnight]+nr[BlackBishop] == 1 /* KBKN, KBKB, KNKN */ - ) ) { - if(--moveCount < 0 && appData.trivialDraws && canAdjudicate) - { /* if the first 3 moves do not show a tactical win, declare draw */ - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - } - GameEnds( GameIsDrawn, "Xboard adjudication: Trivial draw", GE_XBOARD ); - return 1; - } - } else moveCount = 6; - } - - // Repetition draws and 50-move rule can be applied independently of legality testing - - /* Check for rep-draws */ - count = 0; - drop = gameInfo.holdingsSize && (gameInfo.variant != VariantSuper && gameInfo.variant != VariantSChess - && gameInfo.variant != VariantGreat && gameInfo.variant != VariantGrand); - for(k = forwardMostMove-2; - k>=backwardMostMove && k>=forwardMostMove-100 && (drop || - (signed char)boards[k][EP_STATUS] < EP_UNKNOWN && - (signed char)boards[k+2][EP_STATUS] <= EP_NONE && (signed char)boards[k+1][EP_STATUS] <= EP_NONE); - k-=2) - { int rights=0; - if(CompareBoards(boards[k], boards[forwardMostMove])) { - /* compare castling rights */ - if( boards[forwardMostMove][CASTLING][2] != boards[k][CASTLING][2] && - (boards[k][CASTLING][0] != NoRights || boards[k][CASTLING][1] != NoRights) ) - rights++; /* King lost rights, while rook still had them */ - if( boards[forwardMostMove][CASTLING][2] != NoRights ) { /* king has rights */ - if( boards[forwardMostMove][CASTLING][0] != boards[k][CASTLING][0] || - boards[forwardMostMove][CASTLING][1] != boards[k][CASTLING][1] ) - rights++; /* but at least one rook lost them */ - } - if( boards[forwardMostMove][CASTLING][5] != boards[k][CASTLING][5] && - (boards[k][CASTLING][3] != NoRights || boards[k][CASTLING][4] != NoRights) ) - rights++; - if( boards[forwardMostMove][CASTLING][5] != NoRights ) { - if( boards[forwardMostMove][CASTLING][3] != boards[k][CASTLING][3] || - boards[forwardMostMove][CASTLING][4] != boards[k][CASTLING][4] ) - rights++; - } - if( rights == 0 && ++count > appData.drawRepeats-2 && canAdjudicate - && appData.drawRepeats > 1) { - /* adjudicate after user-specified nr of repeats */ - int result = GameIsDrawn; - char *details = "XBoard adjudication: repetition draw"; - if((gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShogi) && appData.testLegality) { - // [HGM] xiangqi: check for forbidden perpetuals - int m, ourPerpetual = 1, hisPerpetual = 1; - for(m=forwardMostMove; m>k; m-=2) { - if(MateTest(boards[m], PosFlags(m)) != MT_CHECK) - ourPerpetual = 0; // the current mover did not always check - if(MateTest(boards[m-1], PosFlags(m-1)) != MT_CHECK) - hisPerpetual = 0; // the opponent did not always check - } - if(appData.debugMode) fprintf(debugFP, "XQ perpetual test, our=%d, his=%d\n", - ourPerpetual, hisPerpetual); - if(ourPerpetual && !hisPerpetual) { // we are actively checking him: forfeit - result = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins; - details = "Xboard adjudication: perpetual checking"; - } else - if(hisPerpetual && !ourPerpetual) { // he is checking us, but did not repeat yet - break; // (or we would have caught him before). Abort repetition-checking loop. - } else - if(gameInfo.variant == VariantShogi) { // in Shogi other repetitions are draws - if(BOARD_HEIGHT == 5 && BOARD_RGHT - BOARD_LEFT == 5) { // but in mini-Shogi gote wins! - result = BlackWins; - details = "Xboard adjudication: repetition"; - } - } else // it must be XQ - // Now check for perpetual chases - if(!ourPerpetual && !hisPerpetual) { // no perpetual check, test for chase - hisPerpetual = PerpetualChase(k, forwardMostMove); - ourPerpetual = PerpetualChase(k+1, forwardMostMove); - if(ourPerpetual && !hisPerpetual) { // we are actively chasing him: forfeit - static char resdet[MSG_SIZ]; - result = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins; - details = resdet; - snprintf(resdet, MSG_SIZ, "Xboard adjudication: perpetual chasing of %c%c", ourPerpetual>>8, ourPerpetual&255); - } else - if(hisPerpetual && !ourPerpetual) // he is chasing us, but did not repeat yet - break; // Abort repetition-checking loop. - } - // if neither of us is checking or chasing all the time, or both are, it is draw - } - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - } - GameEnds( result, details, GE_XBOARD ); - return 1; - } - if( rights == 0 && count > 1 ) /* occurred 2 or more times before */ - boards[forwardMostMove][EP_STATUS] = EP_REP_DRAW; - } - } - - /* Now we test for 50-move draws. Determine ply count */ - count = forwardMostMove; - /* look for last irreversble move */ - while( (signed char)boards[count][EP_STATUS] <= EP_NONE && count > backwardMostMove ) - count--; - /* if we hit starting position, add initial plies */ - if( count == backwardMostMove ) - count -= initialRulePlies; - count = forwardMostMove - count; - if(gameInfo.variant == VariantXiangqi && ( count >= 100 || count >= 2*appData.ruleMoves ) ) { - // adjust reversible move counter for checks in Xiangqi - int i = forwardMostMove - count, inCheck = 0, lastCheck; - if(i < backwardMostMove) i = backwardMostMove; - while(i <= forwardMostMove) { - lastCheck = inCheck; // check evasion does not count - inCheck = (MateTest(boards[i], PosFlags(i)) == MT_CHECK); - if(inCheck || lastCheck) count--; // check does not count - i++; - } - } - if( count >= 100) - boards[forwardMostMove][EP_STATUS] = EP_RULE_DRAW; - /* this is used to judge if draw claims are legal */ - if(canAdjudicate && appData.ruleMoves > 0 && count >= 2*appData.ruleMoves) { - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - } - GameEnds( GameIsDrawn, "Xboard adjudication: 50-move rule", GE_XBOARD ); - return 1; - } - - /* if draw offer is pending, treat it as a draw claim - * when draw condition present, to allow engines a way to - * claim draws before making their move to avoid a race - * condition occurring after their move - */ - if((gameMode == TwoMachinesPlay ? second.offeredDraw : userOfferedDraw) || first.offeredDraw ) { - char *p = NULL; - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_RULE_DRAW) - p = "Draw claim: 50-move rule"; - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_REP_DRAW) - p = "Draw claim: 3-fold repetition"; - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_INSUF_DRAW) - p = "Draw claim: insufficient mating material"; - if( p != NULL && canAdjudicate) { - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - } - GameEnds( GameIsDrawn, p, GE_XBOARD ); - return 1; - } - } - - if( canAdjudicate && appData.adjudicateDrawMoves > 0 && forwardMostMove > (2*appData.adjudicateDrawMoves) ) { - if(engineOpponent) { - SendToProgram("force\n", engineOpponent); // suppress reply - SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */ - } - GameEnds( GameIsDrawn, "Xboard adjudication: long game", GE_XBOARD ); - return 1; - } - return 0; -} - -typedef int (CDECL *PPROBE_EGBB) (int player, int *piece, int *square); -typedef int (CDECL *PLOAD_EGBB) (char *path, int cache_size, int load_options); -static int egbbCode[] = { 6, 5, 4, 3, 2, 1 }; - -static int -BitbaseProbe () -{ - int pieces[10], squares[10], cnt=0, r, f, res; - static int loaded; - static PPROBE_EGBB probeBB; - if(!appData.testLegality) return 10; - if(BOARD_HEIGHT != 8 || BOARD_RGHT-BOARD_LEFT != 8) return 12; - if(gameInfo.holdingsSize && gameInfo.variant != VariantSuper && gameInfo.variant != VariantSChess) return 12; - if(loaded == 2 && forwardMostMove < 2) loaded = 0; // retry on new game - for(r=0; r= BlackPawn); - int type = piece - black*BlackPawn; - if(piece == EmptySquare) continue; - if(type != WhiteKing && type > WhiteQueen) return 12; // unorthodox piece - if(type == WhiteKing) type = WhiteQueen + 1; - type = egbbCode[type]; - squares[cnt] = r*(BOARD_RGHT - BOARD_LEFT) + f - BOARD_LEFT; - pieces[cnt] = type + black*6; - if(++cnt > 5) return 11; - } - pieces[cnt] = squares[cnt] = 0; - // probe EGBB - if(loaded == 2) return 13; // loading failed before - if(loaded == 0) { - char *p, *path = strstr(appData.egtFormats, "scorpio:"), buf[MSG_SIZ]; - HMODULE lib; - PLOAD_EGBB loadBB; - loaded = 2; // prepare for failure - if(!path) return 13; // no egbb installed - strncpy(buf, path + 8, MSG_SIZ); - if(p = strchr(buf, ',')) *p = NULLCHAR; else p = buf + strlen(buf); - snprintf(p, MSG_SIZ - strlen(buf), "%c%s", SLASH, EGBB_NAME); - lib = LoadLibrary(buf); - if(!lib) { DisplayError(_("could not load EGBB library"), 0); return 13; } - loadBB = (PLOAD_EGBB) GetProcAddress(lib, "load_egbb_xmen"); - probeBB = (PPROBE_EGBB) GetProcAddress(lib, "probe_egbb_xmen"); - if(!loadBB || !probeBB) { DisplayError(_("wrong EGBB version"), 0); return 13; } - p[1] = NULLCHAR; loadBB(buf, 64*1028, 2); // 2 = SMART_LOAD - loaded = 1; // success! - } - res = probeBB(forwardMostMove & 1, pieces, squares); - return res > 0 ? 1 : res < 0 ? -1 : 0; -} - -char * -SendMoveToBookUser (int moveNr, ChessProgramState *cps, int initial) -{ // [HGM] book: this routine intercepts moves to simulate book replies - char *bookHit = NULL; - - if(cps->drawDepth && BitbaseProbe() == 0) { // [HG} egbb: reduce depth in drawn position - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "sd %d\n", cps->drawDepth); - SendToProgram(buf, cps); - } - //first determine if the incoming move brings opponent into his book - if(appData.usePolyglotBook && (cps == &first ? !appData.firstHasOwnBookUCI : !appData.secondHasOwnBookUCI)) - bookHit = ProbeBook(moveNr+1, appData.polyglotBook); // returns move - if(appData.debugMode) fprintf(debugFP, "book hit = %s\n", bookHit ? bookHit : "(NULL)"); - if(bookHit != NULL && !cps->bookSuspend) { - // make sure opponent is not going to reply after receiving move to book position - SendToProgram("force\n", cps); - cps->bookSuspend = TRUE; // flag indicating it has to be restarted - } - if(bookHit) setboardSpoiledMachineBlack = FALSE; // suppress 'go' in SendMoveToProgram - if(!initial) SendMoveToProgram(moveNr, cps); // with hit on initial position there is no move - // now arrange restart after book miss - if(bookHit) { - // after a book hit we never send 'go', and the code after the call to this routine - // has '&& !bookHit' added to suppress potential sending there (based on 'firstMove'). - char buf[MSG_SIZ], *move = bookHit; - if(cps->useSAN) { - int fromX, fromY, toX, toY; - char promoChar; - ChessMove moveType; - move = buf + 30; - if (ParseOneMove(bookHit, forwardMostMove, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - (void) CoordsToAlgebraic(boards[forwardMostMove], - PosFlags(forwardMostMove), - fromY, fromX, toY, toX, promoChar, move); - } else { - if(appData.debugMode) fprintf(debugFP, "Book move could not be parsed\n"); - bookHit = NULL; - } - } - snprintf(buf, MSG_SIZ, "%s%s\n", (cps->useUsermove ? "usermove " : ""), move); // force book move into program supposed to play it - SendToProgram(buf, cps); - if(!initial) firstMove = FALSE; // normally we would clear the firstMove condition after return & sending 'go' - } else if(initial) { // 'go' was needed irrespective of firstMove, and it has to be done in this routine - SendToProgram("go\n", cps); - cps->bookSuspend = FALSE; // after a 'go' we are never suspended - } else { // 'go' might be sent based on 'firstMove' after this routine returns - if(cps->bookSuspend && !firstMove) // 'go' needed, and it will not be done after we return - SendToProgram("go\n", cps); - cps->bookSuspend = FALSE; // anyhow, we will not be suspended after a miss - } - return bookHit; // notify caller of hit, so it can take action to send move to opponent -} - -int -LoadError (char *errmess, ChessProgramState *cps) -{ // unloads engine and switches back to -ncp mode if it was first - if(cps->initDone) return FALSE; - cps->isr = NULL; // this should suppress further error popups from breaking pipes - DestroyChildProcess(cps->pr, 9 ); // just to be sure - cps->pr = NoProc; - if(cps == &first) { - appData.noChessProgram = TRUE; - gameMode = MachinePlaysBlack; ModeHighlight(); // kludge to unmark Machine Black menu - gameMode = BeginningOfGame; ModeHighlight(); - SetNCPMode(); - } - if(GetDelayedEvent()) CancelDelayedEvent(), ThawUI(); // [HGM] cancel remaining loading effort scheduled after feature timeout - DisplayMessage("", ""); // erase waiting message - if(errmess) DisplayError(errmess, 0); // announce reason, if given - return TRUE; -} - -char *savedMessage; -ChessProgramState *savedState; -void -DeferredBookMove (void) -{ - if(savedState->lastPing != savedState->lastPong) - ScheduleDelayedEvent(DeferredBookMove, 10); - else - HandleMachineMove(savedMessage, savedState); -} - -static int savedWhitePlayer, savedBlackPlayer, pairingReceived; -static ChessProgramState *stalledEngine; -static char stashedInputMove[MSG_SIZ], abortEngineThink; - -void -HandleMachineMove (char *message, ChessProgramState *cps) -{ - static char firstLeg[20], legs; - char machineMove[MSG_SIZ], buf1[MSG_SIZ*10], buf2[MSG_SIZ]; - char realname[MSG_SIZ]; - int fromX, fromY, toX, toY; - ChessMove moveType; - char promoChar, roar; - char *p, *pv=buf1; - int oldError; - char *bookHit; - - if(cps == &pairing && sscanf(message, "%d-%d", &savedWhitePlayer, &savedBlackPlayer) == 2) { - // [HGM] pairing: Mega-hack! Pairing engine also uses this routine (so it could give other WB commands). - if(savedWhitePlayer == 0 || savedBlackPlayer == 0) { - DisplayError(_("Invalid pairing from pairing engine"), 0); - return; - } - pairingReceived = 1; - NextMatchGame(); - return; // Skim the pairing messages here. - } - - oldError = cps->userError; cps->userError = 0; - -FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book hit - /* - * Kludge to ignore BEL characters - */ - while (*message == '\007') message++; - - /* - * [HGM] engine debug message: ignore lines starting with '#' character - */ - if(cps->debug && *message == '#') return; - - /* - * Look for book output - */ - if (cps == &first && bookRequested) { - if (message[0] == '\t' || message[0] == ' ') { - /* Part of the book output is here; append it */ - strcat(bookOutput, message); - strcat(bookOutput, " \n"); - return; - } else if (bookOutput[0] != NULLCHAR) { - /* All of book output has arrived; display it */ - char *p = bookOutput; - while (*p != NULLCHAR) { - if (*p == '\t') *p = ' '; - p++; - } - DisplayInformation(bookOutput); - bookRequested = FALSE; - /* Fall through to parse the current output */ - } - } - - /* - * Look for machine move. - */ - if ((sscanf(message, "%s %s %s", buf1, buf2, machineMove) == 3 && strcmp(buf2, "...") == 0) || - (sscanf(message, "%s %s", buf1, machineMove) == 2 && strcmp(buf1, "move") == 0)) - { - if(pausing && !cps->pause) { // for pausing engine that does not support 'pause', we stash its move for processing when we resume. - if(appData.debugMode) fprintf(debugFP, "pause %s engine after move\n", cps->which); - safeStrCpy(stashedInputMove, message, MSG_SIZ); - stalledEngine = cps; - if(appData.ponderNextMove) { // bring opponent out of ponder - if(gameMode == TwoMachinesPlay) { - if(cps->other->pause) - PauseEngine(cps->other); - else - SendToProgram("easy\n", cps->other); - } - } - StopClocks(); - return; - } - - if(cps->usePing) { - - /* This method is only useful on engines that support ping */ - if(abortEngineThink) { - if (appData.debugMode) { - fprintf(debugFP, "Undoing move from aborted think of %s\n", cps->which); - } - SendToProgram("undo\n", cps); - return; - } - - if (cps->lastPing != cps->lastPong) { - /* Extra move from before last new; ignore */ - if (appData.debugMode) { - fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); - } - return; - } - - } else { - - int machineWhite = FALSE; - - switch (gameMode) { - case BeginningOfGame: - /* Extra move from before last reset; ignore */ - if (appData.debugMode) { - fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); - } - return; - - case EndOfGame: - case IcsIdle: - default: - /* Extra move after we tried to stop. The mode test is - not a reliable way of detecting this problem, but it's - the best we can do on engines that don't support ping. - */ - if (appData.debugMode) { - fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", - cps->which, gameMode); - } - SendToProgram("undo\n", cps); - return; - - case MachinePlaysWhite: - case IcsPlayingWhite: - machineWhite = TRUE; - break; - - case MachinePlaysBlack: - case IcsPlayingBlack: - machineWhite = FALSE; - break; - - case TwoMachinesPlay: - machineWhite = (cps->twoMachinesColor[0] == 'w'); - break; - } - if (WhiteOnMove(forwardMostMove) != machineWhite) { - if (appData.debugMode) { - fprintf(debugFP, - "Ignoring move out of turn by %s, gameMode %d" - ", forwardMost %d\n", - cps->which, gameMode, forwardMostMove); - } - return; - } - } - - if(cps->alphaRank) AlphaRank(machineMove, 4); - - // [HGM] lion: (some very limited) support for Alien protocol - killX = killY = kill2X = kill2Y = -1; - if(machineMove[strlen(machineMove)-1] == ',') { // move ends in coma: non-final leg of composite move - if(legs++) return; // middle leg contains only redundant info, ignore (but count it) - safeStrCpy(firstLeg, machineMove, 20); // just remember it for processing when second leg arrives - return; - } - if(p = strchr(machineMove, ',')) { // we got both legs in one (happens on book move) - char *q = strchr(p+1, ','); // second comma? - safeStrCpy(firstLeg, machineMove, 20); // kludge: fake we received the first leg earlier, and clip it off - if(q) legs = 2, p = q; else legs = 1; // with 3-leg move we clipof first two legs! - safeStrCpy(machineMove, firstLeg + (p - machineMove) + 1, 20); - } - if(firstLeg[0]) { // there was a previous leg; - // only support case where same piece makes two step - char buf[20], *p = machineMove+1, *q = buf+1, f; - safeStrCpy(buf, machineMove, 20); - while(isdigit(*q)) q++; // find start of to-square - safeStrCpy(machineMove, firstLeg, 20); - while(isdigit(*p)) p++; // to-square of first leg (which is now copied to machineMove) - if(legs == 2) sscanf(p, "%c%d", &f, &kill2Y), kill2X = f - AAA, kill2Y -= ONE - '0'; // in 3-leg move 2nd kill is to-sqr of 1st leg - else if(*p == *buf) // if first-leg to not equal to second-leg from first leg says unmodified (assume it is King move of castling) - safeStrCpy(p, q, 20); // glue to-square of second leg to from-square of first, to process over-all move - sscanf(buf, "%c%d", &f, &killY); killX = f - AAA; killY -= ONE - '0'; // pass intermediate square to MakeMove in global - firstLeg[0] = NULLCHAR; legs = 0; - } - - if (!ParseOneMove(machineMove, forwardMostMove, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - /* Machine move could not be parsed; ignore it. */ - snprintf(buf1, MSG_SIZ*10, _("Illegal move \"%s\" from %s machine"), - machineMove, _(cps->which)); - DisplayMoveError(buf1); - snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to invalid move: %s (%c%c%c%c via %c%c, %c%c) res=%d", - machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, killX+AAA, killY+ONE, kill2X+AAA, kill2Y+ONE, moveType); - if (gameMode == TwoMachinesPlay) { - GameEnds(cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, - buf1, GE_XBOARD); - } - return; - } - - /* [HGM] Apparently legal, but so far only tested with EP_UNKOWN */ - /* So we have to redo legality test with true e.p. status here, */ - /* to make sure an illegal e.p. capture does not slip through, */ - /* to cause a forfeit on a justified illegal-move complaint */ - /* of the opponent. */ - if( gameMode==TwoMachinesPlay && appData.testLegality ) { - ChessMove moveType; - moveType = LegalityTest(boards[forwardMostMove], PosFlags(forwardMostMove), - fromY, fromX, toY, toX, promoChar); - if(moveType == IllegalMove) { - snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to illegal move: %s (%c%c%c%c)%c", - machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, 0); - GameEnds(cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, - buf1, GE_XBOARD); - return; - } else if(!appData.fischerCastling) - /* [HGM] Kludge to handle engines that send FRC-style castling - when they shouldn't (like TSCP-Gothic) */ - switch(moveType) { - case WhiteASideCastleFR: - case BlackASideCastleFR: - toX+=2; - currentMoveString[2]++; - break; - case WhiteHSideCastleFR: - case BlackHSideCastleFR: - toX--; - currentMoveString[2]--; - break; - default: ; // nothing to do, but suppresses warning of pedantic compilers - } - } - hintRequested = FALSE; - lastHint[0] = NULLCHAR; - bookRequested = FALSE; - /* Program may be pondering now */ - cps->maybeThinking = TRUE; - if (cps->sendTime == 2) cps->sendTime = 1; - if (cps->offeredDraw) cps->offeredDraw--; - - /* [AS] Save move info*/ - pvInfoList[ forwardMostMove ].score = programStats.score; - pvInfoList[ forwardMostMove ].depth = programStats.depth; - pvInfoList[ forwardMostMove ].time = programStats.time; // [HGM] PGNtime: take time from engine stats - - MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/ - - /* Test suites abort the 'game' after one move */ - if(*appData.finger) { - static FILE *f; - char *fen = PositionToFEN(backwardMostMove, NULL, 0); // no counts in EPD - if(!f) f = fopen(appData.finger, "w"); - if(f) fprintf(f, "%s bm %s;\n", fen, parseList[backwardMostMove]), fflush(f); - else { DisplayFatalError("Bad output file", errno, 0); return; } - free(fen); - GameEnds(GameUnfinished, NULL, GE_XBOARD); - } - if(appData.epd) { - if(solvingTime >= 0) { - snprintf(buf1, MSG_SIZ, "%d. %4.2fs: %s ", matchGame, solvingTime/100., parseList[backwardMostMove]); - totalTime += solvingTime; first.matchWins++; solvingTime = -1; - } else { - snprintf(buf1, MSG_SIZ, "%d. %s?%s ", matchGame, parseList[backwardMostMove], solvingTime == -2 ? " ???" : ""); - if(solvingTime == -2) second.matchWins++; - } - OutputKibitz(2, buf1); - GameEnds(GameUnfinished, NULL, GE_XBOARD); - } - - /* [AS] Adjudicate game if needed (note: remember that forwardMostMove now points past the last move) */ - if( gameMode == TwoMachinesPlay && appData.adjudicateLossThreshold != 0 && forwardMostMove >= adjudicateLossPlies ) { - int count = 0; - - while( count < adjudicateLossPlies ) { - int score = pvInfoList[ forwardMostMove - count - 1 ].score; - - if( count & 1 ) { - score = -score; /* Flip score for winning side */ - } - - if( score > appData.adjudicateLossThreshold ) { - break; - } - - count++; - } - - if( count >= adjudicateLossPlies ) { - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - - GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins, - "Xboard adjudication", - GE_XBOARD ); - - return; - } - } - - if(Adjudicate(cps)) { - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - return; // [HGM] adjudicate: for all automatic game ends - } - -#if ZIPPY - if ((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack) && - first.initDone) { - if(cps->offeredDraw && (signed char)boards[forwardMostMove][EP_STATUS] <= EP_DRAWS) { - SendToICS(ics_prefix); // [HGM] drawclaim: send caim and move on one line for FICS - SendToICS("draw "); - SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar); - } - SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar); - ics_user_moved = 1; - if(appData.autoKibitz && !appData.icsEngineAnalyze ) { /* [HGM] kibitz: send most-recent PV info to ICS */ - char buf[3*MSG_SIZ]; - - snprintf(buf, 3*MSG_SIZ, "kibitz !!! %+.2f/%d (%.2f sec, %u nodes, %.0f knps) PV=%s\n", - programStats.score / 100., - programStats.depth, - programStats.time / 100., - (unsigned int)programStats.nodes, - (unsigned int)programStats.nodes / (10*abs(programStats.time) + 1.), - programStats.movelist); - SendToICS(buf); - } - } -#endif - - /* [AS] Clear stats for next move */ - ClearProgramStats(); - thinkOutput[0] = NULLCHAR; - hiddenThinkOutputState = 0; - - bookHit = NULL; - if (gameMode == TwoMachinesPlay) { - /* [HGM] relaying draw offers moved to after reception of move */ - /* and interpreting offer as claim if it brings draw condition */ - if (cps->offeredDraw == 1 && cps->other->sendDrawOffers) { - SendToProgram("draw\n", cps->other); - } - if (cps->other->sendTime) { - SendTimeRemaining(cps->other, - cps->other->twoMachinesColor[0] == 'w'); - } - bookHit = SendMoveToBookUser(forwardMostMove-1, cps->other, FALSE); - if (firstMove && !bookHit) { - firstMove = FALSE; - if (cps->other->useColors) { - SendToProgram(cps->other->twoMachinesColor, cps->other); - } - SendToProgram("go\n", cps->other); - } - cps->other->maybeThinking = TRUE; - } - - roar = (killX >= 0 && IS_LION(boards[forwardMostMove][toY][toX])); - - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - - if (!pausing && appData.ringBellAfterMoves) { - if(!roar) RingBell(); - } - - /* - * Reenable menu items that were disabled while - * machine was thinking - */ - if (gameMode != TwoMachinesPlay) - SetUserThinkingEnables(); - - // [HGM] book: after book hit opponent has received move and is now in force mode - // force the book reply into it, and then fake that it outputted this move by jumping - // back to the beginning of HandleMachineMove, with cps toggled and message set to this move - if(bookHit) { - static char bookMove[MSG_SIZ]; // a bit generous? - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - message = bookMove; - cps = cps->other; - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - if(cps->lastPing != cps->lastPong) { - savedMessage = message; // args for deferred call - savedState = cps; - ScheduleDelayedEvent(DeferredBookMove, 10); - return; - } - goto FakeBookMove; - } - - return; - } - - /* Set special modes for chess engines. Later something general - * could be added here; for now there is just one kludge feature, - * needed because Crafty 15.10 and earlier don't ignore SIGINT - * when "xboard" is given as an interactive command. - */ - if (strncmp(message, "kibitz Hello from Crafty", 24) == 0) { - cps->useSigint = FALSE; - cps->useSigterm = FALSE; - } - if (strncmp(message, "feature ", 8) == 0) { // [HGM] moved forward to pre-empt non-compliant commands - ParseFeatures(message+8, cps); - return; // [HGM] This return was missing, causing option features to be recognized as non-compliant commands! - } - - if (!strncmp(message, "setup ", 6) && - (!appData.testLegality || gameInfo.variant == VariantFairy || gameInfo.variant == VariantUnknown || - NonStandardBoardSize(gameInfo.variant, gameInfo.boardWidth, gameInfo.boardHeight, gameInfo.holdingsSize)) - ) { // [HGM] allow first engine to define opening position - int dummy, w, h, hand, s=6; char buf[MSG_SIZ], varName[MSG_SIZ]; - if(appData.icsActive || forwardMostMove != 0 || cps != &first) return; - *buf = NULLCHAR; - if(sscanf(message, "setup (%s", buf) == 1) { - s = 8 + strlen(buf), buf[s-9] = NULLCHAR, SetCharTableEsc(pieceToChar, buf, SUFFIXES); - ASSIGN(appData.pieceToCharTable, buf); - } - dummy = sscanf(message+s, "%dx%d+%d_%s", &w, &h, &hand, varName); - if(dummy >= 3) { - while(message[s] && message[s++] != ' '); - if(BOARD_HEIGHT != h || BOARD_WIDTH != w + 4*(hand != 0) || gameInfo.holdingsSize != hand || - dummy == 4 && gameInfo.variant != StringToVariant(varName) ) { // engine wants to change board format or variant - appData.NrFiles = w; appData.NrRanks = h; appData.holdingsSize = hand; - if(dummy == 4) gameInfo.variant = StringToVariant(varName); // parent variant - InitPosition(1); // calls InitDrawingSizes to let new parameters take effect - if(*buf) SetCharTableEsc(pieceToChar, buf, SUFFIXES); // do again, for it was spoiled by InitPosition - startedFromSetupPosition = FALSE; - } - } - if(startedFromSetupPosition) return; - ParseFEN(boards[0], &dummy, message+s, FALSE); - DrawPosition(TRUE, boards[0]); - CopyBoard(initialPosition, boards[0]); - startedFromSetupPosition = TRUE; - return; - } - if(sscanf(message, "piece %s %s", buf2, buf1) == 2) { - ChessSquare piece = WhitePawn; - char *p=message+6, *q, *s = SUFFIXES, ID = *p; - if(*p == '+') piece = CHUPROMOTED(WhitePawn), ID = *++p; - if(q = strchr(s, p[1])) ID += 64*(q - s + 1), p++; - piece += CharToPiece(ID & 255) - WhitePawn; - if(cps != &first || appData.testLegality && *engineVariant == NULLCHAR - /* always accept definition of */ && piece != WhiteFalcon && piece != BlackFalcon - /* wild-card pieces. */ && piece != WhiteCobra && piece != BlackCobra - /* For variants we don't have */ && gameInfo.variant != VariantBerolina - /* correct rules for, we cannot */ && gameInfo.variant != VariantCylinder - /* enforce legality on our own! */ && gameInfo.variant != VariantUnknown - && gameInfo.variant != VariantGreat - && gameInfo.variant != VariantFairy ) return; - if(piece < EmptySquare) { - pieceDefs = TRUE; - ASSIGN(pieceDesc[piece], buf1); - if((ID & 32) == 0 && p[1] == '&') { ASSIGN(pieceDesc[WHITE_TO_BLACK piece], buf1); } - } - return; - } - if(sscanf(message, "choice %s", promoRestrict) == 1 && promoSweep != EmptySquare) { - promoSweep = CharToPiece(currentMove&1 ? ToLower(*promoRestrict) : ToUpper(*promoRestrict)); - Sweep(0); - return; - } - /* [HGM] Allow engine to set up a position. Don't ask me why one would - * want this, I was asked to put it in, and obliged. - */ - if (!strncmp(message, "setboard ", 9)) { - Board initial_position; - - GameEnds(GameUnfinished, "Engine aborts game", GE_XBOARD); - - if (!ParseFEN(initial_position, &blackPlaysFirst, message + 9, FALSE)) { - DisplayError(_("Bad FEN received from engine"), 0); - return ; - } else { - Reset(TRUE, FALSE); - CopyBoard(boards[0], initial_position); - initialRulePlies = FENrulePlies; - if(blackPlaysFirst) gameMode = MachinePlaysWhite; - else gameMode = MachinePlaysBlack; - DrawPosition(FALSE, boards[currentMove]); - } - return; - } - - /* - * Look for communication commands - */ - if (!strncmp(message, "telluser ", 9)) { - if(message[9] == '\\' && message[10] == '\\') - EscapeExpand(message+9, message+11); // [HGM] esc: allow escape sequences in popup box - PlayTellSound(); - DisplayNote(message + 9); - return; - } - if (!strncmp(message, "tellusererror ", 14)) { - cps->userError = 1; - if(message[14] == '\\' && message[15] == '\\') - EscapeExpand(message+14, message+16); // [HGM] esc: allow escape sequences in popup box - PlayTellSound(); - DisplayError(message + 14, 0); - return; - } - if (!strncmp(message, "tellopponent ", 13)) { - if (appData.icsActive) { - if (loggedOn) { - snprintf(buf1, sizeof(buf1), "%ssay %s\n", ics_prefix, message + 13); - SendToICS(buf1); - } - } else { - DisplayNote(message + 13); - } - return; - } - if (!strncmp(message, "tellothers ", 11)) { - if (appData.icsActive) { - if (loggedOn) { - snprintf(buf1, sizeof(buf1), "%swhisper %s\n", ics_prefix, message + 11); - SendToICS(buf1); - } - } else if(appData.autoComment) AppendComment (forwardMostMove, message + 11, 1); // in local mode, add as move comment - return; - } - if (!strncmp(message, "tellall ", 8)) { - if (appData.icsActive) { - if (loggedOn) { - snprintf(buf1, sizeof(buf1), "%skibitz %s\n", ics_prefix, message + 8); - SendToICS(buf1); - } - } else { - DisplayNote(message + 8); - } - return; - } - if (strncmp(message, "warning", 7) == 0) { - /* Undocumented feature, use tellusererror in new code */ - DisplayError(message, 0); - return; - } - if (sscanf(message, "askuser %s %[^\n]", buf1, buf2) == 2) { - safeStrCpy(realname, cps->tidy, sizeof(realname)/sizeof(realname[0])); - strcat(realname, " query"); - AskQuestion(realname, buf2, buf1, cps->pr); - return; - } - /* Commands from the engine directly to ICS. We don't allow these to be - * sent until we are logged on. Crafty kibitzes have been known to - * interfere with the login process. - */ - if (loggedOn) { - if (!strncmp(message, "tellics ", 8)) { - SendToICS(message + 8); - SendToICS("\n"); - return; - } - if (!strncmp(message, "tellicsnoalias ", 15)) { - SendToICS(ics_prefix); - SendToICS(message + 15); - SendToICS("\n"); - return; - } - /* The following are for backward compatibility only */ - if (!strncmp(message,"whisper",7) || !strncmp(message,"kibitz",6) || - !strncmp(message,"draw",4) || !strncmp(message,"tell",3)) { - SendToICS(ics_prefix); - SendToICS(message); - SendToICS("\n"); - return; - } - } - if (sscanf(message, "pong %d", &cps->lastPong) == 1) { - if(initPing == cps->lastPong) { - if(gameInfo.variant == VariantUnknown) { - DisplayError(_("Engine did not send setup for non-standard variant"), 0); - *engineVariant = NULLCHAR; ASSIGN(appData.variant, "normal"); // back to normal as error recovery? - GameEnds(GameUnfinished, NULL, GE_XBOARD); - } - initPing = -1; - } - if(cps->lastPing == cps->lastPong && abortEngineThink) { - abortEngineThink = FALSE; - DisplayMessage("", ""); - ThawUI(); - } - return; - } - if(!strncmp(message, "highlight ", 10)) { - if(appData.testLegality && !*engineVariant && appData.markers) return; - MarkByFEN(message+10); // [HGM] alien: allow engine to mark board squares - return; - } - if(!strncmp(message, "click ", 6)) { - char f, c=0; int x, y; // [HGM] alien: allow engine to finish user moves (i.e. engine-driven one-click moving) - if(appData.testLegality || !appData.oneClick) return; - sscanf(message+6, "%c%d%c", &f, &y, &c); - x = f - 'a' + BOARD_LEFT, y -= ONE - '0'; - if(flipView) x = BOARD_WIDTH-1 - x; else y = BOARD_HEIGHT-1 - y; - x = x*squareSize + (x+1)*lineGap + squareSize/2; - y = y*squareSize + (y+1)*lineGap + squareSize/2; - f = first.highlight; first.highlight = 0; // kludge to suppress lift/put in response to own clicks - if(lastClickType == Press) // if button still down, fake release on same square, to be ready for next click - LeftClick(Release, lastLeftX, lastLeftY); - controlKey = (c == ','); - LeftClick(Press, x, y); - LeftClick(Release, x, y); - first.highlight = f; - return; - } - /* - * If the move is illegal, cancel it and redraw the board. - * Also deal with other error cases. Matching is rather loose - * here to accommodate engines written before the spec. - */ - if (strncmp(message + 1, "llegal move", 11) == 0 || - strncmp(message, "Error", 5) == 0) { - if (StrStr(message, "name") || - StrStr(message, "rating") || StrStr(message, "?") || - StrStr(message, "result") || StrStr(message, "board") || - StrStr(message, "bk") || StrStr(message, "computer") || - StrStr(message, "variant") || StrStr(message, "hint") || - StrStr(message, "random") || StrStr(message, "depth") || - StrStr(message, "accepted")) { - return; - } - if (StrStr(message, "protover")) { - /* Program is responding to input, so it's apparently done - initializing, and this error message indicates it is - protocol version 1. So we don't need to wait any longer - for it to initialize and send feature commands. */ - FeatureDone(cps, 1); - cps->protocolVersion = 1; - return; - } - cps->maybeThinking = FALSE; - - if (StrStr(message, "draw")) { - /* Program doesn't have "draw" command */ - cps->sendDrawOffers = 0; - return; - } - if (cps->sendTime != 1 && - (StrStr(message, "time") || StrStr(message, "otim"))) { - /* Program apparently doesn't have "time" or "otim" command */ - cps->sendTime = 0; - return; - } - if (StrStr(message, "analyze")) { - cps->analysisSupport = FALSE; - cps->analyzing = FALSE; -// Reset(FALSE, TRUE); // [HGM] this caused discrepancy between display and internal state! - EditGameEvent(); // [HGM] try to preserve loaded game - snprintf(buf2,MSG_SIZ, _("%s does not support analysis"), cps->tidy); - DisplayError(buf2, 0); - return; - } - if (StrStr(message, "(no matching move)st")) { - /* Special kludge for GNU Chess 4 only */ - cps->stKludge = TRUE; - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - return; - } - if (StrStr(message, "(no matching move)sd")) { - /* Special kludge for GNU Chess 4 only */ - cps->sdKludge = TRUE; - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - return; - } - if (!StrStr(message, "llegal")) { - return; - } - if (gameMode == BeginningOfGame || gameMode == EndOfGame || - gameMode == IcsIdle) return; - if (forwardMostMove <= backwardMostMove) return; - if (pausing) PauseEvent(); - if(appData.forceIllegal) { - // [HGM] illegal: machine refused move; force position after move into it - SendToProgram("force\n", cps); - if(!cps->useSetboard) { // hideous kludge on kludge, because SendBoard sucks. - // we have a real problem now, as SendBoard will use the a2a3 kludge - // when black is to move, while there might be nothing on a2 or black - // might already have the move. So send the board as if white has the move. - // But first we must change the stm of the engine, as it refused the last move - SendBoard(cps, 0); // always kludgeless, as white is to move on boards[0] - if(WhiteOnMove(forwardMostMove)) { - SendToProgram("a7a6\n", cps); // for the engine black still had the move - SendBoard(cps, forwardMostMove); // kludgeless board - } else { - SendToProgram("a2a3\n", cps); // for the engine white still had the move - CopyBoard(boards[forwardMostMove+1], boards[forwardMostMove]); - SendBoard(cps, forwardMostMove+1); // kludgeless board - } - } else SendBoard(cps, forwardMostMove); // FEN case, also sets stm properly - if(gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay) - SendToProgram("go\n", cps); - return; - } else - if (gameMode == PlayFromGameFile) { - /* Stop reading this game file */ - gameMode = EditGame; - ModeHighlight(); - } - /* [HGM] illegal-move claim should forfeit game when Xboard */ - /* only passes fully legal moves */ - if( appData.testLegality && gameMode == TwoMachinesPlay ) { - GameEnds( cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, - "False illegal-move claim", GE_XBOARD ); - return; // do not take back move we tested as valid - } - currentMove = forwardMostMove-1; - DisplayMove(currentMove-1); /* before DisplayMoveError */ - SwitchClocks(forwardMostMove-1); // [HGM] race - DisplayBothClocks(); - snprintf(buf1, 10*MSG_SIZ, _("Illegal move \"%s\" (rejected by %s chess program)"), - parseList[currentMove], _(cps->which)); - DisplayMoveError(buf1); - DrawPosition(FALSE, boards[currentMove]); - - SetUserThinkingEnables(); - return; - } - if (strncmp(message, "time", 4) == 0 && StrStr(message, "Illegal")) { - /* Program has a broken "time" command that - outputs a string not ending in newline. - Don't use it. */ - cps->sendTime = 0; - } - if (cps->pseudo) { // [HGM] pseudo-engine, granted unusual powers - if (sscanf(message, "wtime %ld\n", &whiteTimeRemaining) == 1 || // adjust clock times - sscanf(message, "btime %ld\n", &blackTimeRemaining) == 1 ) return; - } - - /* - * If chess program startup fails, exit with an error message. - * Attempts to recover here are futile. [HGM] Well, we try anyway - */ - if ((StrStr(message, "unknown host") != NULL) - || (StrStr(message, "No remote directory") != NULL) - || (StrStr(message, "not found") != NULL) - || (StrStr(message, "No such file") != NULL) - || (StrStr(message, "can't alloc") != NULL) - || (StrStr(message, "Permission denied") != NULL)) { - - cps->maybeThinking = FALSE; - snprintf(buf1, sizeof(buf1), _("Failed to start %s chess program %s on %s: %s\n"), - _(cps->which), cps->program, cps->host, message); - RemoveInputSource(cps->isr); - if(appData.icsActive) DisplayFatalError(buf1, 0, 1); else { - if(LoadError(oldError ? NULL : buf1, cps)) return; // error has then been handled by LoadError - if(!oldError) DisplayError(buf1, 0); // if reason neatly announced, suppress general error popup - } - return; - } - - /* - * Look for hint output - */ - if (sscanf(message, "Hint: %s", buf1) == 1) { - if (cps == &first && hintRequested) { - hintRequested = FALSE; - if (ParseOneMove(buf1, forwardMostMove, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - (void) CoordsToAlgebraic(boards[forwardMostMove], - PosFlags(forwardMostMove), - fromY, fromX, toY, toX, promoChar, buf1); - snprintf(buf2, sizeof(buf2), _("Hint: %s"), buf1); - DisplayInformation(buf2); - } else { - /* Hint move could not be parsed!? */ - snprintf(buf2, sizeof(buf2), - _("Illegal hint move \"%s\"\nfrom %s chess program"), - buf1, _(cps->which)); - DisplayError(buf2, 0); - } - } else { - safeStrCpy(lastHint, buf1, sizeof(lastHint)/sizeof(lastHint[0])); - } - return; - } - - /* - * Ignore other messages if game is not in progress - */ - if (gameMode == BeginningOfGame || gameMode == EndOfGame || - gameMode == IcsIdle || cps->lastPing != cps->lastPong) return; - - /* - * look for win, lose, draw, or draw offer - */ - if (strncmp(message, "1-0", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - GameEnds(WhiteWins, r, GE_ENGINE1 + (cps != &first)); /* [HGM] pass claimer indication for claim test */ - return; - } else if (strncmp(message, "0-1", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - /* Kludge for Arasan 4.1 bug */ - if (strcmp(r, "Black resigns") == 0) { - GameEnds(WhiteWins, r, GE_ENGINE1 + (cps != &first)); - return; - } - GameEnds(BlackWins, r, GE_ENGINE1 + (cps != &first)); - return; - } else if (strncmp(message, "1/2", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - - GameEnds(GameIsDrawn, r, GE_ENGINE1 + (cps != &first)); - return; - - } else if (strncmp(message, "White resign", 12) == 0) { - GameEnds(BlackWins, "White resigns", GE_ENGINE1 + (cps != &first)); - return; - } else if (strncmp(message, "Black resign", 12) == 0) { - GameEnds(WhiteWins, "Black resigns", GE_ENGINE1 + (cps != &first)); - return; - } else if (strncmp(message, "White matches", 13) == 0 || - strncmp(message, "Black matches", 13) == 0 ) { - /* [HGM] ignore GNUShogi noises */ - return; - } else if (strncmp(message, "White", 5) == 0 && - message[5] != '(' && - StrStr(message, "Black") == NULL) { - GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); - return; - } else if (strncmp(message, "Black", 5) == 0 && - message[5] != '(') { - GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); - return; - } else if (strcmp(message, "resign") == 0 || - strcmp(message, "computer resigns") == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(WhiteWins, "Black resigns", GE_ENGINE); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(BlackWins, "White resigns", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(BlackWins, "White resigns", GE_ENGINE1 + (cps != &first)); - else - GameEnds(WhiteWins, "Black resigns", GE_ENGINE1 + (cps != &first)); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "opponent mates", 14) == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(WhiteWins, "White mates", GE_ENGINE); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(BlackWins, "Black mates", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); - else - GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "computer mates", 14) == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(BlackWins, "Black mates", GE_ENGINE1); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(WhiteWins, "White mates", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); - else - GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "checkmate", 9) == 0) { - if (WhiteOnMove(forwardMostMove)) { - GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); - } else { - GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); - } - return; - } else if (strstr(message, "Draw") != NULL || - strstr(message, "game is a draw") != NULL) { - GameEnds(GameIsDrawn, "Draw", GE_ENGINE1 + (cps != &first)); - return; - } else if (strstr(message, "offer") != NULL && - strstr(message, "draw") != NULL) { -#if ZIPPY - if (appData.zippyPlay && first.initDone) { - /* Relay offer to ICS */ - SendToICS(ics_prefix); - SendToICS("draw\n"); - } -#endif - cps->offeredDraw = 2; /* valid until this engine moves twice */ - if (gameMode == TwoMachinesPlay) { - if (cps->other->offeredDraw) { - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - /* [HGM] in two-machine mode we delay relaying draw offer */ - /* until after we also have move, to see if it is really claim */ - } - } else if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack) { - if (userOfferedDraw) { - DisplayInformation(_("Machine accepts your draw offer")); - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - } else { - DisplayInformation(_("Machine offers a draw.\nSelect Action / Draw to accept.")); - } - } - } - - - /* - * Look for thinking output - */ - if ( appData.showThinking // [HGM] thinking: test all options that cause this output - || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() - ) { - int plylev, mvleft, mvtot, curscore, time; - char mvname[MOVE_LEN]; - u64 nodes; // [DM] - char plyext; - int ignore = FALSE; - int prefixHint = FALSE; - mvname[0] = NULLCHAR; - - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - if (WhiteOnMove(forwardMostMove)) prefixHint = TRUE; - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - if (!WhiteOnMove(forwardMostMove)) prefixHint = TRUE; - break; - case AnalyzeMode: - case AnalyzeFile: - break; - case IcsObserving: /* [DM] icsEngineAnalyze */ - if (!appData.icsEngineAnalyze) ignore = TRUE; - break; - case TwoMachinesPlay: - if ((cps->twoMachinesColor[0] == 'w') != WhiteOnMove(forwardMostMove)) { - ignore = TRUE; - } - break; - default: - ignore = TRUE; - break; - } - - if (!ignore) { - ChessProgramStats tempStats = programStats; // [HGM] info: filter out info lines - int solved = 0; - buf1[0] = NULLCHAR; - if (sscanf(message, "%d%c %d %d " u64Display " %[^\n]\n", - &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) { - char score_buf[MSG_SIZ]; - - if(nodes>>32 == u64Const(0xFFFFFFFF)) // [HGM] negative node count read - nodes += u64Const(0x100000000); - - if (plyext != ' ' && plyext != '\t') { - time *= 100; - } - - /* [AS] Negate score if machine is playing black and reporting absolute scores */ - if( cps->scoreIsAbsolute && - ( gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b' || - gameMode == IcsPlayingBlack || // [HGM] also add other situations where engine should report black POV - (gameMode == AnalyzeMode || gameMode == AnalyzeFile || gameMode == IcsObserving && appData.icsEngineAnalyze) && - !WhiteOnMove(currentMove) - ) ) - { - curscore = -curscore; - } - - if(appData.pvSAN[cps==&second]) pv = PvToSAN(buf1); - - if(*bestMove) { // rememer time best EPD move was first found - int ff1, tf1, fr1, tr1, ff2, tf2, fr2, tr2; char pp1, pp2; - ChessMove mt; char *p = bestMove; - int ok = ParseOneMove(pv, forwardMostMove, &mt, &ff2, &fr2, &tf2, &tr2, &pp2); - solved = 0; - while(ok && *p && ParseOneMove(p, forwardMostMove, &mt, &ff1, &fr1, &tf1, &tr1, &pp1)) { - if(ff1==ff2 && fr1==fr2 && tf1==tf2 && tr1==tr2 && pp1==pp2) { - solvingTime = (solvingTime < 0 ? time : solvingTime); - solved = 1; - break; - } - while(*p && *p != ' ') p++; - while(*p == ' ') p++; - } - if(!solved) solvingTime = -1; - } - if(*avoidMove && !solved) { - int ff1, tf1, fr1, tr1, ff2, tf2, fr2, tr2; char pp1, pp2; - ChessMove mt; char *p = avoidMove, solved = 1; - int ok = ParseOneMove(pv, forwardMostMove, &mt, &ff2, &fr2, &tf2, &tr2, &pp2); - while(ok && *p && ParseOneMove(p, forwardMostMove, &mt, &ff1, &fr1, &tf1, &tr1, &pp1)) { - if(ff1==ff2 && fr1==fr2 && tf1==tf2 && tr1==tr2 && pp1==pp2) { - solved = 0; solvingTime = -2; - break; - } - while(*p && *p != ' ') p++; - while(*p == ' ') p++; - } - if(solved && !*bestMove) solvingTime = (solvingTime < 0 ? time : solvingTime); - } - - if(serverMoves && (time > 100 || time == 0 && plylev > 7)) { - char buf[MSG_SIZ]; - FILE *f; - snprintf(buf, MSG_SIZ, "%s", appData.serverMovesName); - buf[strlen(buf)-1] = gameMode == MachinePlaysWhite ? 'w' : - gameMode == MachinePlaysBlack ? 'b' : cps->twoMachinesColor[0]; - if(appData.debugMode) fprintf(debugFP, "write PV on file '%s'\n", buf); - if(f = fopen(buf, "w")) { // export PV to applicable PV file - fprintf(f, "%5.2f/%-2d %s", curscore/100., plylev, pv); - fclose(f); - } - else - /* TRANSLATORS: PV = principal variation, the variation the chess engine thinks is the best for everyone */ - DisplayError(_("failed writing PV"), 0); - } - - tempStats.depth = plylev; - tempStats.nodes = nodes; - tempStats.time = time; - tempStats.score = curscore; - tempStats.got_only_move = 0; - - if(cps->nps >= 0) { /* [HGM] nps: use engine nodes or time to decrement clock */ - int ticklen; - - if(cps->nps == 0) ticklen = 10*time; // use engine reported time - else ticklen = (1000. * u64ToDouble(nodes)) / cps->nps; // convert node count to time - if(WhiteOnMove(forwardMostMove) && (gameMode == MachinePlaysWhite || - gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'w')) - whiteTimeRemaining = timeRemaining[0][forwardMostMove] - ticklen; - if(!WhiteOnMove(forwardMostMove) && (gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) - blackTimeRemaining = timeRemaining[1][forwardMostMove] - ticklen; - } - - /* Buffer overflow protection */ - if (pv[0] != NULLCHAR) { - if (strlen(pv) >= sizeof(tempStats.movelist) - && appData.debugMode) { - fprintf(debugFP, - "PV is too long; using the first %u bytes.\n", - (unsigned) sizeof(tempStats.movelist) - 1); - } - - safeStrCpy( tempStats.movelist, pv, sizeof(tempStats.movelist)/sizeof(tempStats.movelist[0]) ); - } else { - sprintf(tempStats.movelist, " no PV\n"); - } - - if (tempStats.seen_stat) { - tempStats.ok_to_send = 1; - } - - if (strchr(tempStats.movelist, '(') != NULL) { - tempStats.line_is_book = 1; - tempStats.nr_moves = 0; - tempStats.moves_left = 0; - } else { - tempStats.line_is_book = 0; - } - - if(tempStats.score != 0 || tempStats.nodes != 0 || tempStats.time != 0) - programStats = tempStats; // [HGM] info: only set stats if genuine PV and not an info line - - SendProgramStatsToFrontend( cps, &tempStats ); - - /* - [AS] Protect the thinkOutput buffer from overflow... this - is only useful if buf1 hasn't overflowed first! - */ - if((gameMode == AnalyzeMode && appData.whitePOV || appData.scoreWhite) && !WhiteOnMove(forwardMostMove)) curscore *= -1; - if(curscore >= MATE_SCORE) - snprintf(score_buf, MSG_SIZ, "#%d", curscore - MATE_SCORE); - else if(curscore <= -MATE_SCORE) - snprintf(score_buf, MSG_SIZ, "#%d", curscore + MATE_SCORE); - else - snprintf(score_buf, MSG_SIZ, "%+.2f", ((double) curscore) / 100.0); - snprintf(thinkOutput, sizeof(thinkOutput)/sizeof(thinkOutput[0]), "[%d]%c%s %s%s", - plylev, - (gameMode == TwoMachinesPlay ? - ToUpper(cps->twoMachinesColor[0]) : ' '), - score_buf, - prefixHint ? lastHint : "", - prefixHint ? " " : "" ); - - if( buf1[0] != NULLCHAR ) { - unsigned max_len = sizeof(thinkOutput) - strlen(thinkOutput) - 1; - - if( strlen(pv) > max_len ) { - if( appData.debugMode) { - fprintf(debugFP,"PV is too long for thinkOutput, truncating.\n"); - } - pv[max_len+1] = '\0'; - } - - strcat( thinkOutput, pv); - } - - if (currentMove == forwardMostMove || gameMode == AnalyzeMode - || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - } - return; - - } else if ((p=StrStr(message, "(only move)")) != NULL) { - /* crafty (9.25+) says "(only move) " - * if there is only 1 legal move - */ - sscanf(p, "(only move) %s", buf1); - snprintf(thinkOutput, sizeof(thinkOutput)/sizeof(thinkOutput[0]), "%s (only move)", buf1); - sprintf(programStats.movelist, "%s (only move)", buf1); - programStats.depth = 1; - programStats.nr_moves = 1; - programStats.moves_left = 1; - programStats.nodes = 1; - programStats.time = 1; - programStats.got_only_move = 1; - - /* Not really, but we also use this member to - mean "line isn't going to change" (Crafty - isn't searching, so stats won't change) */ - programStats.line_is_book = 1; - - SendProgramStatsToFrontend( cps, &programStats ); - - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || - gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - } - return; - } else if (sscanf(message,"stat01: %d " u64Display " %d %d %d %s", - &time, &nodes, &plylev, &mvleft, - &mvtot, mvname) >= 5) { - /* The stat01: line is from Crafty (9.29+) in response - to the "." command */ - programStats.seen_stat = 1; - cps->maybeThinking = TRUE; - - if (programStats.got_only_move || !appData.periodicUpdates) - return; - - programStats.depth = plylev; - programStats.time = time; - programStats.nodes = nodes; - programStats.moves_left = mvleft; - programStats.nr_moves = mvtot; - safeStrCpy(programStats.move_name, mvname, sizeof(programStats.move_name)/sizeof(programStats.move_name[0])); - programStats.ok_to_send = 1; - programStats.movelist[0] = '\0'; - - SendProgramStatsToFrontend( cps, &programStats ); - - return; - - } else if (strncmp(message,"++",2) == 0) { - /* Crafty 9.29+ outputs this */ - programStats.got_fail = 2; - return; - - } else if (strncmp(message,"--",2) == 0) { - /* Crafty 9.29+ outputs this */ - programStats.got_fail = 1; - return; - - } else if (thinkOutput[0] != NULLCHAR && - strncmp(message, " ", 4) == 0) { - unsigned message_len; - - p = message; - while (*p && *p == ' ') p++; - - message_len = strlen( p ); - - /* [AS] Avoid buffer overflow */ - if( sizeof(thinkOutput) - strlen(thinkOutput) - 1 > message_len ) { - strcat(thinkOutput, " "); - strcat(thinkOutput, p); - } - - if( sizeof(programStats.movelist) - strlen(programStats.movelist) - 1 > message_len ) { - strcat(programStats.movelist, " "); - strcat(programStats.movelist, p); - } - - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || - gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - } - return; - } - } - else { - buf1[0] = NULLCHAR; - - if (sscanf(message, "%d%c %d %d " u64Display " %[^\n]\n", - &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) - { - ChessProgramStats cpstats; - - if (plyext != ' ' && plyext != '\t') { - time *= 100; - } - - /* [AS] Negate score if machine is playing black and reporting absolute scores */ - if( cps->scoreIsAbsolute && ((gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) ) { - curscore = -curscore; - } - - cpstats.depth = plylev; - cpstats.nodes = nodes; - cpstats.time = time; - cpstats.score = curscore; - cpstats.got_only_move = 0; - cpstats.movelist[0] = '\0'; - - if (buf1[0] != NULLCHAR) { - safeStrCpy( cpstats.movelist, buf1, sizeof(cpstats.movelist)/sizeof(cpstats.movelist[0]) ); - } - - cpstats.ok_to_send = 0; - cpstats.line_is_book = 0; - cpstats.nr_moves = 0; - cpstats.moves_left = 0; - - SendProgramStatsToFrontend( cps, &cpstats ); - } - } - } -} - - -/* Parse a game score from the character string "game", and - record it as the history of the current game. The game - score is NOT assumed to start from the standard position. - The display is not updated in any way. - */ -void -ParseGameHistory (char *game) -{ - ChessMove moveType; - int fromX, fromY, toX, toY, boardIndex; - char promoChar; - char *p, *q; - char buf[MSG_SIZ]; - - if (appData.debugMode) - fprintf(debugFP, "Parsing game history: %s\n", game); - - if (gameInfo.event == NULL) gameInfo.event = StrSave("ICS game"); - gameInfo.site = StrSave(appData.icsHost); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - - /* Parse out names of players */ - while (*game == ' ') game++; - p = buf; - while (*game != ' ') *p++ = *game++; - *p = NULLCHAR; - gameInfo.white = StrSave(buf); - while (*game == ' ') game++; - p = buf; - while (*game != ' ' && *game != '\n') *p++ = *game++; - *p = NULLCHAR; - gameInfo.black = StrSave(buf); - - /* Parse moves */ - boardIndex = blackPlaysFirst ? 1 : 0; - yynewstr(game); - for (;;) { - yyboardindex = boardIndex; - moveType = (ChessMove) Myylex(); - switch (moveType) { - case IllegalMove: /* maybe suicide chess, etc. */ - if (appData.debugMode) { - fprintf(debugFP, "Illegal move from ICS: '%s'\n", yy_text); - fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); - setbuf(debugFP, NULL); - } - case WhitePromotion: - case BlackPromotion: - case WhiteNonPromotion: - case BlackNonPromotion: - case NormalMove: - case FirstLeg: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - /* PUSH Fabien */ - case WhiteHSideCastleFR: - case WhiteASideCastleFR: - case BlackHSideCastleFR: - case BlackASideCastleFR: - /* POP Fabien */ - fromX = currentMoveString[0] - AAA; - fromY = currentMoveString[1] - ONE; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = currentMoveString[4]; - break; - case WhiteDrop: - case BlackDrop: - if(currentMoveString[0] == '@') continue; // no null moves in ICS mode! - fromX = moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - fromY = DROP_RANK; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = NULLCHAR; - break; - case AmbiguousMove: - /* bug? */ - snprintf(buf, MSG_SIZ, _("Ambiguous move in ICS output: \"%s\""), yy_text); - if (appData.debugMode) { - fprintf(debugFP, "Ambiguous move from ICS: '%s'\n", yy_text); - fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); - setbuf(debugFP, NULL); - } - DisplayError(buf, 0); - return; - case ImpossibleMove: - /* bug? */ - snprintf(buf, MSG_SIZ, _("Illegal move in ICS output: \"%s\""), yy_text); - if (appData.debugMode) { - fprintf(debugFP, "Impossible move from ICS: '%s'\n", yy_text); - fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); - setbuf(debugFP, NULL); - } - DisplayError(buf, 0); - return; - case EndOfFile: - if (boardIndex < backwardMostMove) { - /* Oops, gap. How did that happen? */ - DisplayError(_("Gap in move list"), 0); - return; - } - backwardMostMove = blackPlaysFirst ? 1 : 0; - if (boardIndex > forwardMostMove) { - forwardMostMove = boardIndex; - } - return; - case ElapsedTime: - if (boardIndex > (blackPlaysFirst ? 1 : 0)) { - strcat(parseList[boardIndex-1], " "); - strcat(parseList[boardIndex-1], yy_text); - } - continue; - case Comment: - case PGNTag: - case NAG: - default: - /* ignore */ - continue; - case WhiteWins: - case BlackWins: - case GameIsDrawn: - case GameUnfinished: - if (gameMode == IcsExamining) { - if (boardIndex < backwardMostMove) { - /* Oops, gap. How did that happen? */ - return; - } - backwardMostMove = blackPlaysFirst ? 1 : 0; - return; - } - gameInfo.result = moveType; - p = strchr(yy_text, '{'); - if (p == NULL) p = strchr(yy_text, '('); - if (p == NULL) { - p = yy_text; - if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; - } else { - q = strchr(p, *p == '{' ? '}' : ')'); - if (q != NULL) *q = NULLCHAR; - p++; - } - while(q = strchr(p, '\n')) *q = ' '; // [HGM] crush linefeeds in result message - gameInfo.resultDetails = StrSave(p); - continue; - } - if (boardIndex >= forwardMostMove && - !(gameMode == IcsObserving && ics_gamenum == -1)) { - backwardMostMove = blackPlaysFirst ? 1 : 0; - return; - } - (void) CoordsToAlgebraic(boards[boardIndex], PosFlags(boardIndex), - fromY, fromX, toY, toX, promoChar, - parseList[boardIndex]); - CopyBoard(boards[boardIndex + 1], boards[boardIndex]); - /* currentMoveString is set as a side-effect of yylex */ - safeStrCpy(moveList[boardIndex], currentMoveString, sizeof(moveList[boardIndex])/sizeof(moveList[boardIndex][0])); - strcat(moveList[boardIndex], "\n"); - boardIndex++; - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[boardIndex]); - switch (MateTest(boards[boardIndex], PosFlags(boardIndex)) ) { - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - if(!IS_SHOGI(gameInfo.variant)) - strcat(parseList[boardIndex - 1], "+"); - break; - case MT_CHECKMATE: - case MT_STAINMATE: - strcat(parseList[boardIndex - 1], "#"); - break; - } - } -} - - -/* Apply a move to the given board */ -void -ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) -{ - ChessSquare captured = board[toY][toX], piece, pawn, king, killed, killed2; int p, rookX, oldEP, epRank, berolina = 0; - int promoRank = gameInfo.variant == VariantMakruk || gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess ? 3 : 1; - - /* [HGM] compute & store e.p. status and castling rights for new position */ - /* we can always do that 'in place', now pointers to these rights are passed to ApplyMove */ - - if(gameInfo.variant == VariantBerolina) berolina = EP_BEROLIN_A; - oldEP = (signed char)board[EP_FILE]; epRank = board[EP_RANK]; - board[EP_STATUS] = EP_NONE; - board[EP_FILE] = board[EP_RANK] = 100; - - if (fromY == DROP_RANK) { - /* must be first */ - if(fromX == EmptySquare) { // [HGM] pass: empty drop encodes null move; nothing to change. - board[EP_STATUS] = EP_CAPTURE; // null move considered irreversible - return; - } - piece = board[toY][toX] = (ChessSquare) fromX; - } else { -// ChessSquare victim; - int i; - - if( killX >= 0 && killY >= 0 ) { // [HGM] lion: Lion trampled over something -// victim = board[killY][killX], - killed = board[killY][killX], - board[killY][killX] = EmptySquare, - board[EP_STATUS] = EP_CAPTURE; - if( kill2X >= 0 && kill2Y >= 0) - killed2 = board[kill2Y][kill2X], board[kill2Y][kill2X] = EmptySquare; - } - - if( board[toY][toX] != EmptySquare ) { - board[EP_STATUS] = EP_CAPTURE; - if( (fromX != toX || fromY != toY) && // not igui! - (captured == WhiteLion && board[fromY][fromX] != BlackLion || - captured == BlackLion && board[fromY][fromX] != WhiteLion ) ) { // [HGM] lion: Chu Lion-capture rules - board[EP_STATUS] = EP_IRON_LION; // non-Lion x Lion: no counter-strike allowed - } - } - - pawn = board[fromY][fromX]; - if( pawn == WhiteLance || pawn == BlackLance ) { - if( gameInfo.variant != VariantSuper && gameInfo.variant != VariantChu ) { - if(gameInfo.variant == VariantSpartan) board[EP_STATUS] = EP_PAWN_MOVE; // in Spartan no e.p. rights must be set - else pawn += WhitePawn - WhiteLance; // Lance is Pawn-like in most variants, so let Pawn code treat it by this kludge - } - } - if( pawn == WhitePawn ) { - if(fromY != toY) // [HGM] Xiangqi sideway Pawn moves should not count as 50-move breakers - board[EP_STATUS] = EP_PAWN_MOVE; - if( toY-fromY>=2) { - board[EP_FILE] = (fromX + toX)/2; board[EP_RANK] = toY - 1 | 128*(toY - fromY > 2); - if(toX>BOARD_LEFT && board[toY][toX-1] == BlackPawn && - gameInfo.variant != VariantBerolina || toX < fromX) - board[EP_STATUS] = toX | berolina; - if(toX fromX) - board[EP_STATUS] = toX; - } - } else - if( pawn == BlackPawn ) { - if(fromY != toY) // [HGM] Xiangqi sideway Pawn moves should not count as 50-move breakers - board[EP_STATUS] = EP_PAWN_MOVE; - if( toY-fromY<= -2) { - board[EP_FILE] = (fromX + toX)/2; board[EP_RANK] = toY + 1 | 128*(fromY - toY > 2); - if(toX>BOARD_LEFT && board[toY][toX-1] == WhitePawn && - gameInfo.variant != VariantBerolina || toX < fromX) - board[EP_STATUS] = toX | berolina; - if(toX fromX) - board[EP_STATUS] = toX; - } - } - - if(fromY == 0) board[TOUCHED_W] |= 1<= 0 && strchr(pieceDesc[piece], 'O') // Betza castling-enabled - && (piece < BlackPawn ? killed < BlackPawn : killed >= BlackPawn)) { // and tramples own - board[toY][toX] = piece; board[fromY][fromX] = EmptySquare; - board[toY][toX + (killX < fromX ? 1 : -1)] = killed; - board[EP_STATUS] = EP_NONE; // capture was fake! - } else - if(nrCastlingRights == 0 && board[toY][toX] < EmptySquare && (piece < BlackPawn) == (board[toY][toX] < BlackPawn)) { - board[fromY][fromX] = board[toY][toX]; // capture own will lead to swapping - board[toY][toX] = piece; - board[EP_STATUS] = EP_NONE; // capture was fake! - } else - /* Code added by Tord: */ - /* FRC castling assumed when king captures friendly rook. [HGM] or RxK for S-Chess */ - if (board[fromY][fromX] == WhiteKing && board[toY][toX] == WhiteRook || - board[fromY][fromX] == WhiteRook && board[toY][toX] == WhiteKing) { - board[EP_STATUS] = EP_NONE; // capture was fake! - board[fromY][fromX] = EmptySquare; - board[toY][toX] = EmptySquare; - if((toX > fromX) != (piece == WhiteRook)) { - board[0][BOARD_RGHT-2] = WhiteKing; board[0][BOARD_RGHT-3] = WhiteRook; - } else { - board[0][BOARD_LEFT+2] = WhiteKing; board[0][BOARD_LEFT+3] = WhiteRook; - } - } else if (board[fromY][fromX] == BlackKing && board[toY][toX] == BlackRook || - board[fromY][fromX] == BlackRook && board[toY][toX] == BlackKing) { - board[EP_STATUS] = EP_NONE; - board[fromY][fromX] = EmptySquare; - board[toY][toX] = EmptySquare; - if((toX > fromX) != (piece == BlackRook)) { - board[BOARD_HEIGHT-1][BOARD_RGHT-2] = BlackKing; board[BOARD_HEIGHT-1][BOARD_RGHT-3] = BlackRook; - } else { - board[BOARD_HEIGHT-1][BOARD_LEFT+2] = BlackKing; board[BOARD_HEIGHT-1][BOARD_LEFT+3] = BlackRook; - } - /* End of code added by Tord */ - - } else if (pieceDesc[piece] && piece == king && !strchr(pieceDesc[piece], 'O') && strchr(pieceDesc[piece], 'i')) { - board[fromY][fromX] = EmptySquare; // never castle if King has virgin moves defined on it other than castling - board[toY][toX] = piece; - } else if (board[fromY][fromX] == king - && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ - && toY == fromY && toX > fromX+1) { - for(rookX=fromX+1; board[toY][rookX] == EmptySquare && rookX < BOARD_RGHT-1; rookX++) - ; // castle with nearest piece - board[fromY][toX-1] = board[fromY][rookX]; - board[fromY][rookX] = EmptySquare; - board[fromY][fromX] = EmptySquare; - board[toY][toX] = king; - } else if (board[fromY][fromX] == king - && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ - && toY == fromY && toX < fromX-1) { - for(rookX=fromX-1; board[toY][rookX] == EmptySquare && rookX > 0; rookX--) - ; // castle with nearest piece - board[fromY][toX+1] = board[fromY][rookX]; - board[fromY][rookX] = EmptySquare; - board[fromY][fromX] = EmptySquare; - board[toY][toX] = king; - } else if ((board[fromY][fromX] == WhitePawn && gameInfo.variant != VariantXiangqi || - board[fromY][fromX] == WhiteLance && gameInfo.variant != VariantSuper && gameInfo.variant != VariantChu) - && toY >= BOARD_HEIGHT-promoRank && promoChar // defaulting to Q is done elsewhere - ) { - /* white pawn promotion */ - board[toY][toX] = CharToPiece(ToUpper(promoChar)); - if(board[toY][toX] < WhiteCannon && PieceToChar(PROMOTED(board[toY][toX])) == '~') /* [HGM] use shadow piece (if available) */ - board[toY][toX] = (ChessSquare) (PROMOTED(board[toY][toX])); - board[fromY][fromX] = EmptySquare; - } else if ((fromY >= BOARD_HEIGHT>>1) - && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality || abs(toX - fromX) > 4) - && (toX != fromX) - && gameInfo.variant != VariantXiangqi - && gameInfo.variant != VariantBerolina - && (pawn == WhitePawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = piece; - if(toY == epRank - 128 + 1) - captured = board[toY - 2][toX], board[toY - 2][toX] = EmptySquare; - else - captured = board[toY - 1][toX], board[toY - 1][toX] = EmptySquare; - } else if ((fromY == BOARD_HEIGHT-4) - && (toX == fromX) - && gameInfo.variant == VariantBerolina - && (board[fromY][fromX] == WhitePawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhitePawn; - if(oldEP & EP_BEROLIN_A) { - captured = board[fromY][fromX-1]; - board[fromY][fromX-1] = EmptySquare; - }else{ captured = board[fromY][fromX+1]; - board[fromY][fromX+1] = EmptySquare; - } - } else if (board[fromY][fromX] == king - && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ - && toY == fromY && toX > fromX+1) { - for(rookX=toX+1; board[toY][rookX] == EmptySquare && rookX < BOARD_RGHT - 1; rookX++) - ; - board[fromY][toX-1] = board[fromY][rookX]; - board[fromY][rookX] = EmptySquare; - board[fromY][fromX] = EmptySquare; - board[toY][toX] = king; - } else if (board[fromY][fromX] == king - && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ - && toY == fromY && toX < fromX-1) { - for(rookX=toX-1; board[toY][rookX] == EmptySquare && rookX > 0; rookX--) - ; - board[fromY][toX+1] = board[fromY][rookX]; - board[fromY][rookX] = EmptySquare; - board[fromY][fromX] = EmptySquare; - board[toY][toX] = king; - } else if (fromY == 7 && fromX == 3 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 5) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][7] = EmptySquare; - board[toY][4] = BlackRook; - } else if (fromY == 7 && fromX == 3 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 1) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][0] = EmptySquare; - board[toY][2] = BlackRook; - } else if ((board[fromY][fromX] == BlackPawn && gameInfo.variant != VariantXiangqi || - board[fromY][fromX] == BlackLance && gameInfo.variant != VariantSuper && gameInfo.variant != VariantChu) - && toY < promoRank && promoChar - ) { - /* black pawn promotion */ - board[toY][toX] = CharToPiece(ToLower(promoChar)); - if(board[toY][toX] < BlackCannon && PieceToChar(PROMOTED(board[toY][toX])) == '~') /* [HGM] use shadow piece (if available) */ - board[toY][toX] = (ChessSquare) (PROMOTED(board[toY][toX])); - board[fromY][fromX] = EmptySquare; - } else if ((fromY < BOARD_HEIGHT>>1) - && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality || abs(toX - fromX) > 4) - && (toX != fromX) - && gameInfo.variant != VariantXiangqi - && gameInfo.variant != VariantBerolina - && (pawn == BlackPawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = piece; - if(toY == epRank - 128 - 1) - captured = board[toY + 2][toX], board[toY + 2][toX] = EmptySquare; - else - captured = board[toY + 1][toX], board[toY + 1][toX] = EmptySquare; - } else if ((fromY == 3) - && (toX == fromX) - && gameInfo.variant == VariantBerolina - && (board[fromY][fromX] == BlackPawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackPawn; - if(oldEP & EP_BEROLIN_A) { - captured = board[fromY][fromX-1]; - board[fromY][fromX-1] = EmptySquare; - }else{ captured = board[fromY][fromX+1]; - board[fromY][fromX+1] = EmptySquare; - } - } else { - ChessSquare piece = board[fromY][fromX]; // [HGM] lion: allow for igui (where from == to) - board[fromY][fromX] = EmptySquare; - board[toY][toX] = piece; - } - } - - if (gameInfo.holdingsWidth != 0) { - - /* !!A lot more code needs to be written to support holdings */ - /* [HGM] OK, so I have written it. Holdings are stored in the */ - /* penultimate board files, so they are automaticlly stored */ - /* in the game history. */ - if (fromY == DROP_RANK || gameInfo.variant == VariantSChess - && promoChar && piece != WhitePawn && piece != BlackPawn) { - /* Delete from holdings, by decreasing count */ - /* and erasing image if necessary */ - p = fromY == DROP_RANK ? (int) fromX : CharToPiece(piece > BlackPawn ? ToLower(promoChar) : ToUpper(promoChar)); - if(p < (int) BlackPawn) { /* white drop */ - p -= (int)WhitePawn; - p = PieceToNumber((ChessSquare)p); - if(p >= gameInfo.holdingsSize) p = 0; - if(--board[p][BOARD_WIDTH-2] <= 0) - board[p][BOARD_WIDTH-1] = EmptySquare; - if((int)board[p][BOARD_WIDTH-2] < 0) - board[p][BOARD_WIDTH-2] = 0; - } else { /* black drop */ - p -= (int)BlackPawn; - p = PieceToNumber((ChessSquare)p); - if(p >= gameInfo.holdingsSize) p = 0; - if(--board[BOARD_HEIGHT-1-p][1] <= 0) - board[BOARD_HEIGHT-1-p][0] = EmptySquare; - if((int)board[BOARD_HEIGHT-1-p][1] < 0) - board[BOARD_HEIGHT-1-p][1] = 0; - } - } - if (captured != EmptySquare && gameInfo.holdingsSize > 0 - && gameInfo.variant != VariantBughouse && gameInfo.variant != VariantSChess ) { - /* [HGM] holdings: Add to holdings, if holdings exist */ - if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) { - // [HGM] superchess: suppress flipping color of captured pieces by reverse pre-flip - captured = (int) captured >= (int) BlackPawn ? BLACK_TO_WHITE captured : WHITE_TO_BLACK captured; - } - p = (int) captured; - if (p >= (int) BlackPawn) { - p -= (int)BlackPawn; - if(DEMOTED(p) >= 0 && PieceToChar(p) == '+') { - /* Restore shogi-promoted piece to its original first */ - captured = (ChessSquare) (DEMOTED(captured)); - p = DEMOTED(p); - } - p = PieceToNumber((ChessSquare)p); - if(p >= gameInfo.holdingsSize) { p = 0; captured = BlackPawn; } - board[p][BOARD_WIDTH-2]++; - board[p][BOARD_WIDTH-1] = BLACK_TO_WHITE captured; - } else { - p -= (int)WhitePawn; - if(DEMOTED(p) >= 0 && PieceToChar(p) == '+') { - captured = (ChessSquare) (DEMOTED(captured)); - p = DEMOTED(p); - } - p = PieceToNumber((ChessSquare)p); - if(p >= gameInfo.holdingsSize) { p = 0; captured = WhitePawn; } - board[BOARD_HEIGHT-1-p][1]++; - board[BOARD_HEIGHT-1-p][0] = WHITE_TO_BLACK captured; - } - } - } else if (gameInfo.variant == VariantAtomic) { - if (captured != EmptySquare) { - int y, x; - for (y = toY-1; y <= toY+1; y++) { - for (x = toX-1; x <= toX+1; x++) { - if (y >= 0 && y < BOARD_HEIGHT && x >= BOARD_LEFT && x < BOARD_RGHT && - board[y][x] != WhitePawn && board[y][x] != BlackPawn) { - board[y][x] = EmptySquare; - } - } - } - board[toY][toX] = EmptySquare; - } - } - - if(gameInfo.variant == VariantSChess && promoChar != NULLCHAR && promoChar != '=' && piece != WhitePawn && piece != BlackPawn) { - board[fromY][fromX] = CharToPiece(piece < BlackPawn ? ToUpper(promoChar) : ToLower(promoChar)); // S-Chess gating - } else - if(promoChar == '+') { - /* [HGM] Shogi-style promotions, to piece implied by original (Might overwrite ordinary Pawn promotion) */ - board[toY][toX] = (ChessSquare) (CHUPROMOTED(piece)); - if(gameInfo.variant == VariantChuChess && (piece == WhiteKnight || piece == BlackKnight)) - board[toY][toX] = piece + WhiteLion - WhiteKnight; // adjust Knight promotions to Lion - } else if(!appData.testLegality && promoChar != NULLCHAR && promoChar != '=') { // without legality testing, unconditionally believe promoChar - ChessSquare newPiece = CharToPiece(piece < BlackPawn ? ToUpper(promoChar) : ToLower(promoChar)); - if((newPiece <= WhiteMan || newPiece >= BlackPawn && newPiece <= BlackMan) // unpromoted piece specified - && pieceToChar[PROMOTED(newPiece)] == '~') newPiece = PROMOTED(newPiece);// but promoted version available - board[toY][toX] = newPiece; - } - if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) - && promoChar != NULLCHAR && gameInfo.holdingsSize) { - // [HGM] superchess: take promotion piece out of holdings - int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); - if((int)piece < (int)BlackPawn) { // determine stm from piece color - if(!--board[k][BOARD_WIDTH-2]) - board[k][BOARD_WIDTH-1] = EmptySquare; - } else { - if(!--board[BOARD_HEIGHT-1-k][1]) - board[BOARD_HEIGHT-1-k][0] = EmptySquare; - } - } -} - -/* Updates forwardMostMove */ -void -MakeMove (int fromX, int fromY, int toX, int toY, int promoChar) -{ - int x = toX, y = toY; - char *s = parseList[forwardMostMove]; - ChessSquare p = boards[forwardMostMove][toY][toX]; -// forwardMostMove++; // [HGM] bare: moved downstream - - if(kill2X >= 0) x = kill2X, y = kill2Y; else - if(killX >= 0 && killY >= 0) x = killX, y = killY; // [HGM] lion: make SAN move to intermediate square, if there is one - (void) CoordsToAlgebraic(boards[forwardMostMove], - PosFlags(forwardMostMove), - fromY, fromX, y, x, (killX < 0)*promoChar, - s); - if(kill2X >= 0 && kill2Y >= 0) - sprintf(s + strlen(s), "x%c%d", killX + AAA, killY + ONE - '0'); // 2nd leg of 3-leg move is always capture - if(killX >= 0 && killY >= 0) - sprintf(s + strlen(s), "%c%c%d%c", p == EmptySquare || toX == fromX && toY == fromY || toX== kill2X && toY == kill2Y ? '-' : 'x', - toX + AAA, toY + ONE - '0', promoChar); - - if(serverMoves != NULL) { /* [HGM] write moves on file for broadcasting (should be separate routine, really) */ - int timeLeft; static int lastLoadFlag=0; int king, piece; - piece = boards[forwardMostMove][fromY][fromX]; - king = piece < (int) BlackPawn ? WhiteKing : BlackKing; - if(gameInfo.variant == VariantKnightmate) - king += (int) WhiteUnicorn - (int) WhiteKing; - if(forwardMostMove == 0) { - if(gameMode == MachinePlaysBlack || gameMode == BeginningOfGame) - fprintf(serverMoves, "%s;", UserName()); - else if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b') - fprintf(serverMoves, "%s;", second.tidy); - fprintf(serverMoves, "%s;", first.tidy); - if(gameMode == MachinePlaysWhite) - fprintf(serverMoves, "%s;", UserName()); - else if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'w') - fprintf(serverMoves, "%s;", second.tidy); - } else fprintf(serverMoves, loadFlag|lastLoadFlag ? ":" : ";"); - lastLoadFlag = loadFlag; - // print base move - fprintf(serverMoves, "%c%c:%c%c", AAA+fromX, ONE+fromY, AAA+toX, ONE+toY); - // print castling suffix - if( toY == fromY && piece == king ) { - if(toX-fromX > 1) - fprintf(serverMoves, ":%c%c:%c%c", AAA+BOARD_RGHT-1, ONE+fromY, AAA+toX-1,ONE+toY); - if(fromX-toX >1) - fprintf(serverMoves, ":%c%c:%c%c", AAA+BOARD_LEFT, ONE+fromY, AAA+toX+1,ONE+toY); - } - // e.p. suffix - if( (boards[forwardMostMove][fromY][fromX] == WhitePawn || - boards[forwardMostMove][fromY][fromX] == BlackPawn ) && - boards[forwardMostMove][toY][toX] == EmptySquare - && fromX != toX && fromY != toY) - fprintf(serverMoves, ":%c%c:%c%c", AAA+fromX, ONE+fromY, AAA+toX, ONE+fromY); - // promotion suffix - if(promoChar != NULLCHAR) { - if(fromY == 0 || fromY == BOARD_HEIGHT-1) - fprintf(serverMoves, ":%c%c:%c%c", WhiteOnMove(forwardMostMove) ? 'w' : 'b', - ToLower(promoChar), AAA+fromX, ONE+fromY); // Seirawan gating - else fprintf(serverMoves, ":%c:%c%c", ToLower(promoChar), AAA+toX, ONE+toY); - } - if(!loadFlag) { - char buf[MOVE_LEN*2], *p; int len; - fprintf(serverMoves, "/%d/%d", - pvInfoList[forwardMostMove].depth, pvInfoList[forwardMostMove].score); - if(forwardMostMove+1 & 1) timeLeft = whiteTimeRemaining/1000; - else timeLeft = blackTimeRemaining/1000; - fprintf(serverMoves, "/%d", timeLeft); - strncpy(buf, parseList[forwardMostMove], MOVE_LEN*2); - if(p = strchr(buf, '/')) *p = NULLCHAR; else - if(p = strchr(buf, '=')) *p = NULLCHAR; - len = strlen(buf); if(len > 1 && buf[len-2] != '-') buf[len-2] = NULLCHAR; // strip to-square - fprintf(serverMoves, "/%s", buf); - } - fflush(serverMoves); - } - - if (forwardMostMove+1 > framePtr) { // [HGM] vari: do not run into saved variations.. - GameEnds(GameUnfinished, _("Game too long; increase MAX_MOVES and recompile"), GE_XBOARD); - return; - } - UnLoadPV(); // [HGM] pv: if we are looking at a PV, abort this - if (commentList[forwardMostMove+1] != NULL) { - free(commentList[forwardMostMove+1]); - commentList[forwardMostMove+1] = NULL; - } - CopyBoard(boards[forwardMostMove+1], boards[forwardMostMove]); - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[forwardMostMove+1]); - // forwardMostMove++; // [HGM] bare: moved to after ApplyMove, to make sure clock interrupt finds complete board - SwitchClocks(forwardMostMove+1); // [HGM] race: incrementing move nr inside - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - adjustedClock = FALSE; - gameInfo.result = GameUnfinished; - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - CoordsToComputerAlgebraic(fromY, fromX, toY, toX, promoChar, - moveList[forwardMostMove - 1]); - switch (MateTest(boards[forwardMostMove], PosFlags(forwardMostMove)) ) { - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - if(!IS_SHOGI(gameInfo.variant)) - strcat(parseList[forwardMostMove - 1], "+"); - break; - case MT_CHECKMATE: - case MT_STAINMATE: - strcat(parseList[forwardMostMove - 1], "#"); - break; - } -} - -/* Updates currentMove if not pausing */ -void -ShowMove (int fromX, int fromY, int toX, int toY) -{ - int instant = (gameMode == PlayFromGameFile) ? - (matchMode || (appData.timeDelay == 0 && !pausing)) : pausing; - if(appData.noGUI) return; - if (!pausing || gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { - if (!instant) { - if (forwardMostMove == currentMove + 1) { - AnimateMove(boards[forwardMostMove - 1], - fromX, fromY, toX, toY); - } - } - currentMove = forwardMostMove; - } - - killX = killY = kill2X = kill2Y = -1; // [HGM] lion: used up - - if (instant) return; - - DisplayMove(currentMove - 1); - if (!pausing || gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { - if (appData.highlightLastMove) { // [HGM] moved to after DrawPosition, as with arrow it could redraw old board - SetHighlights(fromX, fromY, toX, toY); - } - } - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); -} - -void -SendEgtPath (ChessProgramState *cps) -{ /* [HGM] EGT: match formats given in feature with those given by user, and send info for each match */ - char buf[MSG_SIZ], name[MSG_SIZ], *p; - - if((p = cps->egtFormats) == NULL || appData.egtFormats == NULL) return; - - while(*p) { - char c, *q = name+1, *r, *s; - - name[0] = ','; // extract next format name from feature and copy with prefixed ',' - while(*p && *p != ',') *q++ = *p++; - *q++ = ':'; *q = 0; - if( appData.defaultPathEGTB && appData.defaultPathEGTB[0] && - strcmp(name, ",nalimov:") == 0 ) { - // take nalimov path from the menu-changeable option first, if it is defined - snprintf(buf, MSG_SIZ, "egtpath nalimov %s\n", appData.defaultPathEGTB); - SendToProgram(buf,cps); // send egtbpath command for nalimov - } else - if( (s = StrStr(appData.egtFormats, name+1)) == appData.egtFormats || - (s = StrStr(appData.egtFormats, name)) != NULL) { - // format name occurs amongst user-supplied formats, at beginning or immediately after comma - s = r = StrStr(s, ":") + 1; // beginning of path info - while(*r && *r != ',') r++; // path info is everything upto next ';' or end of string - c = *r; *r = 0; // temporarily null-terminate path info - *--q = 0; // strip of trailig ':' from name - snprintf(buf, MSG_SIZ, "egtpath %s %s\n", name+1, s); - *r = c; - SendToProgram(buf,cps); // send egtbpath command for this format - } - if(*p == ',') p++; // read away comma to position for next format name - } -} - -static int -NonStandardBoardSize (VariantClass v, int boardWidth, int boardHeight, int holdingsSize) -{ - int width = 8, height = 8, holdings = 0; // most common sizes - if( v == VariantUnknown || *engineVariant) return 0; // engine-defined name never needs prefix - // correct the deviations default for each variant - if( v == VariantXiangqi ) width = 9, height = 10; - if( v == VariantShogi ) width = 9, height = 9, holdings = 7; - if( v == VariantBughouse || v == VariantCrazyhouse) holdings = 5; - if( v == VariantCapablanca || v == VariantCapaRandom || - v == VariantGothic || v == VariantFalcon || v == VariantJanus ) - width = 10; - if( v == VariantCourier ) width = 12; - if( v == VariantSuper ) holdings = 8; - if( v == VariantGreat ) width = 10, holdings = 8; - if( v == VariantSChess ) holdings = 7; - if( v == VariantGrand ) width = 10, height = 10, holdings = 7; - if( v == VariantChuChess) width = 10, height = 10; - if( v == VariantChu ) width = 12, height = 12; - return boardWidth >= 0 && boardWidth != width || // -1 is default, - boardHeight >= 0 && boardHeight != height || // and thus by definition OK - holdingsSize >= 0 && holdingsSize != holdings; -} - -char variantError[MSG_SIZ]; - -char * -SupportedVariant (char *list, VariantClass v, int boardWidth, int boardHeight, int holdingsSize, int proto, char *engine) -{ // returns error message (recognizable by upper-case) if engine does not support the variant - char *p, *variant = VariantName(v); - static char b[MSG_SIZ]; - if(NonStandardBoardSize(v, boardWidth, boardHeight, holdingsSize)) { /* [HGM] make prefix for non-standard board size. */ - snprintf(b, MSG_SIZ, "%dx%d+%d_%s", boardWidth, boardHeight, - holdingsSize, variant); // cook up sized variant name - /* [HGM] varsize: try first if this deviant size variant is specifically known */ - if(StrStr(list, b) == NULL) { - // specific sized variant not known, check if general sizing allowed - if(proto != 1 && StrStr(list, "boardsize") == NULL) { - snprintf(variantError, MSG_SIZ, "Board size %dx%d+%d not supported by %s", - boardWidth, boardHeight, holdingsSize, engine); - return NULL; - } - /* [HGM] here we really should compare with the maximum supported board size */ - } - } else snprintf(b, MSG_SIZ,"%s", variant); - if(proto == 1) return b; // for protocol 1 we cannot check and hope for the best - p = StrStr(list, b); - while(p && (p != list && p[-1] != ',' || p[strlen(b)] && p[strlen(b)] != ',') ) p = StrStr(p+1, b); - if(p == NULL) { - // occurs not at all in list, or only as sub-string - snprintf(variantError, MSG_SIZ, _("Variant %s not supported by %s"), b, engine); - if(p = StrStr(list, b)) { // handle requesting parent variant when only size-overridden is supported - int l = strlen(variantError); - char *q; - while(p != list && p[-1] != ',') p--; - q = strchr(p, ','); - if(q) *q = NULLCHAR; - snprintf(variantError + l, MSG_SIZ - l, _(", but %s is"), p); - if(q) *q= ','; - } - return NULL; - } - return b; -} - -void -InitChessProgram (ChessProgramState *cps, int setup) -/* setup needed to setup FRC opening position */ -{ - char buf[MSG_SIZ], *b; - if (appData.noChessProgram) return; - hintRequested = FALSE; - bookRequested = FALSE; - - ParseFeatures(appData.features[cps == &second], cps); // [HGM] allow user to overrule features - /* [HGM] some new WB protocol commands to configure engine are sent now, if engine supports them */ - /* moved to before sending initstring in 4.3.15, so Polyglot can delay UCI 'isready' to recepton of 'new' */ - if(cps->memSize) { /* [HGM] memory */ - snprintf(buf, MSG_SIZ, "memory %d\n", appData.defaultHashSize + appData.defaultCacheSizeEGTB); - SendToProgram(buf, cps); - } - SendEgtPath(cps); /* [HGM] EGT */ - if(cps->maxCores) { /* [HGM] SMP: (protocol specified must be last settings command before new!) */ - snprintf(buf, MSG_SIZ, "cores %d\n", appData.smpCores); - SendToProgram(buf, cps); - } - - setboardSpoiledMachineBlack = FALSE; - SendToProgram(cps->initString, cps); - if (gameInfo.variant != VariantNormal && - gameInfo.variant != VariantLoadable - /* [HGM] also send variant if board size non-standard */ - || gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0) { - - b = SupportedVariant(cps->variants, gameInfo.variant, gameInfo.boardWidth, - gameInfo.boardHeight, gameInfo.holdingsSize, cps->protocolVersion, cps->tidy); - - if (b == NULL) { - VariantClass v; - char c, *q = cps->variants, *p = strchr(q, ','); - if(p) *p = NULLCHAR; - v = StringToVariant(q); - DisplayError(variantError, 0); - if(v != VariantUnknown && cps == &first) { - int w, h, s; - if(sscanf(q, "%dx%d+%d_%c", &w, &h, &s, &c) == 4) // get size overrides the engine needs with it (if any) - appData.NrFiles = w, appData.NrRanks = h, appData.holdingsSize = s, q = strchr(q, '_') + 1; - ASSIGN(appData.variant, q); - Reset(TRUE, FALSE); - } - if(p) *p = ','; - return; - } - - snprintf(buf, MSG_SIZ, "variant %s\n", b); - SendToProgram(buf, cps); - } - currentlyInitializedVariant = gameInfo.variant; - - /* [HGM] send opening position in FRC to first engine */ - if(setup) { - SendToProgram("force\n", cps); - SendBoard(cps, 0); - /* engine is now in force mode! Set flag to wake it up after first move. */ - setboardSpoiledMachineBlack = 1; - } - - if (cps->sendICS) { - snprintf(buf, sizeof(buf), "ics %s\n", appData.icsActive ? appData.icsHost : "-"); - SendToProgram(buf, cps); - } - cps->maybeThinking = FALSE; - cps->offeredDraw = 0; - if (!appData.icsActive) { - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - } - if (appData.showThinking - // [HGM] thinking: four options require thinking output to be sent - || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() - ) { - SendToProgram("post\n", cps); - } - SendToProgram("hard\n", cps); - if (!appData.ponderNextMove) { - /* Warning: "easy" is a toggle in GNU Chess, so don't send - it without being sure what state we are in first. "hard" - is not a toggle, so that one is OK. - */ - SendToProgram("easy\n", cps); - } - if (cps->usePing) { - snprintf(buf, MSG_SIZ, "ping %d\n", initPing = ++cps->lastPing); - SendToProgram(buf, cps); - } - cps->initDone = TRUE; - ClearEngineOutputPane(cps == &second); -} - - -void -ResendOptions (ChessProgramState *cps) -{ // send the stored value of the options - int i; - char buf[MSG_SIZ]; - Option *opt = cps->option; - for(i=0; inrOptions; i++, opt++) { - switch(opt->type) { - case Spin: - case Slider: - case CheckBox: - snprintf(buf, MSG_SIZ, "option %s=%d\n", opt->name, opt->value); - break; - case ComboBox: - snprintf(buf, MSG_SIZ, "option %s=%s\n", opt->name, opt->choice[opt->value]); - break; - default: - snprintf(buf, MSG_SIZ, "option %s=%s\n", opt->name, opt->textValue); - break; - case Button: - case SaveButton: - continue; - } - SendToProgram(buf, cps); - } -} - -void -StartChessProgram (ChessProgramState *cps) -{ - char buf[MSG_SIZ]; - int err; - - if (appData.noChessProgram) return; - cps->initDone = FALSE; - - if (strcmp(cps->host, "localhost") == 0) { - err = StartChildProcess(cps->program, cps->dir, &cps->pr); - } else if (*appData.remoteShell == NULLCHAR) { - err = OpenRcmd(cps->host, appData.remoteUser, cps->program, &cps->pr); - } else { - if (*appData.remoteUser == NULLCHAR) { - snprintf(buf, sizeof(buf), "%s %s %s", appData.remoteShell, cps->host, - cps->program); - } else { - snprintf(buf, sizeof(buf), "%s %s -l %s %s", appData.remoteShell, - cps->host, appData.remoteUser, cps->program); - } - err = StartChildProcess(buf, "", &cps->pr); - } - - if (err != 0) { - snprintf(buf, MSG_SIZ, _("Startup failure on '%s'"), cps->program); - DisplayError(buf, err); // [HGM] bit of a rough kludge: ignore failure, (which XBoard would do anyway), and let I/O discover it - if(cps != &first) return; - appData.noChessProgram = TRUE; - ThawUI(); - SetNCPMode(); -// DisplayFatalError(buf, err, 1); -// cps->pr = NoProc; -// cps->isr = NULL; - return; - } - - cps->isr = AddInputSource(cps->pr, TRUE, ReceiveFromProgram, cps); - if (cps->protocolVersion > 1) { - snprintf(buf, MSG_SIZ, "xboard\nprotover %d\n", cps->protocolVersion); - if(!cps->reload) { // do not clear options when reloading because of -xreuse - cps->nrOptions = 0; // [HGM] options: clear all engine-specific options - cps->comboCnt = 0; // and values of combo boxes - } - SendToProgram(buf, cps); - if(cps->reload) ResendOptions(cps); - } else { - SendToProgram("xboard\n", cps); - } -} - -void -TwoMachinesEventIfReady P((void)) -{ - static int curMess = 0; - if (first.lastPing != first.lastPong) { - if(curMess != 1) DisplayMessage("", _("Waiting for first chess program")); curMess = 1; - ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); // [HGM] fast: lowered from 1000 - return; - } - if (second.lastPing != second.lastPong) { - if(curMess != 2) DisplayMessage("", _("Waiting for second chess program")); curMess = 2; - ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); // [HGM] fast: lowered from 1000 - return; - } - DisplayMessage("", ""); curMess = 0; - TwoMachinesEvent(); -} - -char * -MakeName (char *template) -{ - time_t clock; - struct tm *tm; - static char buf[MSG_SIZ]; - char *p = buf; - int i; - - clock = time((time_t *)NULL); - tm = localtime(&clock); - - while(*p++ = *template++) if(p[-1] == '%') { - switch(*template++) { - case 0: *p = 0; return buf; - case 'Y': i = tm->tm_year+1900; break; - case 'y': i = tm->tm_year-100; break; - case 'M': i = tm->tm_mon+1; break; - case 'd': i = tm->tm_mday; break; - case 'h': i = tm->tm_hour; break; - case 'm': i = tm->tm_min; break; - case 's': i = tm->tm_sec; break; - default: i = 0; - } - snprintf(p-1, MSG_SIZ-10 - (p - buf), "%02d", i); p += strlen(p); - } - return buf; -} - -int -CountPlayers (char *p) -{ - int n = 0; - while(p = strchr(p, '\n')) p++, n++; // count participants - return n; -} - -FILE * -WriteTourneyFile (char *results, FILE *f) -{ // write tournament parameters on tourneyFile; on success return the stream pointer for closing - if(f == NULL) f = fopen(appData.tourneyFile, "w"); - if(f == NULL) DisplayError(_("Could not write on tourney file"), 0); else { - // create a file with tournament description - fprintf(f, "-participants {%s}\n", appData.participants); - fprintf(f, "-seedBase %d\n", appData.seedBase); - fprintf(f, "-tourneyType %d\n", appData.tourneyType); - fprintf(f, "-tourneyCycles %d\n", appData.tourneyCycles); - fprintf(f, "-defaultMatchGames %d\n", appData.defaultMatchGames); - fprintf(f, "-syncAfterRound %s\n", appData.roundSync ? "true" : "false"); - fprintf(f, "-syncAfterCycle %s\n", appData.cycleSync ? "true" : "false"); - fprintf(f, "-saveGameFile \"%s\"\n", appData.saveGameFile); - fprintf(f, "-loadGameFile \"%s\"\n", appData.loadGameFile); - fprintf(f, "-loadGameIndex %d\n", appData.loadGameIndex); - fprintf(f, "-loadPositionFile \"%s\"\n", appData.loadPositionFile); - fprintf(f, "-loadPositionIndex %d\n", appData.loadPositionIndex); - fprintf(f, "-rewindIndex %d\n", appData.rewindIndex); - fprintf(f, "-usePolyglotBook %s\n", appData.usePolyglotBook ? "true" : "false"); - fprintf(f, "-polyglotBook \"%s\"\n", appData.polyglotBook); - fprintf(f, "-bookDepth %d\n", appData.bookDepth); - fprintf(f, "-bookVariation %d\n", appData.bookStrength); - fprintf(f, "-discourageOwnBooks %s\n", appData.defNoBook ? "true" : "false"); - fprintf(f, "-defaultHashSize %d\n", appData.defaultHashSize); - fprintf(f, "-defaultCacheSizeEGTB %d\n", appData.defaultCacheSizeEGTB); - fprintf(f, "-ponderNextMove %s\n", appData.ponderNextMove ? "true" : "false"); - fprintf(f, "-smpCores %d\n", appData.smpCores); - if(searchTime > 0) - fprintf(f, "-searchTime \"%d:%02d\"\n", searchTime/60, searchTime%60); - else { - fprintf(f, "-mps %d\n", appData.movesPerSession); - fprintf(f, "-tc %s\n", appData.timeControl); - fprintf(f, "-inc %.2f\n", appData.timeIncrement); - } - fprintf(f, "-results \"%s\"\n", results); - } - return f; -} - -char *command[MAXENGINES], *mnemonic[MAXENGINES]; - -void -Substitute (char *participants, int expunge) -{ - int i, changed, changes=0, nPlayers=0; - char *p, *q, *r, buf[MSG_SIZ]; - if(participants == NULL) return; - if(appData.tourneyFile[0] == NULLCHAR) { free(participants); return; } - r = p = participants; q = appData.participants; - while(*p && *p == *q) { - if(*p == '\n') r = p+1, nPlayers++; - p++; q++; - } - if(*p) { // difference - while(*p && *p++ != '\n') - ; - while(*q && *q++ != '\n') - ; - changed = nPlayers; - changes = 1 + (strcmp(p, q) != 0); - } - if(changes == 1) { // a single engine mnemonic was changed - q = r; while(*q) nPlayers += (*q++ == '\n'); - p = buf; while(*r && (*p = *r++) != '\n') p++; - *p = NULLCHAR; - NamesToList(firstChessProgramNames, command, mnemonic, "all"); - for(i=1; mnemonic[i]; i++) if(!strcmp(buf, mnemonic[i])) break; - if(mnemonic[i]) { // The substitute is valid - FILE *f; - if(appData.tourneyFile[0] && (f = fopen(appData.tourneyFile, "r+")) ) { - flock(fileno(f), LOCK_EX); - ParseArgsFromFile(f); - fseek(f, 0, SEEK_SET); - FREE(appData.participants); appData.participants = participants; - if(expunge) { // erase results of replaced engine - int len = strlen(appData.results), w, b, dummy; - for(i=0; i 1) DisplayError(_("You can only change one engine at the time"), 0); - free(participants); - return; -} - -int -CheckPlayers (char *participants) -{ - int i; - char buf[MSG_SIZ], *p; - NamesToList(firstChessProgramNames, command, mnemonic, "all"); - while(p = strchr(participants, '\n')) { - *p = NULLCHAR; - for(i=1; mnemonic[i]; i++) if(!strcmp(participants, mnemonic[i])) break; - if(!mnemonic[i]) { - snprintf(buf, MSG_SIZ, _("No engine %s is installed"), participants); - *p = '\n'; - DisplayError(buf, 0); - return 1; - } - *p = '\n'; - participants = p + 1; - } - return 0; -} - -int -CreateTourney (char *name) -{ - FILE *f; - if(matchMode && strcmp(name, appData.tourneyFile)) { - ASSIGN(name, appData.tourneyFile); //do not allow change of tourneyfile while playing - } - if(name[0] == NULLCHAR) { - if(appData.participants[0]) - DisplayError(_("You must supply a tournament file,\nfor storing the tourney progress"), 0); - return 0; - } - f = fopen(name, "r"); - if(f) { // file exists - ASSIGN(appData.tourneyFile, name); - ParseArgsFromFile(f); // parse it - } else { - if(!appData.participants[0]) return 0; // ignore tourney file if non-existing & no participants - if(CountPlayers(appData.participants) < (appData.tourneyType>0 ? appData.tourneyType+1 : 2)) { - DisplayError(_("Not enough participants"), 0); - return 0; - } - if(CheckPlayers(appData.participants)) return 0; - ASSIGN(appData.tourneyFile, name); - if(appData.tourneyType < 0) appData.defaultMatchGames = 1; // Swiss forces games/pairing = 1 - if((f = WriteTourneyFile("", NULL)) == NULL) return 0; - } - fclose(f); - appData.noChessProgram = FALSE; - appData.clockMode = TRUE; - SetGNUMode(); - return 1; -} - -int -NamesToList (char *names, char **engineList, char **engineMnemonic, char *group) -{ - char buf[MSG_SIZ], *p, *q; - int i=1, header, skip, all = !strcmp(group, "all"), depth = 0; - insert = names; // afterwards, this global will point just after last retrieved engine line or group end in the 'names' - skip = !all && group[0]; // if group requested, we start in skip mode - for(;*names && depth >= 0 && i < MAXENGINES-1; names = p) { - p = names; q = buf; header = 0; - while(*p && *p != '\n') *q++ = *p++; - *q = 0; - if(*p == '\n') p++; - if(buf[0] == '#') { - if(strstr(buf, "# end") == buf) { if(!--depth) insert = p; continue; } // leave group, and suppress printing label - depth++; // we must be entering a new group - if(all) continue; // suppress printing group headers when complete list requested - header = 1; - if(skip && !strcmp(group, buf)) { depth = 0; skip = FALSE; } // start when we reach requested group - } - if(depth != header && !all || skip) continue; // skip contents of group (but print first-level header) - if(engineList[i]) free(engineList[i]); - engineList[i] = strdup(buf); - if(buf[0] != '#') insert = p, TidyProgramName(engineList[i], "localhost", buf); // group headers not tidied - if(engineMnemonic[i]) free(engineMnemonic[i]); - if((q = strstr(engineList[i]+2, "variant")) && q[-2]== ' ' && (q[-1]=='/' || q[-1]=='-') && (q[7]==' ' || q[7]=='=')) { - strcat(buf, " ("); - sscanf(q + 8, "%s", buf + strlen(buf)); - strcat(buf, ")"); - } - engineMnemonic[i] = strdup(buf); - i++; - } - engineList[i] = engineMnemonic[i] = NULL; - return i; -} - -// following implemented as macro to avoid type limitations -#define SWAP(item, temp) temp = appData.item[0]; appData.item[0] = appData.item[n]; appData.item[n] = temp; - -void -SwapEngines (int n) -{ // swap settings for first engine and other engine (so far only some selected options) - int h; - char *p; - if(n == 0) return; - SWAP(directory, p) - SWAP(chessProgram, p) - SWAP(isUCI, h) - SWAP(hasOwnBookUCI, h) - SWAP(protocolVersion, h) - SWAP(reuse, h) - SWAP(scoreIsAbsolute, h) - SWAP(timeOdds, h) - SWAP(logo, p) - SWAP(pgnName, p) - SWAP(pvSAN, h) - SWAP(engOptions, p) - SWAP(engInitString, p) - SWAP(computerString, p) - SWAP(features, p) - SWAP(fenOverride, p) - SWAP(NPS, h) - SWAP(accumulateTC, h) - SWAP(drawDepth, h) - SWAP(host, p) - SWAP(pseudo, h) -} - -int -GetEngineLine (char *s, int n) -{ - int i; - char buf[MSG_SIZ]; - extern char *icsNames; - if(!s || !*s) return 0; - NamesToList(n >= 10 ? icsNames : firstChessProgramNames, command, mnemonic, "all"); - for(i=1; mnemonic[i]; i++) if(!strcmp(s, mnemonic[i])) break; - if(!mnemonic[i]) return 0; - if(n == 11) return 1; // just testing if there was a match - snprintf(buf, MSG_SIZ, "-%s %s", n == 10 ? "icshost" : "fcp", command[i]); - if(n == 1) SwapEngines(n); - ParseArgsFromString(buf); - if(n == 1) SwapEngines(n); - if(n == 0 && *appData.secondChessProgram == NULLCHAR) { - SwapEngines(1); // set second same as first if not yet set (to suppress WB startup dialog) - ParseArgsFromString(buf); - } - return 1; -} - -int -SetPlayer (int player, char *p) -{ // [HGM] find the engine line of the partcipant given by number, and parse its options. - int i; - char buf[MSG_SIZ], *engineName; - for(i=0; i 0) { - roundsPerCycle = nPlayers - appData.tourneyType; - pairingsPerRound = appData.tourneyType; - } - gamesPerRound = pairingsPerRound * appData.defaultMatchGames; - gamesPerCycle = gamesPerRound * roundsPerCycle; - appData.matchGames = gamesPerCycle * appData.tourneyCycles - 1; // fake like all games are one big match - curCycle = nr / gamesPerCycle; nr %= gamesPerCycle; - curRound = nr / gamesPerRound; nr %= gamesPerRound; - curPairing = nr / appData.defaultMatchGames; nr %= appData.defaultMatchGames; - matchGame = nr + curCycle * appData.defaultMatchGames + 1; // fake game nr that loads correct game or position from file - roundNr = (curCycle * roundsPerCycle + curRound) * appData.defaultMatchGames + nr + 1; - - if(appData.cycleSync) *syncInterval = gamesPerCycle; - if(appData.roundSync) *syncInterval = gamesPerRound; - - if(appData.debugMode) fprintf(debugFP, "cycle=%d, round=%d, pairing=%d curGame=%d\n", curCycle, curRound, curPairing, matchGame); - - if(appData.tourneyType == 0) { - if(curPairing == (nPlayers-1)/2 ) { - *whitePlayer = curRound; - *blackPlayer = nPlayers - 1; // this is the 'bye' when nPlayer is odd - } else { - *whitePlayer = curRound - (nPlayers-1)/2 + curPairing; - if(*whitePlayer < 0) *whitePlayer += nPlayers-1+(nPlayers&1); - *blackPlayer = curRound + (nPlayers-1)/2 - curPairing; - if(*blackPlayer >= nPlayers-1+(nPlayers&1)) *blackPlayer -= nPlayers-1+(nPlayers&1); - } - } else if(appData.tourneyType > 1) { - *blackPlayer = curPairing; // in multi-gauntlet, assign gauntlet engines to second, so first an be kept loaded during round - *whitePlayer = curRound + appData.tourneyType; - } else if(appData.tourneyType > 0) { - *whitePlayer = curPairing; - *blackPlayer = curRound + appData.tourneyType; - } - - // take care of white/black alternation per round. - // For cycles and games this is already taken care of by default, derived from matchGame! - return curRound & 1; -} - -int -NextTourneyGame (int nr, int *swapColors) -{ // !!!major kludge!!! fiddle appData settings to get everything in order for next tourney game - char *p, *q; - int whitePlayer, blackPlayer, firstBusy=1000000000, syncInterval = 0, nPlayers, OK = 1; - FILE *tf; - if(appData.tourneyFile[0] == NULLCHAR) return 1; // no tourney, always allow next game - tf = fopen(appData.tourneyFile, "r"); - if(tf == NULL) { DisplayFatalError(_("Bad tournament file"), 0, 1); return 0; } - ParseArgsFromFile(tf); fclose(tf); - InitTimeControls(); // TC might be altered from tourney file - - nPlayers = CountPlayers(appData.participants); // count participants - if(appData.tourneyType < 0) syncInterval = nPlayers/2; else - *swapColors = Pairing(nr<0 ? 0 : nr, nPlayers, &whitePlayer, &blackPlayer, &syncInterval); - - if(syncInterval) { - p = q = appData.results; - while(*q) if(*q++ == '*' || q[-1] == ' ') { firstBusy = q - p - 1; break; } - if(firstBusy/syncInterval < (nextGame/syncInterval)) { - DisplayMessage(_("Waiting for other game(s)"),""); - waitingForGame = TRUE; - ScheduleDelayedEvent(NextMatchGame, 1000); // wait for all games of previous round to finish - return 0; - } - waitingForGame = FALSE; - } - - if(appData.tourneyType < 0) { - if(nr>=0 && !pairingReceived) { - char buf[1<<16]; - if(pairing.pr == NoProc) { - if(!appData.pairingEngine[0]) { - DisplayFatalError(_("No pairing engine specified"), 0, 1); - return 0; - } - StartChessProgram(&pairing); // starts the pairing engine - } - snprintf(buf, 1<<16, "results %d %s\n", nPlayers, appData.results); - SendToProgram(buf, &pairing); - snprintf(buf, 1<<16, "pairing %d\n", nr+1); - SendToProgram(buf, &pairing); - return 0; // wait for pairing engine to answer (which causes NextTourneyGame to be called again... - } - pairingReceived = 0; // ... so we continue here - *swapColors = 0; - appData.matchGames = appData.tourneyCycles * syncInterval - 1; - whitePlayer = savedWhitePlayer-1; blackPlayer = savedBlackPlayer-1; - matchGame = 1; roundNr = nr / syncInterval + 1; - } - - if(first.pr != NoProc && second.pr != NoProc || nr<0) return 1; // engines already loaded - - // redefine engines, engine dir, etc. - NamesToList(firstChessProgramNames, command, mnemonic, "all"); // get mnemonics of installed engines - if(first.pr == NoProc) { - if(!SetPlayer(whitePlayer, appData.participants)) OK = 0; // find white player amongst it, and parse its engine line - InitEngine(&first, 0); // initialize ChessProgramStates based on new settings. - } - if(second.pr == NoProc) { - SwapEngines(1); - if(!SetPlayer(blackPlayer, appData.participants)) OK = 0; // find black player amongst it, and parse its engine line - SwapEngines(1); // and make that valid for second engine by swapping - InitEngine(&second, 1); - } - CommonEngineInit(); // after this TwoMachinesEvent will create correct engine processes - UpdateLogos(FALSE); // leave display to ModeHiglight() - return OK; -} - -void -NextMatchGame () -{ // performs game initialization that does not invoke engines, and then tries to start the game - int res, firstWhite, swapColors = 0; - if(!NextTourneyGame(nextGame, &swapColors)) return; // this sets matchGame, -fcp / -scp and other options for next game, if needed - if(matchMode && appData.debugMode) { // [HGM] debug split: game is part of a match; we might have to create a debug file just for this game - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, appData.nameOfDebugFile, nextGame+1); // expand name of debug file with %d in it - if(strcmp(buf, currentDebugFile)) { // name has changed - FILE *f = fopen(buf, "w"); - if(f) { // if opening the new file failed, just keep using the old one - ASSIGN(currentDebugFile, buf); - fclose(debugFP); - debugFP = f; - } - if(appData.serverFileName) { - if(serverFP) fclose(serverFP); - serverFP = fopen(appData.serverFileName, "w"); - if(serverFP && first.pr != NoProc) fprintf(serverFP, "StartChildProcess (dir=\".\") .\\%s\n", first.tidy); - if(serverFP && second.pr != NoProc) fprintf(serverFP, "StartChildProcess (dir=\".\") .\\%s\n", second.tidy); - } - } - } - firstWhite = appData.firstPlaysBlack ^ (matchGame & 1 | appData.sameColorGames > 1); // non-incremental default - firstWhite ^= swapColors; // reverses if NextTourneyGame says we are in an odd round - first.twoMachinesColor = firstWhite ? "white\n" : "black\n"; // perform actual color assignement - second.twoMachinesColor = firstWhite ? "black\n" : "white\n"; - appData.noChessProgram = (first.pr == NoProc); // kludge to prevent Reset from starting up chess program - if(appData.loadGameIndex == -2) srandom(appData.seedBase + 68163*(nextGame & ~1)); // deterministic seed to force same opening - Reset(FALSE, first.pr != NoProc); - res = LoadGameOrPosition(matchGame); // setup game - appData.noChessProgram = FALSE; // LoadGameOrPosition might call Reset too! - if(!res) return; // abort when bad game/pos file - if(appData.epd) {// in EPD mode we make sure first engine is to move - firstWhite = !(forwardMostMove & 1); - first.twoMachinesColor = firstWhite ? "white\n" : "black\n"; // perform actual color assignement - second.twoMachinesColor = firstWhite ? "black\n" : "white\n"; - } - TwoMachinesEvent(); -} - -void -UserAdjudicationEvent (int result) -{ - ChessMove gameResult = GameIsDrawn; - - if( result > 0 ) { - gameResult = WhiteWins; - } - else if( result < 0 ) { - gameResult = BlackWins; - } - - if( gameMode == TwoMachinesPlay ) { - GameEnds( gameResult, "User adjudication", GE_XBOARD ); - } -} - - -// [HGM] save: calculate checksum of game to make games easily identifiable -int -StringCheckSum (char *s) -{ - int i = 0; - if(s==NULL) return 0; - while(*s) i = i*259 + *s++; - return i; -} - -int -GameCheckSum () -{ - int i, sum=0; - for(i=backwardMostMove; i1 && sum==0) sum++; // make sure never zero for non-empty game - return sum + StringCheckSum(commentList[i]); -} // end of save patch - -void -GameEnds (ChessMove result, char *resultDetails, int whosays) -{ - GameMode nextGameMode; - int isIcsGame; - char buf[MSG_SIZ], popupRequested = 0, *ranking = NULL; - - if(endingGame) return; /* [HGM] crash: forbid recursion */ - endingGame = 1; - if(twoBoards) { // [HGM] dual: switch back to one board - twoBoards = partnerUp = 0; InitDrawingSizes(-2, 0); - DrawPosition(TRUE, partnerBoard); // observed game becomes foreground - } - if (appData.debugMode) { - fprintf(debugFP, "GameEnds(%d, %s, %d)\n", - result, resultDetails ? resultDetails : "(null)", whosays); - } - - fromX = fromY = killX = killY = kill2X = kill2Y = -1; // [HGM] abort any move the user is entering. // [HGM] lion - - if(pausing) PauseEvent(); // can happen when we abort a paused game (New Game or Quit) - - if (appData.icsActive && (whosays == GE_ENGINE || whosays >= GE_ENGINE1)) { - /* If we are playing on ICS, the server decides when the - game is over, but the engine can offer to draw, claim - a draw, or resign. - */ -#if ZIPPY - if (appData.zippyPlay && first.initDone) { - if (result == GameIsDrawn) { - /* In case draw still needs to be claimed */ - SendToICS(ics_prefix); - SendToICS("draw\n"); - } else if (StrCaseStr(resultDetails, "resign")) { - SendToICS(ics_prefix); - SendToICS("resign\n"); - } - } -#endif - endingGame = 0; /* [HGM] crash */ - return; - } - - /* If we're loading the game from a file, stop */ - if (whosays == GE_FILE) { - (void) StopLoadGameTimer(); - gameFileFP = NULL; - } - - /* Cancel draw offers */ - first.offeredDraw = second.offeredDraw = 0; - - /* If this is an ICS game, only ICS can really say it's done; - if not, anyone can. */ - isIcsGame = (gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == IcsObserving || - gameMode == IcsExamining); - - if (!isIcsGame || whosays == GE_ICS) { - /* OK -- not an ICS game, or ICS said it was done */ - StopClocks(); - if (!isIcsGame && !appData.noChessProgram) - SetUserThinkingEnables(); - - /* [HGM] if a machine claims the game end we verify this claim */ - if(gameMode == TwoMachinesPlay && appData.testClaims) { - if(appData.testLegality && whosays >= GE_ENGINE1 ) { - char claimer; - ChessMove trueResult = (ChessMove) -1; - - claimer = whosays == GE_ENGINE1 ? /* color of claimer */ - first.twoMachinesColor[0] : - second.twoMachinesColor[0] ; - - // [HGM] losers: because the logic is becoming a bit hairy, determine true result first - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_CHECKMATE) { - /* [HGM] verify: engine mate claims accepted if they were flagged */ - trueResult = WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins; - } else - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_WINS) { // added code for games where being mated is a win - /* [HGM] verify: engine mate claims accepted if they were flagged */ - trueResult = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins; - } else - if((signed char)boards[forwardMostMove][EP_STATUS] == EP_STALEMATE) { // only used to indicate draws now - trueResult = GameIsDrawn; // default; in variants where stalemate loses, Status is CHECKMATE - } - - // now verify win claims, but not in drop games, as we don't understand those yet - if( (gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper - || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) && - (result == WhiteWins && claimer == 'w' || - result == BlackWins && claimer == 'b' ) ) { // case to verify: engine claims own win - if (appData.debugMode) { - fprintf(debugFP, "result=%d sp=%d move=%d\n", - result, (signed char)boards[forwardMostMove][EP_STATUS], forwardMostMove); - } - if(result != trueResult) { - snprintf(buf, MSG_SIZ, "False win claim: '%s'", resultDetails); - result = claimer == 'w' ? BlackWins : WhiteWins; - resultDetails = buf; - } - } else - if( result == GameIsDrawn && (signed char)boards[forwardMostMove][EP_STATUS] > EP_DRAWS - && (forwardMostMove <= backwardMostMove || - (signed char)boards[forwardMostMove-1][EP_STATUS] > EP_DRAWS || - (claimer=='b')==(forwardMostMove&1)) - ) { - /* [HGM] verify: draws that were not flagged are false claims */ - snprintf(buf, MSG_SIZ, "False draw claim: '%s'", resultDetails); - result = claimer == 'w' ? BlackWins : WhiteWins; - resultDetails = buf; - } - /* (Claiming a loss is accepted no questions asked!) */ - } else if(matchMode && result == GameIsDrawn && !strcmp(resultDetails, "Engine Abort Request")) { - forwardMostMove = backwardMostMove; // [HGM] delete game to surpress saving - result = GameUnfinished; - if(!*appData.tourneyFile) matchGame--; // replay even in plain match - } - /* [HGM] bare: don't allow bare King to win */ - if((gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper - || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) - && gameInfo.variant != VariantLosers && gameInfo.variant != VariantGiveaway - && gameInfo.variant != VariantSuicide // [HGM] losers: except in losers, of course... - && result != GameIsDrawn) - { int i, j, k=0, oppoKings = 0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn); - for(j=BOARD_LEFT; j= 0 && p <= (int)WhiteKing) k++; - oppoKings += (p + color == WhiteKing + BlackPawn - color); - } - if (appData.debugMode) { - fprintf(debugFP, "GE(%d, %s, %d) bare king k=%d color=%d\n", - result, resultDetails ? resultDetails : "(null)", whosays, k, color); - } - if(k <= 1 && oppoKings > 0) { // the latter needed in Atomic, where bare K wins if opponent King already destroyed - result = GameIsDrawn; - snprintf(buf, MSG_SIZ, "%s but bare king", resultDetails); - resultDetails = buf; - } - } - } - - - if(serverMoves != NULL && !loadFlag) { char c = '='; - if(result==WhiteWins) c = '+'; - if(result==BlackWins) c = '-'; - if(resultDetails != NULL) - fprintf(serverMoves, ";%c;%s\n", c, resultDetails), fflush(serverMoves); - } - if (resultDetails != NULL) { - gameInfo.result = result; - gameInfo.resultDetails = StrSave(resultDetails); - - /* display last move only if game was not loaded from file */ - if ((whosays != GE_FILE) && (currentMove == forwardMostMove)) - DisplayMove(currentMove - 1); - - if (forwardMostMove != 0) { - if (gameMode != PlayFromGameFile && gameMode != EditGame - && lastSavedGame != GameCheckSum() // [HGM] save: suppress duplicates - ) { - if (*appData.saveGameFile != NULLCHAR) { - if(result == GameUnfinished && matchMode && *appData.tourneyFile) - AutoSaveGame(); // [HGM] protect tourney PGN from aborted games, and prompt for name instead - else - SaveGameToFile(appData.saveGameFile, TRUE); - } else if (appData.autoSaveGames) { - if(gameMode != IcsObserving || !appData.onlyOwn) AutoSaveGame(); - } - if (*appData.savePositionFile != NULLCHAR) { - SavePositionToFile(appData.savePositionFile); - } - AddGameToBook(FALSE); // Only does something during Monte-Carlo book building - } - } - - /* Tell program how game ended in case it is learning */ - /* [HGM] Moved this to after saving the PGN, just in case */ - /* engine died and we got here through time loss. In that */ - /* case we will get a fatal error writing the pipe, which */ - /* would otherwise lose us the PGN. */ - /* [HGM] crash: not needed anymore, but doesn't hurt; */ - /* output during GameEnds should never be fatal anymore */ - if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == BeginningOfGame) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "result %s {%s}\n", PGNResult(result), - resultDetails); - if (first.pr != NoProc) { - SendToProgram(buf, &first); - } - if (second.pr != NoProc && - gameMode == TwoMachinesPlay) { - SendToProgram(buf, &second); - } - } - } - - if (appData.icsActive) { - if (appData.quietPlay && - (gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack)) { - SendToICS(ics_prefix); - SendToICS("set shout 1\n"); - } - nextGameMode = IcsIdle; - ics_user_moved = FALSE; - /* clean up premove. It's ugly when the game has ended and the - * premove highlights are still on the board. - */ - if (gotPremove) { - gotPremove = FALSE; - ClearPremoveHighlights(); - DrawPosition(FALSE, boards[currentMove]); - } - if (whosays == GE_ICS) { - switch (result) { - case WhiteWins: - if (gameMode == IcsPlayingWhite) - PlayIcsWinSound(); - else if(gameMode == IcsPlayingBlack) - PlayIcsLossSound(); - break; - case BlackWins: - if (gameMode == IcsPlayingBlack) - PlayIcsWinSound(); - else if(gameMode == IcsPlayingWhite) - PlayIcsLossSound(); - break; - case GameIsDrawn: - PlayIcsDrawSound(); - break; - default: - PlayIcsUnfinishedSound(); - } - } - if(appData.quitNext) { ExitEvent(0); return; } - } else if (gameMode == EditGame || - gameMode == PlayFromGameFile || - gameMode == AnalyzeMode || - gameMode == AnalyzeFile) { - nextGameMode = gameMode; - } else { - nextGameMode = EndOfGame; - } - pausing = FALSE; - ModeHighlight(); - } else { - nextGameMode = gameMode; - } - - if (appData.noChessProgram) { - gameMode = nextGameMode; - ModeHighlight(); - endingGame = 0; /* [HGM] crash */ - return; - } - - if (first.reuse) { - /* Put first chess program into idle state */ - if (first.pr != NoProc && - (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == BeginningOfGame)) { - SendToProgram("force\n", &first); - if (first.usePing) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "ping %d\n", ++first.lastPing); - SendToProgram(buf, &first); - } - } - } else if (result != GameUnfinished || nextGameMode == IcsIdle) { - /* Kill off first chess program */ - if (first.isr != NULL) - RemoveInputSource(first.isr); - first.isr = NULL; - - if (first.pr != NoProc) { - ExitAnalyzeMode(); - DoSleep( appData.delayBeforeQuit ); - SendToProgram("quit\n", &first); - DestroyChildProcess(first.pr, 4 + first.useSigterm); - first.reload = TRUE; - } - first.pr = NoProc; - } - if (second.reuse) { - /* Put second chess program into idle state */ - if (second.pr != NoProc && - gameMode == TwoMachinesPlay) { - SendToProgram("force\n", &second); - if (second.usePing) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "ping %d\n", ++second.lastPing); - SendToProgram(buf, &second); - } - } - } else if (result != GameUnfinished || nextGameMode == IcsIdle) { - /* Kill off second chess program */ - if (second.isr != NULL) - RemoveInputSource(second.isr); - second.isr = NULL; - - if (second.pr != NoProc) { - DoSleep( appData.delayBeforeQuit ); - SendToProgram("quit\n", &second); - DestroyChildProcess(second.pr, 4 + second.useSigterm); - second.reload = TRUE; - } - second.pr = NoProc; - } - - if (matchMode && (gameMode == TwoMachinesPlay || (waitingForGame || startingEngine) && exiting)) { - char resChar = '='; - switch (result) { - case WhiteWins: - resChar = '+'; - if (first.twoMachinesColor[0] == 'w') { - first.matchWins++; - } else { - second.matchWins++; - } - break; - case BlackWins: - resChar = '-'; - if (first.twoMachinesColor[0] == 'b') { - first.matchWins++; - } else { - second.matchWins++; - } - break; - case GameUnfinished: - resChar = ' '; - default: - break; - } - - if(exiting) resChar = ' '; // quit while waiting for round sync: unreserve already reserved game - if(appData.tourneyFile[0]){ // [HGM] we are in a tourney; update tourney file with game result - if(appData.afterGame && appData.afterGame[0]) RunCommand(appData.afterGame); - ReserveGame(nextGame, resChar); // sets nextGame - if(nextGame > appData.matchGames) appData.tourneyFile[0] = 0, ranking = TourneyStandings(3); // tourney is done - else ranking = strdup("busy"); //suppress popup when aborted but not finished - } else roundNr = nextGame = matchGame + 1; // normal match, just increment; round equals matchGame - - if (nextGame <= appData.matchGames && !abortMatch) { - gameMode = nextGameMode; - matchGame = nextGame; // this will be overruled in tourney mode! - GetTimeMark(&pauseStart); // [HGM] matchpause: stipulate a pause - ScheduleDelayedEvent(NextMatchGame, 10); // but start game immediately (as it will wait out the pause itself) - endingGame = 0; /* [HGM] crash */ - return; - } else { - gameMode = nextGameMode; - if(appData.epd) { - snprintf(buf, MSG_SIZ, "-------------------------------------- "); - OutputKibitz(2, buf); - snprintf(buf, MSG_SIZ, _("Average solving time %4.2f sec (total time %4.2f sec) "), totalTime/(100.*first.matchWins), totalTime/100.); - OutputKibitz(2, buf); - snprintf(buf, MSG_SIZ, _("%d avoid-moves played "), second.matchWins); - if(second.matchWins) OutputKibitz(2, buf); - snprintf(buf, MSG_SIZ, _("Solved %d out of %d (%3.1f%%) "), first.matchWins, nextGame-1, first.matchWins*100./(nextGame-1)); - OutputKibitz(2, buf); - } - snprintf(buf, MSG_SIZ, _("Match %s vs. %s: final score %d-%d-%d"), - first.tidy, second.tidy, - first.matchWins, second.matchWins, - appData.matchGames - (first.matchWins + second.matchWins)); - if(!appData.tourneyFile[0]) matchGame++, DisplayTwoMachinesTitle(); // [HGM] update result in window title - if(ranking && strcmp(ranking, "busy") && appData.afterTourney && appData.afterTourney[0]) RunCommand(appData.afterTourney); - popupRequested++; // [HGM] crash: postpone to after resetting endingGame - if (appData.firstPlaysBlack) { // [HGM] match: back to original for next match - first.twoMachinesColor = "black\n"; - second.twoMachinesColor = "white\n"; - } else { - first.twoMachinesColor = "white\n"; - second.twoMachinesColor = "black\n"; - } - } - } - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && - !(nextGameMode == AnalyzeMode || nextGameMode == AnalyzeFile)) - ExitAnalyzeMode(); - gameMode = nextGameMode; - ModeHighlight(); - endingGame = 0; /* [HGM] crash */ - if(popupRequested) { // [HGM] crash: this calls GameEnds recursively through ExitEvent! Make it a harmless tail recursion. - if(matchMode == TRUE) { // match through command line: exit with or without popup - if(ranking) { - ToNrEvent(forwardMostMove); - if(strcmp(ranking, "busy")) DisplayFatalError(ranking, 0, 0); - else ExitEvent(0); - } else DisplayFatalError(buf, 0, 0); - } else { // match through menu; just stop, with or without popup - matchMode = FALSE; appData.matchGames = matchGame = roundNr = 0; - ModeHighlight(); - if(ranking){ - if(strcmp(ranking, "busy")) DisplayNote(ranking); - } else DisplayNote(buf); - } - if(ranking) free(ranking); - } -} - -/* Assumes program was just initialized (initString sent). - Leaves program in force mode. */ -void -FeedMovesToProgram (ChessProgramState *cps, int upto) -{ - int i; - - if (appData.debugMode) - fprintf(debugFP, "Feeding %smoves %d through %d to %s chess program\n", - startedFromSetupPosition ? "position and " : "", - backwardMostMove, upto, cps->which); - if(currentlyInitializedVariant != gameInfo.variant) { - char buf[MSG_SIZ]; - // [HGM] variantswitch: make engine aware of new variant - if(!SupportedVariant(cps->variants, gameInfo.variant, gameInfo.boardWidth, - gameInfo.boardHeight, gameInfo.holdingsSize, cps->protocolVersion, "")) - return; // [HGM] refrain from feeding moves altogether if variant is unsupported! - snprintf(buf, MSG_SIZ, "variant %s\n", VariantName(gameInfo.variant)); - SendToProgram(buf, cps); - currentlyInitializedVariant = gameInfo.variant; - } - SendToProgram("force\n", cps); - if (startedFromSetupPosition) { - SendBoard(cps, backwardMostMove); - if (appData.debugMode) { - fprintf(debugFP, "feedMoves\n"); - } - } - for (i = backwardMostMove; i < upto; i++) { - SendMoveToProgram(i, cps); - } -} - - -int -ResurrectChessProgram () -{ - /* The chess program may have exited. - If so, restart it and feed it all the moves made so far. */ - static int doInit = 0; - - if (appData.noChessProgram) return 1; - - if(matchMode /*&& appData.tourneyFile[0]*/) { // [HGM] tourney: make sure we get features after engine replacement. (Should we always do this?) - if(WaitForEngine(&first, TwoMachinesEventIfReady)) { doInit = 1; return 0; } // request to do init on next visit, because we started engine - if(!doInit) return 1; // this replaces testing first.pr != NoProc, which is true when we get here, but first time no reason to abort - doInit = 0; // we fell through (first time after starting the engine); make sure it doesn't happen again - } else { - if (first.pr != NoProc) return 1; - StartChessProgram(&first); - } - InitChessProgram(&first, FALSE); - FeedMovesToProgram(&first, currentMove); - - if (!first.sendTime) { - /* can't tell gnuchess what its clock should read, - so we bow to its notion. */ - ResetClocks(); - timeRemaining[0][currentMove] = whiteTimeRemaining; - timeRemaining[1][currentMove] = blackTimeRemaining; - } - - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile || - appData.icsEngineAnalyze) && first.analysisSupport) { - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - } - return 1; -} - -/* - * Button procedures - */ -void -Reset (int redraw, int init) -{ - int i; - - if (appData.debugMode) { - fprintf(debugFP, "Reset(%d, %d) from gameMode %d\n", - redraw, init, gameMode); - } - pieceDefs = FALSE; // [HGM] gen: reset engine-defined piece moves - for(i=0; i backwardMostMove && programStats.depth) { - pvInfoList[currentMove].depth = programStats.depth; - pvInfoList[currentMove].score = programStats.score; - pvInfoList[currentMove].time = 0; - if(currentMove < forwardMostMove) AppendComment(currentMove+1, lastPV[0], 2); - else { // append analysis of final position as comment - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "{final score %+4.2f/%d}", programStats.score/100., programStats.depth); - AppendComment(currentMove, buf, 3); // the 3 prevents stripping of the score/depth! - } - programStats.depth = 0; - } - - if (currentMove >= forwardMostMove) { - if(gameMode == AnalyzeFile) { - if(appData.loadGameIndex == -1) { - GameEnds(gameInfo.result, gameInfo.resultDetails ? gameInfo.resultDetails : "", GE_FILE); - ScheduleDelayedEvent(AnalyzeNextGame, 10); - } else { - ExitAnalyzeMode(); SendToProgram("force\n", &first); - } - } -// gameMode = EndOfGame; -// ModeHighlight(); - - /* [AS] Clear current move marker at the end of a game */ - /* HistorySet(parseList, backwardMostMove, forwardMostMove, -1); */ - - return FALSE; - } - - toX = moveList[currentMove][2] - AAA; - toY = moveList[currentMove][3] - ONE; - - if (moveList[currentMove][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[currentMove][0] - AAA; - fromY = moveList[currentMove][1] - ONE; - - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove); /* [AS] */ - - if(moveList[currentMove][4] == ';') { // multi-leg - killX = moveList[currentMove][5] - AAA; - killY = moveList[currentMove][6] - ONE; - } - AnimateMove(boards[currentMove], fromX, fromY, toX, toY); - killX = killY = -1; - - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - DisplayMove(currentMove); - SendMoveToProgram(currentMove++, &first); - DisplayBothClocks(); - DrawPosition(FALSE, boards[currentMove]); - // [HGM] PV info: always display, routine tests if empty - DisplayComment(currentMove - 1, commentList[currentMove]); - return TRUE; -} - - -int -LoadGameOneMove (ChessMove readAhead) -{ - int fromX = 0, fromY = 0, toX = 0, toY = 0, done; - char promoChar = NULLCHAR; - ChessMove moveType; - char move[MSG_SIZ]; - char *p, *q; - - if (gameMode != PlayFromGameFile && gameMode != AnalyzeFile && - gameMode != AnalyzeMode && gameMode != Training) { - gameFileFP = NULL; - return FALSE; - } - - yyboardindex = forwardMostMove; - if (readAhead != EndOfFile) { - moveType = readAhead; - } else { - if (gameFileFP == NULL) - return FALSE; - moveType = (ChessMove) Myylex(); - } - - done = FALSE; - switch (moveType) { - case Comment: - if (appData.debugMode) - fprintf(debugFP, "Parsed Comment: %s\n", yy_text); - p = yy_text; - - /* append the comment but don't display it */ - AppendComment(currentMove, p, FALSE); - return TRUE; - - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhitePromotion: - case BlackPromotion: - case WhiteNonPromotion: - case BlackNonPromotion: - case NormalMove: - case FirstLeg: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - /* PUSH Fabien */ - case WhiteHSideCastleFR: - case WhiteASideCastleFR: - case BlackHSideCastleFR: - case BlackASideCastleFR: - /* POP Fabien */ - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into %s virgin=%x,%x\n", yy_text, currentMoveString, boards[forwardMostMove][TOUCHED_W], boards[forwardMostMove][TOUCHED_B]); - fromX = currentMoveString[0] - AAA; - fromY = currentMoveString[1] - ONE; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = currentMoveString[4]; - if(promoChar == ';') promoChar = currentMoveString[7]; - break; - - case WhiteDrop: - case BlackDrop: - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into %s\n", yy_text, currentMoveString); - fromX = moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - fromY = DROP_RANK; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - break; - - case WhiteWins: - case BlackWins: - case GameIsDrawn: - case GameUnfinished: - if (appData.debugMode) - fprintf(debugFP, "Parsed game end: %s\n", yy_text); - p = strchr(yy_text, '{'); - if (p == NULL) p = strchr(yy_text, '('); - if (p == NULL) { - p = yy_text; - if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; - } else { - q = strchr(p, *p == '{' ? '}' : ')'); - if (q != NULL) *q = NULLCHAR; - p++; - } - while(q = strchr(p, '\n')) *q = ' '; // [HGM] crush linefeeds in result message - GameEnds(moveType, p, GE_FILE); - done = TRUE; - if (cmailMsgLoaded) { - ClearHighlights(); - flipView = WhiteOnMove(currentMove); - if (moveType == GameUnfinished) flipView = !flipView; - if (appData.debugMode) - fprintf(debugFP, "Setting flipView to %d\n", flipView) ; - } - break; - - case EndOfFile: - if (appData.debugMode) - fprintf(debugFP, "Parser hit end of file\n"); - switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - case MT_STAINMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_FILE); - } else { - GameEnds(WhiteWins, "White mates", GE_FILE); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_FILE); - break; - } - done = TRUE; - break; - - case MoveNumberOne: - if (lastLoadGameStart == GNUChessGame) { - /* GNUChessGames have numbers, but they aren't move numbers */ - if (appData.debugMode) - fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", - yy_text, (int) moveType); - return LoadGameOneMove(EndOfFile); /* tail recursion */ - } - /* else fall thru */ - - case XBoardGame: - case GNUChessGame: - case PGNTag: - /* Reached start of next game in file */ - if (appData.debugMode) - fprintf(debugFP, "Parsed start of next game: %s\n", yy_text); - switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - case MT_STAINMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_FILE); - } else { - GameEnds(WhiteWins, "White mates", GE_FILE); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_FILE); - break; - } - done = TRUE; - break; - - case PositionDiagram: /* should not happen; ignore */ - case ElapsedTime: /* ignore */ - case NAG: /* ignore */ - if (appData.debugMode) - fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", - yy_text, (int) moveType); - return LoadGameOneMove(EndOfFile); /* tail recursion */ - - case IllegalMove: - if (appData.testLegality) { - if (appData.debugMode) - fprintf(debugFP, "Parsed IllegalMove: %s\n", yy_text); - snprintf(move, MSG_SIZ, _("Illegal move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - } else { - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into IllegalMove %s\n", - yy_text, currentMoveString); - if(currentMoveString[1] == '@') { - fromX = CharToPiece(WhiteOnMove(currentMove) ? ToUpper(currentMoveString[0]) : ToLower(currentMoveString[0])); - fromY = DROP_RANK; - } else { - fromX = currentMoveString[0] - AAA; - fromY = currentMoveString[1] - ONE; - } - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = currentMoveString[4]; - } - break; - - case AmbiguousMove: - if (appData.debugMode) - fprintf(debugFP, "Parsed AmbiguousMove: %s\n", yy_text); - snprintf(move, MSG_SIZ, _("Ambiguous move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - break; - - default: - case ImpossibleMove: - if (appData.debugMode) - fprintf(debugFP, "Parsed ImpossibleMove (type = %d): %s\n", moveType, yy_text); - snprintf(move, MSG_SIZ, _("Illegal move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - break; - } - - if (done) { - if (appData.matchMode || (appData.timeDelay == 0 && !pausing)) { - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - if (!appData.matchMode) // [HGM] PV info: routine tests if empty - DisplayComment(currentMove - 1, commentList[currentMove]); - } - (void) StopLoadGameTimer(); - gameFileFP = NULL; - cmailOldMove = forwardMostMove; - return FALSE; - } else { - /* currentMoveString is set as a side-effect of yylex */ - - thinkOutput[0] = NULLCHAR; - MakeMove(fromX, fromY, toX, toY, promoChar); - killX = killY = kill2X = kill2Y = -1; // [HGM] lion: used up - currentMove = forwardMostMove; - return TRUE; - } -} - -/* Load the nth game from the given file */ -int -LoadGameFromFile (char *filename, int n, char *title, int useList) -{ - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - f = stdin; - title = "stdin"; - } else { - f = fopen(filename, "rb"); - if (f == NULL) { - snprintf(buf, sizeof(buf), _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } - } - if (fseek(f, 0, 0) == -1) { - /* f is not seekable; probably a pipe */ - useList = FALSE; - } - if (useList && n == 0) { - int error = GameListBuild(f); - if (error) { - DisplayError(_("Cannot build game list"), error); - } else if (!ListEmpty(&gameList) && - ((ListGame *) gameList.tailPred)->number > 1) { - GameListPopUp(f, title); - return TRUE; - } - GameListDestroy(); - n = 1; - } - if (n == 0) n = 1; - return LoadGame(f, n, title, FALSE); -} - - -void -MakeRegisteredMove () -{ - int fromX, fromY, toX, toY; - char promoChar; - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - switch (cmailMoveType[lastLoadGameNumber - 1]) { - case CMAIL_MOVE: - case CMAIL_DRAW: - if (appData.debugMode) - fprintf(debugFP, "Restoring %s for game %d\n", - cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); - - thinkOutput[0] = NULLCHAR; - safeStrCpy(moveList[currentMove], cmailMove[lastLoadGameNumber - 1], sizeof(moveList[currentMove])/sizeof(moveList[currentMove][0])); - fromX = cmailMove[lastLoadGameNumber - 1][0] - AAA; - fromY = cmailMove[lastLoadGameNumber - 1][1] - ONE; - toX = cmailMove[lastLoadGameNumber - 1][2] - AAA; - toY = cmailMove[lastLoadGameNumber - 1][3] - ONE; - promoChar = cmailMove[lastLoadGameNumber - 1][4]; - MakeMove(fromX, fromY, toX, toY, promoChar); - ShowMove(fromX, fromY, toX, toY); - - switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) { - case MT_NONE: - case MT_CHECK: - break; - - case MT_CHECKMATE: - case MT_STAINMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_PLAYER); - } else { - GameEnds(WhiteWins, "White mates", GE_PLAYER); - } - break; - - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); - break; - } - - break; - - case CMAIL_RESIGN: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "White resigns", GE_PLAYER); - } else { - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - } - break; - - case CMAIL_ACCEPT: - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - break; - - default: - break; - } - } - - return; -} - -/* Wrapper around LoadGame for use when a Cmail message is loaded */ -int -CmailLoadGame (FILE *f, int gameNumber, char *title, int useList) -{ - int retVal; - - if (gameNumber > nCmailGames) { - DisplayError(_("No more games in this message"), 0); - return FALSE; - } - if (f == lastLoadGameFP) { - int offset = gameNumber - lastLoadGameNumber; - if (offset == 0) { - cmailMsg[0] = NULLCHAR; - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; - nCmailMovesRegistered--; - } - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - if (cmailResult[lastLoadGameNumber - 1] == CMAIL_NEW_RESULT) { - cmailResult[lastLoadGameNumber - 1] = CMAIL_NOT_RESULT; - } - } else { - if (! RegisterMove()) return FALSE; - } - } - - retVal = LoadGame(f, gameNumber, title, useList); - - /* Make move registered during previous look at this game, if any */ - MakeRegisteredMove(); - - if (cmailCommentList[lastLoadGameNumber - 1] != NULL) { - commentList[currentMove] - = StrSave(cmailCommentList[lastLoadGameNumber - 1]); - DisplayComment(currentMove - 1, commentList[currentMove]); - } - - return retVal; -} - -/* Support for LoadNextGame, LoadPreviousGame, ReloadSameGame */ -int -ReloadGame (int offset) -{ - int gameNumber = lastLoadGameNumber + offset; - if (lastLoadGameFP == NULL) { - DisplayError(_("No game has been loaded yet"), 0); - return FALSE; - } - if (gameNumber <= 0) { - DisplayError(_("Can't back up any further"), 0); - return FALSE; - } - if (cmailMsgLoaded) { - return CmailLoadGame(lastLoadGameFP, gameNumber, - lastLoadGameTitle, lastLoadGameUseList); - } else { - return LoadGame(lastLoadGameFP, gameNumber, - lastLoadGameTitle, lastLoadGameUseList); - } -} - -int keys[EmptySquare+1]; - -int -PositionMatches (Board b1, Board b2) -{ - int r, f, sum=0; - switch(appData.searchMode) { - case 1: return CompareWithRights(b1, b2); - case 2: - for(r=0; r fromX+1 || toX < fromX-1) && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1) { - int from = toX>fromX ? BOARD_RGHT-1 : BOARD_LEFT; - moveDatabase[movePtr++].piece = Q_WCASTL; - quickBoard[sq] = piece; - piece = quickBoard[from]; quickBoard[from] = 0; - moveDatabase[movePtr].to = pieceList[piece] = sq = toX>fromX ? sq-1 : sq+1; - } else if((rook = quickBoard[sq]) && pieceType[rook] == WhiteRook) { // FRC castling - quickBoard[sq] = 0; // remove Rook - moveDatabase[movePtr].to = sq = (toX>fromX ? BOARD_RGHT-2 : BOARD_LEFT+2); // King to-square - moveDatabase[movePtr++].piece = Q_WCASTL; - quickBoard[sq] = pieceList[1]; // put King - piece = rook; - moveDatabase[movePtr].to = pieceList[rook] = sq = toX>fromX ? sq-1 : sq+1; - } - } else - if(piece == pieceList[2] && fromY == toY) { - if((toX > fromX+1 || toX < fromX-1) && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1) { - int from = (toX>fromX ? BOARD_RGHT-1 : BOARD_LEFT) + (BOARD_HEIGHT-1 <<4); - moveDatabase[movePtr++].piece = Q_BCASTL; - quickBoard[sq] = piece; - piece = quickBoard[from]; quickBoard[from] = 0; - moveDatabase[movePtr].to = pieceList[piece] = sq = toX>fromX ? sq-1 : sq+1; - } else if((rook = quickBoard[sq]) && pieceType[rook] == BlackRook) { // FRC castling - quickBoard[sq] = 0; // remove Rook - moveDatabase[movePtr].to = sq = (toX>fromX ? BOARD_RGHT-2 : BOARD_LEFT+2); - moveDatabase[movePtr++].piece = Q_BCASTL; - quickBoard[sq] = pieceList[2]; // put King - piece = rook; - moveDatabase[movePtr].to = pieceList[rook] = sq = toX>fromX ? sq-1 : sq+1; - } - } else - if(epOK && (pieceType[piece] == WhitePawn || pieceType[piece] == BlackPawn) && fromX != toX && quickBoard[sq] == 0) { - quickBoard[(fromY<<4)+toX] = 0; - moveDatabase[movePtr].piece = Q_EP; - moveDatabase[movePtr++].to = (fromY<<4)+toX; - moveDatabase[movePtr].to = sq; - } else - if(promoPiece != pieceType[piece]) { - moveDatabase[movePtr++].piece = Q_PROMO; - moveDatabase[movePtr].to = pieceType[piece] = (int) promoPiece; - } - moveDatabase[movePtr].piece = piece; - quickBoard[sq] = piece; - movePtr++; -} - -int -PackGame (Board board) -{ - Move *newSpace = NULL; - moveDatabase[movePtr].piece = 0; // terminate previous game - if(movePtr > dataSize) { - if(appData.debugMode) fprintf(debugFP, "move-cache overflow, enlarge to %d MB\n", dataSize/128); - dataSize *= 8; // increase size by factor 8 (512KB -> 4MB -> 32MB -> 256MB -> 2GB) - if(dataSize) newSpace = (Move*) calloc(dataSize + 1000, sizeof(Move)); - if(newSpace) { - int i; - Move *p = moveDatabase, *q = newSpace; - for(i=0; i 8*DSIZE) free(moveDatabase); // and free old space (if it was allocated) - moveDatabase = newSpace; - } else { // calloc failed, we must be out of memory. Too bad... - dataSize = 0; // prevent calloc events for all subsequent games - return 0; // and signal this one isn't cached - } - } - movePtr++; - MakePieceList(board, counts); - return movePtr; -} - -int -QuickCompare (Board board, int *minCounts, int *maxCounts) -{ // compare according to search mode - int r, f; - switch(appData.searchMode) - { - case 1: // exact position match - if(!(turn & board[EP_STATUS-1])) return FALSE; // wrong side to move - for(r=0; r maxCounts[r]) return FALSE; - } - return TRUE; -} - -int -QuickScan (Board board, Move *move) -{ // reconstruct game,and compare all positions in it - int cnt=0, stretch=0, found = -1, total = MakePieceList(board, counts); - do { - int piece = move->piece; - int to = move->to, from = pieceList[piece]; - if(found < 0) { // if already found just scan to game end for final piece count - if(QuickCompare(soughtBoard, minSought, maxSought) || - appData.ignoreColors && QuickCompare(reverseBoard, minReverse, maxReverse) || - flipSearch && (QuickCompare(flipBoard, minSought, maxSought) || - appData.ignoreColors && QuickCompare(rotateBoard, minReverse, maxReverse)) - ) { - static int lastCounts[EmptySquare+1]; - int i; - if(stretch) for(i=0; i= appData.stretch)) found = cnt + 1 - stretch; - if(found >= 0 && !appData.minPieces) return found; - } - if(piece <= Q_PROMO) { // special moves encoded by otherwise invalid piece numbers 1-4 - if(!piece) return (appData.minPieces && (total < appData.minPieces || total > appData.maxPieces) ? -1 : found); - if(piece == Q_PROMO) { // promotion, encoded as (Q_PROMO, to) + (piece, promoType) - piece = (++move)->piece; - from = pieceList[piece]; - counts[pieceType[piece]]--; - pieceType[piece] = (ChessSquare) move->to; - counts[move->to]++; - } else if(piece == Q_EP) { // e.p. capture, encoded as (Q_EP, ep-sqr) + (piece, to) - counts[pieceType[quickBoard[to]]]--; - quickBoard[to] = 0; total--; - move++; - continue; - } else if(piece <= Q_BCASTL) { // castling, encoded as (Q_XCASTL, king-to) + (rook, rook-to) - piece = pieceList[piece]; // first two elements of pieceList contain King numbers - from = pieceList[piece]; // so this must be King - quickBoard[from] = 0; - pieceList[piece] = to; - from = pieceList[(++move)->piece]; // for FRC this has to be done here - quickBoard[from] = 0; // rook - quickBoard[to] = piece; - to = move->to; piece = move->piece; - goto aftercastle; - } - } - if(appData.searchMode > 2) counts[pieceType[quickBoard[to]]]--; // account capture - if((total -= (quickBoard[to] != 0)) < soughtTotal && found < 0) return -1; // piece count dropped below what we search for - quickBoard[from] = 0; - aftercastle: - quickBoard[to] = piece; - pieceList[piece] = to; - cnt++; turn ^= 3; - move++; - } while(1); -} - -void -InitSearch () -{ - int r, f; - flipSearch = FALSE; - CopyBoard(soughtBoard, boards[currentMove]); - soughtTotal = MakePieceList(soughtBoard, maxSought); - soughtBoard[EP_STATUS-1] = (currentMove & 1) + 1; - if(currentMove == 0 && gameMode == EditPosition) soughtBoard[EP_STATUS-1] = blackPlaysFirst + 1; // (!) - CopyBoard(reverseBoard, boards[currentMove]); - for(r=0; r= 5) { - for(r=BOARD_HEIGHT/2; rgameInfo.variant != gameInfo.variant) return -1; // wrong variant - if(appData.eloThreshold1 && (lg->gameInfo.whiteRating < appData.eloThreshold1 && lg->gameInfo.blackRating < appData.eloThreshold1)) return -1; - if(appData.eloThreshold2 && (lg->gameInfo.whiteRating < appData.eloThreshold2 || lg->gameInfo.blackRating < appData.eloThreshold2)) return -1; - if(appData.dateThreshold && (!lg->gameInfo.date || atoi(lg->gameInfo.date) < appData.dateThreshold)) return -1; - if(!initDone) { - for(next = WhitePawn; next>8 ^ random()<<6 ^random()<<20; - initDone = TRUE; - } - if(lg->gameInfo.fen) ParseFEN(boards[scratch], &btm, lg->gameInfo.fen, FALSE); - else CopyBoard(boards[scratch], initialPosition); // default start position - if(lg->moves) { - turn = btm + 1; - if((next = QuickScan( boards[scratch], &moveDatabase[lg->moves] )) < 0) return -1; // quick scan rules out it is there - if(appData.searchMode >= 4) return next; // for material searches, trust QuickScan. - } - if(btm) plyNr++; - if(PositionMatches(boards[scratch], boards[currentMove])) return plyNr; - fseek(f, lg->offset, 0); - yynewfile(f); - while(1) { - yyboardindex = scratch; - quickFlag = plyNr+1; - next = Myylex(); - quickFlag = 0; - switch(next) { - case PGNTag: - if(plyNr) return -1; // after we have seen moves, any tags will be start of next game - default: - continue; - - case XBoardGame: - case GNUChessGame: - if(plyNr) return -1; // after we have seen moves, this is for new game - continue; - - case AmbiguousMove: // we cannot reconstruct the game beyond these two - case ImpossibleMove: - case WhiteWins: // game ends here with these four - case BlackWins: - case GameIsDrawn: - case GameUnfinished: - return -1; - - case IllegalMove: - if(appData.testLegality) return -1; - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhitePromotion: - case BlackPromotion: - case WhiteNonPromotion: - case BlackNonPromotion: - case NormalMove: - case FirstLeg: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - case WhiteHSideCastleFR: - case WhiteASideCastleFR: - case BlackHSideCastleFR: - case BlackASideCastleFR: - fromX = currentMoveString[0] - AAA; - fromY = currentMoveString[1] - ONE; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = currentMoveString[4]; - break; - case WhiteDrop: - case BlackDrop: - fromX = next == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - fromY = DROP_RANK; - toX = currentMoveString[2] - AAA; - toY = currentMoveString[3] - ONE; - promoChar = 0; - break; - } - // Move encountered; peform it. We need to shuttle between two boards, as even/odd index determines side to move - plyNr++; - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[scratch]); - if(PositionMatches(boards[scratch], boards[currentMove])) return plyNr; - if(appData.ignoreColors && PositionMatches(boards[scratch], reverseBoard)) return plyNr; - if(appData.findMirror) { - if(PositionMatches(boards[scratch], flipBoard)) return plyNr; - if(appData.ignoreColors && PositionMatches(boards[scratch], rotateBoard)) return plyNr; - } - } -} - -/* Load the nth game from open file f */ -int -LoadGame (FILE *f, int gameNumber, char *title, int useList) -{ - ChessMove cm; - char buf[MSG_SIZ]; - int gn = gameNumber; - ListGame *lg = NULL; - int numPGNTags = 0, i; - int err, pos = -1; - GameMode oldGameMode; - VariantClass v, oldVariant = gameInfo.variant; /* [HGM] PGNvariant */ - char oldName[MSG_SIZ]; - - safeStrCpy(oldName, engineVariant, MSG_SIZ); v = oldVariant; - - if (appData.debugMode) - fprintf(debugFP, "LoadGame(): on entry, gameMode %d\n", gameMode); - - if (gameMode == Training ) - SetTrainingModeOff(); - - oldGameMode = gameMode; - if (gameMode != BeginningOfGame) { - Reset(FALSE, TRUE); - } - killX = killY = kill2X = kill2Y = -1; // [HGM] lion: in case we did not Reset - - gameFileFP = f; - if (lastLoadGameFP != NULL && lastLoadGameFP != f) { - fclose(lastLoadGameFP); - } - - if (useList) { - lg = (ListGame *) ListElem(&gameList, gameNumber-1); - - if (lg) { - fseek(f, lg->offset, 0); - GameListHighlight(gameNumber); - pos = lg->position; - gn = 1; - } - else { - if(oldGameMode == AnalyzeFile && appData.loadGameIndex == -1) - appData.loadGameIndex = 0; // [HGM] suppress error message if we reach file end after auto-stepping analysis - else - DisplayError(_("Game number out of range"), 0); - return FALSE; - } - } else { - GameListDestroy(); - if (fseek(f, 0, 0) == -1) { - if (f == lastLoadGameFP ? - gameNumber == lastLoadGameNumber + 1 : - gameNumber == 1) { - gn = 1; - } else { - DisplayError(_("Can't seek on game file"), 0); - return FALSE; - } - } - } - lastLoadGameFP = f; - lastLoadGameNumber = gameNumber; - safeStrCpy(lastLoadGameTitle, title, sizeof(lastLoadGameTitle)/sizeof(lastLoadGameTitle[0])); - lastLoadGameUseList = useList; - - yynewfile(f); - - if (lg && lg->gameInfo.white && lg->gameInfo.black) { - snprintf(buf, sizeof(buf), "%s %s %s", lg->gameInfo.white, _("vs."), - lg->gameInfo.black); - DisplayTitle(buf); - } else if (*title != NULLCHAR) { - if (gameNumber > 1) { - snprintf(buf, MSG_SIZ, "%s %d", title, gameNumber); - DisplayTitle(buf); - } else { - DisplayTitle(title); - } - } - - if (gameMode != AnalyzeFile && gameMode != AnalyzeMode) { - gameMode = PlayFromGameFile; - ModeHighlight(); - } - - currentMove = forwardMostMove = backwardMostMove = 0; - CopyBoard(boards[0], initialPosition); - StopClocks(); - - /* - * Skip the first gn-1 games in the file. - * Also skip over anything that precedes an identifiable - * start of game marker, to avoid being confused by - * garbage at the start of the file. Currently - * recognized start of game markers are the move number "1", - * the pattern "gnuchess .* game", the pattern - * "^[#;%] [^ ]* game file", and a PGN tag block. - * A game that starts with one of the latter two patterns - * will also have a move number 1, possibly - * following a position diagram. - * 5-4-02: Let's try being more lenient and allowing a game to - * start with an unnumbered move. Does that break anything? - */ - cm = lastLoadGameStart = EndOfFile; - while (gn > 0) { - yyboardindex = forwardMostMove; - cm = (ChessMove) Myylex(); - switch (cm) { - case EndOfFile: - if (cmailMsgLoaded) { - nCmailGames = CMAIL_MAX_GAMES - gn; - } else { - Reset(TRUE, TRUE); - DisplayError(_("Game not found in file"), 0); - } - return FALSE; - - case GNUChessGame: - case XBoardGame: - gn--; - lastLoadGameStart = cm; - break; - - case MoveNumberOne: - switch (lastLoadGameStart) { - case GNUChessGame: - case XBoardGame: - case PGNTag: - break; - case MoveNumberOne: - case EndOfFile: - gn--; /* count this game */ - lastLoadGameStart = cm; - break; - default: - /* impossible */ - break; - } - break; - - case PGNTag: - switch (lastLoadGameStart) { - case GNUChessGame: - case PGNTag: - case MoveNumberOne: - case EndOfFile: - gn--; /* count this game */ - lastLoadGameStart = cm; - break; - case XBoardGame: - lastLoadGameStart = cm; /* game counted already */ - break; - default: - /* impossible */ - break; - } - if (gn > 0) { - do { - yyboardindex = forwardMostMove; - cm = (ChessMove) Myylex(); - } while (cm == PGNTag || cm == Comment); - } - break; - - case WhiteWins: - case BlackWins: - case GameIsDrawn: - if (cmailMsgLoaded && (CMAIL_MAX_GAMES == lastLoadGameNumber)) { - if ( cmailResult[CMAIL_MAX_GAMES - gn - 1] - != CMAIL_OLD_RESULT) { - nCmailResults ++ ; - cmailResult[ CMAIL_MAX_GAMES - - gn - 1] = CMAIL_OLD_RESULT; - } - } - break; - - case NormalMove: - case FirstLeg: - /* Only a NormalMove can be at the start of a game - * without a position diagram. */ - if (lastLoadGameStart == EndOfFile ) { - gn--; - lastLoadGameStart = MoveNumberOne; - } - break; - - default: - break; - } - } - - if (appData.debugMode) - fprintf(debugFP, "Parsed game start '%s' (%d)\n", yy_text, (int) cm); - - for(i=0; i 0){ - char *tags; - if (gameInfo.variant == VariantNormal) { - VariantClass v = StringToVariant(gameInfo.event); - // [HGM] do not recognize variants from event tag that were introduced after supporting variant tag - if(v < VariantShogi) gameInfo.variant = v; - } - if (!matchMode) { - if( appData.autoDisplayTags ) { - tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - } - } else { - /* Make something up, but don't display it now */ - SetGameInfo(); - TagsPopDown(); - } - - if (cm == PositionDiagram) { - int i, j; - char *p; - Board initial_position; - - if (appData.debugMode) - fprintf(debugFP, "Parsed PositionDiagram: %s\n", yy_text); - - if (!startedFromSetupPosition) { - p = yy_text; - for (i = BOARD_HEIGHT - 1; i >= 0; i--) - for (j = BOARD_LEFT; j < BOARD_RGHT; p++) - switch (*p) { - case '{': - case '[': - case '-': - case ' ': - case '\t': - case '\n': - case '\r': - break; - default: - initial_position[i][j++] = CharToPiece(*p); - break; - } - while (*p == ' ' || *p == '\t' || - *p == '\n' || *p == '\r') p++; - - if (strncmp(p, "black", strlen("black"))==0) - blackPlaysFirst = TRUE; - else - blackPlaysFirst = FALSE; - startedFromSetupPosition = TRUE; - - CopyBoard(boards[0], initial_position); - if (blackPlaysFirst) { - currentMove = forwardMostMove = backwardMostMove = 1; - CopyBoard(boards[1], initial_position); - safeStrCpy(moveList[0], "", sizeof(moveList[0])/sizeof(moveList[0][0])); - safeStrCpy(parseList[0], "", sizeof(parseList[0])/sizeof(parseList[0][0])); - timeRemaining[0][1] = whiteTimeRemaining; - timeRemaining[1][1] = blackTimeRemaining; - if (commentList[0] != NULL) { - commentList[1] = commentList[0]; - commentList[0] = NULL; - } - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - } - } - yyboardindex = forwardMostMove; - cm = (ChessMove) Myylex(); - } - - if(!creatingBook) { - if (first.pr == NoProc) { - StartChessProgram(&first); - } - InitChessProgram(&first, FALSE); - if(gameInfo.variant == VariantUnknown && *oldName) { - safeStrCpy(engineVariant, oldName, MSG_SIZ); - gameInfo.variant = v; - } - SendToProgram("force\n", &first); - if (startedFromSetupPosition) { - SendBoard(&first, forwardMostMove); - if (appData.debugMode) { - fprintf(debugFP, "Load Game\n"); - } - DisplayBothClocks(); - } - } - - /* [HGM] server: flag to write setup moves in broadcast file as one */ - loadFlag = appData.suppressLoadMoves; - - while (cm == Comment) { - char *p; - if (appData.debugMode) - fprintf(debugFP, "Parsed Comment: %s\n", yy_text); - p = yy_text; - AppendComment(currentMove, p, FALSE); - yyboardindex = forwardMostMove; - cm = (ChessMove) Myylex(); - } - - if ((cm == EndOfFile && lastLoadGameStart != EndOfFile ) || - cm == WhiteWins || cm == BlackWins || - cm == GameIsDrawn || cm == GameUnfinished) { - DisplayMessage("", _("No moves in game")); - if (cmailMsgLoaded) { - if (appData.debugMode) - fprintf(debugFP, "Setting flipView to %d.\n", FALSE); - ClearHighlights(); - flipView = FALSE; - } - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - gameMode = EditGame; - ModeHighlight(); - gameFileFP = NULL; - cmailOldMove = 0; - return TRUE; - } - - // [HGM] PV info: routine tests if comment empty - if (!matchMode && (pausing || appData.timeDelay != 0)) { - DisplayComment(currentMove - 1, commentList[currentMove]); - } - if (!matchMode && appData.timeDelay != 0) - DrawPosition(FALSE, boards[currentMove]); - - if (gameMode == AnalyzeFile || gameMode == AnalyzeMode) { - programStats.ok_to_send = 1; - } - - /* if the first token after the PGN tags is a move - * and not move number 1, retrieve it from the parser - */ - if (cm != MoveNumberOne) - LoadGameOneMove(cm); - - /* load the remaining moves from the file */ - while (LoadGameOneMove(EndOfFile)) { - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - } - - /* rewind to the start of the game */ - currentMove = backwardMostMove; - - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - - if (oldGameMode == AnalyzeFile) { - appData.loadGameIndex = -1; // [HGM] order auto-stepping through games - AnalyzeFileEvent(); - } else - if (oldGameMode == AnalyzeMode) { - AnalyzeFileEvent(); - } - - if(gameInfo.result == GameUnfinished && gameInfo.resultDetails && appData.clockMode) { - long int w, b; // [HGM] adjourn: restore saved clock times - char *p = strstr(gameInfo.resultDetails, "(Clocks:"); - if(p && sscanf(p+8, "%ld,%ld", &w, &b) == 2) { - timeRemaining[0][forwardMostMove] = whiteTimeRemaining = 1000*w + 500; - timeRemaining[1][forwardMostMove] = blackTimeRemaining = 1000*b + 500; - } - } - - if(creatingBook) return TRUE; - if (!matchMode && pos > 0) { - ToNrEvent(pos); // [HGM] no autoplay if selected on position - } else - if (matchMode || appData.timeDelay == 0) { - ToEndEvent(); - } else if (appData.timeDelay > 0) { - AutoPlayGameLoop(); - } - - if (appData.debugMode) - fprintf(debugFP, "LoadGame(): on exit, gameMode %d\n", gameMode); - - loadFlag = 0; /* [HGM] true game starts */ - return TRUE; -} - -/* Support for LoadNextPosition, LoadPreviousPosition, ReloadSamePosition */ -int -ReloadPosition (int offset) -{ - int positionNumber = lastLoadPositionNumber + offset; - if (lastLoadPositionFP == NULL) { - DisplayError(_("No position has been loaded yet"), 0); - return FALSE; - } - if (positionNumber <= 0) { - DisplayError(_("Can't back up any further"), 0); - return FALSE; - } - return LoadPosition(lastLoadPositionFP, positionNumber, - lastLoadPositionTitle); -} - -/* Load the nth position from the given file */ -int -LoadPositionFromFile (char *filename, int n, char *title) -{ - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - return LoadPosition(stdin, n, "stdin"); - } else { - f = fopen(filename, "rb"); - if (f == NULL) { - snprintf(buf, sizeof(buf), _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - return LoadPosition(f, n, title); - } - } -} - -/* Load the nth position from the given open file, and close it */ -int -LoadPosition (FILE *f, int positionNumber, char *title) -{ - char *p, line[MSG_SIZ]; - Board initial_position; - int i, j, fenMode, pn; - - if (gameMode == Training ) - SetTrainingModeOff(); - - if (gameMode != BeginningOfGame) { - Reset(FALSE, TRUE); - } - if (lastLoadPositionFP != NULL && lastLoadPositionFP != f) { - fclose(lastLoadPositionFP); - } - if (positionNumber == 0) positionNumber = 1; - lastLoadPositionFP = f; - lastLoadPositionNumber = positionNumber; - safeStrCpy(lastLoadPositionTitle, title, sizeof(lastLoadPositionTitle)/sizeof(lastLoadPositionTitle[0])); - if (first.pr == NoProc && !appData.noChessProgram) { - StartChessProgram(&first); - InitChessProgram(&first, FALSE); - } - pn = positionNumber; - if (positionNumber < 0) { - /* Negative position number means to seek to that byte offset */ - if (fseek(f, -positionNumber, 0) == -1) { - DisplayError(_("Can't seek on position file"), 0); - return FALSE; - }; - pn = 1; - } else { - if (fseek(f, 0, 0) == -1) { - if (f == lastLoadPositionFP ? - positionNumber == lastLoadPositionNumber + 1 : - positionNumber == 1) { - pn = 1; - } else { - DisplayError(_("Can't seek on position file"), 0); - return FALSE; - } - } - } - /* See if this file is FEN or old-style xboard */ - if (fgets(line, MSG_SIZ, f) == NULL) { - DisplayError(_("Position not found in file"), 0); - return FALSE; - } - // [HGM] FEN can begin with digit, any piece letter valid in this variant, or a + for Shogi promoted pieces (or * for blackout) - fenMode = line[0] >= '0' && line[0] <= '9' || line[0] == '+' || line[0] == '*' || CharToPiece(line[0]) != EmptySquare; - - if (pn >= 2) { - if (fenMode || line[0] == '#') pn--; - while (pn > 0) { - /* skip positions before number pn */ - if (fgets(line, MSG_SIZ, f) == NULL) { - Reset(TRUE, TRUE); - DisplayError(_("Position not found in file"), 0); - return FALSE; - } - if (fenMode || line[0] == '#') pn--; - } - } - - if (fenMode) { - char *p; - if (!ParseFEN(initial_position, &blackPlaysFirst, line, TRUE)) { - DisplayError(_("Bad FEN position in file"), 0); - return FALSE; - } - if((strchr(line, ';')) && (p = strstr(line, " bm "))) { // EPD with best move - sscanf(p+4, "%[^;]", bestMove); - } else *bestMove = NULLCHAR; - if((strchr(line, ';')) && (p = strstr(line, " am "))) { // EPD with avoid move - sscanf(p+4, "%[^;]", avoidMove); - } else *avoidMove = NULLCHAR; - } else { - (void) fgets(line, MSG_SIZ, f); - (void) fgets(line, MSG_SIZ, f); - - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - (void) fgets(line, MSG_SIZ, f); - for (p = line, j = BOARD_LEFT; j < BOARD_RGHT; p++) { - if (*p == ' ') - continue; - initial_position[i][j++] = CharToPiece(*p); - } - } - - blackPlaysFirst = FALSE; - if (!feof(f)) { - (void) fgets(line, MSG_SIZ, f); - if (strncmp(line, "black", strlen("black"))==0) - blackPlaysFirst = TRUE; - } - } - startedFromSetupPosition = TRUE; - - CopyBoard(boards[0], initial_position); - if (blackPlaysFirst) { - currentMove = forwardMostMove = backwardMostMove = 1; - safeStrCpy(moveList[0], "", sizeof(moveList[0])/sizeof(moveList[0][0])); - safeStrCpy(parseList[0], "", sizeof(parseList[0])/sizeof(parseList[0][0])); - CopyBoard(boards[1], initial_position); - DisplayMessage("", _("Black to play")); - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - DisplayMessage("", _("White to play")); - } - initialRulePlies = FENrulePlies; /* [HGM] copy FEN attributes as well */ - if(first.pr != NoProc) { // [HGM] in tourney-mode a position can be loaded before the chess engine is installed - SendToProgram("force\n", &first); - SendBoard(&first, forwardMostMove); - } - if (appData.debugMode) { -int i, j; - for(i=0;i<2;i++){for(j=0;j<6;j++)fprintf(debugFP, " %d", boards[i][CASTLING][j]);fprintf(debugFP,"\n");} - for(j=0;j<6;j++)fprintf(debugFP, " %d", initialRights[j]);fprintf(debugFP,"\n"); - fprintf(debugFP, "Load Position\n"); - } - - if (positionNumber > 1) { - snprintf(line, MSG_SIZ, "%s %d", title, positionNumber); - DisplayTitle(line); - } else { - DisplayTitle(title); - } - gameMode = EditGame; - ModeHighlight(); - ResetClocks(); - timeRemaining[0][1] = whiteTimeRemaining; - timeRemaining[1][1] = blackTimeRemaining; - DrawPosition(FALSE, boards[currentMove]); - - return TRUE; -} - - -void -CopyPlayerNameIntoFileName (char **dest, char *src) -{ - while (*src != NULLCHAR && *src != ',') { - if (*src == ' ') { - *(*dest)++ = '_'; - src++; - } else { - *(*dest)++ = *src++; - } - } -} - -char * -DefaultFileName (char *ext) -{ - static char def[MSG_SIZ]; - char *p; - - if (gameInfo.white != NULL && gameInfo.white[0] != '-') { - p = def; - CopyPlayerNameIntoFileName(&p, gameInfo.white); - *p++ = '-'; - CopyPlayerNameIntoFileName(&p, gameInfo.black); - *p++ = '.'; - safeStrCpy(p, ext, MSG_SIZ-2-strlen(gameInfo.white)-strlen(gameInfo.black)); - } else { - def[0] = NULLCHAR; - } - return def; -} - -/* Save the current game to the given file */ -int -SaveGameToFile (char *filename, int append) -{ - FILE *f; - char buf[MSG_SIZ]; - int result, i, t,tot=0; - - if (strcmp(filename, "-") == 0) { - return SaveGame(stdout, 0, NULL); - } else { - for(i=0; i<10; i++) { // upto 10 tries - f = fopen(filename, append ? "a" : "w"); - if(f && i) fprintf(f, "[Delay \"%d retries, %d msec\"]\n",i,tot); - if(f || errno != 13) break; - DoSleep(t = 5 + random()%11); // wait 5-15 msec - tot += t; - } - if (f == NULL) { - snprintf(buf, sizeof(buf), _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - safeStrCpy(buf, lastMsg, MSG_SIZ); - DisplayMessage(_("Waiting for access to save file"), ""); - flock(fileno(f), LOCK_EX); // [HGM] lock: lock file while we are writing - DisplayMessage(_("Saving game"), ""); - if(lseek(fileno(f), 0, SEEK_END) == -1) DisplayError(_("Bad Seek"), errno); // better safe than sorry... - result = SaveGame(f, 0, NULL); - DisplayMessage(buf, ""); - return result; - } - } -} - -char * -SavePart (char *str) -{ - static char buf[MSG_SIZ]; - char *p; - - p = strchr(str, ' '); - if (p == NULL) return str; - strncpy(buf, str, p - str); - buf[p - str] = NULLCHAR; - return buf; -} - -#define PGN_MAX_LINE 75 - -#define PGN_SIDE_WHITE 0 -#define PGN_SIDE_BLACK 1 - -static int -FindFirstMoveOutOfBook (int side) -{ - int result = -1; - - if( backwardMostMove == 0 && ! startedFromSetupPosition) { - int index = backwardMostMove; - int has_book_hit = 0; - - if( (index % 2) != side ) { - index++; - } - - while( index < forwardMostMove ) { - /* Check to see if engine is in book */ - int depth = pvInfoList[index].depth; - int score = pvInfoList[index].score; - int in_book = 0; - - if( depth <= 2 ) { - in_book = 1; - } - else if( score == 0 && depth == 63 ) { - in_book = 1; /* Zappa */ - } - else if( score == 2 && depth == 99 ) { - in_book = 1; /* Abrok */ - } - - has_book_hit += in_book; - - if( ! in_book ) { - result = index; - - break; - } - - index += 2; - } - } - - return result; -} - -void -GetOutOfBookInfo (char * buf) -{ - int oob[2]; - int i; - int offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - - oob[0] = FindFirstMoveOutOfBook( PGN_SIDE_WHITE ); - oob[1] = FindFirstMoveOutOfBook( PGN_SIDE_BLACK ); - - *buf = '\0'; - - if( oob[0] >= 0 || oob[1] >= 0 ) { - for( i=0; i<2; i++ ) { - int idx = oob[i]; - - if( idx >= 0 ) { - if( i > 0 && oob[0] >= 0 ) { - strcat( buf, " " ); - } - - sprintf( buf+strlen(buf), "%d%s. ", (idx - offset)/2 + 1, idx & 1 ? ".." : "" ); - sprintf( buf+strlen(buf), "%s%.2f", - pvInfoList[idx].score >= 0 ? "+" : "", - pvInfoList[idx].score / 100.0 ); - } - } - } -} - -/* Save game in PGN style */ -static void -SaveGamePGN2 (FILE *f) -{ - int i, offset, linelen, newblock; -// char *movetext; - char numtext[32]; - int movelen, numlen, blank; - char move_buffer[100]; /* [AS] Buffer for move+PV info */ - - offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - - PrintPGNTags(f, &gameInfo); - - if(appData.numberTag && matchMode) fprintf(f, "[Number \"%d\"]\n", nextGame+1); // [HGM] number tag - - if (backwardMostMove > 0 || startedFromSetupPosition) { - char *fen = PositionToFEN(backwardMostMove, NULL, 1); - fprintf(f, "[FEN \"%s\"]\n[SetUp \"1\"]\n", fen); - fprintf(f, "\n{--------------\n"); - PrintPosition(f, backwardMostMove); - fprintf(f, "--------------}\n"); - free(fen); - } - else { - /* [AS] Out of book annotation */ - if( appData.saveOutOfBookInfo ) { - char buf[64]; - - GetOutOfBookInfo( buf ); - - if( buf[0] != '\0' ) { - fprintf( f, "[%s \"%s\"]\n", PGN_OUT_OF_BOOK, buf ); - } - } - - fprintf(f, "\n"); - } - - i = backwardMostMove; - linelen = 0; - newblock = TRUE; - - while (i < forwardMostMove) { - /* Print comments preceding this move */ - if (commentList[i] != NULL) { - if (linelen > 0) fprintf(f, "\n"); - fprintf(f, "%s", commentList[i]); - linelen = 0; - newblock = TRUE; - } - - /* Format move number */ - if ((i % 2) == 0) - snprintf(numtext, sizeof(numtext)/sizeof(numtext[0]),"%d.", (i - offset)/2 + 1); - else - if (newblock) - snprintf(numtext, sizeof(numtext)/sizeof(numtext[0]), "%d...", (i - offset)/2 + 1); - else - numtext[0] = NULLCHAR; - - numlen = strlen(numtext); - newblock = FALSE; - - /* Print move number */ - blank = linelen > 0 && numlen > 0; - if (linelen + (blank ? 1 : 0) + numlen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, "%s", numtext); - linelen += numlen; - - /* Get move */ - safeStrCpy(move_buffer, SavePart(parseList[i]), sizeof(move_buffer)/sizeof(move_buffer[0])); // [HGM] pgn: print move via buffer, so it can be edited - movelen = strlen(move_buffer); /* [HGM] pgn: line-break point before move */ - - /* Print move */ - blank = linelen > 0 && movelen > 0; - if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, "%s", move_buffer); - linelen += movelen; - - /* [AS] Add PV info if present */ - if( i >= 0 && appData.saveExtendedInfoInPGN && pvInfoList[i].depth > 0 ) { - /* [HGM] add time */ - char buf[MSG_SIZ]; int seconds; - - seconds = (pvInfoList[i].time+5)/10; // deci-seconds, rounded to nearest - - if( seconds <= 0) - buf[0] = 0; - else - if( seconds < 30 ) - snprintf(buf, MSG_SIZ, " %3.1f%c", seconds/10., 0); - else - { - seconds = (seconds + 4)/10; // round to full seconds - if( seconds < 60 ) - snprintf(buf, MSG_SIZ, " %d%c", seconds, 0); - else - snprintf(buf, MSG_SIZ, " %d:%02d%c", seconds/60, seconds%60, 0); - } - - snprintf( move_buffer, sizeof(move_buffer)/sizeof(move_buffer[0]),"{%s%.2f/%d%s}", - pvInfoList[i].score >= 0 ? "+" : "", - pvInfoList[i].score / 100.0, - pvInfoList[i].depth, - buf ); - - movelen = strlen(move_buffer); /* [HGM] pgn: line-break point after move */ - - /* Print score/depth */ - blank = linelen > 0 && movelen > 0; - if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, "%s", move_buffer); - linelen += movelen; - } - - i++; - } - - /* Start a new line */ - if (linelen > 0) fprintf(f, "\n"); - - /* Print comments after last move */ - if (commentList[i] != NULL) { - fprintf(f, "%s\n", commentList[i]); - } - - /* Print result */ - if (gameInfo.resultDetails != NULL && - gameInfo.resultDetails[0] != NULLCHAR) { - char buf[MSG_SIZ], *p = gameInfo.resultDetails; - if(gameInfo.result == GameUnfinished && appData.clockMode && - (gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || gameMode == TwoMachinesPlay)) // [HGM] adjourn: save clock settings - snprintf(buf, MSG_SIZ, "%s (Clocks: %ld, %ld)", p, whiteTimeRemaining/1000, blackTimeRemaining/1000), p = buf; - fprintf(f, "{%s} %s\n\n", p, PGNResult(gameInfo.result)); - } else { - fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); - } -} - -/* Save game in PGN style and close the file */ -int -SaveGamePGN (FILE *f) -{ - SaveGamePGN2(f); - fclose(f); - lastSavedGame = GameCheckSum(); // [HGM] save: remember ID of last saved game to prevent double saving - return TRUE; -} - -/* Save game in old style and close the file */ -int -SaveGameOldStyle (FILE *f) -{ - int i, offset; - time_t tm; - - tm = time((time_t *) NULL); - - fprintf(f, "# %s game file -- %s", programName, ctime(&tm)); - PrintOpponents(f); - - if (backwardMostMove > 0 || startedFromSetupPosition) { - fprintf(f, "\n[--------------\n"); - PrintPosition(f, backwardMostMove); - fprintf(f, "--------------]\n"); - } else { - fprintf(f, "\n"); - } - - i = backwardMostMove; - offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - - while (i < forwardMostMove) { - if (commentList[i] != NULL) { - fprintf(f, "[%s]\n", commentList[i]); - } - - if ((i % 2) == 1) { - fprintf(f, "%d. ... %s\n", (i - offset)/2 + 1, parseList[i]); - i++; - } else { - fprintf(f, "%d. %s ", (i - offset)/2 + 1, parseList[i]); - i++; - if (commentList[i] != NULL) { - fprintf(f, "\n"); - continue; - } - if (i >= forwardMostMove) { - fprintf(f, "\n"); - break; - } - fprintf(f, "%s\n", parseList[i]); - i++; - } - } - - if (commentList[i] != NULL) { - fprintf(f, "[%s]\n", commentList[i]); - } - - /* This isn't really the old style, but it's close enough */ - if (gameInfo.resultDetails != NULL && - gameInfo.resultDetails[0] != NULLCHAR) { - fprintf(f, "%s (%s)\n\n", PGNResult(gameInfo.result), - gameInfo.resultDetails); - } else { - fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); - } - - fclose(f); - return TRUE; -} - -/* Save the current game to open file f and close the file */ -int -SaveGame (FILE *f, int dummy, char *dummy2) -{ - if (gameMode == EditPosition) EditPositionDone(TRUE); - lastSavedGame = GameCheckSum(); // [HGM] save: remember ID of last saved game to prevent double saving - if (appData.oldSaveStyle) - return SaveGameOldStyle(f); - else - return SaveGamePGN(f); -} - -/* Save the current position to the given file */ -int -SavePositionToFile (char *filename) -{ - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - return SavePosition(stdout, 0, NULL); - } else { - f = fopen(filename, "a"); - if (f == NULL) { - snprintf(buf, sizeof(buf), _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - safeStrCpy(buf, lastMsg, MSG_SIZ); - DisplayMessage(_("Waiting for access to save file"), ""); - flock(fileno(f), LOCK_EX); // [HGM] lock - DisplayMessage(_("Saving position"), ""); - lseek(fileno(f), 0, SEEK_END); // better safe than sorry... - SavePosition(f, 0, NULL); - DisplayMessage(buf, ""); - return TRUE; - } - } -} - -/* Save the current position to the given open file and close the file */ -int -SavePosition (FILE *f, int dummy, char *dummy2) -{ - time_t tm; - char *fen; - - if (gameMode == EditPosition) EditPositionDone(TRUE); - if (appData.oldSaveStyle) { - tm = time((time_t *) NULL); - - fprintf(f, "# %s position file -- %s", programName, ctime(&tm)); - PrintOpponents(f); - fprintf(f, "[--------------\n"); - PrintPosition(f, currentMove); - fprintf(f, "--------------]\n"); - } else { - fen = PositionToFEN(currentMove, NULL, 1); - fprintf(f, "%s\n", fen); - free(fen); - } - fclose(f); - return TRUE; -} - -void -ReloadCmailMsgEvent (int unregister) -{ -#if !WIN32 - static char *inFilename = NULL; - static char *outFilename; - int i; - struct stat inbuf, outbuf; - int status; - - /* Any registered moves are unregistered if unregister is set, */ - /* i.e. invoked by the signal handler */ - if (unregister) { - for (i = 0; i < CMAIL_MAX_GAMES; i ++) { - cmailMoveRegistered[i] = FALSE; - if (cmailCommentList[i] != NULL) { - free(cmailCommentList[i]); - cmailCommentList[i] = NULL; - } - } - nCmailMovesRegistered = 0; - } - - for (i = 0; i < CMAIL_MAX_GAMES; i ++) { - cmailResult[i] = CMAIL_NOT_RESULT; - } - nCmailResults = 0; - - if (inFilename == NULL) { - /* Because the filenames are static they only get malloced once */ - /* and they never get freed */ - inFilename = (char *) malloc(strlen(appData.cmailGameName) + 9); - sprintf(inFilename, "%s.game.in", appData.cmailGameName); - - outFilename = (char *) malloc(strlen(appData.cmailGameName) + 5); - sprintf(outFilename, "%s.out", appData.cmailGameName); - } - - status = stat(outFilename, &outbuf); - if (status < 0) { - cmailMailedMove = FALSE; - } else { - status = stat(inFilename, &inbuf); - cmailMailedMove = (inbuf.st_mtime < outbuf.st_mtime); - } - - /* LoadGameFromFile(CMAIL_MAX_GAMES) with cmailMsgLoaded == TRUE - counts the games, notes how each one terminated, etc. - - It would be nice to remove this kludge and instead gather all - the information while building the game list. (And to keep it - in the game list nodes instead of having a bunch of fixed-size - parallel arrays.) Note this will require getting each game's - termination from the PGN tags, as the game list builder does - not process the game moves. --mann - */ - cmailMsgLoaded = TRUE; - LoadGameFromFile(inFilename, CMAIL_MAX_GAMES, "", FALSE); - - /* Load first game in the file or popup game menu */ - LoadGameFromFile(inFilename, 0, appData.cmailGameName, TRUE); - -#endif /* !WIN32 */ - return; -} - -int -RegisterMove () -{ - FILE *f; - char string[MSG_SIZ]; - - if ( cmailMailedMove - || (cmailResult[lastLoadGameNumber - 1] == CMAIL_OLD_RESULT)) { - return TRUE; /* Allow free viewing */ - } - - /* Unregister move to ensure that we don't leave RegisterMove */ - /* with the move registered when the conditions for registering no */ - /* longer hold */ - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; - nCmailMovesRegistered --; - - if (cmailCommentList[lastLoadGameNumber - 1] != NULL) - { - free(cmailCommentList[lastLoadGameNumber - 1]); - cmailCommentList[lastLoadGameNumber - 1] = NULL; - } - } - - if (cmailOldMove == -1) { - DisplayError(_("You have edited the game history.\nUse Reload Same Game and make your move again."), 0); - return FALSE; - } - - if (currentMove > cmailOldMove + 1) { - DisplayError(_("You have entered too many moves.\nBack up to the correct position and try again."), 0); - return FALSE; - } - - if (currentMove < cmailOldMove) { - DisplayError(_("Displayed position is not current.\nStep forward to the correct position and try again."), 0); - return FALSE; - } - - if (forwardMostMove > currentMove) { - /* Silently truncate extra moves */ - TruncateGame(); - } - - if ( (currentMove == cmailOldMove + 1) - || ( (currentMove == cmailOldMove) - && ( (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_ACCEPT) - || (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_RESIGN)))) { - if (gameInfo.result != GameUnfinished) { - cmailResult[lastLoadGameNumber - 1] = CMAIL_NEW_RESULT; - } - - if (commentList[currentMove] != NULL) { - cmailCommentList[lastLoadGameNumber - 1] - = StrSave(commentList[currentMove]); - } - safeStrCpy(cmailMove[lastLoadGameNumber - 1], moveList[currentMove - 1], sizeof(cmailMove[lastLoadGameNumber - 1])/sizeof(cmailMove[lastLoadGameNumber - 1][0])); - - if (appData.debugMode) - fprintf(debugFP, "Saving %s for game %d\n", - cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); - - snprintf(string, MSG_SIZ, "%s.game.out.%d", appData.cmailGameName, lastLoadGameNumber); - - f = fopen(string, "w"); - if (appData.oldSaveStyle) { - SaveGameOldStyle(f); /* also closes the file */ - - snprintf(string, MSG_SIZ, "%s.pos.out", appData.cmailGameName); - f = fopen(string, "w"); - SavePosition(f, 0, NULL); /* also closes the file */ - } else { - fprintf(f, "{--------------\n"); - PrintPosition(f, currentMove); - fprintf(f, "--------------}\n\n"); - - SaveGame(f, 0, NULL); /* also closes the file*/ - } - - cmailMoveRegistered[lastLoadGameNumber - 1] = TRUE; - nCmailMovesRegistered ++; - } else if (nCmailGames == 1) { - DisplayError(_("You have not made a move yet"), 0); - return FALSE; - } - - return TRUE; -} - -void -MailMoveEvent () -{ -#if !WIN32 - static char *partCommandString = "cmail -xv%s -remail -game %s 2>&1"; - FILE *commandOutput; - char buffer[MSG_SIZ], msg[MSG_SIZ], string[MSG_SIZ]; - int nBytes = 0; /* Suppress warnings on uninitialized variables */ - int nBuffers; - int i; - int archived; - char *arcDir; - - if (! cmailMsgLoaded) { - DisplayError(_("The cmail message is not loaded.\nUse Reload CMail Message and make your move again."), 0); - return; - } - - if (nCmailGames == nCmailResults) { - DisplayError(_("No unfinished games"), 0); - return; - } - -#if CMAIL_PROHIBIT_REMAIL - if (cmailMailedMove) { - snprintf(msg, MSG_SIZ, _("You have already mailed a move.\nWait until a move arrives from your opponent.\nTo resend the same move, type\n\"cmail -remail -game %s\"\non the command line."), appData.cmailGameName); - DisplayError(msg, 0); - return; - } -#endif - - if (! (cmailMailedMove || RegisterMove())) return; - - if ( cmailMailedMove - || (nCmailMovesRegistered + nCmailResults == nCmailGames)) { - snprintf(string, MSG_SIZ, partCommandString, - appData.debugMode ? " -v" : "", appData.cmailGameName); - commandOutput = popen(string, "r"); - - if (commandOutput == NULL) { - DisplayError(_("Failed to invoke cmail"), 0); - } else { - for (nBuffers = 0; (! feof(commandOutput)); nBuffers ++) { - nBytes = fread(buffer, 1, MSG_SIZ - 1, commandOutput); - } - if (nBuffers > 1) { - (void) memcpy(msg, buffer + nBytes, MSG_SIZ - nBytes - 1); - (void) memcpy(msg + MSG_SIZ - nBytes - 1, buffer, nBytes); - nBytes = MSG_SIZ - 1; - } else { - (void) memcpy(msg, buffer, nBytes); - } - *(msg + nBytes) = '\0'; /* \0 for end-of-string*/ - - if(StrStr(msg, "Mailed cmail message to ") != NULL) { - cmailMailedMove = TRUE; /* Prevent >1 moves */ - - archived = TRUE; - for (i = 0; i < nCmailGames; i ++) { - if (cmailResult[i] == CMAIL_NOT_RESULT) { - archived = FALSE; - } - } - if ( archived - && ( (arcDir = (char *) getenv("CMAIL_ARCDIR")) - != NULL)) { - snprintf(buffer, MSG_SIZ, "%s/%s.%s.archive", - arcDir, - appData.cmailGameName, - gameInfo.date); - LoadGameFromFile(buffer, 1, buffer, FALSE); - cmailMsgLoaded = FALSE; - } - } - - DisplayInformation(msg); - pclose(commandOutput); - } - } else { - if ((*cmailMsg) != '\0') { - DisplayInformation(cmailMsg); - } - } - - return; -#endif /* !WIN32 */ -} - -char * -CmailMsg () -{ -#if WIN32 - return NULL; -#else - int prependComma = 0; - char number[5]; - char string[MSG_SIZ]; /* Space for game-list */ - int i; - - if (!cmailMsgLoaded) return ""; - - if (cmailMailedMove) { - snprintf(cmailMsg, MSG_SIZ, _("Waiting for reply from opponent\n")); - } else { - /* Create a list of games left */ - snprintf(string, MSG_SIZ, "["); - for (i = 0; i < nCmailGames; i ++) { - if (! ( cmailMoveRegistered[i] - || (cmailResult[i] == CMAIL_OLD_RESULT))) { - if (prependComma) { - snprintf(number, sizeof(number)/sizeof(number[0]), ",%d", i + 1); - } else { - snprintf(number, sizeof(number)/sizeof(number[0]), "%d", i + 1); - prependComma = 1; - } - - strcat(string, number); - } - } - strcat(string, "]"); - - if (nCmailMovesRegistered + nCmailResults == 0) { - switch (nCmailGames) { - case 1: - snprintf(cmailMsg, MSG_SIZ, _("Still need to make move for game\n")); - break; - - case 2: - snprintf(cmailMsg, MSG_SIZ, _("Still need to make moves for both games\n")); - break; - - default: - snprintf(cmailMsg, MSG_SIZ, _("Still need to make moves for all %d games\n"), - nCmailGames); - break; - } - } else { - switch (nCmailGames - nCmailMovesRegistered - nCmailResults) { - case 1: - snprintf(cmailMsg, MSG_SIZ, _("Still need to make a move for game %s\n"), - string); - break; - - case 0: - if (nCmailResults == nCmailGames) { - snprintf(cmailMsg, MSG_SIZ, _("No unfinished games\n")); - } else { - snprintf(cmailMsg, MSG_SIZ, _("Ready to send mail\n")); - } - break; - - default: - snprintf(cmailMsg, MSG_SIZ, _("Still need to make moves for games %s\n"), - string); - } - } - } - return cmailMsg; -#endif /* WIN32 */ -} - -void -ResetGameEvent () -{ - if (gameMode == Training) - SetTrainingModeOff(); - - Reset(TRUE, TRUE); - cmailMsgLoaded = FALSE; - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } -} - -void -ExitEvent (int status) -{ - exiting++; - if (exiting > 2) { - /* Give up on clean exit */ - exit(status); - } - if (exiting > 1) { - /* Keep trying for clean exit */ - return; - } - - if (appData.icsActive) printf("\n"); // [HGM] end on new line after closing XBoard - if (appData.icsActive && appData.colorize) Colorize(ColorNone, FALSE); - - if (telnetISR != NULL) { - RemoveInputSource(telnetISR); - } - if (icsPR != NoProc) { - DestroyChildProcess(icsPR, TRUE); - } - - /* [HGM] crash: leave writing PGN and position entirely to GameEnds() */ - GameEnds(gameInfo.result, gameInfo.resultDetails==NULL ? "xboard exit" : gameInfo.resultDetails, GE_PLAYER); - - /* [HGM] crash: the above GameEnds() is a dud if another one was running */ - /* make sure this other one finishes before killing it! */ - if(endingGame) { int count = 0; - if(appData.debugMode) fprintf(debugFP, "ExitEvent() during GameEnds(), wait\n"); - while(endingGame && count++ < 10) DoSleep(1); - if(appData.debugMode && endingGame) fprintf(debugFP, "GameEnds() seems stuck, proceed exiting\n"); - } - - /* Kill off chess programs */ - if (first.pr != NoProc) { - ExitAnalyzeMode(); - - DoSleep( appData.delayBeforeQuit ); - SendToProgram("quit\n", &first); - DestroyChildProcess(first.pr, 4 + first.useSigterm /* [AS] first.useSigterm */ ); - } - if (second.pr != NoProc) { - DoSleep( appData.delayBeforeQuit ); - SendToProgram("quit\n", &second); - DestroyChildProcess(second.pr, 4 + second.useSigterm /* [AS] second.useSigterm */ ); - } - if (first.isr != NULL) { - RemoveInputSource(first.isr); - } - if (second.isr != NULL) { - RemoveInputSource(second.isr); - } - - if (pairing.pr != NoProc) SendToProgram("quit\n", &pairing); - if (pairing.isr != NULL) RemoveInputSource(pairing.isr); - - ShutDownFrontEnd(); - exit(status); -} - -void -PauseEngine (ChessProgramState *cps) -{ - SendToProgram("pause\n", cps); - cps->pause = 2; -} - -void -UnPauseEngine (ChessProgramState *cps) -{ - SendToProgram("resume\n", cps); - cps->pause = 1; -} - -void -PauseEvent () -{ - if (appData.debugMode) - fprintf(debugFP, "PauseEvent(): pausing %d\n", pausing); - if (pausing) { - pausing = FALSE; - ModeHighlight(); - if(stalledEngine) { // [HGM] pause: resume game by releasing withheld move - StartClocks(); - if(gameMode == TwoMachinesPlay) { // we might have to make the opponent resume pondering - if(stalledEngine->other->pause == 2) UnPauseEngine(stalledEngine->other); - else if(appData.ponderNextMove) SendToProgram("hard\n", stalledEngine->other); - } - if(appData.ponderNextMove) SendToProgram("hard\n", stalledEngine); - HandleMachineMove(stashedInputMove, stalledEngine); - stalledEngine = NULL; - return; - } - if (gameMode == MachinePlaysWhite || - gameMode == TwoMachinesPlay || - gameMode == MachinePlaysBlack) { // the thinking engine must have used pause mode, or it would have been stalledEngine - if(first.pause) UnPauseEngine(&first); - else if(appData.ponderNextMove) SendToProgram("hard\n", &first); - if(second.pause) UnPauseEngine(&second); - else if(gameMode == TwoMachinesPlay && appData.ponderNextMove) SendToProgram("hard\n", &second); - StartClocks(); - } else { - DisplayBothClocks(); - } - if (gameMode == PlayFromGameFile) { - if (appData.timeDelay >= 0) - AutoPlayGameLoop(); - } else if (gameMode == IcsExamining && pauseExamInvalid) { - Reset(FALSE, TRUE); - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } else if (currentMove < forwardMostMove && gameMode != AnalyzeMode) { - ForwardInner(forwardMostMove); - } - pauseExamInvalid = FALSE; - } else { - switch (gameMode) { - default: - return; - case IcsExamining: - pauseExamForwardMostMove = forwardMostMove; - pauseExamInvalid = FALSE; - /* fall through */ - case IcsObserving: - case IcsPlayingWhite: - case IcsPlayingBlack: - pausing = TRUE; - ModeHighlight(); - return; - case PlayFromGameFile: - (void) StopLoadGameTimer(); - pausing = TRUE; - ModeHighlight(); - break; - case BeginningOfGame: - if (appData.icsActive) return; - /* else fall through */ - case MachinePlaysWhite: - case MachinePlaysBlack: - case TwoMachinesPlay: - if (forwardMostMove == 0) - return; /* don't pause if no one has moved */ - if(gameMode == TwoMachinesPlay) { // [HGM] pause: stop clocks if engine can be paused immediately - ChessProgramState *onMove = (WhiteOnMove(forwardMostMove) == (first.twoMachinesColor[0] == 'w') ? &first : &second); - if(onMove->pause) { // thinking engine can be paused - PauseEngine(onMove); // do it - if(onMove->other->pause) // pondering opponent can always be paused immediately - PauseEngine(onMove->other); - else - SendToProgram("easy\n", onMove->other); - StopClocks(); - } else if(appData.ponderNextMove) SendToProgram("easy\n", onMove); // pre-emptively bring out of ponder - } else if(gameMode == (WhiteOnMove(forwardMostMove) ? MachinePlaysWhite : MachinePlaysBlack)) { // engine on move - if(first.pause) { - PauseEngine(&first); - StopClocks(); - } else if(appData.ponderNextMove) SendToProgram("easy\n", &first); // pre-emptively bring out of ponder - } else { // human on move, pause pondering by either method - if(first.pause) - PauseEngine(&first); - else if(appData.ponderNextMove) - SendToProgram("easy\n", &first); - StopClocks(); - } - // if no immediate pausing is possible, wait for engine to move, and stop clocks then - case AnalyzeMode: - pausing = TRUE; - ModeHighlight(); - break; - } - } -} - -void -EditCommentEvent () -{ - char title[MSG_SIZ]; - - if (currentMove < 1 || parseList[currentMove - 1][0] == NULLCHAR) { - safeStrCpy(title, _("Edit comment"), sizeof(title)/sizeof(title[0])); - } else { - snprintf(title, MSG_SIZ, _("Edit comment on %d.%s%s"), (currentMove - 1) / 2 + 1, - WhiteOnMove(currentMove - 1) ? " " : ".. ", - parseList[currentMove - 1]); - } - - EditCommentPopUp(currentMove, title, commentList[currentMove]); -} - - -void -EditTagsEvent () -{ - char *tags = PGNTags(&gameInfo); - bookUp = FALSE; - EditTagsPopUp(tags, NULL); - free(tags); -} - -void -ToggleSecond () -{ - if(second.analyzing) { - SendToProgram("exit\n", &second); - second.analyzing = FALSE; - } else { - if (second.pr == NoProc) StartChessProgram(&second); - InitChessProgram(&second, FALSE); - FeedMovesToProgram(&second, currentMove); - - SendToProgram("analyze\n", &second); - second.analyzing = TRUE; - } -} - -/* Toggle ShowThinking */ -void -ToggleShowThinking() -{ - appData.showThinking = !appData.showThinking; - ShowThinkingEvent(); -} - -int -AnalyzeModeEvent () -{ - char buf[MSG_SIZ]; - - if (!first.analysisSupport) { - snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return 0; - } - /* [DM] icsEngineAnalyze [HGM] This is horrible code; reverse the gameMode and isEngineAnalyze tests! */ - if (appData.icsActive) { - if (gameMode != IcsObserving) { - snprintf(buf, MSG_SIZ, _("You are not observing a game")); - DisplayError(buf, 0); - /* secure check */ - if (appData.icsEngineAnalyze) { - if (appData.debugMode) - fprintf(debugFP, "Found unexpected active ICS engine analyze \n"); - ExitAnalyzeMode(); - ModeHighlight(); - } - return 0; - } - /* if enable, user wants to disable icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - return 0; - } - appData.icsEngineAnalyze = TRUE; - if (appData.debugMode) - fprintf(debugFP, "ICS engine analyze starting... \n"); - } - - if (gameMode == AnalyzeMode) { ToggleSecond(); return 0; } - if (appData.noChessProgram || gameMode == AnalyzeMode) - return 0; - - if (gameMode != AnalyzeFile) { - if (!appData.icsEngineAnalyze) { - EditGameEvent(); - if (gameMode != EditGame) return 0; - } - if (!appData.showThinking) ToggleShowThinking(); - ResurrectChessProgram(); - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - EngineOutputPopUp(); - } - if (!appData.icsEngineAnalyze) { - gameMode = AnalyzeMode; - ClearEngineOutputPane(0); // [TK] exclude: to print exclusion/multipv header - } - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - - StartAnalysisClock(); - GetTimeMark(&lastNodeCountTime); - lastNodeCount = 0; - return 1; -} - -void -AnalyzeFileEvent () -{ - if (appData.noChessProgram || gameMode == AnalyzeFile) - return; - - if (!first.analysisSupport) { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; - } - - if (gameMode != AnalyzeMode) { - keepInfo = 1; // mere annotating should not alter PGN tags - EditGameEvent(); - keepInfo = 0; - if (gameMode != EditGame) return; - if (!appData.showThinking) ToggleShowThinking(); - ResurrectChessProgram(); - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - EngineOutputPopUp(); - } - gameMode = AnalyzeFile; - pausing = FALSE; - ModeHighlight(); - - StartAnalysisClock(); - GetTimeMark(&lastNodeCountTime); - lastNodeCount = 0; - if(appData.timeDelay > 0) StartLoadGameTimer((long)(1000.0f * appData.timeDelay)); - AnalysisPeriodicEvent(1); -} - -void -MachineWhiteEvent () -{ - char buf[MSG_SIZ]; - char *bookHit = NULL; - - if (appData.noChessProgram || (gameMode == MachinePlaysWhite)) - return; - - - if (gameMode == PlayFromGameFile || - gameMode == TwoMachinesPlay || - gameMode == Training || - gameMode == AnalyzeMode || - gameMode == EndOfGame) - EditGameEvent(); - - if (gameMode == EditPosition) - EditPositionDone(TRUE); - - if (!WhiteOnMove(currentMove)) { - DisplayError(_("It is not White's turn"), 0); - return; - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) - ExitAnalyzeMode(); - - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == AnalyzeFile) - TruncateGame(); - - ResurrectChessProgram(); /* in case it isn't running */ - if(gameMode == BeginningOfGame) { /* [HGM] time odds: to get right odds in human mode */ - gameMode = MachinePlaysWhite; - ResetClocks(); - } else - gameMode = MachinePlaysWhite; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - snprintf(buf, MSG_SIZ, "%s %s %s", gameInfo.white, _("vs."), gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - snprintf(buf, MSG_SIZ, "name %s\n", gameInfo.black); - SendToProgram(buf, &first); - } - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); /*gnu kludge*/ - } - SendTimeRemaining(&first, TRUE); - } - if (first.useColors) { - SendToProgram("white\n", &first); // [HGM] book: send 'go' separately - } - bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move - SetMachineThinkingEnables(); - first.maybeThinking = TRUE; - StartClocks(); - firstMove = FALSE; - - if (appData.autoFlipView && !flipView) { - flipView = !flipView; - DrawPosition(FALSE, NULL); - DisplayBothClocks(); // [HGM] logo: clocks might have to be exchanged; - } - - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } -} - -void -MachineBlackEvent () -{ - char buf[MSG_SIZ]; - char *bookHit = NULL; - - if (appData.noChessProgram || (gameMode == MachinePlaysBlack)) - return; - - - if (gameMode == PlayFromGameFile || - gameMode == TwoMachinesPlay || - gameMode == Training || - gameMode == AnalyzeMode || - gameMode == EndOfGame) - EditGameEvent(); - - if (gameMode == EditPosition) - EditPositionDone(TRUE); - - if (WhiteOnMove(currentMove)) { - DisplayError(_("It is not Black's turn"), 0); - return; - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) - ExitAnalyzeMode(); - - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == AnalyzeFile) - TruncateGame(); - - ResurrectChessProgram(); /* in case it isn't running */ - gameMode = MachinePlaysBlack; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - snprintf(buf, MSG_SIZ, "%s %s %s", gameInfo.white, _("vs."), gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - snprintf(buf, MSG_SIZ, "name %s\n", gameInfo.white); - SendToProgram(buf, &first); - } - if (first.sendTime) { - if (first.useColors) { - SendToProgram("white\n", &first); /*gnu kludge*/ - } - SendTimeRemaining(&first, FALSE); - } - if (first.useColors) { - SendToProgram("black\n", &first); // [HGM] book: 'go' sent separately - } - bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move - SetMachineThinkingEnables(); - first.maybeThinking = TRUE; - StartClocks(); - - if (appData.autoFlipView && flipView) { - flipView = !flipView; - DrawPosition(FALSE, NULL); - DisplayBothClocks(); // [HGM] logo: clocks might have to be exchanged; - } - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } -} - - -void -DisplayTwoMachinesTitle () -{ - char buf[MSG_SIZ]; - if (appData.matchGames > 0) { - if(appData.tourneyFile[0]) { - snprintf(buf, MSG_SIZ, "%s %s %s (%d/%d%s)", - gameInfo.white, _("vs."), gameInfo.black, - nextGame+1, appData.matchGames+1, - appData.tourneyType>0 ? "gt" : appData.tourneyType<0 ? "sw" : "rr"); - } else - if (first.twoMachinesColor[0] == 'w') { - snprintf(buf, MSG_SIZ, "%s %s %s (%d-%d-%d)", - gameInfo.white, _("vs."), gameInfo.black, - first.matchWins, second.matchWins, - matchGame - 1 - (first.matchWins + second.matchWins)); - } else { - snprintf(buf, MSG_SIZ, "%s %s %s (%d-%d-%d)", - gameInfo.white, _("vs."), gameInfo.black, - second.matchWins, first.matchWins, - matchGame - 1 - (first.matchWins + second.matchWins)); - } - } else { - snprintf(buf, MSG_SIZ, "%s %s %s", gameInfo.white, _("vs."), gameInfo.black); - } - DisplayTitle(buf); -} - -void -SettingsMenuIfReady () -{ - if (second.lastPing != second.lastPong) { - DisplayMessage("", _("Waiting for second chess program")); - ScheduleDelayedEvent(SettingsMenuIfReady, 10); // [HGM] fast: lowered from 1000 - return; - } - ThawUI(); - DisplayMessage("", ""); - SettingsPopUp(&second); -} - -int -WaitForEngine (ChessProgramState *cps, DelayedEventCallback retry) -{ - char buf[MSG_SIZ]; - if (cps->pr == NoProc) { - StartChessProgram(cps); - if (cps->protocolVersion == 1) { - retry(); - ScheduleDelayedEvent(retry, 1); // Do this also through timeout to avoid recursive calling of 'retry' - } else { - /* kludge: allow timeout for initial "feature" command */ - if(retry != TwoMachinesEventIfReady) FreezeUI(); - snprintf(buf, MSG_SIZ, _("Starting %s chess program"), _(cps->which)); - DisplayMessage("", buf); - ScheduleDelayedEvent(retry, FEATURE_TIMEOUT); - } - return 1; - } - return 0; -} - -void -TwoMachinesEvent P((void)) -{ - int i; - char buf[MSG_SIZ]; - ChessProgramState *onmove; - char *bookHit = NULL; - static int stalling = 0; - TimeMark now; - long wait; - - if (appData.noChessProgram) return; - - switch (gameMode) { - case TwoMachinesPlay: - return; - case MachinePlaysWhite: - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError(_("Wait until your turn,\nor select 'Move Now'."), 0); - return; - } - /* fall through */ - case BeginningOfGame: - case PlayFromGameFile: - case EndOfGame: - EditGameEvent(); - if (gameMode != EditGame) return; - break; - case EditPosition: - EditPositionDone(TRUE); - break; - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - break; - case EditGame: - default: - break; - } - -// forwardMostMove = currentMove; - TruncateGame(); // [HGM] vari: MachineWhite and MachineBlack do this... - startingEngine = TRUE; - - if(!ResurrectChessProgram()) return; /* in case first program isn't running (unbalances its ping due to InitChessProgram!) */ - - if(!first.initDone && GetDelayedEvent() == TwoMachinesEventIfReady) return; // [HGM] engine #1 still waiting for feature timeout - if(first.lastPing != first.lastPong) { // [HGM] wait till we are sure first engine has set up position - ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); - return; - } - if(!appData.epd) { - if(WaitForEngine(&second, TwoMachinesEventIfReady)) return; // (if needed:) started up second engine, so wait for features - - if(!SupportedVariant(second.variants, gameInfo.variant, gameInfo.boardWidth, - gameInfo.boardHeight, gameInfo.holdingsSize, second.protocolVersion, second.tidy)) { - startingEngine = matchMode = FALSE; - DisplayError("second engine does not play this", 0); - gameMode = TwoMachinesPlay; ModeHighlight(); // Needed to make sure menu item is unchecked - EditGameEvent(); // switch back to EditGame mode - return; - } - - if(!stalling) { - InitChessProgram(&second, FALSE); // unbalances ping of second engine - SendToProgram("force\n", &second); - stalling = 1; - ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); - return; - } - } - GetTimeMark(&now); // [HGM] matchpause: implement match pause after engine load - if(appData.matchPause>10000 || appData.matchPause<10) - appData.matchPause = 10000; /* [HGM] make pause adjustable */ - wait = SubtractTimeMarks(&now, &pauseStart); - if(wait < appData.matchPause) { - ScheduleDelayedEvent(TwoMachinesEventIfReady, appData.matchPause - wait); - return; - } - // we are now committed to starting the game - stalling = 0; - DisplayMessage("", ""); - if(!appData.epd) { - if (startedFromSetupPosition) { - SendBoard(&second, backwardMostMove); - if (appData.debugMode) { - fprintf(debugFP, "Two Machines\n"); - } - } - for (i = backwardMostMove; i < forwardMostMove; i++) { - SendMoveToProgram(i, &second); - } - } - - gameMode = TwoMachinesPlay; - pausing = startingEngine = FALSE; - ModeHighlight(); // [HGM] logo: this triggers display update of logos - SetGameInfo(); - DisplayTwoMachinesTitle(); - firstMove = TRUE; - if ((first.twoMachinesColor[0] == 'w') == WhiteOnMove(forwardMostMove)) { - onmove = &first; - } else { - onmove = &second; - } - if(appData.debugMode) fprintf(debugFP, "New game (%d): %s-%s (%c)\n", matchGame, first.tidy, second.tidy, first.twoMachinesColor[0]); - SendToProgram(first.computerString, &first); - if (first.sendName) { - snprintf(buf, MSG_SIZ, "name %s\n", second.tidy); - SendToProgram(buf, &first); - } - if(!appData.epd) { - SendToProgram(second.computerString, &second); - if (second.sendName) { - snprintf(buf, MSG_SIZ, "name %s\n", first.tidy); - SendToProgram(buf, &second); - } - } - - ResetClocks(); - if (!first.sendTime || !second.sendTime) { - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - } - if (onmove->sendTime) { - if (onmove->useColors) { - SendToProgram(onmove->other->twoMachinesColor, onmove); /*gnu kludge*/ - } - SendTimeRemaining(onmove, WhiteOnMove(forwardMostMove)); - } - if (onmove->useColors) { - SendToProgram(onmove->twoMachinesColor, onmove); - } - bookHit = SendMoveToBookUser(forwardMostMove-1, onmove, TRUE); // [HGM] book: send go or retrieve book move -// SendToProgram("go\n", onmove); - onmove->maybeThinking = TRUE; - SetMachineThinkingEnables(); - - StartClocks(); - - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.nodes = programStats.depth = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - safeStrCpy(bookMove, "move ", sizeof(bookMove)/sizeof(bookMove[0])); - strcat(bookMove, bookHit); - savedMessage = bookMove; // args for deferred call - savedState = onmove; - ScheduleDelayedEvent(DeferredBookMove, 1); - } -} - -void -TrainingEvent () -{ - if (gameMode == Training) { - SetTrainingModeOff(); - gameMode = PlayFromGameFile; - DisplayMessage("", _("Training mode off")); - } else { - gameMode = Training; - animateTraining = appData.animate; - - /* make sure we are not already at the end of the game */ - if (currentMove < forwardMostMove) { - SetTrainingModeOn(); - DisplayMessage("", _("Training mode on")); - } else { - gameMode = PlayFromGameFile; - DisplayError(_("Already at end of game"), 0); - } - } - ModeHighlight(); -} - -void -IcsClientEvent () -{ - if (!appData.icsActive) return; - switch (gameMode) { - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsIdle: - case BeginningOfGame: - case IcsExamining: - return; - - case EditGame: - break; - - case EditPosition: - EditPositionDone(TRUE); - break; - - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - break; - - default: - EditGameEvent(); - break; - } - - gameMode = IcsIdle; - ModeHighlight(); - return; -} - -void -EditGameEvent () -{ - int i; - - switch (gameMode) { - case Training: - SetTrainingModeOff(); - break; - case MachinePlaysWhite: - case MachinePlaysBlack: - case BeginningOfGame: - SendToProgram("force\n", &first); - if(gameMode == (forwardMostMove & 1 ? MachinePlaysBlack : MachinePlaysWhite)) { // engine is thinking - if (first.usePing) { // [HGM] always send ping when we might interrupt machine thinking - char buf[MSG_SIZ]; - abortEngineThink = TRUE; - snprintf(buf, MSG_SIZ, "ping %d\n", initPing = ++first.lastPing); - SendToProgram(buf, &first); - DisplayMessage("Aborting engine think", ""); - FreezeUI(); - } - } - SetUserThinkingEnables(); - break; - case PlayFromGameFile: - (void) StopLoadGameTimer(); - if (gameFileFP != NULL) { - gameFileFP = NULL; - } - break; - case EditPosition: - EditPositionDone(TRUE); - break; - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - SendToProgram("force\n", &first); - break; - case TwoMachinesPlay: - GameEnds(EndOfFile, NULL, GE_PLAYER); - ResurrectChessProgram(); - SetUserThinkingEnables(); - break; - case EndOfGame: - ResurrectChessProgram(); - break; - case IcsPlayingBlack: - case IcsPlayingWhite: - DisplayError(_("Warning: You are still playing a game"), 0); - break; - case IcsObserving: - DisplayError(_("Warning: You are still observing a game"), 0); - break; - case IcsExamining: - DisplayError(_("Warning: You are still examining a game"), 0); - break; - case IcsIdle: - break; - case EditGame: - default: - return; - } - - pausing = FALSE; - StopClocks(); - first.offeredDraw = second.offeredDraw = 0; - - if (gameMode == PlayFromGameFile) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayTitle(""); - } - - if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == EndOfGame) { - i = forwardMostMove; - while (i > currentMove) { - SendToProgram("undo\n", &first); - i--; - } - if(!adjustedClock) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayBothClocks(); - } - if (whiteFlag || blackFlag) { - whiteFlag = blackFlag = 0; - } - DisplayTitle(""); - } - - gameMode = EditGame; - ModeHighlight(); - SetGameInfo(); -} - -void -EditPositionEvent () -{ - int i; - if (gameMode == EditPosition) { - EditGameEvent(); - return; - } - - EditGameEvent(); - if (gameMode != EditGame) return; - - gameMode = EditPosition; - ModeHighlight(); - SetGameInfo(); - CopyBoard(rightsBoard, nullBoard); - if (currentMove > 0) - CopyBoard(boards[0], boards[currentMove]); - for(i=0; i=0; r--) for(f=BOARD_RGHT-1; f>=BOARD_LEFT; f--) { // first pass: Kings & e.p. - if(rightsBoard[r][f]) { - ChessSquare p = boards[0][r][f]; - if(p == (blackPlaysFirst ? WhitePawn : BlackPawn)) boards[0][EP_STATUS] = f; - else if(p == king) boards[0][CASTLING][2] = f; - else if(p == WHITE_TO_BLACK king) boards[0][CASTLING][5] = f; - else rightsBoard[r][f] = 2; // mark for second pass - } - } - for(r=BOARD_HEIGHT-1; r>=0; r--) for(f=BOARD_RGHT-1; f>=BOARD_LEFT; f--) { // second pass: Rooks - if(rightsBoard[r][f] == 2) { - ChessSquare p = boards[0][r][f]; - if(p == WhiteRook) boards[0][CASTLING][(f < boards[0][CASTLING][2])] = f; else - if(p == BlackRook) boards[0][CASTLING][(f < boards[0][CASTLING][5])+3] = f; - } - } - } - SendToProgram("force\n", &first); - if (blackPlaysFirst) { - safeStrCpy(moveList[0], "", sizeof(moveList[0])/sizeof(moveList[0][0])); - safeStrCpy(parseList[0], "", sizeof(parseList[0])/sizeof(parseList[0][0])); - currentMove = forwardMostMove = backwardMostMove = 1; - CopyBoard(boards[1], boards[0]); - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - } - SendBoard(&first, forwardMostMove); - if (appData.debugMode) { - fprintf(debugFP, "EditPosDone\n"); - } - DisplayTitle(""); - DisplayMessage("", ""); - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - gameMode = EditGame; - ModeHighlight(); - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - ClearHighlights(); /* [AS] */ -} - -/* Pause for `ms' milliseconds */ -/* !! Ugh, this is a kludge. Fix it sometime. --tpm */ -void -TimeDelay (long ms) -{ - TimeMark m1, m2; - - GetTimeMark(&m1); - do { - GetTimeMark(&m2); - } while (SubtractTimeMarks(&m2, &m1) < ms); -} - -/* !! Ugh, this is a kludge. Fix it sometime. --tpm */ -void -SendMultiLineToICS (char *buf) -{ - char temp[MSG_SIZ+1], *p; - int len; - - len = strlen(buf); - if (len > MSG_SIZ) - len = MSG_SIZ; - - strncpy(temp, buf, len); - temp[len] = 0; - - p = temp; - while (*p) { - if (*p == '\n' || *p == '\r') - *p = ' '; - ++p; - } - - strcat(temp, "\n"); - SendToICS(temp); - SendToPlayer(temp, strlen(temp)); -} - -void -SetWhiteToPlayEvent () -{ - if (gameMode == EditPosition) { - blackPlaysFirst = FALSE; - DisplayBothClocks(); /* works because currentMove is 0 */ - } else if (gameMode == IcsExamining) { - SendToICS(ics_prefix); - SendToICS("tomove white\n"); - } -} - -void -SetBlackToPlayEvent () -{ - if (gameMode == EditPosition) { - blackPlaysFirst = TRUE; - currentMove = 1; /* kludge */ - DisplayBothClocks(); - currentMove = 0; - } else if (gameMode == IcsExamining) { - SendToICS(ics_prefix); - SendToICS("tomove black\n"); - } -} - -void -EditPositionMenuEvent (ChessSquare selection, int x, int y) -{ - char buf[MSG_SIZ]; - ChessSquare piece = boards[0][y][x]; - static Board erasedBoard, currentBoard, menuBoard, nullBoard; - static int lastVariant; - int baseRank = BOARD_HEIGHT-1, hasRights = 0; - - if (gameMode != EditPosition && gameMode != IcsExamining) return; - - switch (selection) { - case ClearBoard: - fromX = fromY = killX = killY = kill2X = kill2Y = -1; // [HGM] abort any move entry in progress - MarkTargetSquares(1); - CopyBoard(currentBoard, boards[0]); - CopyBoard(menuBoard, initialPosition); - if (gameMode == IcsExamining && ics_type == ICS_FICS) { - SendToICS(ics_prefix); - SendToICS("bsetup clear\n"); - } else if (gameMode == IcsExamining && ics_type == ICS_ICC) { - SendToICS(ics_prefix); - SendToICS("clearboard\n"); - } else { - int nonEmpty = 0; - for (x = 0; x < BOARD_WIDTH; x++) { ChessSquare p = EmptySquare; - if(x == BOARD_LEFT-1 || x == BOARD_RGHT) p = (ChessSquare) 0; /* [HGM] holdings */ - for (y = 0; y < BOARD_HEIGHT; y++) { - if (gameMode == IcsExamining) { - if (boards[currentMove][y][x] != EmptySquare) { - snprintf(buf, MSG_SIZ, "%sx@%c%c\n", ics_prefix, - AAA + x, ONE + y); - SendToICS(buf); - } - } else if(boards[0][y][x] != DarkSquare) { - if(boards[0][y][x] != p) nonEmpty++; - boards[0][y][x] = p; - } - } - } - CopyBoard(rightsBoard, nullBoard); - if(gameMode != IcsExamining) { // [HGM] editpos: cycle trough boards - int r, i; - for(r = 0; r < BOARD_HEIGHT; r++) { - for(x = BOARD_LEFT; x < BOARD_RGHT; x++) { // create 'menu board' by removing duplicates - ChessSquare p = menuBoard[r][x]; - for(y = x + 1; y < BOARD_RGHT; y++) if(menuBoard[r][y] == p) menuBoard[r][y] = EmptySquare; - } - } - menuBoard[CASTLING][0] = menuBoard[CASTLING][3] = NoRights; // h-side Rook was deleted - DisplayMessage("Clicking clock again restores position", ""); - if(gameInfo.variant != lastVariant) lastVariant = gameInfo.variant, CopyBoard(erasedBoard, boards[0]); - if(!nonEmpty) { // asked to clear an empty board - CopyBoard(boards[0], menuBoard); - } else - if(CompareBoards(currentBoard, menuBoard)) { // asked to clear an empty board - CopyBoard(boards[0], initialPosition); - } else - if(CompareBoards(currentBoard, initialPosition) && !CompareBoards(currentBoard, erasedBoard) - && !CompareBoards(nullBoard, erasedBoard)) { - CopyBoard(boards[0], erasedBoard); - } else - CopyBoard(erasedBoard, currentBoard); - - for(i=0; i= BOARD_RGHT) break; // [HGM] holdings - snprintf(buf, MSG_SIZ, "%sx@%c%c\n", ics_prefix, AAA + x, ONE + y); - SendToICS(buf); - } else { - if(x < BOARD_LEFT || x >= BOARD_RGHT) { - if(x == BOARD_LEFT-2) { - if(y < BOARD_HEIGHT-1-gameInfo.holdingsSize) break; - boards[0][y][1] = 0; - } else - if(x == BOARD_RGHT+1) { - if(y >= gameInfo.holdingsSize) break; - boards[0][y][BOARD_WIDTH-2] = 0; - } else break; - } - boards[0][y][x] = EmptySquare; - DrawPosition(FALSE, boards[0]); - } - break; - - case PromotePiece: - if(piece >= (int)WhitePawn && piece < (int)WhiteMan || - piece >= (int)BlackPawn && piece < (int)BlackMan ) { - selection = (ChessSquare) (PROMOTED(piece)); - } else if(piece == EmptySquare) selection = WhiteSilver; - else selection = (ChessSquare)((int)piece - 1); - goto defaultlabel; - - case DemotePiece: - if(piece > (int)WhiteMan && piece <= (int)WhiteKing || - piece > (int)BlackMan && piece <= (int)BlackKing ) { - selection = (ChessSquare) (DEMOTED(piece)); - } else if(piece == EmptySquare) selection = BlackSilver; - else selection = (ChessSquare)((int)piece + 1); - goto defaultlabel; - - case WhiteQueen: - case BlackQueen: - if(gameInfo.variant == VariantShatranj || - gameInfo.variant == VariantXiangqi || - gameInfo.variant == VariantCourier || - gameInfo.variant == VariantASEAN || - gameInfo.variant == VariantMakruk ) - selection = (ChessSquare)((int)selection - (int)WhiteQueen + (int)WhiteFerz); - goto defaultlabel; - - case WhiteRook: - baseRank = 0; - case BlackRook: - if(y == baseRank && (x == BOARD_LEFT || x == BOARD_RGHT-1 || appData.fischerCastling)) hasRights = 1; - if(y == baseRank && (x == BOARD_WIDTH>>1 || appData.fischerCastling)) hasRights = 1; - goto defaultlabel; - - case WhiteKing: - baseRank = 0; - case BlackKing: - if(gameInfo.variant == VariantXiangqi) - selection = (ChessSquare)((int)selection - (int)WhiteKing + (int)WhiteWazir); - if(gameInfo.variant == VariantKnightmate) - selection = (ChessSquare)((int)selection - (int)WhiteKing + (int)WhiteUnicorn); - if(y == baseRank && (x == BOARD_WIDTH>>1 || appData.fischerCastling)) hasRights = 1; - default: - defaultlabel: - if (gameMode == IcsExamining) { - if (x < BOARD_LEFT || x >= BOARD_RGHT) break; // [HGM] holdings - snprintf(buf, MSG_SIZ, "%s%c@%c%c\n", ics_prefix, - PieceToChar(selection), AAA + x, ONE + y); - SendToICS(buf); - } else { - rightsBoard[y][x] = hasRights; - if(x < BOARD_LEFT || x >= BOARD_RGHT) { - int n; - if(x == BOARD_LEFT-2 && selection >= BlackPawn) { - n = PieceToNumber(selection - BlackPawn); - if(n >= gameInfo.holdingsSize) { n = 0; selection = BlackPawn; } - boards[0][BOARD_HEIGHT-1-n][0] = selection; - boards[0][BOARD_HEIGHT-1-n][1]++; - } else - if(x == BOARD_RGHT+1 && selection < BlackPawn) { - n = PieceToNumber(selection); - if(n >= gameInfo.holdingsSize) { n = 0; selection = WhitePawn; } - boards[0][n][BOARD_WIDTH-1] = selection; - boards[0][n][BOARD_WIDTH-2]++; - } - } else - boards[0][y][x] = selection; - DrawPosition(TRUE, boards[0]); - ClearHighlights(); - fromX = fromY = -1; - } - break; - } -} - - -void -DropMenuEvent (ChessSquare selection, int x, int y) -{ - ChessMove moveType; - - switch (gameMode) { - case IcsPlayingWhite: - case MachinePlaysBlack: - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - moveType = WhiteDrop; - break; - case IcsPlayingBlack: - case MachinePlaysWhite: - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - moveType = BlackDrop; - break; - case EditGame: - moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; - break; - default: - return; - } - - if (moveType == BlackDrop && selection < BlackPawn) { - selection = (ChessSquare) ((int) selection - + (int) BlackPawn - (int) WhitePawn); - } - if (boards[currentMove][y][x] != EmptySquare) { - DisplayMoveError(_("That square is occupied")); - return; - } - - FinishMove(moveType, (int) selection, DROP_RANK, x, y, NULLCHAR); -} - -void -AcceptEvent () -{ - /* Accept a pending offer of any kind from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("accept\n"); - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { - TruncateGame(); - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; - } else { - DisplayError(_("There is no pending offer on this move"), 0); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } else { - /* Not used for offers from chess program */ - } -} - -void -DeclineEvent () -{ - /* Decline a pending offer of any kind from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("decline\n"); - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { -#ifdef NOTDEF - AppendComment(cmailOldMove, "Draw declined", TRUE); - DisplayComment(cmailOldMove - 1, "Draw declined"); -#endif /*NOTDEF*/ - } else { - DisplayError(_("There is no pending offer on this move"), 0); - } - } else { - /* Not used for offers from chess program */ - } -} - -void -RematchEvent () -{ - /* Issue ICS rematch command */ - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("rematch\n"); - } -} - -void -CallFlagEvent () -{ - /* Call your opponent's flag (claim a win on time) */ - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } else { - switch (gameMode) { - default: - return; - case MachinePlaysWhite: - if (whiteFlag) { - if (blackFlag) - GameEnds(GameIsDrawn, "Both players ran out of time", - GE_PLAYER); - else - GameEnds(BlackWins, "Black wins on time", GE_PLAYER); - } else { - DisplayError(_("Your opponent is not out of time"), 0); - } - break; - case MachinePlaysBlack: - if (blackFlag) { - if (whiteFlag) - GameEnds(GameIsDrawn, "Both players ran out of time", - GE_PLAYER); - else - GameEnds(WhiteWins, "White wins on time", GE_PLAYER); - } else { - DisplayError(_("Your opponent is not out of time"), 0); - } - break; - } - } -} - -void -ClockClick (int which) -{ // [HGM] code moved to back-end from winboard.c - if(which) { // black clock - if (gameMode == EditPosition || gameMode == IcsExamining) { - if(!appData.pieceMenu && blackPlaysFirst) EditPositionMenuEvent(ClearBoard, 0, 0); - SetBlackToPlayEvent(); - } else if ((gameMode == AnalyzeMode || gameMode == EditGame || - gameMode == MachinePlaysBlack && PosFlags(0) & F_NULL_MOVE && !blackFlag && !shiftKey) && WhiteOnMove(currentMove)) { - UserMoveEvent((int)EmptySquare, DROP_RANK, 0, 0, 0); // [HGM] multi-move: if not out of time, enters null move - } else if (shiftKey) { - AdjustClock(which, -1); - } else if (gameMode == IcsPlayingWhite || - gameMode == MachinePlaysBlack) { - CallFlagEvent(); - } - } else { // white clock - if (gameMode == EditPosition || gameMode == IcsExamining) { - if(!appData.pieceMenu && !blackPlaysFirst) EditPositionMenuEvent(ClearBoard, 0, 0); - SetWhiteToPlayEvent(); - } else if ((gameMode == AnalyzeMode || gameMode == EditGame || - gameMode == MachinePlaysWhite && PosFlags(0) & F_NULL_MOVE && !whiteFlag && !shiftKey) && !WhiteOnMove(currentMove)) { - UserMoveEvent((int)EmptySquare, DROP_RANK, 0, 0, 0); // [HGM] multi-move - } else if (shiftKey) { - AdjustClock(which, -1); - } else if (gameMode == IcsPlayingBlack || - gameMode == MachinePlaysWhite) { - CallFlagEvent(); - } - } -} - -void -DrawEvent () -{ - /* Offer draw or accept pending draw offer from opponent */ - - if (appData.icsActive) { - /* Note: tournament rules require draw offers to be - made after you make your move but before you punch - your clock. Currently ICS doesn't let you do that; - instead, you immediately punch your clock after making - a move, but you can offer a draw at any time. */ - - SendToICS(ics_prefix); - SendToICS("draw\n"); - userOfferedDraw = TRUE; // [HGM] drawclaim: also set flag in ICS play - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; - } else if (currentMove == cmailOldMove + 1) { - char *offer = WhiteOnMove(cmailOldMove) ? - "White offers a draw" : "Black offers a draw"; - AppendComment(currentMove, offer, TRUE); - DisplayComment(currentMove - 1, offer); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_DRAW; - } else { - DisplayError(_("You must make your move before offering a draw"), 0); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } else if (first.offeredDraw) { - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - } else { - if (first.sendDrawOffers) { - SendToProgram("draw\n", &first); - userOfferedDraw = TRUE; - } - } -} - -void -AdjournEvent () -{ - /* Offer Adjourn or accept pending Adjourn offer from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("adjourn\n"); - } else { - /* Currently GNU Chess doesn't offer or accept Adjourns */ - } -} - - -void -AbortEvent () -{ - /* Offer Abort or accept pending Abort offer from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("abort\n"); - } else { - GameEnds(GameUnfinished, "Game aborted", GE_PLAYER); - } -} - -void -ResignEvent () -{ - /* Resign. You can do this even if it's not your turn. */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("resign\n"); - } else { - switch (gameMode) { - case MachinePlaysWhite: - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - break; - case MachinePlaysBlack: - GameEnds(BlackWins, "White resigns", GE_PLAYER); - break; - case EditGame: - if (cmailMsgLoaded) { - TruncateGame(); - if (WhiteOnMove(cmailOldMove)) { - GameEnds(BlackWins, "White resigns", GE_PLAYER); - } else { - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - } - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_RESIGN; - } - break; - default: - break; - } - } -} - - -void -StopObservingEvent () -{ - /* Stop observing current games */ - SendToICS(ics_prefix); - SendToICS("unobserve\n"); -} - -void -StopExaminingEvent () -{ - /* Stop observing current game */ - SendToICS(ics_prefix); - SendToICS("unexamine\n"); -} - -void -ForwardInner (int target) -{ - int limit; int oldSeekGraphUp = seekGraphUp; - - if (appData.debugMode) - fprintf(debugFP, "ForwardInner(%d), current %d, forward %d\n", - target, currentMove, forwardMostMove); - - if (gameMode == EditPosition) - return; - - seekGraphUp = FALSE; - MarkTargetSquares(1); - fromX = fromY = killX = killY = kill2X = kill2Y = -1; // [HGM] abort any move entry in progress - - if (gameMode == PlayFromGameFile && !pausing) - PauseEvent(); - - if (gameMode == IcsExamining && pausing) - limit = pauseExamForwardMostMove; - else - limit = forwardMostMove; - - if (target > limit) target = limit; - - if (target > 0 && moveList[target - 1][0]) { - int fromX, fromY, toX, toY; - toX = moveList[target - 1][2] - AAA; - toY = moveList[target - 1][3] - ONE; - if (moveList[target - 1][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[target - 1][0] - AAA; - fromY = moveList[target - 1][1] - ONE; - if (target == currentMove + 1) { - if(moveList[target - 1][4] == ';') { // multi-leg - killX = moveList[target - 1][5] - AAA; - killY = moveList[target - 1][6] - ONE; - } - AnimateMove(boards[currentMove], fromX, fromY, toX, toY); - killX = killY = -1; - } - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - } - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == Training || gameMode == PlayFromGameFile || - gameMode == AnalyzeFile) { - while (currentMove < target) { - if(second.analyzing) SendMoveToProgram(currentMove, &second); - SendMoveToProgram(currentMove++, &first); - } - } else { - currentMove = target; - } - - if (gameMode == EditGame || gameMode == EndOfGame) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - } - DisplayBothClocks(); - DisplayMove(currentMove - 1); - DrawPosition(oldSeekGraphUp, boards[currentMove]); - HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); - if ( !matchMode && gameMode != Training) { // [HGM] PV info: routine tests if empty - DisplayComment(currentMove - 1, commentList[currentMove]); - } - ClearMap(); // [HGM] exclude: invalidate map -} - - -void -ForwardEvent () -{ - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("forward\n"); - } else { - ForwardInner(currentMove + 1); - } -} - -void -ToEndEvent () -{ - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* to optimze, we temporarily turn off analysis mode while we feed - * the remaining moves to the engine. Otherwise we get analysis output - * after each move. - */ - if (first.analysisSupport) { - SendToProgram("exit\nforce\n", &first); - first.analyzing = FALSE; - } - } - - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("forward 999999\n"); - } else { - ForwardInner(forwardMostMove); - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* we have fed all the moves, so reactivate analysis mode */ - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - } -} - -void -BackwardInner (int target) -{ - int full_redraw = TRUE; /* [AS] Was FALSE, had to change it! */ - - if (appData.debugMode) - fprintf(debugFP, "BackwardInner(%d), current %d, forward %d\n", - target, currentMove, forwardMostMove); - - if (gameMode == EditPosition) return; - seekGraphUp = FALSE; - MarkTargetSquares(1); - fromX = fromY = killX = killY = kill2X = kill2Y = -1; // [HGM] abort any move entry in progress - if (currentMove <= backwardMostMove) { - ClearHighlights(); - DrawPosition(full_redraw, boards[currentMove]); - return; - } - if (gameMode == PlayFromGameFile && !pausing) - PauseEvent(); - - if (moveList[target][0]) { - int fromX, fromY, toX, toY; - toX = moveList[target][2] - AAA; - toY = moveList[target][3] - ONE; - if (moveList[target][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[target][0] - AAA; - fromY = moveList[target][1] - ONE; - if (target == currentMove - 1) { - AnimateMove(boards[currentMove], toX, toY, fromX, fromY); - } - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - } - if (gameMode == EditGame || gameMode==AnalyzeMode || - gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { - while (currentMove > target) { - if(moveList[currentMove-1][1] == '@' && moveList[currentMove-1][0] == '@') { - // null move cannot be undone. Reload program with move history before it. - int i; - for(i=target; i>backwardMostMove; i--) { // seek back to start or previous null move - if(moveList[i-1][1] == '@' && moveList[i-1][0] == '@') break; - } - SendBoard(&first, i); - if(second.analyzing) SendBoard(&second, i); - for(currentMove=i; currentMove= forwardMostMove) to = forwardMostMove; - if (to <= backwardMostMove) to = backwardMostMove; - if (to < currentMove) { - BackwardInner(to); - } else { - ForwardInner(to); - } -} - -void -RevertEvent (Boolean annotate) -{ - if(PopTail(annotate)) { // [HGM] vari: restore old game tail - return; - } - if (gameMode != IcsExamining) { - DisplayError(_("You are not examining a game"), 0); - return; - } - if (pausing) { - DisplayError(_("You can't revert while pausing"), 0); - return; - } - SendToICS(ics_prefix); - SendToICS("revert\n"); -} - -void -RetractMoveEvent () -{ - switch (gameMode) { - case MachinePlaysWhite: - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError(_("Wait until your turn,\nor select 'Move Now'."), 0); - return; - } - if (forwardMostMove < 2) return; - currentMove = forwardMostMove = forwardMostMove - 2; - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayBothClocks(); - DisplayMove(currentMove - 1); - ClearHighlights();/*!! could figure this out*/ - DrawPosition(TRUE, boards[currentMove]); /* [AS] Changed to full redraw! */ - SendToProgram("remove\n", &first); - /*first.maybeThinking = TRUE;*/ /* GNU Chess does not ponder here */ - break; - - case BeginningOfGame: - default: - break; - - case IcsPlayingWhite: - case IcsPlayingBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == IcsPlayingWhite)) { - SendToICS(ics_prefix); - SendToICS("takeback 2\n"); - } else { - SendToICS(ics_prefix); - SendToICS("takeback 1\n"); - } - break; - } -} - -void -MoveNowEvent () -{ - ChessProgramState *cps; - - switch (gameMode) { - case MachinePlaysWhite: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("It is your turn"), 0); - return; - } - cps = &first; - break; - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("It is your turn"), 0); - return; - } - cps = &first; - break; - case TwoMachinesPlay: - if (WhiteOnMove(forwardMostMove) == - (first.twoMachinesColor[0] == 'w')) { - cps = &first; - } else { - cps = &second; - } - break; - case BeginningOfGame: - default: - return; - } - SendToProgram("?\n", cps); -} - -void -TruncateGameEvent () -{ - EditGameEvent(); - if (gameMode != EditGame) return; - TruncateGame(); -} - -void -TruncateGame () -{ - CleanupTail(); // [HGM] vari: only keep current variation if we explicitly truncate - if (forwardMostMove > currentMove) { - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - gameInfo.result = GameUnfinished; - } - forwardMostMove = currentMove; - HistorySet(parseList, backwardMostMove, forwardMostMove, - currentMove-1); - } -} - -void -HintEvent () -{ - if (appData.noChessProgram) return; - switch (gameMode) { - case MachinePlaysWhite: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn."), 0); - return; - } - break; - case BeginningOfGame: - case MachinePlaysBlack: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn."), 0); - return; - } - break; - default: - DisplayError(_("No hint available"), 0); - return; - } - SendToProgram("hint\n", &first); - hintRequested = TRUE; -} - -int -SaveSelected (FILE *g, int dummy, char *dummy2) -{ - ListGame * lg = (ListGame *) gameList.head; - int nItem, cnt=0; - FILE *f; - - if( !(f = GameFile()) || ((ListGame *) gameList.tailPred)->number <= 0 ) { - DisplayError(_("Game list not loaded or empty"), 0); - return 0; - } - - creatingBook = TRUE; // suppresses stuff during load game - - /* Get list size */ - for (nItem = 1; nItem <= ((ListGame *) gameList.tailPred)->number; nItem++){ - if(lg->position >= 0) { // selected? - LoadGame(f, nItem, "", TRUE); - SaveGamePGN2(g); // leaves g open - cnt++; DoEvents(); - } - lg = (ListGame *) lg->node.succ; - } - - fclose(g); - creatingBook = FALSE; - - return cnt; -} - -void -CreateBookEvent () -{ - ListGame * lg = (ListGame *) gameList.head; - FILE *f, *g; - int nItem; - static int secondTime = FALSE; - - if( !(f = GameFile()) || ((ListGame *) gameList.tailPred)->number <= 0 ) { - DisplayError(_("Game list not loaded or empty"), 0); - return; - } - - if(!secondTime && (g = fopen(appData.polyglotBook, "r"))) { - fclose(g); - secondTime++; - DisplayNote(_("Book file exists! Try again for overwrite.")); - return; - } - - creatingBook = TRUE; - secondTime = FALSE; - - /* Get list size */ - for (nItem = 1; nItem <= ((ListGame *) gameList.tailPred)->number; nItem++){ - if(lg->position >= 0) { - LoadGame(f, nItem, "", TRUE); - AddGameToBook(TRUE); - DoEvents(); - } - lg = (ListGame *) lg->node.succ; - } - - creatingBook = FALSE; - FlushBook(); -} - -void -BookEvent () -{ - if (appData.noChessProgram) return; - switch (gameMode) { - case MachinePlaysWhite: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn."), 0); - return; - } - break; - case BeginningOfGame: - case MachinePlaysBlack: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn."), 0); - return; - } - break; - case EditPosition: - EditPositionDone(TRUE); - break; - case TwoMachinesPlay: - return; - default: - break; - } - SendToProgram("bk\n", &first); - bookOutput[0] = NULLCHAR; - bookRequested = TRUE; -} - -void -AboutGameEvent () -{ - char *tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); -} - -/* end button procedures */ - -void -PrintPosition (FILE *fp, int move) -{ - int i, j; - - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - for (j = BOARD_LEFT; j < BOARD_RGHT; j++) { - char c = PieceToChar(boards[move][i][j]); - fputc(c == '?' ? '.' : c, fp); - fputc(j == BOARD_RGHT - 1 ? '\n' : ' ', fp); - } - } - if ((gameMode == EditPosition) ? !blackPlaysFirst : (move % 2 == 0)) - fprintf(fp, "white to play\n"); - else - fprintf(fp, "black to play\n"); -} - -void -PrintOpponents (FILE *fp) -{ - if (gameInfo.white != NULL) { - fprintf(fp, "\t%s vs. %s\n", gameInfo.white, gameInfo.black); - } else { - fprintf(fp, "\n"); - } -} - -/* Find last component of program's own name, using some heuristics */ -void -TidyProgramName (char *prog, char *host, char buf[MSG_SIZ]) -{ - char *p, *q, c; - int local = (strcmp(host, "localhost") == 0); - while (!local && (p = strchr(prog, ';')) != NULL) { - p++; - while (*p == ' ') p++; - prog = p; - } - if (*prog == '"' || *prog == '\'') { - q = strchr(prog + 1, *prog); - } else { - q = strchr(prog, ' '); - } - if (q == NULL) q = prog + strlen(prog); - p = q; - while (p >= prog && *p != '/' && *p != '\\') p--; - p++; - if(p == prog && *p == '"') p++; - c = *q; *q = 0; - if (q - p >= 4 && StrCaseCmp(q - 4, ".exe") == 0) *q = c, q -= 4; else *q = c; - memcpy(buf, p, q - p); - buf[q - p] = NULLCHAR; - if (!local) { - strcat(buf, "@"); - strcat(buf, host); - } -} - -char * -TimeControlTagValue () -{ - char buf[MSG_SIZ]; - if (!appData.clockMode) { - safeStrCpy(buf, "-", sizeof(buf)/sizeof(buf[0])); - } else if (movesPerSession > 0) { - snprintf(buf, MSG_SIZ, "%d/%ld", movesPerSession, timeControl/1000); - } else if (timeIncrement == 0) { - snprintf(buf, MSG_SIZ, "%ld", timeControl/1000); - } else { - snprintf(buf, MSG_SIZ, "%ld+%ld", timeControl/1000, timeIncrement/1000); - } - return StrSave(buf); -} - -void -SetGameInfo () -{ - /* This routine is used only for certain modes */ - VariantClass v = gameInfo.variant; - ChessMove r = GameUnfinished; - char *p = NULL; - - if(keepInfo) return; - - if(gameMode == EditGame) { // [HGM] vari: do not erase result on EditGame - r = gameInfo.result; - p = gameInfo.resultDetails; - gameInfo.resultDetails = NULL; - } - ClearGameInfo(&gameInfo); - gameInfo.variant = v; - - switch (gameMode) { - case MachinePlaysWhite: - gameInfo.event = StrSave( appData.pgnEventHeader ); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(first.tidy); - gameInfo.black = StrSave(UserName()); - gameInfo.timeControl = TimeControlTagValue(); - break; - - case MachinePlaysBlack: - gameInfo.event = StrSave( appData.pgnEventHeader ); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(UserName()); - gameInfo.black = StrSave(first.tidy); - gameInfo.timeControl = TimeControlTagValue(); - break; - - case TwoMachinesPlay: - gameInfo.event = StrSave( appData.pgnEventHeader ); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - if (roundNr > 0) { - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%d", roundNr); - gameInfo.round = StrSave(buf); - } else { - gameInfo.round = StrSave("-"); - } - if (first.twoMachinesColor[0] == 'w') { - gameInfo.white = StrSave(appData.pgnName[0][0] ? appData.pgnName[0] : first.tidy); - gameInfo.black = StrSave(appData.pgnName[1][0] ? appData.pgnName[1] : second.tidy); - } else { - gameInfo.white = StrSave(appData.pgnName[1][0] ? appData.pgnName[1] : second.tidy); - gameInfo.black = StrSave(appData.pgnName[0][0] ? appData.pgnName[0] : first.tidy); - } - gameInfo.timeControl = TimeControlTagValue(); - break; - - case EditGame: - gameInfo.event = StrSave("Edited game"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("-"); - gameInfo.black = StrSave("-"); - gameInfo.result = r; - gameInfo.resultDetails = p; - break; - - case EditPosition: - gameInfo.event = StrSave("Edited position"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("-"); - gameInfo.black = StrSave("-"); - break; - - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsExamining: - break; - - case PlayFromGameFile: - gameInfo.event = StrSave("Game from non-PGN file"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("?"); - gameInfo.black = StrSave("?"); - break; - - default: - break; - } -} - -void -ReplaceComment (int index, char *text) -{ - int len; - char *p; - float score; - - if(index && sscanf(text, "%f/%d", &score, &len) == 2 && - pvInfoList[index-1].depth == len && - fabs(pvInfoList[index-1].score - score*100.) < 0.5 && - (p = strchr(text, '\n'))) text = p; // [HGM] strip off first line with PV info, if any - while (*text == '\n') text++; - len = strlen(text); - while (len > 0 && text[len - 1] == '\n') len--; - - if (commentList[index] != NULL) - free(commentList[index]); - - if (len == 0) { - commentList[index] = NULL; - return; - } - if( *text == '{' && strchr(text, '}') || // [HGM] braces: if certainy malformed, put braces - *text == '[' && strchr(text, ']') || // otherwise hope the user knows what he is doing - *text == '(' && strchr(text, ')')) { // (perhaps check if this parses as comment-only?) - commentList[index] = (char *) malloc(len + 2); - strncpy(commentList[index], text, len); - commentList[index][len] = '\n'; - commentList[index][len + 1] = NULLCHAR; - } else { - // [HGM] braces: if text does not start with known OK delimiter, put braces around it. - char *p; - commentList[index] = (char *) malloc(len + 7); - safeStrCpy(commentList[index], "{\n", 3); - safeStrCpy(commentList[index]+2, text, len+1); - commentList[index][len+2] = NULLCHAR; - while(p = strchr(commentList[index], '}')) *p = ')'; // kill all } to make it one comment - strcat(commentList[index], "\n}\n"); - } -} - -void -CrushCRs (char *text) -{ - char *p = text; - char *q = text; - char ch; - - do { - ch = *p++; - if (ch == '\r') continue; - *q++ = ch; - } while (ch != '\0'); -} - -void -AppendComment (int index, char *text, Boolean addBraces) -/* addBraces tells if we should add {} */ -{ - int oldlen, len; - char *old; - -if(appData.debugMode) fprintf(debugFP, "Append: in='%s' %d\n", text, addBraces); - if(addBraces == 3) addBraces = 0; else // force appending literally - text = GetInfoFromComment( index, text ); /* [HGM] PV time: strip PV info from comment */ - - CrushCRs(text); - while (*text == '\n') text++; - len = strlen(text); - while (len > 0 && text[len - 1] == '\n') len--; - text[len] = NULLCHAR; - - if (len == 0) return; - - if (commentList[index] != NULL) { - Boolean addClosingBrace = addBraces; - old = commentList[index]; - oldlen = strlen(old); - while(commentList[index][oldlen-1] == '\n') - commentList[index][--oldlen] = NULLCHAR; - commentList[index] = (char *) malloc(oldlen + len + 6); // might waste 4 - safeStrCpy(commentList[index], old, oldlen + len + 6); - free(old); - // [HGM] braces: join "{A\n}\n" + "{\nB}" as "{A\nB\n}" - if(commentList[index][oldlen-1] == '}' && (text[0] == '{' || addBraces == TRUE)) { - if(addBraces == TRUE) addBraces = FALSE; else { text++; len--; } - while (*text == '\n') { text++; len--; } - commentList[index][--oldlen] = NULLCHAR; - } - if(addBraces) strcat(commentList[index], addBraces == 2 ? "\n(" : "\n{\n"); - else strcat(commentList[index], "\n"); - strcat(commentList[index], text); - if(addClosingBrace) strcat(commentList[index], addClosingBrace == 2 ? ")\n" : "\n}\n"); - else strcat(commentList[index], "\n"); - } else { - commentList[index] = (char *) malloc(len + 6); // perhaps wastes 4... - if(addBraces) - safeStrCpy(commentList[index], addBraces == 2 ? "(" : "{\n", 3); - else commentList[index][0] = NULLCHAR; - strcat(commentList[index], text); - strcat(commentList[index], addBraces == 2 ? ")\n" : "\n"); - if(addBraces == TRUE) strcat(commentList[index], "}\n"); - } -} - -static char * -FindStr (char * text, char * sub_text) -{ - char * result = strstr( text, sub_text ); - - if( result != NULL ) { - result += strlen( sub_text ); - } - - return result; -} - -/* [AS] Try to extract PV info from PGN comment */ -/* [HGM] PV time: and then remove it, to prevent it appearing twice */ -char * -GetInfoFromComment (int index, char * text) -{ - char * sep = text, *p; - - if( text != NULL && index > 0 ) { - int score = 0; - int depth = 0; - int time = -1, sec = 0, deci; - char * s_eval = FindStr( text, "[%eval " ); - char * s_emt = FindStr( text, "[%emt " ); -#if 0 - if( s_eval != NULL || s_emt != NULL ) { -#else - if(0) { // [HGM] this code is not finished, and could actually be detrimental -#endif - /* New style */ - char delim; - - if( s_eval != NULL ) { - if( sscanf( s_eval, "%d,%d%c", &score, &depth, &delim ) != 3 ) { - return text; - } - - if( delim != ']' ) { - return text; - } - } - - if( s_emt != NULL ) { - } - return text; - } - else { - /* We expect something like: [+|-]nnn.nn/dd */ - int score_lo = 0; - - if(*text != '{') return text; // [HGM] braces: must be normal comment - - sep = strchr( text, '/' ); - if( sep == NULL || sep < (text+4) ) { - return text; - } - - p = text; - if(!strncmp(p+1, "final score ", 12)) p += 12, index++; else - if(p[1] == '(') { // comment starts with PV - p = strchr(p, ')'); // locate end of PV - if(p == NULL || sep < p+5) return text; - // at this point we have something like "{(.*) +0.23/6 ..." - p = text; while(*++p != ')') p[-1] = *p; p[-1] = ')'; - *p = '\n'; while(*p == ' ' || *p == '\n') p++; *--p = '{'; - // we now moved the brace to behind the PV: "(.*) {+0.23/6 ..." - } - time = -1; sec = -1; deci = -1; - if( sscanf( p+1, "%d.%d/%d %d:%d", &score, &score_lo, &depth, &time, &sec ) != 5 && - sscanf( p+1, "%d.%d/%d %d.%d", &score, &score_lo, &depth, &time, &deci ) != 5 && - sscanf( p+1, "%d.%d/%d %d", &score, &score_lo, &depth, &time ) != 4 && - sscanf( p+1, "%d.%d/%d", &score, &score_lo, &depth ) != 3 ) { - return text; - } - - if( score_lo < 0 || score_lo >= 100 ) { - return text; - } - - if(sec >= 0) time = 600*time + 10*sec; else - if(deci >= 0) time = 10*time + deci; else time *= 10; // deci-sec - - score = score > 0 || !score & p[1] != '-' ? score*100 + score_lo : score*100 - score_lo; - - /* [HGM] PV time: now locate end of PV info */ - while( *++sep >= '0' && *sep <= '9'); // strip depth - if(time >= 0) - while( *++sep >= '0' && *sep <= '9' || *sep == '\n'); // strip time - if(sec >= 0) - while( *++sep >= '0' && *sep <= '9'); // strip seconds - if(deci >= 0) - while( *++sep >= '0' && *sep <= '9'); // strip fractional seconds - while(*sep == ' ' || *sep == '\n' || *sep == '\r') sep++; - } - - if( depth <= 0 ) { - return text; - } - - if( time < 0 ) { - time = -1; - } - - pvInfoList[index-1].depth = depth; - pvInfoList[index-1].score = score; - pvInfoList[index-1].time = 10*time; // centi-sec - if(*sep == '}') *sep = 0; else *--sep = '{'; - if(p != text) { - while(*p++ = *sep++) - ; - sep = text; - } // squeeze out space between PV and comment, and return both - } - return sep; -} - -void -SendToProgram (char *message, ChessProgramState *cps) -{ - int count, outCount, error; - char buf[MSG_SIZ]; - - if (cps->pr == NoProc) return; - Attention(cps); - - if (appData.debugMode) { - TimeMark now; - GetTimeMark(&now); - fprintf(debugFP, "%ld >%-6s: %s", - SubtractTimeMarks(&now, &programStartTime), - cps->which, message); - if(serverFP) - fprintf(serverFP, "%ld >%-6s: %s", - SubtractTimeMarks(&now, &programStartTime), - cps->which, message), fflush(serverFP); - } - - count = strlen(message); - outCount = OutputToProcess(cps->pr, message, count, &error); - if (outCount < count && !exiting - && !endingGame) { /* [HGM] crash: to not hang GameEnds() writing to deceased engines */ - if(!cps->initDone) return; // [HGM] should not generate fatal error during engine load - snprintf(buf, MSG_SIZ, _("Error writing to %s chess program"), _(cps->which)); - if(gameInfo.resultDetails==NULL) { /* [HGM] crash: if game in progress, give reason for abort */ - if((signed char)boards[forwardMostMove][EP_STATUS] <= EP_DRAWS) { - snprintf(buf, MSG_SIZ, _("%s program exits in draw position (%s)"), _(cps->which), cps->program); - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; GameEnds(GameIsDrawn, buf, GE_XBOARD); return; } - gameInfo.result = GameIsDrawn; /* [HGM] accept exit as draw claim */ - } else { - ChessMove res = cps->twoMachinesColor[0]=='w' ? BlackWins : WhiteWins; - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; GameEnds(res, buf, GE_XBOARD); return; } - gameInfo.result = res; - } - gameInfo.resultDetails = StrSave(buf); - } - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; return; } - if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, error, 1); else errorExitStatus = 1; - } -} - -void -ReceiveFromProgram (InputSourceRef isr, VOIDSTAR closure, char *message, int count, int error) -{ - char *end_str; - char buf[MSG_SIZ]; - ChessProgramState *cps = (ChessProgramState *)closure; - - if (isr != cps->isr) return; /* Killed intentionally */ - if (count <= 0) { - if (count == 0) { - RemoveInputSource(cps->isr); - snprintf(buf, MSG_SIZ, _("Error: %s chess program (%s) exited unexpectedly"), - _(cps->which), cps->program); - if(LoadError(cps->userError ? NULL : buf, cps)) return; // [HGM] should not generate fatal error during engine load - if(gameInfo.resultDetails==NULL) { /* [HGM] crash: if game in progress, give reason for abort */ - if((signed char)boards[forwardMostMove][EP_STATUS] <= EP_DRAWS) { - snprintf(buf, MSG_SIZ, _("%s program exits in draw position (%s)"), _(cps->which), cps->program); - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; GameEnds(GameIsDrawn, buf, GE_XBOARD); return; } - gameInfo.result = GameIsDrawn; /* [HGM] accept exit as draw claim */ - } else { - ChessMove res = cps->twoMachinesColor[0]=='w' ? BlackWins : WhiteWins; - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; GameEnds(res, buf, GE_XBOARD); return; } - gameInfo.result = res; - } - gameInfo.resultDetails = StrSave(buf); - } - if(matchMode && appData.tourneyFile[0]) { cps->pr = NoProc; return; } - if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, 0, 1); else errorExitStatus = 1; - } else { - snprintf(buf, MSG_SIZ, _("Error reading from %s chess program (%s)"), - _(cps->which), cps->program); - RemoveInputSource(cps->isr); - - /* [AS] Program is misbehaving badly... kill it */ - if( count == -2 ) { - DestroyChildProcess( cps->pr, 9 ); - cps->pr = NoProc; - } - - if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, error, 1); else errorExitStatus = 1; - } - return; - } - - if ((end_str = strchr(message, '\r')) != NULL) - *end_str = NULLCHAR; - if ((end_str = strchr(message, '\n')) != NULL) - *end_str = NULLCHAR; - - if (appData.debugMode) { - TimeMark now; int print = 1; - char *quote = ""; char c; int i; - - if(appData.engineComments != 1) { /* [HGM] debug: decide if protocol-violating output is written */ - char start = message[0]; - if(start >='A' && start <= 'Z') start += 'a' - 'A'; // be tolerant to capitalizing - if(sscanf(message, "%d%c%d%d%d", &i, &c, &i, &i, &i) != 5 && - sscanf(message, "move %c", &c)!=1 && sscanf(message, "offer%c", &c)!=1 && - sscanf(message, "resign%c", &c)!=1 && sscanf(message, "feature %c", &c)!=1 && - sscanf(message, "error %c", &c)!=1 && sscanf(message, "illegal %c", &c)!=1 && - sscanf(message, "tell%c", &c)!=1 && sscanf(message, "0-1 %c", &c)!=1 && - sscanf(message, "1-0 %c", &c)!=1 && sscanf(message, "1/2-1/2 %c", &c)!=1 && - sscanf(message, "setboard %c", &c)!=1 && sscanf(message, "setup %c", &c)!=1 && - sscanf(message, "hint: %c", &c)!=1 && - sscanf(message, "pong %c", &c)!=1 && start != '#') { - quote = appData.engineComments == 2 ? "# " : "### NON-COMPLIANT! ### "; - print = (appData.engineComments >= 2); - } - message[0] = start; // restore original message - } - if(print) { - GetTimeMark(&now); - fprintf(debugFP, "%ld <%-6s: %s%s\n", - SubtractTimeMarks(&now, &programStartTime), cps->which, - quote, - message); - if(serverFP) - fprintf(serverFP, "%ld <%-6s: %s%s\n", - SubtractTimeMarks(&now, &programStartTime), cps->which, - quote, - message), fflush(serverFP); - } - } - - /* [DM] if icsEngineAnalyze is active we block all whisper and kibitz output, because nobody want to see this */ - if (appData.icsEngineAnalyze) { - if (strstr(message, "whisper") != NULL || - strstr(message, "kibitz") != NULL || - strstr(message, "tellics") != NULL) return; - } - - HandleMachineMove(message, cps); -} - - -void -SendTimeControl (ChessProgramState *cps, int mps, long tc, int inc, int sd, int st) -{ - char buf[MSG_SIZ]; - int seconds; - - if( timeControl_2 > 0 ) { - if( (gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b') ) { - tc = timeControl_2; - } - } - tc /= cps->timeOdds; /* [HGM] time odds: apply before telling engine */ - inc /= cps->timeOdds; - st /= cps->timeOdds; - - seconds = (tc / 1000) % 60; /* [HGM] displaced to after applying odds */ - - if (st > 0) { - /* Set exact time per move, normally using st command */ - if (cps->stKludge) { - /* GNU Chess 4 has no st command; uses level in a nonstandard way */ - seconds = st % 60; - if (seconds == 0) { - snprintf(buf, MSG_SIZ, "level 1 %d\n", st/60); - } else { - snprintf(buf, MSG_SIZ, "level 1 %d:%02d\n", st/60, seconds); - } - } else { - snprintf(buf, MSG_SIZ, "st %d\n", st); - } - } else { - /* Set conventional or incremental time control, using level command */ - if (seconds == 0) { - /* Note old gnuchess bug -- minutes:seconds used to not work. - Fixed in later versions, but still avoid :seconds - when seconds is 0. */ - snprintf(buf, MSG_SIZ, "level %d %ld %g\n", mps, tc/60000, inc/1000.); - } else { - snprintf(buf, MSG_SIZ, "level %d %ld:%02d %g\n", mps, tc/60000, - seconds, inc/1000.); - } - } - SendToProgram(buf, cps); - - /* Orthoganally (except for GNU Chess 4), limit time to st seconds */ - /* Orthogonally, limit search to given depth */ - if (sd > 0) { - if (cps->sdKludge) { - snprintf(buf, MSG_SIZ, "depth\n%d\n", sd); - } else { - snprintf(buf, MSG_SIZ, "sd %d\n", sd); - } - SendToProgram(buf, cps); - } - - if(cps->nps >= 0) { /* [HGM] nps */ - if(cps->supportsNPS == FALSE) - cps->nps = -1; // don't use if engine explicitly says not supported! - else { - snprintf(buf, MSG_SIZ, "nps %d\n", cps->nps); - SendToProgram(buf, cps); - } - } -} - -ChessProgramState * -WhitePlayer () -/* [HGM] return pointer to 'first' or 'second', depending on who plays white */ -{ - if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b' || - gameMode == BeginningOfGame || gameMode == MachinePlaysBlack) - return &second; - return &first; -} - -void -SendTimeRemaining (ChessProgramState *cps, int machineWhite) -{ - char message[MSG_SIZ]; - long time, otime; - - /* Note: this routine must be called when the clocks are stopped - or when they have *just* been set or switched; otherwise - it will be off by the time since the current tick started. - */ - if (machineWhite) { - time = whiteTimeRemaining / 10; - otime = blackTimeRemaining / 10; - } else { - time = blackTimeRemaining / 10; - otime = whiteTimeRemaining / 10; - } - /* [HGM] translate opponent's time by time-odds factor */ - otime = (otime * cps->other->timeOdds) / cps->timeOdds; - - if (time <= 0) time = 1; - if (otime <= 0) otime = 1; - - snprintf(message, MSG_SIZ, "time %ld\n", time); - SendToProgram(message, cps); - - snprintf(message, MSG_SIZ, "otim %ld\n", otime); - SendToProgram(message, cps); -} - -char * -EngineDefinedVariant (ChessProgramState *cps, int n) -{ // return name of n-th unknown variant that engine supports - static char buf[MSG_SIZ]; - char *p, *s = cps->variants; - if(!s) return NULL; - do { // parse string from variants feature - VariantClass v; - p = strchr(s, ','); - if(p) *p = NULLCHAR; - v = StringToVariant(s); - if(v == VariantNormal && strcmp(s, "normal") && !strstr(s, "_normal")) v = VariantUnknown; // garbage is recognized as normal - if(v == VariantUnknown) { // non-standard variant in list of engine-supported variants - if(!strcmp(s, "tenjiku") || !strcmp(s, "dai") || !strcmp(s, "dada") || // ignore Alien-Edition variants - !strcmp(s, "maka") || !strcmp(s, "tai") || !strcmp(s, "kyoku") || - !strcmp(s, "checkers") || !strcmp(s, "go") || !strcmp(s, "reversi") || - !strcmp(s, "dark") || !strcmp(s, "alien") || !strcmp(s, "multi") || !strcmp(s, "amazons") ) n++; - if(--n < 0) safeStrCpy(buf, s, MSG_SIZ); - } - if(p) *p++ = ','; - if(n < 0) return buf; - } while(s = p); - return NULL; -} - -int -BoolFeature (char **p, char *name, int *loc, ChessProgramState *cps) -{ - char buf[MSG_SIZ]; - int len = strlen(name); - int val; - - if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { - (*p) += len + 1; - sscanf(*p, "%d", &val); - *loc = (val != 0); - while (**p && **p != ' ') - (*p)++; - snprintf(buf, MSG_SIZ, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; -} - -int -IntFeature (char **p, char *name, int *loc, ChessProgramState *cps) -{ - char buf[MSG_SIZ]; - int len = strlen(name); - if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { - (*p) += len + 1; - sscanf(*p, "%d", loc); - while (**p && **p != ' ') (*p)++; - snprintf(buf, MSG_SIZ, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; -} - -int -StringFeature (char **p, char *name, char **loc, ChessProgramState *cps) -{ - char buf[MSG_SIZ]; - int len = strlen(name); - if (strncmp((*p), name, len) == 0 - && (*p)[len] == '=' && (*p)[len+1] == '\"') { - (*p) += len + 2; - ASSIGN(*loc, *p); // kludge alert: assign rest of line just to be sure allocation is large enough so that sscanf below always fits - sscanf(*p, "%[^\"]", *loc); - while (**p && **p != '\"') (*p)++; - if (**p == '\"') (*p)++; - snprintf(buf, MSG_SIZ, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; -} - -int -ParseOption (Option *opt, ChessProgramState *cps) -// [HGM] options: process the string that defines an engine option, and determine -// name, type, default value, and allowed value range -{ - char *p, *q, buf[MSG_SIZ]; - int n, min = (-1)<<31, max = 1<<31, def; - - opt->target = &opt->value; // OK for spin/slider and checkbox - if(p = strstr(opt->name, " -spin ")) { - if((n = sscanf(p, " -spin %d %d %d", &def, &min, &max)) < 3 ) return FALSE; - if(max < min) max = min; // enforce consistency - if(def < min) def = min; - if(def > max) def = max; - opt->value = def; - opt->min = min; - opt->max = max; - opt->type = Spin; - } else if((p = strstr(opt->name, " -slider "))) { - // for now -slider is a synonym for -spin, to already provide compatibility with future polyglots - if((n = sscanf(p, " -slider %d %d %d", &def, &min, &max)) < 3 ) return FALSE; - if(max < min) max = min; // enforce consistency - if(def < min) def = min; - if(def > max) def = max; - opt->value = def; - opt->min = min; - opt->max = max; - opt->type = Spin; // Slider; - } else if((p = strstr(opt->name, " -string "))) { - opt->textValue = p+9; - opt->type = TextBox; - opt->target = &opt->textValue; - } else if((p = strstr(opt->name, " -file "))) { - // for now -file is a synonym for -string, to already provide compatibility with future polyglots - opt->target = opt->textValue = p+7; - opt->type = FileName; // FileName; - opt->target = &opt->textValue; - } else if((p = strstr(opt->name, " -path "))) { - // for now -file is a synonym for -string, to already provide compatibility with future polyglots - opt->target = opt->textValue = p+7; - opt->type = PathName; // PathName; - opt->target = &opt->textValue; - } else if(p = strstr(opt->name, " -check ")) { - if(sscanf(p, " -check %d", &def) < 1) return FALSE; - opt->value = (def != 0); - opt->type = CheckBox; - } else if(p = strstr(opt->name, " -combo ")) { - opt->textValue = (char*) (opt->choice = &cps->comboList[cps->comboCnt]); // cheat with pointer type - cps->comboList[cps->comboCnt++] = q = p+8; // holds possible choices - if(*q == '*') cps->comboList[cps->comboCnt-1]++; - opt->value = n = 0; - while(q = StrStr(q, " /// ")) { - n++; *q = 0; // count choices, and null-terminate each of them - q += 5; - if(*q == '*') { // remember default, which is marked with * prefix - q++; - opt->value = n; - } - cps->comboList[cps->comboCnt++] = q; - } - cps->comboList[cps->comboCnt++] = NULL; - opt->max = n + 1; - opt->type = ComboBox; - } else if(p = strstr(opt->name, " -button")) { - opt->type = Button; - } else if(p = strstr(opt->name, " -save")) { - opt->type = SaveButton; - } else return FALSE; - *p = 0; // terminate option name - // now look if the command-line options define a setting for this engine option. - if(cps->optionSettings && cps->optionSettings[0]) - p = strstr(cps->optionSettings, opt->name); else p = NULL; - if(p && (p == cps->optionSettings || p[-1] == ',')) { - snprintf(buf, MSG_SIZ, "option %s", p); - if(p = strstr(buf, ",")) *p = 0; - if(q = strchr(buf, '=')) switch(opt->type) { - case ComboBox: - for(n=0; nmax; n++) - if(!strcmp(((char**)opt->textValue)[n], q+1)) opt->value = n; - break; - case TextBox: - safeStrCpy(opt->textValue, q+1, MSG_SIZ - (opt->textValue - opt->name)); - break; - case Spin: - case CheckBox: - opt->value = atoi(q+1); - default: - break; - } - strcat(buf, "\n"); - SendToProgram(buf, cps); - } - return TRUE; -} - -void -FeatureDone (ChessProgramState *cps, int val) -{ - DelayedEventCallback cb = GetDelayedEvent(); - if ((cb == InitBackEnd3 && cps == &first) || - (cb == SettingsMenuIfReady && cps == &second) || - (cb == LoadEngine) || - (cb == TwoMachinesEventIfReady)) { - CancelDelayedEvent(); - ScheduleDelayedEvent(cb, val ? 1 : 3600000); - } else if(!val && !cps->reload) ClearOptions(cps); // let 'spurious' done=0 clear engine's option list - cps->initDone = val; - if(val) cps->reload = FALSE, RefreshSettingsDialog(cps, val); -} - -/* Parse feature command from engine */ -void -ParseFeatures (char *args, ChessProgramState *cps) -{ - char *p = args; - char *q = NULL; - int val; - char buf[MSG_SIZ]; - - for (;;) { - while (*p == ' ') p++; - if (*p == NULLCHAR) return; - - if (BoolFeature(&p, "setboard", &cps->useSetboard, cps)) continue; - if (BoolFeature(&p, "xedit", &cps->extendedEdit, cps)) continue; - if (BoolFeature(&p, "time", &cps->sendTime, cps)) continue; - if (BoolFeature(&p, "draw", &cps->sendDrawOffers, cps)) continue; - if (BoolFeature(&p, "sigint", &cps->useSigint, cps)) continue; - if (BoolFeature(&p, "sigterm", &cps->useSigterm, cps)) continue; - if (BoolFeature(&p, "reuse", &val, cps)) { - /* Engine can disable reuse, but can't enable it if user said no */ - if (!val) cps->reuse = FALSE; - continue; - } - if (BoolFeature(&p, "analyze", &cps->analysisSupport, cps)) continue; - if (StringFeature(&p, "myname", &cps->tidy, cps)) { - if (gameMode == TwoMachinesPlay) { - DisplayTwoMachinesTitle(); - } else { - DisplayTitle(""); - } - continue; - } - if (StringFeature(&p, "variants", &cps->variants, cps)) continue; - if (BoolFeature(&p, "san", &cps->useSAN, cps)) continue; - if (BoolFeature(&p, "ping", &cps->usePing, cps)) continue; - if (BoolFeature(&p, "playother", &cps->usePlayother, cps)) continue; - if (BoolFeature(&p, "colors", &cps->useColors, cps)) continue; - if (BoolFeature(&p, "usermove", &cps->useUsermove, cps)) continue; - if (BoolFeature(&p, "exclude", &cps->excludeMoves, cps)) continue; - if (BoolFeature(&p, "ics", &cps->sendICS, cps)) continue; - if (BoolFeature(&p, "name", &cps->sendName, cps)) continue; - if (BoolFeature(&p, "pause", &cps->pause, cps)) continue; // [HGM] pause - if (IntFeature(&p, "done", &val, cps)) { - FeatureDone(cps, val); - continue; - } - /* Added by Tord: */ - if (BoolFeature(&p, "fen960", &cps->useFEN960, cps)) continue; - if (BoolFeature(&p, "oocastle", &cps->useOOCastle, cps)) continue; - /* End of additions by Tord */ - - /* [HGM] added features: */ - if (BoolFeature(&p, "highlight", &cps->highlight, cps)) continue; - if (BoolFeature(&p, "debug", &cps->debug, cps)) continue; - if (BoolFeature(&p, "nps", &cps->supportsNPS, cps)) continue; - if (IntFeature(&p, "level", &cps->maxNrOfSessions, cps)) continue; - if (BoolFeature(&p, "memory", &cps->memSize, cps)) continue; - if (BoolFeature(&p, "smp", &cps->maxCores, cps)) continue; - if (StringFeature(&p, "egt", &cps->egtFormats, cps)) continue; - if (StringFeature(&p, "option", &q, cps)) { // read to freshly allocated temp buffer first - if(cps->reload) { FREE(q); q = NULL; continue; } // we are reloading because of xreuse - FREE(cps->option[cps->nrOptions].name); - cps->option[cps->nrOptions].name = q; q = NULL; - if(!ParseOption(&(cps->option[cps->nrOptions++]), cps)) { // [HGM] options: add option feature - snprintf(buf, MSG_SIZ, "rejected option %s\n", cps->option[--cps->nrOptions].name); - SendToProgram(buf, cps); - continue; - } - if(cps->nrOptions >= MAX_OPTIONS) { - cps->nrOptions--; - snprintf(buf, MSG_SIZ, _("%s engine has too many options\n"), _(cps->which)); - DisplayError(buf, 0); - } - continue; - } - /* End of additions by HGM */ - - /* unknown feature: complain and skip */ - q = p; - while (*q && *q != '=') q++; - snprintf(buf, MSG_SIZ,"rejected %.*s\n", (int)(q-p), p); - SendToProgram(buf, cps); - p = q; - if (*p == '=') { - p++; - if (*p == '\"') { - p++; - while (*p && *p != '\"') p++; - if (*p == '\"') p++; - } else { - while (*p && *p != ' ') p++; - } - } - } - -} - -void -PeriodicUpdatesEvent (int newState) -{ - if (newState == appData.periodicUpdates) - return; - - appData.periodicUpdates=newState; - - /* Display type changes, so update it now */ -// DisplayAnalysis(); - - /* Get the ball rolling again... */ - if (newState) { - AnalysisPeriodicEvent(1); - StartAnalysisClock(); - } -} - -void -PonderNextMoveEvent (int newState) -{ - if (newState == appData.ponderNextMove) return; - if (gameMode == EditPosition) EditPositionDone(TRUE); - if (newState) { - SendToProgram("hard\n", &first); - if (gameMode == TwoMachinesPlay) { - SendToProgram("hard\n", &second); - } - } else { - SendToProgram("easy\n", &first); - thinkOutput[0] = NULLCHAR; - if (gameMode == TwoMachinesPlay) { - SendToProgram("easy\n", &second); - } - } - appData.ponderNextMove = newState; -} - -void -NewSettingEvent (int option, int *feature, char *command, int value) -{ - char buf[MSG_SIZ]; - - if (gameMode == EditPosition) EditPositionDone(TRUE); - snprintf(buf, MSG_SIZ,"%s%s %d\n", (option ? "option ": ""), command, value); - if(feature == NULL || *feature) SendToProgram(buf, &first); - if (gameMode == TwoMachinesPlay) { - if(feature == NULL || feature[(int*)&second - (int*)&first]) SendToProgram(buf, &second); - } -} - -void -ShowThinkingEvent () -// [HGM] thinking: this routine is now also called from "Options -> Engine..." popup -{ - static int oldState = 2; // kludge alert! Neither true nor fals, so first time oldState is always updated - int newState = appData.showThinking - // [HGM] thinking: other features now need thinking output as well - || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp(); - - if (oldState == newState) return; - oldState = newState; - if (gameMode == EditPosition) EditPositionDone(TRUE); - if (oldState) { - SendToProgram("post\n", &first); - if (gameMode == TwoMachinesPlay) { - SendToProgram("post\n", &second); - } - } else { - SendToProgram("nopost\n", &first); - thinkOutput[0] = NULLCHAR; - if (gameMode == TwoMachinesPlay) { - SendToProgram("nopost\n", &second); - } - } -// appData.showThinking = newState; // [HGM] thinking: responsible option should already have be changed when calling this routine! -} - -void -AskQuestionEvent (char *title, char *question, char *replyPrefix, char *which) -{ - ProcRef pr = (which[0] == '1') ? first.pr : second.pr; - if (pr == NoProc) return; - AskQuestion(title, question, replyPrefix, pr); -} - -void -TypeInEvent (char firstChar) -{ - if ((gameMode == BeginningOfGame && !appData.icsActive) || - gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || - gameMode == AnalyzeMode || gameMode == EditGame || - gameMode == EditPosition || gameMode == IcsExamining || - gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || - isdigit(firstChar) && // [HGM] movenum: allow typing in of move nr in 'passive' modes - ( gameMode == AnalyzeFile || gameMode == PlayFromGameFile || - gameMode == IcsObserving || gameMode == TwoMachinesPlay ) || - gameMode == Training) PopUpMoveDialog(firstChar); -} - -void -TypeInDoneEvent (char *move) -{ - Board board; - int n, fromX, fromY, toX, toY; - char promoChar; - ChessMove moveType; - - // [HGM] FENedit - if(gameMode == EditPosition && ParseFEN(board, &n, move, TRUE) ) { - EditPositionPasteFEN(move); - return; - } - // [HGM] movenum: allow move number to be typed in any mode - if(sscanf(move, "%d", &n) == 1 && n != 0 ) { - ToNrEvent(2*n-1); - return; - } - // undocumented kludge: allow command-line option to be typed in! - // (potentially fatal, and does not implement the effect of the option.) - // should only be used for options that are values on which future decisions will be made, - // and definitely not on options that would be used during initialization. - if(strstr(move, "!!! -") == move) { - ParseArgsFromString(move+4); - return; - } - - if (gameMode != EditGame && currentMove != forwardMostMove && - gameMode != Training) { - DisplayMoveError(_("Displayed move is not current")); - } else { - int ok = ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, - &moveType, &fromX, &fromY, &toX, &toY, &promoChar); - if(!ok && move[0] >= 'a') { move[0] += 'A' - 'a'; ok = 2; } // [HGM] try also capitalized - if (ok==1 || ok && ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, - &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { - UserMoveEvent(fromX, fromY, toX, toY, promoChar); - } else { - DisplayMoveError(_("Could not parse move")); - } - } -} - -void -DisplayMove (int moveNumber) -{ - char message[MSG_SIZ]; - char res[MSG_SIZ]; - char cpThinkOutput[MSG_SIZ]; - - if(appData.noGUI) return; // [HGM] fast: suppress display of moves - - if (moveNumber == forwardMostMove - 1 || - gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - - safeStrCpy(cpThinkOutput, thinkOutput, sizeof(cpThinkOutput)/sizeof(cpThinkOutput[0])); - - if (strchr(cpThinkOutput, '\n')) { - *strchr(cpThinkOutput, '\n') = NULLCHAR; - } - } else { - *cpThinkOutput = NULLCHAR; - } - - /* [AS] Hide thinking from human user */ - if( appData.hideThinkingFromHuman && gameMode != TwoMachinesPlay ) { - *cpThinkOutput = NULLCHAR; - if( thinkOutput[0] != NULLCHAR ) { - int i; - - for( i=0; i<=hiddenThinkOutputState; i++ ) { - cpThinkOutput[i] = '.'; - } - cpThinkOutput[i] = NULLCHAR; - hiddenThinkOutputState = (hiddenThinkOutputState + 1) % 3; - } - } - - if (moveNumber == forwardMostMove - 1 && - gameInfo.resultDetails != NULL) { - if (gameInfo.resultDetails[0] == NULLCHAR) { - snprintf(res, MSG_SIZ, " %s", PGNResult(gameInfo.result)); - } else { - snprintf(res, MSG_SIZ, " {%s} %s", - T_(gameInfo.resultDetails), PGNResult(gameInfo.result)); - } - } else { - res[0] = NULLCHAR; - } - - if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { - DisplayMessage(res, cpThinkOutput); - } else { - snprintf(message, MSG_SIZ, "%d.%s%s%s", moveNumber / 2 + 1, - WhiteOnMove(moveNumber) ? " " : ".. ", - parseList[moveNumber], res); - DisplayMessage(message, cpThinkOutput); - } -} - -void -DisplayComment (int moveNumber, char *text) -{ - char title[MSG_SIZ]; - - if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { - safeStrCpy(title, "Comment", sizeof(title)/sizeof(title[0])); - } else { - snprintf(title,MSG_SIZ, "Comment on %d.%s%s", moveNumber / 2 + 1, - WhiteOnMove(moveNumber) ? " " : ".. ", - parseList[moveNumber]); - } - if (text != NULL && (appData.autoDisplayComment || commentUp)) - CommentPopUp(title, text); -} - -/* This routine sends a ^C interrupt to gnuchess, to awaken it if it - * might be busy thinking or pondering. It can be omitted if your - * gnuchess is configured to stop thinking immediately on any user - * input. However, that gnuchess feature depends on the FIONREAD - * ioctl, which does not work properly on some flavors of Unix. - */ -void -Attention (ChessProgramState *cps) -{ -#if ATTENTION - if (!cps->useSigint) return; - if (appData.noChessProgram || (cps->pr == NoProc)) return; - switch (gameMode) { - case MachinePlaysWhite: - case MachinePlaysBlack: - case TwoMachinesPlay: - case IcsPlayingWhite: - case IcsPlayingBlack: - case AnalyzeMode: - case AnalyzeFile: - /* Skip if we know it isn't thinking */ - if (!cps->maybeThinking) return; - if (appData.debugMode) - fprintf(debugFP, "Interrupting %s\n", cps->which); - InterruptChildProcess(cps->pr); - cps->maybeThinking = FALSE; - break; - default: - break; - } -#endif /*ATTENTION*/ -} - -int -CheckFlags () -{ - if (whiteTimeRemaining <= 0) { - if (!whiteFlag) { - whiteFlag = TRUE; - if (appData.icsActive) { - if (appData.autoCallFlag && - gameMode == IcsPlayingBlack && !blackFlag) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } - } else { - if (blackFlag) { - if(gameMode != TwoMachinesPlay) DisplayTitle(_("Both flags fell")); - } else { - if(gameMode != TwoMachinesPlay) DisplayTitle(_("White's flag fell")); - if (appData.autoCallFlag) { - GameEnds(BlackWins, "Black wins on time", GE_XBOARD); - return TRUE; - } - } - } - } - } - if (blackTimeRemaining <= 0) { - if (!blackFlag) { - blackFlag = TRUE; - if (appData.icsActive) { - if (appData.autoCallFlag && - gameMode == IcsPlayingWhite && !whiteFlag) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } - } else { - if (whiteFlag) { - if(gameMode != TwoMachinesPlay) DisplayTitle(_("Both flags fell")); - } else { - if(gameMode != TwoMachinesPlay) DisplayTitle(_("Black's flag fell")); - if (appData.autoCallFlag) { - GameEnds(WhiteWins, "White wins on time", GE_XBOARD); - return TRUE; - } - } - } - } - } - return FALSE; -} - -void -CheckTimeControl () -{ - if (!appData.clockMode || appData.icsActive || searchTime || // [HGM] st: no inc in st mode - gameMode == PlayFromGameFile || forwardMostMove == 0) return; - - /* - * add time to clocks when time control is achieved ([HGM] now also used for increment) - */ - if ( !WhiteOnMove(forwardMostMove) ) { - /* White made time control */ - lastWhite -= whiteTimeRemaining; // [HGM] contains start time, socalculate thinking time - whiteTimeRemaining += GetTimeQuota((forwardMostMove-whiteStartMove-1)/2, lastWhite, whiteTC) - /* [HGM] time odds: correct new time quota for time odds! */ - / WhitePlayer()->timeOdds; - lastBlack = blackTimeRemaining; // [HGM] leave absolute time (after quota), so next switch we can us it to calculate thinking time - } else { - lastBlack -= blackTimeRemaining; - /* Black made time control */ - blackTimeRemaining += GetTimeQuota((forwardMostMove-blackStartMove-1)/2, lastBlack, blackTC) - / WhitePlayer()->other->timeOdds; - lastWhite = whiteTimeRemaining; - } -} - -void -DisplayBothClocks () -{ - int wom = gameMode == EditPosition ? - !blackPlaysFirst : WhiteOnMove(currentMove); - DisplayWhiteClock(whiteTimeRemaining, wom); - DisplayBlackClock(blackTimeRemaining, !wom); -} - - -/* Timekeeping seems to be a portability nightmare. I think everyone - has ftime(), but I'm really not sure, so I'm including some ifdefs - to use other calls if you don't. Clocks will be less accurate if - you have neither ftime nor gettimeofday. -*/ - -/* VS 2008 requires the #include outside of the function */ -#if !HAVE_GETTIMEOFDAY && HAVE_FTIME -#include -#endif - -/* Get the current time as a TimeMark */ -void -GetTimeMark (TimeMark *tm) -{ -#if HAVE_GETTIMEOFDAY - - struct timeval timeVal; - struct timezone timeZone; - - gettimeofday(&timeVal, &timeZone); - tm->sec = (long) timeVal.tv_sec; - tm->ms = (int) (timeVal.tv_usec / 1000L); - -#else /*!HAVE_GETTIMEOFDAY*/ -#if HAVE_FTIME - -// include / moved to just above start of function - struct timeb timeB; - - ftime(&timeB); - tm->sec = (long) timeB.time; - tm->ms = (int) timeB.millitm; - -#else /*!HAVE_FTIME && !HAVE_GETTIMEOFDAY*/ - tm->sec = (long) time(NULL); - tm->ms = 0; -#endif -#endif -} - -/* Return the difference in milliseconds between two - time marks. We assume the difference will fit in a long! -*/ -long -SubtractTimeMarks (TimeMark *tm2, TimeMark *tm1) -{ - return 1000L*(tm2->sec - tm1->sec) + - (long) (tm2->ms - tm1->ms); -} - - -/* - * Code to manage the game clocks. - * - * In tournament play, black starts the clock and then white makes a move. - * We give the human user a slight advantage if he is playing white---the - * clocks don't run until he makes his first move, so it takes zero time. - * Also, we don't account for network lag, so we could get out of sync - * with GNU Chess's clock -- but then, referees are always right. - */ - -static TimeMark tickStartTM; -static long intendedTickLength; - -long -NextTickLength (long timeRemaining) -{ - long nominalTickLength, nextTickLength; - - if (timeRemaining > 0L && timeRemaining <= 10000L) - nominalTickLength = 100L; - else - nominalTickLength = 1000L; - nextTickLength = timeRemaining % nominalTickLength; - if (nextTickLength <= 0) nextTickLength += nominalTickLength; - - return nextTickLength; -} - -/* Adjust clock one minute up or down */ -void -AdjustClock (Boolean which, int dir) -{ - if(appData.autoCallFlag) { DisplayError(_("Clock adjustment not allowed in auto-flag mode"), 0); return; } - if(which) blackTimeRemaining += 60000*dir; - else whiteTimeRemaining += 60000*dir; - DisplayBothClocks(); - adjustedClock = TRUE; -} - -/* Stop clocks and reset to a fresh time control */ -void -ResetClocks () -{ - (void) StopClockTimer(); - if (appData.icsActive) { - whiteTimeRemaining = blackTimeRemaining = 0; - } else if (searchTime) { - whiteTimeRemaining = 1000*searchTime / WhitePlayer()->timeOdds; - blackTimeRemaining = 1000*searchTime / WhitePlayer()->other->timeOdds; - } else { /* [HGM] correct new time quote for time odds */ - whiteTC = blackTC = fullTimeControlString; - whiteTimeRemaining = GetTimeQuota(-1, 0, whiteTC) / WhitePlayer()->timeOdds; - blackTimeRemaining = GetTimeQuota(-1, 0, blackTC) / WhitePlayer()->other->timeOdds; - } - if (whiteFlag || blackFlag) { - DisplayTitle(""); - whiteFlag = blackFlag = FALSE; - } - lastWhite = lastBlack = whiteStartMove = blackStartMove = 0; - DisplayBothClocks(); - adjustedClock = FALSE; -} - -#define FUDGE 25 /* 25ms = 1/40 sec; should be plenty even for 50 Hz clocks */ - -/* Decrement running clock by amount of time that has passed */ -void -DecrementClocks () -{ - long timeRemaining; - long lastTickLength, fudge; - TimeMark now; - - if (!appData.clockMode) return; - if (gameMode==AnalyzeMode || gameMode == AnalyzeFile) return; - - GetTimeMark(&now); - - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - - /* Fudge if we woke up a little too soon */ - fudge = intendedTickLength - lastTickLength; - if (fudge < 0 || fudge > FUDGE) fudge = 0; - - if (WhiteOnMove(forwardMostMove)) { - if(whiteNPS >= 0) lastTickLength = 0; - timeRemaining = whiteTimeRemaining -= lastTickLength; - if(timeRemaining < 0 && !appData.icsActive) { - GetTimeQuota((forwardMostMove-whiteStartMove-1)/2, 0, whiteTC); // sets suddenDeath & nextSession; - if(suddenDeath) { // [HGM] if we run out of a non-last incremental session, go to the next - whiteStartMove = forwardMostMove; whiteTC = nextSession; - lastWhite= timeRemaining = whiteTimeRemaining += GetTimeQuota(-1, 0, whiteTC); - } - } - DisplayWhiteClock(whiteTimeRemaining - fudge, - WhiteOnMove(currentMove < forwardMostMove ? currentMove : forwardMostMove)); - } else { - if(blackNPS >= 0) lastTickLength = 0; - timeRemaining = blackTimeRemaining -= lastTickLength; - if(timeRemaining < 0 && !appData.icsActive) { // [HGM] if we run out of a non-last incremental session, go to the next - GetTimeQuota((forwardMostMove-blackStartMove-1)/2, 0, blackTC); - if(suddenDeath) { - blackStartMove = forwardMostMove; - lastBlack = timeRemaining = blackTimeRemaining += GetTimeQuota(-1, 0, blackTC=nextSession); - } - } - DisplayBlackClock(blackTimeRemaining - fudge, - !WhiteOnMove(currentMove < forwardMostMove ? currentMove : forwardMostMove)); - } - if (CheckFlags()) return; - - if(twoBoards) { // count down secondary board's clocks as well - activePartnerTime -= lastTickLength; - partnerUp = 1; - if(activePartner == 'W') - DisplayWhiteClock(activePartnerTime, TRUE); // the counting clock is always the highlighted one! - else - DisplayBlackClock(activePartnerTime, TRUE); - partnerUp = 0; - } - - tickStartTM = now; - intendedTickLength = NextTickLength(timeRemaining - fudge) + fudge; - StartClockTimer(intendedTickLength); - - /* if the time remaining has fallen below the alarm threshold, sound the - * alarm. if the alarm has sounded and (due to a takeback or time control - * with increment) the time remaining has increased to a level above the - * threshold, reset the alarm so it can sound again. - */ - - if (appData.icsActive && appData.icsAlarm) { - - /* make sure we are dealing with the user's clock */ - if (!( ((gameMode == IcsPlayingWhite) && WhiteOnMove(currentMove)) || - ((gameMode == IcsPlayingBlack) && !WhiteOnMove(currentMove)) - )) return; - - if (alarmSounded && (timeRemaining > appData.icsAlarmTime)) { - alarmSounded = FALSE; - } else if (!alarmSounded && (timeRemaining <= appData.icsAlarmTime)) { - PlayAlarmSound(); - alarmSounded = TRUE; - } - } -} - - -/* A player has just moved, so stop the previously running - clock and (if in clock mode) start the other one. - We redisplay both clocks in case we're in ICS mode, because - ICS gives us an update to both clocks after every move. - Note that this routine is called *after* forwardMostMove - is updated, so the last fractional tick must be subtracted - from the color that is *not* on move now. -*/ -void -SwitchClocks (int newMoveNr) -{ - long lastTickLength; - TimeMark now; - int flagged = FALSE; - - GetTimeMark(&now); - - if (StopClockTimer() && appData.clockMode) { - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - if (!WhiteOnMove(forwardMostMove)) { - if(blackNPS >= 0) lastTickLength = 0; - blackTimeRemaining -= lastTickLength; - /* [HGM] PGNtime: save time for PGN file if engine did not give it */ -// if(pvInfoList[forwardMostMove].time == -1) - pvInfoList[forwardMostMove].time = // use GUI time - (timeRemaining[1][forwardMostMove-1] - blackTimeRemaining)/10; - } else { - if(whiteNPS >= 0) lastTickLength = 0; - whiteTimeRemaining -= lastTickLength; - /* [HGM] PGNtime: save time for PGN file if engine did not give it */ -// if(pvInfoList[forwardMostMove].time == -1) - pvInfoList[forwardMostMove].time = - (timeRemaining[0][forwardMostMove-1] - whiteTimeRemaining)/10; - } - flagged = CheckFlags(); - } - forwardMostMove = newMoveNr; // [HGM] race: change stm when no timer interrupt scheduled - CheckTimeControl(); - - if (flagged || !appData.clockMode) return; - - switch (gameMode) { - case MachinePlaysBlack: - case MachinePlaysWhite: - case BeginningOfGame: - if (pausing) return; - break; - - case EditGame: - case PlayFromGameFile: - case IcsExamining: - return; - - default: - break; - } - - if (searchTime) { // [HGM] st: set clock of player that has to move to max time - if(WhiteOnMove(forwardMostMove)) - whiteTimeRemaining = 1000*searchTime / WhitePlayer()->timeOdds; - else blackTimeRemaining = 1000*searchTime / WhitePlayer()->other->timeOdds; - } - - tickStartTM = now; - intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? - whiteTimeRemaining : blackTimeRemaining); - StartClockTimer(intendedTickLength); -} - - -/* Stop both clocks */ -void -StopClocks () -{ - long lastTickLength; - TimeMark now; - - if (!StopClockTimer()) return; - if (!appData.clockMode) return; - - GetTimeMark(&now); - - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - if (WhiteOnMove(forwardMostMove)) { - if(whiteNPS >= 0) lastTickLength = 0; - whiteTimeRemaining -= lastTickLength; - DisplayWhiteClock(whiteTimeRemaining, WhiteOnMove(currentMove)); - } else { - if(blackNPS >= 0) lastTickLength = 0; - blackTimeRemaining -= lastTickLength; - DisplayBlackClock(blackTimeRemaining, !WhiteOnMove(currentMove)); - } - CheckFlags(); -} - -/* Start clock of player on move. Time may have been reset, so - if clock is already running, stop and restart it. */ -void -StartClocks () -{ - (void) StopClockTimer(); /* in case it was running already */ - DisplayBothClocks(); - if (CheckFlags()) return; - - if (!appData.clockMode) return; - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) return; - - GetTimeMark(&tickStartTM); - intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? - whiteTimeRemaining : blackTimeRemaining); - - /* [HGM] nps: figure out nps factors, by determining which engine plays white and/or black once and for all */ - whiteNPS = blackNPS = -1; - if(gameMode == MachinePlaysWhite || gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'w' - || appData.zippyPlay && gameMode == IcsPlayingBlack) // first (perhaps only) engine has white - whiteNPS = first.nps; - if(gameMode == MachinePlaysBlack || gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b' - || appData.zippyPlay && gameMode == IcsPlayingWhite) // first (perhaps only) engine has black - blackNPS = first.nps; - if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b') // second only used in Two-Machines mode - whiteNPS = second.nps; - if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'w') - blackNPS = second.nps; - if(appData.debugMode) fprintf(debugFP, "nps: w=%d, b=%d\n", whiteNPS, blackNPS); - - StartClockTimer(intendedTickLength); -} - -char * -TimeString (long ms) -{ - long second, minute, hour, day; - char *sign = ""; - static char buf[32]; - - if (ms > 0 && ms <= 9900) { - /* convert milliseconds to tenths, rounding up */ - double tenths = floor( ((double)(ms + 99L)) / 100.00 ); - - snprintf(buf,sizeof(buf)/sizeof(buf[0]), " %03.1f ", tenths/10.0); - return buf; - } - - /* convert milliseconds to seconds, rounding up */ - /* use floating point to avoid strangeness of integer division - with negative dividends on many machines */ - second = (long) floor(((double) (ms + 999L)) / 1000.0); - - if (second < 0) { - sign = "-"; - second = -second; - } - - day = second / (60 * 60 * 24); - second = second % (60 * 60 * 24); - hour = second / (60 * 60); - second = second % (60 * 60); - minute = second / 60; - second = second % 60; - - if (day > 0) - snprintf(buf, sizeof(buf)/sizeof(buf[0]), " %s%ld:%02ld:%02ld:%02ld ", - sign, day, hour, minute, second); - else if (hour > 0) - snprintf(buf, sizeof(buf)/sizeof(buf[0]), " %s%ld:%02ld:%02ld ", sign, hour, minute, second); - else - snprintf(buf, sizeof(buf)/sizeof(buf[0]), " %s%2ld:%02ld ", sign, minute, second); - - return buf; -} - - -/* - * This is necessary because some C libraries aren't ANSI C compliant yet. - */ -char * -StrStr (char *string, char *match) -{ - int i, length; - - length = strlen(match); - - for (i = strlen(string) - length; i >= 0; i--, string++) - if (!strncmp(match, string, length)) - return string; - - return NULL; -} - -char * -StrCaseStr (char *string, char *match) -{ - int i, j, length; - - length = strlen(match); - - for (i = strlen(string) - length; i >= 0; i--, string++) { - for (j = 0; j < length; j++) { - if (ToLower(match[j]) != ToLower(string[j])) - break; - } - if (j == length) return string; - } - - return NULL; -} - -#ifndef _amigados -int -StrCaseCmp (char *s1, char *s2) -{ - char c1, c2; - - for (;;) { - c1 = ToLower(*s1++); - c2 = ToLower(*s2++); - if (c1 > c2) return 1; - if (c1 < c2) return -1; - if (c1 == NULLCHAR) return 0; - } -} - - -int -ToLower (int c) -{ - return isupper(c) ? tolower(c) : c; -} - - -int -ToUpper (int c) -{ - return islower(c) ? toupper(c) : c; -} -#endif /* !_amigados */ - -char * -StrSave (char *s) -{ - char *ret; - - if ((ret = (char *) malloc(strlen(s) + 1))) - { - safeStrCpy(ret, s, strlen(s)+1); - } - return ret; -} - -char * -StrSavePtr (char *s, char **savePtr) -{ - if (*savePtr) { - free(*savePtr); - } - if ((*savePtr = (char *) malloc(strlen(s) + 1))) { - safeStrCpy(*savePtr, s, strlen(s)+1); - } - return(*savePtr); -} - -char * -PGNDate () -{ - time_t clock; - struct tm *tm; - char buf[MSG_SIZ]; - - clock = time((time_t *)NULL); - tm = localtime(&clock); - snprintf(buf, MSG_SIZ, "%04d.%02d.%02d", - tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); - return StrSave(buf); -} - - -char * -PositionToFEN (int move, char *overrideCastling, int moveCounts) -{ - int i, j, fromX, fromY, toX, toY; - int whiteToPlay, haveRights = nrCastlingRights; - char buf[MSG_SIZ]; - char *p, *q; - int emptycount; - ChessSquare piece; - - whiteToPlay = (gameMode == EditPosition) ? - !blackPlaysFirst : (move % 2 == 0); - p = buf; - - /* Piece placement data */ - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - if(MSG_SIZ - (p - buf) < BOARD_RGHT - BOARD_LEFT + 20) { *p = 0; return StrSave(buf); } - emptycount = 0; - for (j = BOARD_LEFT; j < BOARD_RGHT; j++) { - if (boards[move][i][j] == EmptySquare) { - emptycount++; - } else { ChessSquare piece = boards[move][i][j]; - if (emptycount > 0) { - if(emptycount<10) /* [HGM] can be >= 10 */ - *p++ = '0' + emptycount; - else { *p++ = '0' + emptycount/10; *p++ = '0' + emptycount%10; } - emptycount = 0; - } - if(PieceToChar(piece) == '+') { - /* [HGM] write promoted pieces as '+' (Shogi) */ - *p++ = '+'; - piece = (ChessSquare)(CHUDEMOTED(piece)); - } - *p++ = (piece == DarkSquare ? '*' : PieceToChar(piece)); - if(*p = PieceSuffix(piece)) p++; - if(p[-1] == '~') { - /* [HGM] flag promoted pieces as '~' (Crazyhouse) */ - p[-1] = PieceToChar((ChessSquare)(CHUDEMOTED(piece))); - *p++ = '~'; - } - } - } - if (emptycount > 0) { - if(emptycount<10) /* [HGM] can be >= 10 */ - *p++ = '0' + emptycount; - else { *p++ = '0' + emptycount/10; *p++ = '0' + emptycount%10; } - emptycount = 0; - } - *p++ = '/'; - } - *(p - 1) = ' '; - - /* [HGM] print Crazyhouse or Shogi holdings */ - if( gameInfo.holdingsWidth ) { - *(p-1) = '['; /* if we wanted to support BFEN, this could be '/' */ - q = p; - for(i=0; i=BOARD_LEFT; i--) { - piece = boards[move][0][i]; - if(piece >= WhitePawn && piece <= WhiteKing && pieceDesc[piece] && strchr(pieceDesc[piece], 'i')) { // piece with initial move - if(!(boards[move][TOUCHED_W] & 1<=BOARD_LEFT; i--) { - piece = boards[move][BOARD_HEIGHT-1][i]; - if(piece >= BlackPawn && piece <= BlackKing && pieceDesc[piece] && strchr(pieceDesc[piece], 'i')) { // piece with initial move - if(!(boards[move][TOUCHED_B] & 1<=BOARD_LEFT; i--) - if(boards[move][VIRGIN][i] & VIRGIN_W) *p++ = i + AAA + 'A' - 'a'; - } else { - /* [HGM] write directly from rights */ - if(boards[move][CASTLING][2] != NoRights && - boards[move][CASTLING][0] != NoRights ) - *p++ = boards[move][CASTLING][0] + AAA + 'A' - 'a'; - if(boards[move][CASTLING][2] != NoRights && - boards[move][CASTLING][1] != NoRights ) - *p++ = boards[move][CASTLING][1] + AAA + 'A' - 'a'; - } - if(handB) { - for(i=BOARD_RGHT-1; i>=BOARD_LEFT; i--) - if(boards[move][VIRGIN][i] & VIRGIN_B) *p++ = i + AAA; - } else { - if(boards[move][CASTLING][5] != NoRights && - boards[move][CASTLING][3] != NoRights ) - *p++ = boards[move][CASTLING][3] + AAA; - if(boards[move][CASTLING][5] != NoRights && - boards[move][CASTLING][4] != NoRights ) - *p++ = boards[move][CASTLING][4] + AAA; - } - } else { - - /* [HGM] write true castling rights */ - if( nrCastlingRights == 6 ) { - int q, k=0; - if(boards[move][CASTLING][0] != NoRights && - boards[move][CASTLING][2] != NoRights ) k = 1, *p++ = 'K'; - q = (boards[move][CASTLING][1] != NoRights && - boards[move][CASTLING][2] != NoRights ); - if(handW) { // for S-Chess with pieces in hand, list virgin pieces between K and Q - for(i=BOARD_RGHT-1-k; i>=BOARD_LEFT+q; i--) - if((boards[move][0][i] != WhiteKing || k+q == 0) && - boards[move][VIRGIN][i] & VIRGIN_W) *p++ = i + AAA + 'A' - 'a'; - } - if(q) *p++ = 'Q'; - k = 0; - if(boards[move][CASTLING][3] != NoRights && - boards[move][CASTLING][5] != NoRights ) k = 1, *p++ = 'k'; - q = (boards[move][CASTLING][4] != NoRights && - boards[move][CASTLING][5] != NoRights ); - if(handB) { - for(i=BOARD_RGHT-1-k; i>=BOARD_LEFT+q; i--) - if((boards[move][BOARD_HEIGHT-1][i] != BlackKing || k+q == 0) && - boards[move][VIRGIN][i] & VIRGIN_B) *p++ = i + AAA; - } - if(q) *p++ = 'q'; - } - } - if (q == p) *p++ = '-'; /* No castling rights */ - *p++ = ' '; - } - - if(gameInfo.variant != VariantShogi && gameInfo.variant != VariantXiangqi && - gameInfo.variant != VariantShatranj && gameInfo.variant != VariantCourier && - gameInfo.variant != VariantMakruk && gameInfo.variant != VariantASEAN ) { - /* En passant target square */ - if (move > backwardMostMove) { - fromX = moveList[move - 1][0] - AAA; - fromY = moveList[move - 1][1] - ONE; - toX = moveList[move - 1][2] - AAA; - toY = moveList[move - 1][3] - ONE; - if (fromY == (whiteToPlay ? BOARD_HEIGHT-2 : 1) && - toY == (whiteToPlay ? BOARD_HEIGHT-4 : 3) && - boards[move][toY][toX] == (whiteToPlay ? BlackPawn : WhitePawn) && - fromX == toX) { - /* 2-square pawn move just happened */ - *p++ = toX + AAA; - *p++ = whiteToPlay ? '6'+BOARD_HEIGHT-8 : '3'; - } else { - *p++ = '-'; - } - } else if(move == backwardMostMove) { - // [HGM] perhaps we should always do it like this, and forget the above? - if((signed char)boards[move][EP_STATUS] >= 0) { - *p++ = boards[move][EP_STATUS] + AAA; - *p++ = whiteToPlay ? '6'+BOARD_HEIGHT-8 : '3'; - } else { - *p++ = '-'; - } - } else { - *p++ = '-'; - } - *p++ = ' '; - } - } - - if(moveCounts) - { int i = 0, j=move; - - /* [HGM] find reversible plies */ - if (appData.debugMode) { int k; - fprintf(debugFP, "write FEN 50-move: %d %d %d\n", initialRulePlies, forwardMostMove, backwardMostMove); - for(k=backwardMostMove; k<=forwardMostMove; k++) - fprintf(debugFP, "e%d. p=%d\n", k, (signed char)boards[k][EP_STATUS]); - - } - - while(j > backwardMostMove && (signed char)boards[j][EP_STATUS] <= EP_NONE) j--,i++; - if( j == backwardMostMove ) i += initialRulePlies; - sprintf(p, "%d ", i); - p += i>=100 ? 4 : i >= 10 ? 3 : 2; - - /* Fullmove number */ - sprintf(p, "%d", (move / 2) + 1); - } else *--p = NULLCHAR; - - return StrSave(buf); -} - -Boolean -ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) -{ - int i, j, k, w=0, subst=0, shuffle=0, wKingRank = -1, bKingRank = -1; - char *p, c; - int emptycount, virgin[BOARD_FILES]; - ChessSquare piece, king = (gameInfo.variant == VariantKnightmate ? WhiteUnicorn : WhiteKing); - - p = fen; - - /* Piece placement data */ - for (i = BOARD_HEIGHT - 1; i >= 0; i--) { - j = 0; - for (;;) { - if (*p == '/' || *p == ' ' || *p == '[' ) { - if(j > w) w = j; - emptycount = gameInfo.boardWidth - j; - while (emptycount--) - board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; - if (*p == '/') p++; - else if(autoSize && i != BOARD_HEIGHT-1) { // we stumbled unexpectedly into end of board - for(k=i; k= 10)*0 - } else if(*p=='x' || *p=='X') { /* [HGM] X means 10 */ - p++; emptycount=10; - if (j + emptycount > gameInfo.boardWidth) return FALSE; - while (emptycount--) - board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; -#endif - } else if (*p == '*') { - board[i][(j++)+gameInfo.holdingsWidth] = DarkSquare; p++; - } else if (isdigit(*p)) { - emptycount = *p++ - '0'; - while(isdigit(*p)) emptycount = 10*emptycount + *p++ - '0'; /* [HGM] allow > 9 */ - if (j + emptycount > gameInfo.boardWidth) return FALSE; - while (emptycount--) - board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; - } else if (*p == '<') { - if(i == BOARD_HEIGHT-1) shuffle = 1; - else if (i != 0 || !shuffle) return FALSE; - p++; - } else if (shuffle && *p == '>') { - p++; // for now ignore closing shuffle range, and assume rank-end - } else if (*p == '?') { - if (j >= gameInfo.boardWidth) return FALSE; - if (i != 0 && i != BOARD_HEIGHT-1) return FALSE; // only on back-rank - board[i][(j++)+gameInfo.holdingsWidth] = ClearBoard; p++; subst++; // placeHolder - } else if (*p == '+' || isalpha(*p)) { - char *q, *s = SUFFIXES; - if (j >= gameInfo.boardWidth) return FALSE; - if(*p=='+') { - char c = *++p; - if(q = strchr(s, p[1])) p++; - piece = CharToPiece(c + (q ? 64*(q - s + 1) : 0)); - if(piece == EmptySquare) return FALSE; /* unknown piece */ - piece = (ChessSquare) (CHUPROMOTED(piece)); p++; - if(PieceToChar(piece) != '+') return FALSE; /* unpromotable piece */ - } else { - char c = *p++; - if(q = strchr(s, *p)) p++; - piece = CharToPiece(c + (q ? 64*(q - s + 1) : 0)); - } - - if(piece==EmptySquare) return FALSE; /* unknown piece */ - if(*p == '~') { /* [HGM] make it a promoted piece for Crazyhouse */ - piece = (ChessSquare) (PROMOTED(piece)); - if(PieceToChar(piece) != '~') return FALSE; /* cannot be a promoted piece */ - p++; - } - board[i][(j++)+gameInfo.holdingsWidth] = piece; - if(piece == king) wKingRank = i; - if(piece == WHITE_TO_BLACK king) bKingRank = i; - } else { - return FALSE; - } - } - } - while (*p == '/' || *p == ' ') p++; - - if(autoSize && w != 0) appData.NrFiles = w, InitPosition(TRUE); - - /* [HGM] by default clear Crazyhouse holdings, if present */ - if(gameInfo.holdingsWidth) { - for(i=0; i= (int) BlackPawn ) { - i = (int)piece - (int)BlackPawn; - i = PieceToNumber((ChessSquare)i); - if( i >= gameInfo.holdingsSize ) return FALSE; - board[BOARD_HEIGHT-1-i][0] = piece; /* black holdings */ - board[BOARD_HEIGHT-1-i][1]++; /* black counts */ - bcnt++; - } else { - i = (int)piece - (int)WhitePawn; - i = PieceToNumber((ChessSquare)i); - if( i >= gameInfo.holdingsSize ) return FALSE; - board[i][BOARD_WIDTH-1] = piece; /* white holdings */ - board[i][BOARD_WIDTH-2]++; /* black holdings */ - wcnt++; - } - } - if(subst) { // substitute back-rank question marks by holdings pieces - for(j=BOARD_LEFT; j= bcnt) n = rand() % bcnt; // use same randomization for black and white if possible - for(k=0, m=n; k= 0) for(i=0; i<3; i++) castlingRank[i] = wKingRank; - if(bKingRank >= 0) for(i=3; i<6; i++) castlingRank[i] = bKingRank; - } - - /* set defaults in case FEN is incomplete */ - board[EP_STATUS] = EP_UNKNOWN; - board[TOUCHED_W] = board[TOUCHED_B] = 0; - for(i=0; i= 'A' && *p <= 'Z' || *p >= 'a' && *p <= 'z' || *p=='-') { - /* castling indicator present, so default becomes no castlings */ - for(i=0; i= 'a' && *p < 'a' + gameInfo.boardWidth) || - ( *p >= 'A' && *p < 'A' + gameInfo.boardWidth) ) { - int c = *p++, whiteKingFile=NoRights, blackKingFile=NoRights; - - for(i=BOARD_LEFT; i> 1; // for these variant scanning fails - if(whiteKingFile == NoRights || board[castlingRank[2]][whiteKingFile] != WhiteUnicorn - && board[castlingRank[2]][whiteKingFile] != WhiteKing) whiteKingFile = NoRights; - if(blackKingFile == NoRights || board[castlingRank[5]][blackKingFile] != BlackUnicorn - && board[castlingRank[5]][blackKingFile] != BlackKing) blackKingFile = NoRights; - switch(c) { - case'K': - for(i=BOARD_RGHT-1; board[castlingRank[2]][i]!=WhiteRook && i>whiteKingFile; i--); - board[CASTLING][0] = i != whiteKingFile ? i : NoRights; - board[CASTLING][2] = whiteKingFile; - if(board[CASTLING][0] != NoRights) virgin[board[CASTLING][0]] |= VIRGIN_W; - if(board[CASTLING][2] != NoRights) virgin[board[CASTLING][2]] |= VIRGIN_W; - if(whiteKingFile != BOARD_WIDTH>>1|| i != BOARD_RGHT-1) fischer = 1; - break; - case'Q': - for(i=BOARD_LEFT; i>1|| i != BOARD_LEFT) fischer = 1; - break; - case'k': - for(i=BOARD_RGHT-1; board[castlingRank[5]][i]!=BlackRook && i>blackKingFile; i--); - board[CASTLING][3] = i != blackKingFile ? i : NoRights; - board[CASTLING][5] = blackKingFile; - if(board[CASTLING][3] != NoRights) virgin[board[CASTLING][3]] |= VIRGIN_B; - if(board[CASTLING][5] != NoRights) virgin[board[CASTLING][5]] |= VIRGIN_B; - if(blackKingFile != BOARD_WIDTH>>1|| i != BOARD_RGHT-1) fischer = 1; - break; - case'q': - for(i=BOARD_LEFT; i>1|| i != BOARD_LEFT) fischer = 1; - case '-': - break; - default: /* FRC castlings */ - if(c >= 'a') { /* black rights */ - if(gameInfo.variant == VariantSChess) { virgin[c-AAA] |= VIRGIN_B; break; } // in S-Chess castlings are always kq, so just virginity - for(i=BOARD_LEFT; i= BlackKing ) break; - if(c > i) - board[CASTLING][3] = c; - else - board[CASTLING][4] = c; - } else { /* white rights */ - if(gameInfo.variant == VariantSChess) { virgin[c-AAA-'A'+'a'] |= VIRGIN_W; break; } // in S-Chess castlings are always KQ - for(i=BOARD_LEFT; i= WhiteKing) break; - if(c > i) - board[CASTLING][0] = c; - else - board[CASTLING][1] = c; - } - } - } - for(i=0; i= BOARD_RGHT) return TRUE; - if(*p >= '0' && *p <='9') p++; - board[EP_STATUS] = c; - } - } - - - if(sscanf(p, "%d", &i) == 1) { - FENrulePlies = i; /* 50-move ply counter */ - /* (The move number is still ignored) */ - } - - return TRUE; -} - -void -EditPositionPasteFEN (char *fen) -{ - if (fen != NULL) { - Board initial_position; - - if (!ParseFEN(initial_position, &blackPlaysFirst, fen, TRUE)) { - DisplayError(_("Bad FEN position in clipboard"), 0); - return ; - } else { - int savedBlackPlaysFirst = blackPlaysFirst; - EditPositionEvent(); - blackPlaysFirst = savedBlackPlaysFirst; - CopyBoard(boards[0], initial_position); - initialRulePlies = FENrulePlies; /* [HGM] copy FEN attributes as well */ - EditPositionDone(FALSE); // [HGM] fake: do not fake rights if we had FEN - DisplayBothClocks(); - DrawPosition(FALSE, boards[currentMove]); - } - } -} - -static char cseq[12] = "\\ "; - -Boolean -set_cont_sequence (char *new_seq) -{ - int len; - Boolean ret; - - // handle bad attempts to set the sequence - if (!new_seq) - return 0; // acceptable error - no debug - - len = strlen(new_seq); - ret = (len > 0) && (len < sizeof(cseq)); - if (ret) - safeStrCpy(cseq, new_seq, sizeof(cseq)/sizeof(cseq[0])); - else if (appData.debugMode) - fprintf(debugFP, "Invalid continuation sequence \"%s\" (maximum length is: %u)\n", new_seq, (unsigned) sizeof(cseq)-1); - return ret; -} - -/* - reformat a source message so words don't cross the width boundary. internal - newlines are not removed. returns the wrapped size (no null character unless - included in source message). If dest is NULL, only calculate the size required - for the dest buffer. lp argument indicats line position upon entry, and it's - passed back upon exit. -*/ -int -wrap (char *dest, char *src, int count, int width, int *lp) -{ - int len, i, ansi, cseq_len, line, old_line, old_i, old_len, clen; - - cseq_len = strlen(cseq); - old_line = line = *lp; - ansi = len = clen = 0; - - for (i=0; i < count; i++) - { - if (src[i] == '\033') - ansi = 1; - - // if we hit the width, back up - if (!ansi && (line >= width) && src[i] != '\n' && src[i] != ' ') - { - // store i & len in case the word is too long - old_i = i, old_len = len; - - // find the end of the last word - while (i && src[i] != ' ' && src[i] != '\n') - { - i--; - len--; - } - - // word too long? restore i & len before splitting it - if ((old_i-i+clen) >= width) - { - i = old_i; - len = old_len; - } - - // extra space? - if (i && src[i-1] == ' ') - len--; - - if (src[i] != ' ' && src[i] != '\n') - { - i--; - if (len) - len--; - } - - // now append the newline and continuation sequence - if (dest) - dest[len] = '\n'; - len++; - if (dest) - strncpy(dest+len, cseq, cseq_len); - len += cseq_len; - line = cseq_len; - clen = cseq_len; - continue; - } - - if (dest) - dest[len] = src[i]; - len++; - if (!ansi) - line++; - if (src[i] == '\n') - line = 0; - if (src[i] == 'm') - ansi = 0; - } - if (dest && appData.debugMode) - { - fprintf(debugFP, "wrap(count:%d,width:%d,line:%d,len:%d,*lp:%d,src: ", - count, width, line, len, *lp); - show_bytes(debugFP, src, count); - fprintf(debugFP, "\ndest: "); - show_bytes(debugFP, dest, len); - fprintf(debugFP, "\n"); - } - *lp = dest ? line : old_line; - - return len; -} - -// [HGM] vari: routines for shelving variations -Boolean modeRestore = FALSE; - -void -PushInner (int firstMove, int lastMove) -{ - int i, j, nrMoves = lastMove - firstMove; - - // push current tail of game on stack - savedResult[storedGames] = gameInfo.result; - savedDetails[storedGames] = gameInfo.resultDetails; - gameInfo.resultDetails = NULL; - savedFirst[storedGames] = firstMove; - savedLast [storedGames] = lastMove; - savedFramePtr[storedGames] = framePtr; - framePtr -= nrMoves; // reserve space for the boards - for(i=nrMoves; i>=1; i--) { // copy boards to stack, working downwards, in case of overlap - CopyBoard(boards[framePtr+i], boards[firstMove+i]); - for(j=0; j= MAX_VARIATIONS-2) return; // leave one for PV-walk - - PushInner(firstMove, lastMove); - if(storedGames == 1) GreyRevert(FALSE); - if(gameMode == PlayFromGameFile) gameMode = EditGame, modeRestore = TRUE; -} - -void -PopInner (Boolean annotate) -{ - int i, j, nrMoves; - char buf[8000], moveBuf[20]; - - ToNrEvent(savedFirst[storedGames-1]); // sets currentMove - storedGames--; // do this after ToNrEvent, to make sure HistorySet will refresh entire game after PopInner returns - nrMoves = savedLast[storedGames] - currentMove; - if(annotate) { - int cnt = 10; - if(!WhiteOnMove(currentMove)) - snprintf(buf, sizeof(buf)/sizeof(buf[0]),"(%d...", (currentMove+2)>>1); - else safeStrCpy(buf, "(", sizeof(buf)/sizeof(buf[0])); - for(i=currentMove; i>1, SavePart(parseList[i])); - else snprintf(moveBuf, sizeof(moveBuf)/sizeof(moveBuf[0])," %s", SavePart(parseList[i])); - strcat(buf, moveBuf); - if(commentList[i]) { strcat(buf, " "); strcat(buf, commentList[i]); } - if(!--cnt) { strcat(buf, "\n"); cnt = 10; } - } - strcat(buf, ")"); - } - for(i=1; i<=nrMoves; i++) { // copy last variation back - CopyBoard(boards[currentMove+i], boards[framePtr+i]); - for(j=0; j 0 && --level == 0 && p-text > index && end == NULL) end = p-1; - } - if(*p == wait) wait = NULLCHAR; // closing ]} found - p++; - } - if(!start || !end) return; // no variation found, or syntax error in PGN: ignore click - if(appData.debugMode) fprintf(debugFP, "at move %d load variation '%s'\n", currentMove, start); - end[1] = NULLCHAR; // clip off comment beyond variation - ToNrEvent(currentMove-1); - PushTail(currentMove, forwardMostMove); // shelve main variation. This truncates game - // kludge: use ParsePV() to append variation to game - move = currentMove; - ParsePV(start, TRUE, TRUE); - forwardMostMove = endPV; endPV = -1; currentMove = move; // cleanup what ParsePV did - ClearPremoveHighlights(); - CommentPopDown(); - ToNrEvent(currentMove+1); -} - -void -LoadTheme () -{ - char *p, *q, buf[MSG_SIZ]; - if(engineLine && engineLine[0]) { // a theme was selected from the listbox - snprintf(buf, MSG_SIZ, "-theme %s", engineLine); - ParseArgsFromString(buf); - ActivateTheme(TRUE); // also redo colors - return; - } - p = nickName; - if(*p && !strchr(p, '"')) // theme name specified and well-formed; add settings to theme list - { - int len; - q = appData.themeNames; - snprintf(buf, MSG_SIZ, "\"%s\"", nickName); - if(appData.useBitmaps) { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ubt true -lbtf \"%s\" -dbtf \"%s\" -lbtm %d -dbtm %d", - appData.liteBackTextureFile, appData.darkBackTextureFile, - appData.liteBackTextureMode, - appData.darkBackTextureMode ); - } else { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ubt false -lsc %s -dsc %s", - Col2Text(2), // lightSquareColor - Col2Text(3) ); // darkSquareColor - } - if(appData.useBorder) { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ub true -border \"%s\"", - appData.border); - } else { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ub false"); - } - if(appData.useFont) { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -upf true -pf \"%s\" -fptc \"%s\" -fpfcw %s -fpbcb %s", - appData.renderPiecesWithFont, - appData.fontToPieceTable, - Col2Text(9), // appData.fontBackColorWhite - Col2Text(10) ); // appData.fontForeColorBlack - } else { - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -upf false -pid \"%s\"", - appData.pieceDirectory); - if(!appData.pieceDirectory[0]) - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -wpc %s -bpc %s", - Col2Text(0), // whitePieceColor - Col2Text(1) ); // blackPieceColor - } - snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -hsc %s -phc %s\n", - Col2Text(4), // highlightSquareColor - Col2Text(5) ); // premoveHighlightColor - appData.themeNames = malloc(len = strlen(q) + strlen(buf) + 1); - if(insert != q) insert[-1] = NULLCHAR; - snprintf(appData.themeNames, len, "%s\n%s%s", q, buf, insert); - if(q) free(q); - } - ActivateTheme(FALSE); -} diff --git a/backend.h b/backend.h deleted file mode 100644 index fadc926..0000000 --- a/backend.h +++ /dev/null @@ -1,446 +0,0 @@ -/* - * backend.h -- Interface exported by XBoard back end - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * Enhancements Copyright 2005 Alessandro Scotti - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -#ifndef XB_BACKEND -#define XB_BACKEND - -#include "lists.h" - -typedef int (*FileProc) P((FILE *f, int n, char *title)); - -extern char *wbOptions; -extern int gotPremove; -extern GameMode gameMode; -extern int matchMode; -extern int matchGame; -extern int pausing, cmailMsgLoaded, flipView, mute; -extern char white_holding[], black_holding[]; -extern int currentMove, backwardMostMove, forwardMostMove; -extern int blackPlaysFirst; -extern FILE *debugFP; -extern char* programVersion; -extern Board boards[]; -extern char marker[BOARD_RANKS][BOARD_FILES]; -extern char lastMsg[MSG_SIZ]; -extern Boolean bookUp; -extern Boolean addToBookFlag; -extern int tinyLayout, smallLayout; -extern Boolean mcMode; -extern int dragging; -extern char variantError[]; -extern char lastTalker[]; - -void MarkMenuItem P((char *menuRef, int state)); -char *CmailMsg P((void)); -/* Tord: Added the useFEN960 parameter in PositionToFEN() below */ -char *PositionToFEN P((int move, char* useFEN960, int moveCounts)); -void AlphaRank P((char *s, int n)); /* [HGM] Shogi move preprocessor */ -void EditPositionPasteFEN P((char *fen)); -void TimeDelay P((long ms)); -void SendMultiLineToICS P(( char *text )); -void AnalysisPeriodicEvent P((int force)); -void SetWhiteToPlayEvent P((void)); -void SetBlackToPlayEvent P((void)); -void UploadGameEvent P((void)); -void InitBackEnd1 P((void)); -void InitBackEnd2 P((void)); -int HasPromotionChoice P((int fromX, int fromY, int toX, int toY, char *choice, int sweep)); -int InPalace P((int row, int column)); -int PieceForSquare P((int x, int y)); -int OKToStartUserMove P((int x, int y)); -void Reset P((int redraw, int init)); -void ResetGameEvent P((void)); -Boolean HasPattern P(( const char * text, const char * pattern )); -Boolean SearchPattern P(( const char * text, const char * pattern )); -int LoadGame P((FILE *f, int n, char *title, int useList)); -int LoadGameFromFile P((char *filename, int n, char *title, int useList)); -int CmailLoadGame P((FILE *f, int n, char *title, int useList)); -int ReloadGame P((int offset)); -int SaveSelected P((FILE *f, int dummy, char *dummy2)); -int SaveGame P((FILE *f, int dummy, char *dummy2)); -int SaveGameToFile P((char *filename, int append)); -int LoadPosition P((FILE *f, int n, char *title)); -int ReloadPosition P((int offset)); -int SavePosition P((FILE *f, int dummy, char *dummy2)); -int DrawSeekGraph P(()); -int SeekGraphClick P((ClickType click, int x, int y, int moving)); -void EditPositionEvent P((void)); -void FlipViewEvent P((void)); -void MachineWhiteEvent P((void)); -void MachineBlackEvent P((void)); -void TwoMachinesEvent P((void)); -void EditGameEvent P((void)); -void TrainingEvent P((void)); -void IcsClientEvent P((void)); -void ForwardEvent P((void)); -void BackwardEvent P((void)); -void ToEndEvent P((void)); -void ToStartEvent P((void)); -void ToNrEvent P((int to)); -void RevertEvent P((Boolean annotate)); -void RetractMoveEvent P((void)); -void MoveNowEvent P((void)); -void TruncateGameEvent P((void)); -void PauseEvent P((void)); -void CallFlagEvent P((void)); -void ClockClick P((int which)); -void AcceptEvent P((void)); -void DeclineEvent P((void)); -void RematchEvent P((void)); -void DrawEvent P((void)); -void AbortEvent P((void)); -void AdjournEvent P((void)); -void ResignEvent P((void)); -void UserAdjudicationEvent P((int result)); -void StopObservingEvent P((void)); -void StopExaminingEvent P((void)); -void PonderNextMoveEvent P((int newState)); -void ShowThinkingEvent P(()); -void PeriodicUpdatesEvent P((int newState)); -void HintEvent P((void)); -void BookEvent P((void)); -void AboutGameEvent P((void)); -void ExitEvent P((int status)); -char *DefaultFileName P((char *)); -ChessMove UserMoveTest P((int fromX, int fromY, int toX, int toY, int promoChar, Boolean captureOwn)); -void UserMoveEvent P((int fromX, int fromY, int toX, int toY, int promoChar)); -void DecrementClocks P((void)); -char *TimeString P((long millisec)); -void AutoPlayGameLoop P((void)); -void AdjustClock P((Boolean which, int dir)); -void DisplayBothClocks P((void)); -void EditPositionMenuEvent P((ChessSquare selection, int x, int y)); -void DropMenuEvent P((ChessSquare selection, int x, int y)); -int ParseTimeControl P((char *tc, float ti, int mps)); -void EscapeExpand(char *p, char *q); -void ProcessICSInitScript P((FILE * f)); -void EditCommentEvent P((void)); -void ReplaceComment P((int index, char *text)); -int ReplaceTags P((char *tags, GameInfo *gi));/* returns nonzero on error */ -void AppendComment P((int index, char *text, Boolean addBraces)); -void LoadVariation P((int index, char *text)); -void ReloadCmailMsgEvent P((int unregister)); -void MailMoveEvent P((void)); -void EditTagsEvent P((void)); -void GetMoveListEvent P((void)); -void ExitAnalyzeMode P((void)); -int AnalyzeModeEvent P((void)); -void AnalyzeFileEvent P((void)); -void MatchEvent P((int mode)); -void RecentEngineEvent P((int nr)); -void TypeInEvent P((char first)); -void TypeInDoneEvent P((char *move)); -void InitPosition P((int redraw)); -void NewSettingEvent P((int option, int *feature, char *command, int value)); -void SettingsMenuIfReady P((void)); -void DoEcho P((void)); -void DontEcho P((void)); -void TidyProgramName P((char *prog, char *host, char *buf)); -void SetGameInfo P((void)); -void AskQuestionEvent P((char *title, char *question, - char *replyPrefix, char *which)); -Boolean ParseOneMove P((char *move, int moveNum, - ChessMove *moveType, int *fromX, int *fromY, - int *toX, int *toY, char *promoChar)); -char *VariantName P((VariantClass v)); -VariantClass StringToVariant P((char *e)); -double u64ToDouble P((u64 value)); -void OutputChatMessage P((int partner, char *mess)); -void EditPositionDone P((Boolean fakeRights)); -Boolean GetArgValue P((char *name)); -Boolean LoadPV P((int x, int y)); -Boolean LoadMultiPV P((int x, int y, char *buf, int index, int *start, int *end, int pane)); -void UnLoadPV P(()); -void MovePV P((int x, int y, int h)); -int PromoScroll P((int x, int y)); -void EditBookEvent P((void)); -Boolean DisplayBook P((int moveNr)); -void SaveToBook P((char *text)); -void AddBookMove P((char *text)); -void PlayBookMove P((char *text, int index)); -void HoverEvent P((int hiX, int hiY, int x, int y)); -int PackGame P((Board board)); -Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen, Boolean autoSize)); -void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, Board board)); -void PackMove P((int fromX, int fromY, int toX, int toY, ChessSquare promoPiece)); -void ics_printf P((char *format, ...)); -int GetEngineLine P((char *nick, int engine)); -void AddGameToBook P((int always)); -void FlushBook P((void)); -char PieceToChar P((ChessSquare p)); -int LoadPieceDesc P((char *s)); - -char *StrStr P((char *string, char *match)); -char *StrCaseStr P((char *string, char *match)); -char *StrSave P((char *s)); -char *StrSavePtr P((char *s, char **savePtr)); -char *SavePart P((char *)); -char* safeStrCpy P(( char *dst, const char *src, size_t count )); - -#ifndef _amigados -int StrCaseCmp P((char *s1, char *s2)); -int ToLower P((int c)); -int ToUpper P((int c)); -#else -#define StrCaseCmp Stricmp /* Use utility.library functions */ -#include -#endif - -extern GameInfo gameInfo; - -/* ICS vars used with backend.c and zippy.c */ -enum ICS_TYPE { ICS_GENERIC, ICS_ICC, ICS_FICS, ICS_CHESSNET /* not really supported */ }; -enum ICS_TYPE ics_type; - -/* pgntags.c prototypes - */ -char *PGNTags P((GameInfo *)); -void PrintPGNTags P((FILE *f, GameInfo *)); -int ParsePGNTag P((char *, GameInfo *)); -char *PGNResult P((ChessMove result)); - - -/* gamelist.c prototypes - */ -/* A game node in the double linked list of games. - */ -typedef struct XB_ListGame { - ListNode node; - int number; - int position; - int moves; - unsigned long offset; /* Byte offset of game within file. */ - GameInfo gameInfo; /* Note that some entries may be NULL. */ -} ListGame; - -extern int border; -extern int doubleClick; -extern int storedGames; -extern int opponentKibitzes; -extern ChessSquare gatingPiece; -extern List gameList; -extern int lastLoadGameNumber; -void ClearGameInfo P((GameInfo *)); -int GameListBuild P((FILE *)); -void GameListInitGameInfo P((GameInfo *)); -char *GameListLine P((int, GameInfo *)); -char * GameListLineFull P(( int, GameInfo *)); -void InitSearch P((void)); -int GameContainsPosition P((FILE *f, ListGame *lg)); -void GLT_TagsToList P(( char * tags )); -void GLT_ParseList P((void)); -int NamesToList P((char *name, char **engines, char **mnemonics, char *group)); -int CreateTourney P((char *name)); -char *MakeName P((char *templ)); -void SwapEngines P((int n)); -void Substitute P((char *participants, int expunge)); - -extern char* StripHighlight P((char *)); /* returns static data */ -extern char* StripHighlightAndTitle P((char *)); /* returns static data */ -extern void ics_update_width P((int new_width)); -extern Boolean set_cont_sequence P((char *new_seq)); -extern int wrap P((char *dest, char *src, int count, int width, int *lp)); -int Explode P((Board board, int fromX, int fromY, int toX, int toY)); - -typedef enum { CheckBox, ComboBox, TextBox, Button, Spin, ResetButton, SaveButton, ListBox, Graph, PopUp, - FileName, PathName, Slider, Message, Fractional, Label, Icon, - BoxBegin, BoxEnd, BarBegin, BarEnd, DropDown, Break, EndMark, Skip } Control; - -typedef struct XB_OPT { // [HGM] options: descriptor of UCI-style option - int value; // current setting, starts as default - int min; // Also used for flags - int max; - void *handle; // for use by front end - void *target; // for use by front end - char *textValue; // points to beginning of text value in name field - char **choice; // points to array of combo choices in cps->combo - Control type; - char *name; // holds both option name and text value (in allocated memory) - char **font; -} Option; - -typedef struct XB_CPS { - char *which; - int maybeThinking; - ProcRef pr; - InputSourceRef isr; - char *twoMachinesColor; /* "white\n" or "black\n" */ - char *program; - char *host; - char *dir; - struct XB_CPS *other; - char *initString; - char *computerString; - int sendTime; /* 0=don't, 1=do, 2=test */ - int sendDrawOffers; - int useSigint; - int useSigterm; - int offeredDraw; /* countdown */ - int reuse; - int useSetboard; /* 0=use "edit"; 1=use "setboard" */ - int extendedEdit;/* 1=also set holdings with "edit" */ - int useSAN; /* 0=use coordinate notation; 1=use SAN */ - int usePing; /* 0=not OK to use ping; 1=OK */ - int lastPing; - int lastPong; - int usePlayother;/* 0=not OK to use playother; 1=OK */ - int useColors; /* 0=avoid obsolete white/black commands; 1=use them */ - int useUsermove; /* 0=just send move; 1=send "usermove move" */ - int sendICS; /* 0=don't use "ics" command; 1=do */ - int sendName; /* 0=don't use "name" command; 1=do */ - int sdKludge; /* 0=use "sd DEPTH" command; 1=use "depth\nDEPTH" */ - int stKludge; /* 0=use "st TIME" command; 1=use "level 1 TIME" */ - int excludeMoves;/* 0=don't use "exclude" command; 1=do */ - char *tidy; - int matchWins; - char *variants; - int analysisSupport; - int analyzing; - int protocolVersion; - int initDone; - int pseudo; - - /* Added by Tord: */ - int useFEN960; /* 0=use "KQkq" style FENs, 1=use "HAha" style FENs */ - int useOOCastle; /* 0="O-O" notation for castling, 1="king capture rook" notation */ - /* End of additions by Tord */ - - int scoreIsAbsolute; /* [AS] 0=don't know (standard), 1=score is always from white side */ - int isUCI; /* [AS] 0=no (Winboard), 1=UCI (requires Polyglot) */ - int hasOwnBookUCI; /* [AS] 0=use GUI or Polyglot book, 1=has own book */ - - /* [HGM] time odds */ - float timeOdds; /* factor through which we divide time for this engine */ - int debug; /* [HGM] ignore engine debug lines starting with '#' */ - int maxNrOfSessions; /* [HGM] secondary TC: max args in 'level' command */ - int accumulateTC; /* [HGM] secondary TC: how to handle extra sessions */ - int drawDepth; /* [HGM] egbb: search depth to play egbb draws */ - int nps; /* [HGM] nps: factor for node count to replace time */ - int supportsNPS; - int alphaRank; /* [HGM] shogi: engine uses shogi-type coordinates */ - int maxCores; /* [HGM] SMP: engine understands cores command */ - int memSize; /* [HGM] memsize: engine understands memory command */ - char *egtFormats; /* [HGM] EGT: supported tablebase formats */ - int bookSuspend; /* [HGM] book: go was deferred because of book hit */ - int pause; /* [HGM] pause: 1=supports it, 2=actually paused */ - int highlight; /* [HGM] engine wants to get lift and put commands */ - int nrOptions; /* [HGM] options: remembered option="..." features */ -#define MAX_OPTIONS 200 - Option option[MAX_OPTIONS]; - int comboCnt; - char *comboList[20*MAX_OPTIONS]; - char *optionSettings; - void *programLogo; /* [HGM] logo: bitmap of the logo */ - char *fenOverride; /* [HGM} FRC: force FEN casling & ep fields by hand */ - char userError; /* [HGM] crash: flag to suppress fatal-error messages*/ - char reload; /* [HGM] options: flag to resend options with xreuse */ -} ChessProgramState; - -extern ChessProgramState first, second; - -/* Search stats from chessprogram */ -typedef struct { - char movelist[2*MSG_SIZ]; /* Last PV we were sent */ - int depth; /* Current search depth */ - int nr_moves; /* Total nr of root moves */ - int moves_left; /* Moves remaining to be searched */ - char move_name[MOVE_LEN]; /* Current move being searched, if provided */ - u64 nodes; /* # of nodes searched */ - int time; /* Search time (centiseconds) */ - int score; /* Score (centipawns) */ - int got_only_move; /* If last msg was "(only move)" */ - int got_fail; /* 0 - nothing, 1 - got "--", 2 - got "++" */ - int ok_to_send; /* handshaking between send & recv */ - int line_is_book; /* 1 if movelist is book moves */ - int seen_stat; /* 1 if we've seen the stat01: line */ -} ChessProgramStats; - -extern ChessProgramStats_Move pvInfoList[MAX_MOVES]; -extern Boolean shuffleOpenings; -extern ChessProgramStats programStats; -extern int opponentKibitzes; // used by wengineo.c -extern int errorExitStatus; -extern char *recentEngines; -extern char *comboLine; -extern Boolean partnerUp, twoBoards; -extern char engineVariant[]; -char *EngineDefinedVariant P((ChessProgramState *cps, int n)); -void SettingsPopUp P((ChessProgramState *cps)); // [HGM] really in front-end, but CPS not known in frontend.h -int WaitForEngine P((ChessProgramState *cps, DelayedEventCallback x)); -void Load P((ChessProgramState *cps, int n)); -int MultiPV P((ChessProgramState *cps, int kind)); -void MoveHistorySet P(( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo )); -void MakeEngineOutputTitle P((void)); -void LoadTheme P((void)); -void CreateBookEvent P((void)); -char *SupportedVariant P((char *list, VariantClass v, int w, int h, int s, int proto, char *engine)); -char *CollectPieceDescriptors P((void)); -void RefreshSettingsDialog P((ChessProgramState *cps, int val)); -void StartChessProgram P((ChessProgramState *cps)); -void SendToICS P((char *s)); -int PosFlags P((int n)); - - -/* A point in time */ -typedef struct { - long sec; /* Assuming this is >= 32 bits */ - int ms; /* Assuming this is >= 16 bits */ -} TimeMark; - -extern TimeMark programStartTime; - -void GetTimeMark P((TimeMark *)); -long SubtractTimeMarks P((TimeMark *, TimeMark *)); - -#endif /* XB_BACKEND */ diff --git a/backendz.h b/backendz.h deleted file mode 100644 index 8946e62..0000000 --- a/backendz.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * backendz.h -- Internal interface exported by XBoard backend.c to zippy.c - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * Enhancements Copyright 2005 Alessandro Scotti - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -#ifndef XB_BACKENDZ -#define XB_BACKENDZ - -extern long whiteTimeRemaining, blackTimeRemaining; -extern int forwardMostMove; -extern char star_match[STAR_MATCH_N][MSG_SIZ]; -extern ProcRef firstProgramPR; -extern int startedFromSetupPosition; -extern int firstMove; -extern GameInfo gameInfo; -extern void ics_printf P((char *format, ...)); -extern void SendToICS P((char *s)); -extern int looking_at P((char *, int *, char *)); -extern void SendToProgram P((char *message, ChessProgramState *cps)); -extern void SendBoard P((ChessProgramState *cps, int moveNum)); -void SendTimeRemaining P((ChessProgramState *cps, - int/*boolean*/ machineWhite)); - -extern char ics_handle[]; -extern char *ics_prefix; - -#endif diff --git a/bitmaps/checkmark.bm b/bitmaps/checkmark.bm deleted file mode 100644 index 869e77b..0000000 --- a/bitmaps/checkmark.bm +++ /dev/null @@ -1,6 +0,0 @@ -#define checkmark_width 11 -#define checkmark_height 11 - -static unsigned char checkmark_bits[] = { - 0x0f, 0x04, 0x0f, 0x02, 0x1e, 0x01, 0x3c, 0x01, 0xb8, 0x00, 0x58, 0x00, - 0xe8, 0x00, 0xe4, 0x01, 0xc4, 0x03, 0xc2, 0x03, 0x81, 0x07 }; diff --git a/bitmaps/icon_black.bm b/bitmaps/icon_black.bm deleted file mode 100644 index b7c120e..0000000 --- a/bitmaps/icon_black.bm +++ /dev/null @@ -1,14 +0,0 @@ -#define icon_black_width 32 -#define icon_black_height 32 -static unsigned char icon_black_bits[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xff, - 0xff, 0x9c, 0xff, 0xff, 0xff, 0x18, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, - 0xff, 0x18, 0xf3, 0xff, 0x7f, 0x04, 0xcc, 0xff, 0x7f, 0x00, 0x90, 0xff, - 0x3f, 0x06, 0x20, 0xff, 0x3f, 0x01, 0x40, 0xfe, 0x3f, 0x01, 0xc0, 0xfe, - 0x1f, 0x00, 0x80, 0xfc, 0x1f, 0x00, 0x80, 0xfd, 0x0f, 0x00, 0x01, 0xf9, - 0x0f, 0x00, 0x00, 0xfb, 0x07, 0x00, 0x00, 0xfa, 0x07, 0xc0, 0x00, 0xf6, - 0x13, 0xf0, 0x00, 0xf6, 0x13, 0x78, 0x00, 0xf6, 0x43, 0x7c, 0x00, 0xf6, - 0x03, 0x3e, 0x00, 0xf4, 0x07, 0x1f, 0x00, 0xec, 0xff, 0x0f, 0x00, 0xec, - 0xff, 0x07, 0x00, 0xec, 0xff, 0x03, 0x00, 0xec, 0xff, 0x03, 0x00, 0xec, - 0xff, 0x01, 0x00, 0xec, 0xff, 0x01, 0x00, 0xe8, 0xff, 0x01, 0x00, 0xe0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; diff --git a/bitmaps/icon_white.bm b/bitmaps/icon_white.bm deleted file mode 100644 index 8c3c98e..0000000 --- a/bitmaps/icon_white.bm +++ /dev/null @@ -1,14 +0,0 @@ -#define icon_white_width 32 -#define icon_white_height 32 -static unsigned char icon_white_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, - 0x00, 0x63, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, - 0x00, 0xe7, 0x0c, 0x00, 0x80, 0xfb, 0x33, 0x00, 0x80, 0xff, 0x6f, 0x00, - 0xc0, 0xf9, 0xdf, 0x00, 0xc0, 0xfe, 0xbf, 0x01, 0xc0, 0xfe, 0x3f, 0x01, - 0xe0, 0xff, 0x7f, 0x03, 0xe0, 0xff, 0x7f, 0x02, 0xf0, 0xff, 0xfe, 0x06, - 0xf0, 0xff, 0xff, 0x04, 0xf8, 0xff, 0xff, 0x05, 0xf8, 0x3f, 0xff, 0x09, - 0xec, 0x0f, 0xff, 0x09, 0xec, 0x87, 0xff, 0x09, 0xbc, 0x83, 0xff, 0x09, - 0xfc, 0xc1, 0xff, 0x0b, 0xf8, 0xe0, 0xff, 0x13, 0x00, 0xf0, 0xff, 0x13, - 0x00, 0xf8, 0xff, 0x13, 0x00, 0xfc, 0xff, 0x13, 0x00, 0xfc, 0xff, 0x13, - 0x00, 0xfe, 0xff, 0x13, 0x00, 0xfe, 0xff, 0x17, 0x00, 0xfe, 0xff, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/board.c b/board.c deleted file mode 100644 index a0ce36e..0000000 --- a/board.c +++ /dev/null @@ -1,1286 +0,0 @@ -/* - * board.c -- platform-independent drawing code for XBoard - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -#define HIGHDRAG 1 - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -#else /* not STDC_HEADERS */ -extern char *getenv(); -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#if HAVE_UNISTD_H -# include -#endif - -#if HAVE_SYS_WAIT_H -# include -#endif - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "xboard2.h" -#include "moves.h" -#include "board.h" -#include "draw.h" - - -#ifdef __EMX__ -#ifndef HAVE_USLEEP -#define HAVE_USLEEP -#endif -#define usleep(t) _sleep2(((t)+500)/1000) -#endif - - -int squareSize, lineGap; - -int damage[2][BOARD_RANKS][BOARD_FILES]; - -/* There can be two pieces being animated at once: a player - can begin dragging a piece before the remote opponent has moved. */ - -AnimState anims[NrOfAnims]; - -static void DrawSquare P((int row, int column, ChessSquare piece, int do_flash)); -static Boolean IsDrawArrowEnabled P((void)); -static void DrawArrowHighlight P((int fromX, int fromY, int toX,int toY)); -static void ArrowDamage P((int s_col, int s_row, int d_col, int d_row)); - -static void -drawHighlight (int file, int rank, int type) -{ - int x, y; - - if (lineGap == 0) return; - - if (flipView) { - x = lineGap/2 + ((BOARD_WIDTH-1)-file) * - (squareSize + lineGap); - y = lineGap/2 + rank * (squareSize + lineGap); - } else { - x = lineGap/2 + file * (squareSize + lineGap); - y = lineGap/2 + ((BOARD_HEIGHT-1)-rank) * - (squareSize + lineGap); - } - - DrawBorder(x,y, type, lineGap & 1); // pass whether lineGap is odd -} - -int hi1X = -1, hi1Y = -1, hi2X = -1, hi2Y = -1; -int pm1X = -1, pm1Y = -1, pm2X = -1, pm2Y = -1; - -void -SetHighlights (int fromX, int fromY, int toX, int toY) -{ // [HGM] schedule old for erasure, and leave drawing new to DrawPosition - int change = 0; - - if (hi1X >= 0 && hi1Y >= 0) { - if (hi1X != fromX || hi1Y != fromY) { - damage[0][hi1Y][hi1X] |= 2; - change |= 1; - } - change |= 4; - } - - if (hi2X >= 0 && hi2Y >= 0) { - if (hi2X != toX || hi2Y != toY) { - damage[0][hi2Y][hi2X] |= 2; - change |= 2; - } - change |= 8; - } - - if(change > 12 && IsDrawArrowEnabled()) ArrowDamage(hi1X, hi1Y, hi2X, hi2Y); - - hi1X = fromX; - hi1Y = fromY; - hi2X = toX; - hi2Y = toY; -} - -void -ClearHighlights () -{ - SetHighlights(-1, -1, -1, -1); -} - - -void -SetPremoveHighlights (int fromX, int fromY, int toX, int toY) -{ - if (pm1X != fromX || pm1Y != fromY) { - if (pm1X >= 0 && pm1Y >= 0) { - damage[0][pm1Y][pm1X] |= 2; - } - } - if (pm2X != toX || pm2Y != toY) { - if (pm2X >= 0 && pm2Y >= 0) { - damage[0][pm2Y][pm2X] |= 2; - } - } - pm1X = fromX; - pm1Y = fromY; - pm2X = toX; - pm2Y = toY; -} - -void -ClearPremoveHighlights () -{ - SetPremoveHighlights(-1, -1, -1, -1); -} - -/* - * If the user selects on a border boundary, return -1; if off the board, - * return -2. Otherwise map the event coordinate to the square. - */ -int -EventToSquare (int x, int limit) -{ - if (x <= 0) - return -2; - if (x < lineGap) - return -1; - x -= lineGap; - if ((x % (squareSize + lineGap)) >= squareSize) - return -1; - x /= (squareSize + lineGap); - if (x >= limit) - return -2; - return x; -} - -/* [HR] determine square color depending on chess variant. */ -int -SquareColor (int row, int column) -{ - int square_color; - - if (gameInfo.variant == VariantXiangqi) { - if (column >= 3 && column <= 5 && row >= 0 && row <= 2) { - square_color = 1; - } else if (column >= 3 && column <= 5 && row >= 7 && row <= 9) { - square_color = 0; - } else if (row <= 4) { - square_color = 0; - } else { - square_color = 1; - } - } else { - square_color = ((column + row) % 2) == 1; - } - - /* [hgm] holdings: next line makes all holdings squares light */ - if(column < BOARD_LEFT || column >= BOARD_RGHT) square_color = 1; - - if ( // [HGM] holdings: blank out area between board and holdings - column == BOARD_LEFT-1 - || column == BOARD_RGHT - || (column == BOARD_LEFT-2 && row < BOARD_HEIGHT-gameInfo.holdingsSize) - || (column == BOARD_RGHT+1 && row >= gameInfo.holdingsSize) ) - square_color = 2; // black - - return square_color; -} - -/* Convert board position to corner of screen rect and color */ - -void -ScreenSquare (int column, int row, Pnt *pt, int *color) -{ - if (flipView) { - pt->x = lineGap + ((BOARD_WIDTH-1)-column) * (squareSize + lineGap); - pt->y = lineGap + row * (squareSize + lineGap); - } else { - pt->x = lineGap + column * (squareSize + lineGap); - pt->y = lineGap + ((BOARD_HEIGHT-1)-row) * (squareSize + lineGap); - } - *color = SquareColor(row, column); -} - -/* Convert window coords to square */ - -void -BoardSquare (int x, int y, int *column, int *row) -{ - *column = EventToSquare(x, BOARD_WIDTH); - if (flipView && *column >= 0) - *column = BOARD_WIDTH - 1 - *column; - *row = EventToSquare(y, BOARD_HEIGHT); - if (!flipView && *row >= 0) - *row = BOARD_HEIGHT - 1 - *row; -} - -/* Generate a series of frame coords from start->mid->finish. - The movement rate doubles until the half way point is - reached, then halves back down to the final destination, - which gives a nice slow in/out effect. The algorithmn - may seem to generate too many intermediates for short - moves, but remember that the purpose is to attract the - viewers attention to the piece about to be moved and - then to where it ends up. Too few frames would be less - noticeable. */ - -static void -Tween (Pnt *start, Pnt *mid, Pnt *finish, int factor, Pnt frames[], int *nFrames) -{ - int fraction, n, count; - - count = 0; - - /* Slow in, stepping 1/16th, then 1/8th, ... */ - fraction = 1; - for (n = 0; n < factor; n++) - fraction *= 2; - for (n = 0; n < factor; n++) { - frames[count].x = start->x + (mid->x - start->x) / fraction; - frames[count].y = start->y + (mid->y - start->y) / fraction; - count ++; - fraction = fraction / 2; - } - - /* Midpoint */ - frames[count] = *mid; - count ++; - - /* Slow out, stepping 1/2, then 1/4, ... */ - fraction = 2; - for (n = 0; n < factor; n++) { - frames[count].x = finish->x - (finish->x - mid->x) / fraction; - frames[count].y = finish->y - (finish->y - mid->y) / fraction; - count ++; - fraction = fraction * 2; - } - *nFrames = count; -} - -/**** Animation code by Hugh Fisher, DCS, ANU. - - Known problem: if a window overlapping the board is - moved away while a piece is being animated underneath, - the newly exposed area won't be updated properly. - I can live with this. - - Known problem: if you look carefully at the animation - of pieces in mono mode, they are being drawn as solid - shapes without interior detail while moving. Fixing - this would be a major complication for minimal return. -****/ - -/* Utilities */ - -#undef Max /* just in case */ -#undef Min -#define Max(a, b) ((a) > (b) ? (a) : (b)) -#define Min(a, b) ((a) < (b) ? (a) : (b)) - -typedef struct { - short int x, y, width, height; -} MyRectangle; - -void -DoSleep (int n) -{ - FrameDelay(n); -} - -static void -SetRect (MyRectangle *rect, int x, int y, int width, int height) -{ - rect->x = x; - rect->y = y; - rect->width = width; - rect->height = height; -} - -/* Test if two frames overlap. If they do, return - intersection rect within old and location of - that rect within new. */ - -static Boolean -Intersect ( Pnt *old, Pnt *new, int size, MyRectangle *area, Pnt *pt) -{ - if (old->x > new->x + size || new->x > old->x + size || - old->y > new->y + size || new->y > old->y + size) { - return False; - } else { - SetRect(area, Max(new->x - old->x, 0), Max(new->y - old->y, 0), - size - abs(old->x - new->x), size - abs(old->y - new->y)); - pt->x = Max(old->x - new->x, 0); - pt->y = Max(old->y - new->y, 0); - return True; - } -} - -/* For two overlapping frames, return the rect(s) - in the old that do not intersect with the new. */ - -static void -CalcUpdateRects (Pnt *old, Pnt *new, int size, MyRectangle update[], int *nUpdates) -{ - int count; - - /* If old = new (shouldn't happen) then nothing to draw */ - if (old->x == new->x && old->y == new->y) { - *nUpdates = 0; - return; - } - /* Work out what bits overlap. Since we know the rects - are the same size we don't need a full intersect calc. */ - count = 0; - /* Top or bottom edge? */ - if (new->y > old->y) { - SetRect(&(update[count]), old->x, old->y, size, new->y - old->y); - count ++; - } else if (old->y > new->y) { - SetRect(&(update[count]), old->x, old->y + size - (old->y - new->y), - size, old->y - new->y); - count ++; - } - /* Left or right edge - don't overlap any update calculated above. */ - if (new->x > old->x) { - SetRect(&(update[count]), old->x, Max(new->y, old->y), - new->x - old->x, size - abs(new->y - old->y)); - count ++; - } else if (old->x > new->x) { - SetRect(&(update[count]), new->x + size, Max(new->y, old->y), - old->x - new->x, size - abs(new->y - old->y)); - count ++; - } - /* Done */ - *nUpdates = count; -} - -/* Animate the movement of a single piece */ - -static void -BeginAnimation (AnimNr anr, ChessSquare piece, ChessSquare bgPiece, int startColor, Pnt *start) -{ - AnimState *anim = &anims[anr]; - - if(appData.upsideDown && flipView) piece += piece < BlackPawn ? BlackPawn : -BlackPawn; - /* The old buffer is initialised with the start square (empty) */ - if(bgPiece == EmptySquare) { - DrawBlank(anr, start->x, start->y, startColor); - } else { - /* Kludge alert: When gating we want the introduced - piece to appear on the from square. To generate an - image of it, we draw it on the board, copy the image, - and draw the original piece again. */ - if(piece != bgPiece) DrawSquare(anim->startBoardY, anim->startBoardX, bgPiece, 0); - CopyRectangle(anr, DISP, 2, - start->x, start->y, squareSize, squareSize, - 0, 0); // [HGM] zh: unstack in stead of grab - if(piece != bgPiece) DrawSquare(anim->startBoardY, anim->startBoardX, piece, 0); - } - anim->prevFrame = *start; - - SetDragPiece(anr, piece); -} - -static void -AnimationFrame (AnimNr anr, Pnt *frame, ChessSquare piece) -{ - MyRectangle updates[4]; - MyRectangle overlap; - Pnt pt; - AnimState *anim = &anims[anr]; - int count, i, x, y, w, h; - - /* Save what we are about to draw into the new buffer */ - CopyRectangle(anr, DISP, 0, - x = frame->x, y = frame->y, w = squareSize, h = squareSize, - 0, 0); - - /* Erase bits of the previous frame */ - if (Intersect(&anim->prevFrame, frame, squareSize, &overlap, &pt)) { - /* Where the new frame overlapped the previous, - the contents in newBuf are wrong. */ - CopyRectangle(anr, 2, 0, - overlap.x, overlap.y, - overlap.width, overlap.height, - pt.x, pt.y); - /* Repaint the areas in the old that don't overlap new */ - CalcUpdateRects(&anim->prevFrame, frame, squareSize, updates, &count); - for (i = 0; i < count; i++) - CopyRectangle(anr, 2, DISP, - updates[i].x - anim->prevFrame.x, - updates[i].y - anim->prevFrame.y, - updates[i].width, updates[i].height, - updates[i].x, updates[i].y); - /* [HGM] correct expose rectangle to encompass both overlapping squares */ - if(x > anim->prevFrame.x) w += x - anim->prevFrame.x, x = anim->prevFrame.x; - else w += anim->prevFrame.x - x; - if(y > anim->prevFrame.y) h += y - anim->prevFrame.y, y = anim->prevFrame.y; - else h += anim->prevFrame.y - y; - } else { - /* Easy when no overlap */ - CopyRectangle(anr, 2, DISP, - 0, 0, squareSize, squareSize, - anim->prevFrame.x, anim->prevFrame.y); - GraphExpose(currBoard, anim->prevFrame.x, anim->prevFrame.y, squareSize, squareSize); - } - - /* Save this frame for next time round */ - CopyRectangle(anr, 0, 2, - 0, 0, squareSize, squareSize, - 0, 0); - anim->prevFrame = *frame; - - /* Draw piece over original screen contents, not current, - and copy entire rect. Wipes out overlapping piece images. */ - InsertPiece(anr, piece); - CopyRectangle(anr, 0, DISP, - 0, 0, squareSize, squareSize, - frame->x, frame->y); - GraphExpose(currBoard, x, y, w, h); -} - -static void -EndAnimation (AnimNr anr, Pnt *finish) -{ - MyRectangle updates[4]; - MyRectangle overlap; - Pnt pt; - int count, i; - AnimState *anim = &anims[anr]; - - /* The main code will redraw the final square, so we - only need to erase the bits that don't overlap. */ - if (Intersect(&anim->prevFrame, finish, squareSize, &overlap, &pt)) { - CalcUpdateRects(&anim->prevFrame, finish, squareSize, updates, &count); - for (i = 0; i < count; i++) - CopyRectangle(anr, 2, DISP, - updates[i].x - anim->prevFrame.x, - updates[i].y - anim->prevFrame.y, - updates[i].width, updates[i].height, - updates[i].x, updates[i].y); - } else { - CopyRectangle(anr, 2, DISP, - 0, 0, squareSize, squareSize, - anim->prevFrame.x, anim->prevFrame.y); - } -} - -static void -FrameSequence (AnimNr anr, ChessSquare piece, int startColor, Pnt *start, Pnt *finish, Pnt frames[], int nFrames) -{ - int n; - - BeginAnimation(anr, piece, EmptySquare, startColor, start); - for (n = 0; n < nFrames; n++) { - AnimationFrame(anr, &(frames[n]), piece); - FrameDelay(appData.animSpeed); - } - EndAnimation(anr, finish); -} - -void -AnimateAtomicCapture (Board board, int fromX, int fromY, int toX, int toY) -{ - int i, x, y; - ChessSquare piece = board[fromY][toY]; - board[fromY][toY] = EmptySquare; - DrawPosition(FALSE, board); - if (flipView) { - x = lineGap + ((BOARD_WIDTH-1)-toX) * (squareSize + lineGap); - y = lineGap + toY * (squareSize + lineGap); - } else { - x = lineGap + toX * (squareSize + lineGap); - y = lineGap + ((BOARD_HEIGHT-1)-toY) * (squareSize + lineGap); - } - for(i=1; i<4*kFactor; i++) { - int r = squareSize * 9 * i/(20*kFactor - 5); - DrawDot(1, x + squareSize/2 - r, y+squareSize/2 - r, 2*r); - FrameDelay(appData.animSpeed); - } - board[fromY][toY] = piece; - DrawGrid(); -} - -/* Main control logic for deciding what to animate and how */ - -void -AnimateMove (Board board, int fromX, int fromY, int toX, int toY) -{ - ChessSquare piece; - int hop, x = toX, y = toY, x2 = kill2X; - Pnt start, finish, mid; - Pnt frames[kFactor * 2 + 1]; - int nFrames, startColor, endColor; - - if(killX >= 0 && IS_LION(board[fromY][fromX])) Roar(); - - /* Are we animating? */ - if (!appData.animate || appData.blindfold) - return; - - if(board[toY][toX] == WhiteRook && board[fromY][fromX] == WhiteKing || - board[toY][toX] == BlackRook && board[fromY][fromX] == BlackKing || - board[toY][toX] == WhiteKing && board[fromY][fromX] == WhiteRook || // [HGM] seirawan - board[toY][toX] == BlackKing && board[fromY][fromX] == BlackRook) - return; // [HGM] FRC: no animtion of FRC castlings, as to-square is not true to-square - - if (fromY < 0 || fromX < 0 || toX < 0 || toY < 0) return; - piece = board[fromY][fromX]; - if (piece >= EmptySquare) return; - - if(x2 >= 0) toX = kill2X, toY = kill2Y; else - if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square - -again: - -#if DONT_HOP - hop = FALSE; -#else - hop = abs(fromX-toX) == 1 && abs(fromY-toY) == 2 || abs(fromX-toX) == 2 && abs(fromY-toY) == 1; -#endif - - ScreenSquare(fromX, fromY, &start, &startColor); - ScreenSquare(toX, toY, &finish, &endColor); - - if (hop) { - /* Knight: make straight movement then diagonal */ - if (abs(toY - fromY) < abs(toX - fromX)) { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = start.y; - } else { - mid.x = start.x; - mid.y = start.y + (finish.y - start.y) / 2; - } - } else { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = start.y + (finish.y - start.y) / 2; - } - - /* Don't use as many frames for very short moves */ - if (abs(toY - fromY) + abs(toX - fromX) <= 2) - Tween(&start, &mid, &finish, kFactor - 1, frames, &nFrames); - else - Tween(&start, &mid, &finish, kFactor, frames, &nFrames); - FrameSequence(Game, piece, startColor, &start, &finish, frames, nFrames); - if(Explode(board, fromX, fromY, toX, toY)) { // mark as damaged - int i,j; - for(i=0; i= 0 && anims[Player].dragPiece < EmptySquare) { - ChessSquare bgPiece = EmptySquare; - anims[Player].dragActive = True; - if(boardX == BOARD_RGHT+1 && PieceForSquare(boardX-1, boardY) > 1 || - boardX == BOARD_LEFT-2 && PieceForSquare(boardX+1, boardY) > 1) - bgPiece = anims[Player].dragPiece; - if(gatingPiece != EmptySquare) bgPiece = gatingPiece; - BeginAnimation(Player, anims[Player].dragPiece, bgPiece, color, &corner); - /* Mark this square as needing to be redrawn. Note that - we don't remove the piece though, since logically (ie - as seen by opponent) the move hasn't been made yet. */ - damage[0][boardY][boardX] |= True; - } else { - anims[Player].dragActive = False; - } -} - -/* Handle expose event while piece being dragged */ - -static void -DrawDragPiece () -{ - if (!anims[Player].dragActive || appData.blindfold) - return; - - /* What we're doing: logically, the move hasn't been made yet, - so the piece is still in it's original square. But visually - it's being dragged around the board. So we erase the square - that the piece is on and draw it at the last known drag point. */ - DrawOneSquare(anims[Player].startSquare.x, anims[Player].startSquare.y, - EmptySquare, anims[Player].startColor, 0, NULL, NULL, 0); - AnimationFrame(Player, &anims[Player].prevFrame, anims[Player].dragPiece); - damage[0][anims[Player].startBoardY][anims[Player].startBoardX] |= TRUE; -} - -static void -DrawSquare (int row, int column, ChessSquare piece, int do_flash) -{ - int square_color, x, y, align=0; - int i; - char tString[3], bString[2]; - int flash_delay; - - /* Calculate delay in milliseconds (2-delays per complete flash) */ - flash_delay = 500 / appData.flashRate; - - if (flipView) { - x = lineGap + ((BOARD_WIDTH-1)-column) * - (squareSize + lineGap); - y = lineGap + row * (squareSize + lineGap); - } else { - x = lineGap + column * (squareSize + lineGap); - y = lineGap + ((BOARD_HEIGHT-1)-row) * - (squareSize + lineGap); - } - - square_color = SquareColor(row, column); - - bString[1] = bString[0] = NULLCHAR; - if (appData.showCoords && row == (flipView ? BOARD_HEIGHT-1 : 0) - && column >= BOARD_LEFT && column < BOARD_RGHT) { - bString[0] = 'a' + column - BOARD_LEFT; - align = 1; // coord in lower-right corner - } - if (appData.showCoords && column == (flipView ? BOARD_RGHT-1 : BOARD_LEFT)) { - snprintf(tString, 3, "%d", ONE - '0' + row); - align = 2; // coord in upper-left corner - } - if (column == (flipView ? BOARD_LEFT-1 : BOARD_RGHT) && piece > 1 ) { - snprintf(tString, 3, "%d", piece); - align = 3; // holdings count in upper-right corner - } - if (column == (flipView ? BOARD_RGHT : BOARD_LEFT-1) && piece > 1) { - snprintf(tString, 3, "%d", piece); - align = 4; // holdings count in upper-left corner - } - if(piece == DarkSquare) square_color = 2; - if(square_color == 2 || appData.blindfold) piece = EmptySquare; - - if (do_flash && piece != EmptySquare && appData.flashCount > 0) { - for (i=0; i 4) /* Castling causes 4 diffs */ - return 1; - } - } - } - return 0; -} - -/* Matrix describing castling maneuvers */ -/* Row, ColRookFrom, ColKingFrom, ColRookTo, ColKingTo */ -static int castling_matrix[4][5] = { - { 0, 0, 4, 3, 2 }, /* 0-0-0, white */ - { 0, 7, 4, 5, 6 }, /* 0-0, white */ - { 7, 0, 4, 3, 2 }, /* 0-0-0, black */ - { 7, 7, 4, 5, 6 } /* 0-0, black */ -}; - -/* Checks whether castling occurred. If it did, *rrow and *rcol - are set to the destination (row,col) of the rook that moved. - - Returns 1 if castling occurred, 0 if not. - - Note: Only handles a max of 1 castling move, so be sure - to call too_many_diffs() first. - */ -static int -check_castle_draw (Board newb, Board oldb, int *rrow, int *rcol) -{ - int i, *r, j; - int match; - - /* For each type of castling... */ - for (i=0; i<4; ++i) { - r = castling_matrix[i]; - - /* Check the 4 squares involved in the castling move */ - match = 0; - for (j=1; j<=4; ++j) { - if (newb[r[0]][r[j]] == oldb[r[0]][r[j]]) { - match = 1; - break; - } - } - - if (!match) { - /* All 4 changed, so it must be a castling move */ - *rrow = r[0]; - *rcol = r[3]; - return 1; - } - } - return 0; -} - -void -SquareExpose(int i, int j, int d) -{ - int x, y; - if (flipView) { - x = lineGap + ((BOARD_WIDTH-1)-j) * - (squareSize + lineGap); - y = lineGap + i * (squareSize + lineGap); - } else { - x = lineGap + j * (squareSize + lineGap); - y = lineGap + ((BOARD_HEIGHT-1)-i) * - (squareSize + lineGap); - } - GraphExpose(currBoard, x-d, y-d, squareSize+2*d, squareSize+2*d); -} - -void -DrawPosition (int repaint, Board board) -{ - int i, j, do_flash, exposeAll = False; - static int lastFlipView = 0; - static int lastBoardValid[2] = {0, 0}; - static Board lastBoard[2]; - static char lastMarker[BOARD_RANKS][BOARD_FILES], messedUp; - int rrow = -1, rcol = -1; - int nr = twoBoards*partnerUp; - - repaint |= messedUp; - - if(DrawSeekGraph()) return; // [HGM] seekgraph: suppress any drawing if seek graph up - - if (board == NULL) { - if (!lastBoardValid[nr]) return; - board = lastBoard[nr]; - } - if (!lastBoardValid[nr] || (nr == 0 && lastFlipView != flipView)) { - MarkMenuItem("View.Flip View", flipView); - } - - if(nr) { SlavePopUp(); SwitchWindow(0); } // [HGM] popup board if not yet popped up, and switch drawing to it. - - /* - * It would be simpler to clear the window with XClearWindow() - * but this causes a very distracting flicker. - */ - - if (!repaint && lastBoardValid[nr] && (nr == 1 || lastFlipView == flipView)) { - - /* If too much changes (begin observing new game, etc.), don't - do flashing */ - do_flash = too_many_diffs(board, lastBoard[nr]) ? 0 : 1; - - /* Special check for castling so we don't flash both the king - and the rook (just flash the king). */ - if (do_flash) { - if(check_castle_draw(board, lastBoard[nr], &rrow, &rcol)) { - /* Mark rook for drawing with NO flashing. */ - damage[nr][rrow][rcol] |= 1; - } - } - - /* First pass -- Erase arrow and grid highlights, but keep square content unchanged. Except for new markers. */ - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) - if (damage[nr][i][j] || !nr && marker[i][j] != lastMarker[i][j]) { - DrawSquare(i, j, board[i][j], 0); - if(lineGap && damage[nr][i][j] & 2) { - drawHighlight(j, i, 0); - SquareExpose(i, j, lineGap); - } else SquareExpose(i, j, 0); - damage[nr][i][j] = 0; - } - - /* Second pass -- Draw (newly) empty squares - This prevents you from having a piece show up twice while it - is flashing on its new square */ - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) - if (board[i][j] != lastBoard[nr][i][j] && board[i][j] == EmptySquare) { - DrawSquare(i, j, board[i][j], 0); - SquareExpose(i, j, 0); - } - - /* Third pass -- Draw piece(s) in new position and flash them */ - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) - if (board[i][j] != lastBoard[nr][i][j]) { - DrawSquare(i, j, board[i][j], do_flash && (i != rrow || j != rcol)); - damage[nr][i][j] = 1; // mark for expose - } - - } else { - if (lineGap > 0) - DrawGrid(); - - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) { - DrawSquare(i, j, board[i][j], 0); - damage[nr][i][j] = False; - } - - exposeAll = True; - } - - CopyBoard(lastBoard[nr], board); - lastBoardValid[nr] = 1; - if(nr == 0) { // [HGM] dual: no highlights on second board yet - lastFlipView = flipView; - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) - lastMarker[i][j] = marker[i][j]; - - /* Draw highlights */ - if (pm1X >= 0 && pm1Y >= 0) { - drawHighlight(pm1X, pm1Y, 2); - if(lineGap) damage[nr][pm1Y][pm1X] |= 2; - } - if (pm2X >= 0 && pm2Y >= 0) { - drawHighlight(pm2X, pm2Y, 2); - if(lineGap) damage[nr][pm2Y][pm2X] |= 2; - } - if (hi1X >= 0 && hi1Y >= 0) { - drawHighlight(hi1X, hi1Y, 1); - if(lineGap) damage[nr][hi1Y][hi1X] |= 2; - } - if (hi2X >= 0 && hi2Y >= 0) { - drawHighlight(hi2X, hi2Y, 1); - if(lineGap) damage[nr][hi2Y][hi2X] |= 2; - } - DrawArrowHighlight(hi1X, hi1Y, hi2X, hi2Y); - } - else DrawArrowHighlight (board[EP_STATUS-3], board[EP_STATUS-4], board[EP_STATUS-1], board[EP_STATUS-2]); - - /* If piece being dragged around board, must redraw that too */ - DrawDragPiece(); - - if(exposeAll) - GraphExpose(currBoard, 0, 0, BOARD_WIDTH*(squareSize + lineGap) + lineGap, BOARD_HEIGHT*(squareSize + lineGap) + lineGap); - else { - for (i = 0; i < BOARD_HEIGHT; i++) - for (j = 0; j < BOARD_WIDTH; j++) - if(damage[nr][i][j]) { - if(damage[nr][i][j] & 2) // damage by old or new arrow - SquareExpose(i, j, lineGap); - else - SquareExpose(i, j, 0); - if(nr == 0) damage[nr][i][j] = 0; // on auxiliary board we retain arrow damage - } - } - - FlashDelay(0); // this flushes drawing queue; - if(nr) SwitchWindow(1); - else { - TimeMark now; - GetTimeMark(&now); - if(repaint && SubtractTimeMarks(&now, &programStartTime) < 1000) { - char *p = appData.message, *q; - i = 0; - while(*p) { - q = strchr(p, '\n'); - if(q) *q = NULLCHAR; - if(!strstr(appData.suppress, p)) { - if(i == 0) DrawSeekBackground(2*squareSize, 3*squareSize, 6.5*squareSize, 5*squareSize); - DrawText(p, 2*squareSize + 5, (int) ((3 + 0.3*i++)*squareSize) + 5, 2); - } - if(q) *q++ = '\n'; else q = ""; - p = q; - } - GraphExpose(currBoard, 2*squareSize, 3*squareSize, 4*squareSize, 2*squareSize); - messedUp = TRUE; - } else messedUp = FALSE; - } -} - -/* [AS] Arrow highlighting support */ - -static double A_WIDTH = 5; /* Width of arrow body */ - -#define A_HEIGHT_FACTOR 6 /* Length of arrow "point", relative to body width */ -#define A_WIDTH_FACTOR 3 /* Width of arrow "point", relative to body width */ - -static double -Sqr (double x) -{ - return x*x; -} - -static int -Round (double x) -{ - return (int) (x + 0.5); -} - -void -SquareToPos (int rank, int file, int *x, int *y) -{ - if (flipView) { - *x = lineGap + ((BOARD_WIDTH-1)-file) * (squareSize + lineGap); - *y = lineGap + rank * (squareSize + lineGap); - } else { - *x = lineGap + file * (squareSize + lineGap); - *y = lineGap + ((BOARD_HEIGHT-1)-rank) * (squareSize + lineGap); - } -} - -/* Draw an arrow between two points using current settings */ -static void -DrawArrowBetweenPoints (int s_x, int s_y, int d_x, int d_y) -{ - Pnt arrow[8]; - double dx, dy, j, k, x, y; - - if( d_x == s_x ) { - int h = (d_y > s_y) ? +A_WIDTH*A_HEIGHT_FACTOR : -A_WIDTH*A_HEIGHT_FACTOR; - - arrow[0].x = s_x + A_WIDTH + 0.5; - arrow[0].y = s_y; - - arrow[1].x = s_x + A_WIDTH + 0.5; - arrow[1].y = d_y - h; - - arrow[2].x = arrow[1].x + A_WIDTH*(A_WIDTH_FACTOR-1) + 0.5; - arrow[2].y = d_y - h; - - arrow[3].x = d_x; - arrow[3].y = d_y; - - arrow[5].x = arrow[1].x - 2*A_WIDTH + 0.5; - arrow[5].y = d_y - h; - - arrow[4].x = arrow[5].x - A_WIDTH*(A_WIDTH_FACTOR-1) + 0.5; - arrow[4].y = d_y - h; - - arrow[6].x = arrow[1].x - 2*A_WIDTH + 0.5; - arrow[6].y = s_y; - } - else if( d_y == s_y ) { - int w = (d_x > s_x) ? +A_WIDTH*A_HEIGHT_FACTOR : -A_WIDTH*A_HEIGHT_FACTOR; - - arrow[0].x = s_x; - arrow[0].y = s_y + A_WIDTH + 0.5; - - arrow[1].x = d_x - w; - arrow[1].y = s_y + A_WIDTH + 0.5; - - arrow[2].x = d_x - w; - arrow[2].y = arrow[1].y + A_WIDTH*(A_WIDTH_FACTOR-1) + 0.5; - - arrow[3].x = d_x; - arrow[3].y = d_y; - - arrow[5].x = d_x - w; - arrow[5].y = arrow[1].y - 2*A_WIDTH + 0.5; - - arrow[4].x = d_x - w; - arrow[4].y = arrow[5].y - A_WIDTH*(A_WIDTH_FACTOR-1) + 0.5; - - arrow[6].x = s_x; - arrow[6].y = arrow[1].y - 2*A_WIDTH + 0.5; - } - else { - /* [AS] Needed a lot of paper for this! :-) */ - dy = (double) (d_y - s_y) / (double) (d_x - s_x); - dx = (double) (s_x - d_x) / (double) (s_y - d_y); - - j = sqrt( Sqr(A_WIDTH) / (1.0 + Sqr(dx)) ); - - k = sqrt( Sqr(A_WIDTH*A_HEIGHT_FACTOR) / (1.0 + Sqr(dy)) ); - - x = s_x; - y = s_y; - - arrow[0].x = Round(x - j); - arrow[0].y = Round(y + j*dx); - - arrow[1].x = Round(arrow[0].x + 2*j); // [HGM] prevent width to be affected by rounding twice - arrow[1].y = Round(arrow[0].y - 2*j*dx); - - if( d_x > s_x ) { - x = (double) d_x - k; - y = (double) d_y - k*dy; - } - else { - x = (double) d_x + k; - y = (double) d_y + k*dy; - } - - x = Round(x); y = Round(y); // [HGM] make sure width of shaft is rounded the same way on both ends - - arrow[6].x = Round(x - j); - arrow[6].y = Round(y + j*dx); - - arrow[2].x = Round(arrow[6].x + 2*j); - arrow[2].y = Round(arrow[6].y - 2*j*dx); - - arrow[3].x = Round(arrow[2].x + j*(A_WIDTH_FACTOR-1)); - arrow[3].y = Round(arrow[2].y - j*(A_WIDTH_FACTOR-1)*dx); - - arrow[4].x = d_x; - arrow[4].y = d_y; - - arrow[5].x = Round(arrow[6].x - j*(A_WIDTH_FACTOR-1)); - arrow[5].y = Round(arrow[6].y + j*(A_WIDTH_FACTOR-1)*dx); - } - - DrawPolygon(arrow, 7); -// Polygon( hdc, arrow, 7 ); -} - -static void -ArrowDamage (int s_col, int s_row, int d_col, int d_row) -{ - int hor, vert, i, n = partnerUp * twoBoards, delta = abs(d_row - s_row); - - if( 2*(d_row - s_row) > abs(d_col - s_col) ) d_row = 4*d_row + 1; else - if( 2*(s_row - d_row) > abs(d_col - s_col) ) d_row = 4*d_row + 3; else d_row = 4*d_row + 2; - if( 2*(d_col - s_col) > delta ) d_col = 4*d_col + 1; else - if( 2*(s_col - d_col) > delta ) d_col = 4*d_col + 3; else d_col = 4*d_col + 2; - s_row = 4*s_row + 2; s_col = 4*s_col + 2; - - hor = 64*s_col; vert = 64*s_row; - for(i=0; i<= 64; i++) { - damage[n][vert+30>>8][hor+30>>8] |= 2; - damage[n][vert-30>>8][hor+30>>8] |= 2; - damage[n][vert+30>>8][hor-30>>8] |= 2; - damage[n][vert-30>>8][hor-30>>8] |= 2; - hor += d_col - s_col; vert += d_row - s_row; - } -} - -/* [AS] Draw an arrow between two squares */ -static void -DrawArrowBetweenSquares (int s_col, int s_row, int d_col, int d_row) -{ - int s_x, s_y, d_x, d_y, delta_y; - - if( s_col == d_col && s_row == d_row ) { - return; - } - - /* Get source and destination points */ - SquareToPos( s_row, s_col, &s_x, &s_y); - SquareToPos( d_row, d_col, &d_x, &d_y); - delta_y = abs(d_y - s_y); - - if( d_y > s_y && 2*(d_y - s_y) > abs(d_x - s_x)) { - d_y += squareSize / 2 - squareSize / 4; // [HGM] round towards same centers on all sides! - } - else if( d_y < s_y && 2*(s_y - d_y) > abs(d_x - s_x)) { - d_y += squareSize / 2 + squareSize / 4; - } - else { - d_y += squareSize / 2; - } - - if( d_x > s_x && 2*(d_x - s_x) > delta_y) { - d_x += squareSize / 2 - squareSize / 4; - } - else if( d_x < s_x && 2*(s_x - d_x) > delta_y) { - d_x += squareSize / 2 + squareSize / 4; - } - else { - d_x += squareSize / 2; - } - - s_x += squareSize / 2; - s_y += squareSize / 2; - - /* Adjust width */ - A_WIDTH = squareSize / 14.; //[HGM] make float - - DrawArrowBetweenPoints( s_x, s_y, d_x, d_y ); - ArrowDamage(s_col, s_row, d_col, d_row); -} - -static Boolean -IsDrawArrowEnabled () -{ - return (appData.highlightMoveWithArrow || twoBoards && partnerUp) && squareSize >= 32; -} - -static void -DrawArrowHighlight (int fromX, int fromY, int toX,int toY) -{ - if( IsDrawArrowEnabled() && fromX >= 0 && fromY >= 0 && toX >= 0 && toY >= 0) - DrawArrowBetweenSquares(fromX, fromY, toX, toY); -} diff --git a/board.h b/board.h deleted file mode 100644 index 1511052..0000000 --- a/board.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * board.h -- header for XBoard: variables shared by xboard.c and board.c - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - - -/* This magic number is the number of intermediate frames used - in each half of the animation. For short moves it's reduced - by 1. The total number of frames will be factor * 2 + 1. */ -#define kFactor 4 - -/* Variables for doing smooth animation. This whole thing - would be much easier if the board was double-buffered, - but that would require a fairly major rewrite. */ - -#define DISP 4 - -typedef enum { Game=0, Player, NrOfAnims } AnimNr; - -typedef struct { - short int x, y; - } Pnt; - -typedef struct { - Pnt startSquare, prevFrame, mouseDelta; - int startColor; - int dragPiece; - Boolean dragActive; - int startBoardX, startBoardY; - } AnimState; - -extern AnimState anims[]; - -void DrawPolygon P((Pnt arrow[], int nr)); -void DrawOneSquare P((int x, int y, ChessSquare piece, int square_color, int marker, char *tString, char *bString, int align)); -void DrawDot P((int marker, int x, int y, int r)); -void DrawGrid P((void)); -int SquareColor P((int row, int column)); -void ScreenSquare P((int column, int row, Pnt *pt, int *color)); -void BoardSquare P((int x, int y, int *column, int *row)); -void FrameDelay P((int time)); -void InsertPiece P((AnimNr anr, ChessSquare piece)); -void DrawBlank P((AnimNr anr, int x, int y, int startColor)); -void CopyRectangle P((AnimNr anr, int srcBuf, int destBuf, int srcX, int srcY, int width, int height, int destX, int destY)); -void SetDragPiece P((AnimNr anr, ChessSquare piece)); -void DragPieceMove P((int x, int y)); -void DrawBorder P((int x, int y, int type, int odd)); -void FlashDelay P((int flash_delay)); -void SwitchWindow P((int main)); - -extern int damage[2][BOARD_RANKS][BOARD_FILES]; -extern Option *currBoard; diff --git a/book.c b/book.c deleted file mode 100644 index 9828dd2..0000000 --- a/book.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* - * book.c -- code for probing Polyglot opening books - * - * This code was first released in the public domain by Michel Van den Bergh. - * The array Random64 is taken from the Polyglot source code. - * I am pretty sure that a table of random numbers is never protected - * by copyright. - * - * It s adapted by H.G. Muller for working with xboard / Winboard - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - * ------------------------------------------------------------------------ - */ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "moves.h" -#include "gettext.h" - -#ifdef ENABLE_NLS -# define _(s) gettext (s) -# define N_(s) gettext_noop (s) -#else -# define _(s) (s) -# define N_(s) s -#endif - -#ifdef _MSC_VER - typedef unsigned __int64 uint64; -#else - typedef unsigned long long int uint64; -#endif - -#ifdef _MSC_VER -# define U64(u) (u##ui64) -#else -# define U64(u) (u##ULL) -#endif - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; - -typedef struct { - uint64 key; - uint16 move; - uint16 weight; - uint16 learnPoints; - uint16 learnCount; -} entry_t; - -entry_t entry_none = { - 0, 0, 0, 0 -}; - -char *promote_pieces=" nbrqac=+"; - -uint64 Random64[781] = { - U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), - U64(0x75834465489C0C89), U64(0x3290AC3A203001BF), U64(0x0FBBAD1F61042279), U64(0xE83A908FF2FB60CA), - U64(0x0D7E765D58755C10), U64(0x1A083822CEAFE02D), U64(0x9605D5F0E25EC3B0), U64(0xD021FF5CD13A2ED5), - U64(0x40BDF15D4A672E32), U64(0x011355146FD56395), U64(0x5DB4832046F3D9E5), U64(0x239F8B2D7FF719CC), - U64(0x05D1A1AE85B49AA1), U64(0x679F848F6E8FC971), U64(0x7449BBFF801FED0B), U64(0x7D11CDB1C3B7ADF0), - U64(0x82C7709E781EB7CC), U64(0xF3218F1C9510786C), U64(0x331478F3AF51BBE6), U64(0x4BB38DE5E7219443), - U64(0xAA649C6EBCFD50FC), U64(0x8DBD98A352AFD40B), U64(0x87D2074B81D79217), U64(0x19F3C751D3E92AE1), - U64(0xB4AB30F062B19ABF), U64(0x7B0500AC42047AC4), U64(0xC9452CA81A09D85D), U64(0x24AA6C514DA27500), - U64(0x4C9F34427501B447), U64(0x14A68FD73C910841), U64(0xA71B9B83461CBD93), U64(0x03488B95B0F1850F), - U64(0x637B2B34FF93C040), U64(0x09D1BC9A3DD90A94), U64(0x3575668334A1DD3B), U64(0x735E2B97A4C45A23), - U64(0x18727070F1BD400B), U64(0x1FCBACD259BF02E7), U64(0xD310A7C2CE9B6555), U64(0xBF983FE0FE5D8244), - U64(0x9F74D14F7454A824), U64(0x51EBDC4AB9BA3035), U64(0x5C82C505DB9AB0FA), U64(0xFCF7FE8A3430B241), - U64(0x3253A729B9BA3DDE), U64(0x8C74C368081B3075), U64(0xB9BC6C87167C33E7), U64(0x7EF48F2B83024E20), - U64(0x11D505D4C351BD7F), U64(0x6568FCA92C76A243), U64(0x4DE0B0F40F32A7B8), U64(0x96D693460CC37E5D), - U64(0x42E240CB63689F2F), U64(0x6D2BDCDAE2919661), U64(0x42880B0236E4D951), U64(0x5F0F4A5898171BB6), - U64(0x39F890F579F92F88), U64(0x93C5B5F47356388B), U64(0x63DC359D8D231B78), U64(0xEC16CA8AEA98AD76), - U64(0x5355F900C2A82DC7), U64(0x07FB9F855A997142), U64(0x5093417AA8A7ED5E), U64(0x7BCBC38DA25A7F3C), - U64(0x19FC8A768CF4B6D4), U64(0x637A7780DECFC0D9), U64(0x8249A47AEE0E41F7), U64(0x79AD695501E7D1E8), - U64(0x14ACBAF4777D5776), U64(0xF145B6BECCDEA195), U64(0xDABF2AC8201752FC), U64(0x24C3C94DF9C8D3F6), - U64(0xBB6E2924F03912EA), U64(0x0CE26C0B95C980D9), U64(0xA49CD132BFBF7CC4), U64(0xE99D662AF4243939), - U64(0x27E6AD7891165C3F), U64(0x8535F040B9744FF1), U64(0x54B3F4FA5F40D873), U64(0x72B12C32127FED2B), - U64(0xEE954D3C7B411F47), U64(0x9A85AC909A24EAA1), U64(0x70AC4CD9F04F21F5), U64(0xF9B89D3E99A075C2), - U64(0x87B3E2B2B5C907B1), U64(0xA366E5B8C54F48B8), U64(0xAE4A9346CC3F7CF2), U64(0x1920C04D47267BBD), - U64(0x87BF02C6B49E2AE9), U64(0x092237AC237F3859), U64(0xFF07F64EF8ED14D0), U64(0x8DE8DCA9F03CC54E), - U64(0x9C1633264DB49C89), U64(0xB3F22C3D0B0B38ED), U64(0x390E5FB44D01144B), U64(0x5BFEA5B4712768E9), - U64(0x1E1032911FA78984), U64(0x9A74ACB964E78CB3), U64(0x4F80F7A035DAFB04), U64(0x6304D09A0B3738C4), - U64(0x2171E64683023A08), U64(0x5B9B63EB9CEFF80C), U64(0x506AACF489889342), U64(0x1881AFC9A3A701D6), - U64(0x6503080440750644), U64(0xDFD395339CDBF4A7), U64(0xEF927DBCF00C20F2), U64(0x7B32F7D1E03680EC), - U64(0xB9FD7620E7316243), U64(0x05A7E8A57DB91B77), U64(0xB5889C6E15630A75), U64(0x4A750A09CE9573F7), - U64(0xCF464CEC899A2F8A), U64(0xF538639CE705B824), U64(0x3C79A0FF5580EF7F), U64(0xEDE6C87F8477609D), - U64(0x799E81F05BC93F31), U64(0x86536B8CF3428A8C), U64(0x97D7374C60087B73), U64(0xA246637CFF328532), - U64(0x043FCAE60CC0EBA0), U64(0x920E449535DD359E), U64(0x70EB093B15B290CC), U64(0x73A1921916591CBD), - U64(0x56436C9FE1A1AA8D), U64(0xEFAC4B70633B8F81), U64(0xBB215798D45DF7AF), U64(0x45F20042F24F1768), - U64(0x930F80F4E8EB7462), U64(0xFF6712FFCFD75EA1), U64(0xAE623FD67468AA70), U64(0xDD2C5BC84BC8D8FC), - U64(0x7EED120D54CF2DD9), U64(0x22FE545401165F1C), U64(0xC91800E98FB99929), U64(0x808BD68E6AC10365), - U64(0xDEC468145B7605F6), U64(0x1BEDE3A3AEF53302), U64(0x43539603D6C55602), U64(0xAA969B5C691CCB7A), - U64(0xA87832D392EFEE56), U64(0x65942C7B3C7E11AE), U64(0xDED2D633CAD004F6), U64(0x21F08570F420E565), - U64(0xB415938D7DA94E3C), U64(0x91B859E59ECB6350), U64(0x10CFF333E0ED804A), U64(0x28AED140BE0BB7DD), - U64(0xC5CC1D89724FA456), U64(0x5648F680F11A2741), U64(0x2D255069F0B7DAB3), U64(0x9BC5A38EF729ABD4), - U64(0xEF2F054308F6A2BC), U64(0xAF2042F5CC5C2858), U64(0x480412BAB7F5BE2A), U64(0xAEF3AF4A563DFE43), - U64(0x19AFE59AE451497F), U64(0x52593803DFF1E840), U64(0xF4F076E65F2CE6F0), U64(0x11379625747D5AF3), - U64(0xBCE5D2248682C115), U64(0x9DA4243DE836994F), U64(0x066F70B33FE09017), U64(0x4DC4DE189B671A1C), - U64(0x51039AB7712457C3), U64(0xC07A3F80C31FB4B4), U64(0xB46EE9C5E64A6E7C), U64(0xB3819A42ABE61C87), - U64(0x21A007933A522A20), U64(0x2DF16F761598AA4F), U64(0x763C4A1371B368FD), U64(0xF793C46702E086A0), - U64(0xD7288E012AEB8D31), U64(0xDE336A2A4BC1C44B), U64(0x0BF692B38D079F23), U64(0x2C604A7A177326B3), - U64(0x4850E73E03EB6064), U64(0xCFC447F1E53C8E1B), U64(0xB05CA3F564268D99), U64(0x9AE182C8BC9474E8), - U64(0xA4FC4BD4FC5558CA), U64(0xE755178D58FC4E76), U64(0x69B97DB1A4C03DFE), U64(0xF9B5B7C4ACC67C96), - U64(0xFC6A82D64B8655FB), U64(0x9C684CB6C4D24417), U64(0x8EC97D2917456ED0), U64(0x6703DF9D2924E97E), - U64(0xC547F57E42A7444E), U64(0x78E37644E7CAD29E), U64(0xFE9A44E9362F05FA), U64(0x08BD35CC38336615), - U64(0x9315E5EB3A129ACE), U64(0x94061B871E04DF75), U64(0xDF1D9F9D784BA010), U64(0x3BBA57B68871B59D), - U64(0xD2B7ADEEDED1F73F), U64(0xF7A255D83BC373F8), U64(0xD7F4F2448C0CEB81), U64(0xD95BE88CD210FFA7), - U64(0x336F52F8FF4728E7), U64(0xA74049DAC312AC71), U64(0xA2F61BB6E437FDB5), U64(0x4F2A5CB07F6A35B3), - U64(0x87D380BDA5BF7859), U64(0x16B9F7E06C453A21), U64(0x7BA2484C8A0FD54E), U64(0xF3A678CAD9A2E38C), - U64(0x39B0BF7DDE437BA2), U64(0xFCAF55C1BF8A4424), U64(0x18FCF680573FA594), U64(0x4C0563B89F495AC3), - U64(0x40E087931A00930D), U64(0x8CFFA9412EB642C1), U64(0x68CA39053261169F), U64(0x7A1EE967D27579E2), - U64(0x9D1D60E5076F5B6F), U64(0x3810E399B6F65BA2), U64(0x32095B6D4AB5F9B1), U64(0x35CAB62109DD038A), - U64(0xA90B24499FCFAFB1), U64(0x77A225A07CC2C6BD), U64(0x513E5E634C70E331), U64(0x4361C0CA3F692F12), - U64(0xD941ACA44B20A45B), U64(0x528F7C8602C5807B), U64(0x52AB92BEB9613989), U64(0x9D1DFA2EFC557F73), - U64(0x722FF175F572C348), U64(0x1D1260A51107FE97), U64(0x7A249A57EC0C9BA2), U64(0x04208FE9E8F7F2D6), - U64(0x5A110C6058B920A0), U64(0x0CD9A497658A5698), U64(0x56FD23C8F9715A4C), U64(0x284C847B9D887AAE), - U64(0x04FEABFBBDB619CB), U64(0x742E1E651C60BA83), U64(0x9A9632E65904AD3C), U64(0x881B82A13B51B9E2), - U64(0x506E6744CD974924), U64(0xB0183DB56FFC6A79), U64(0x0ED9B915C66ED37E), U64(0x5E11E86D5873D484), - U64(0xF678647E3519AC6E), U64(0x1B85D488D0F20CC5), U64(0xDAB9FE6525D89021), U64(0x0D151D86ADB73615), - U64(0xA865A54EDCC0F019), U64(0x93C42566AEF98FFB), U64(0x99E7AFEABE000731), U64(0x48CBFF086DDF285A), - U64(0x7F9B6AF1EBF78BAF), U64(0x58627E1A149BBA21), U64(0x2CD16E2ABD791E33), U64(0xD363EFF5F0977996), - U64(0x0CE2A38C344A6EED), U64(0x1A804AADB9CFA741), U64(0x907F30421D78C5DE), U64(0x501F65EDB3034D07), - U64(0x37624AE5A48FA6E9), U64(0x957BAF61700CFF4E), U64(0x3A6C27934E31188A), U64(0xD49503536ABCA345), - U64(0x088E049589C432E0), U64(0xF943AEE7FEBF21B8), U64(0x6C3B8E3E336139D3), U64(0x364F6FFA464EE52E), - U64(0xD60F6DCEDC314222), U64(0x56963B0DCA418FC0), U64(0x16F50EDF91E513AF), U64(0xEF1955914B609F93), - U64(0x565601C0364E3228), U64(0xECB53939887E8175), U64(0xBAC7A9A18531294B), U64(0xB344C470397BBA52), - U64(0x65D34954DAF3CEBD), U64(0xB4B81B3FA97511E2), U64(0xB422061193D6F6A7), U64(0x071582401C38434D), - U64(0x7A13F18BBEDC4FF5), U64(0xBC4097B116C524D2), U64(0x59B97885E2F2EA28), U64(0x99170A5DC3115544), - U64(0x6F423357E7C6A9F9), U64(0x325928EE6E6F8794), U64(0xD0E4366228B03343), U64(0x565C31F7DE89EA27), - U64(0x30F5611484119414), U64(0xD873DB391292ED4F), U64(0x7BD94E1D8E17DEBC), U64(0xC7D9F16864A76E94), - U64(0x947AE053EE56E63C), U64(0xC8C93882F9475F5F), U64(0x3A9BF55BA91F81CA), U64(0xD9A11FBB3D9808E4), - U64(0x0FD22063EDC29FCA), U64(0xB3F256D8ACA0B0B9), U64(0xB03031A8B4516E84), U64(0x35DD37D5871448AF), - U64(0xE9F6082B05542E4E), U64(0xEBFAFA33D7254B59), U64(0x9255ABB50D532280), U64(0xB9AB4CE57F2D34F3), - U64(0x693501D628297551), U64(0xC62C58F97DD949BF), U64(0xCD454F8F19C5126A), U64(0xBBE83F4ECC2BDECB), - U64(0xDC842B7E2819E230), U64(0xBA89142E007503B8), U64(0xA3BC941D0A5061CB), U64(0xE9F6760E32CD8021), - U64(0x09C7E552BC76492F), U64(0x852F54934DA55CC9), U64(0x8107FCCF064FCF56), U64(0x098954D51FFF6580), - U64(0x23B70EDB1955C4BF), U64(0xC330DE426430F69D), U64(0x4715ED43E8A45C0A), U64(0xA8D7E4DAB780A08D), - U64(0x0572B974F03CE0BB), U64(0xB57D2E985E1419C7), U64(0xE8D9ECBE2CF3D73F), U64(0x2FE4B17170E59750), - U64(0x11317BA87905E790), U64(0x7FBF21EC8A1F45EC), U64(0x1725CABFCB045B00), U64(0x964E915CD5E2B207), - U64(0x3E2B8BCBF016D66D), U64(0xBE7444E39328A0AC), U64(0xF85B2B4FBCDE44B7), U64(0x49353FEA39BA63B1), - U64(0x1DD01AAFCD53486A), U64(0x1FCA8A92FD719F85), U64(0xFC7C95D827357AFA), U64(0x18A6A990C8B35EBD), - U64(0xCCCB7005C6B9C28D), U64(0x3BDBB92C43B17F26), U64(0xAA70B5B4F89695A2), U64(0xE94C39A54A98307F), - U64(0xB7A0B174CFF6F36E), U64(0xD4DBA84729AF48AD), U64(0x2E18BC1AD9704A68), U64(0x2DE0966DAF2F8B1C), - U64(0xB9C11D5B1E43A07E), U64(0x64972D68DEE33360), U64(0x94628D38D0C20584), U64(0xDBC0D2B6AB90A559), - U64(0xD2733C4335C6A72F), U64(0x7E75D99D94A70F4D), U64(0x6CED1983376FA72B), U64(0x97FCAACBF030BC24), - U64(0x7B77497B32503B12), U64(0x8547EDDFB81CCB94), U64(0x79999CDFF70902CB), U64(0xCFFE1939438E9B24), - U64(0x829626E3892D95D7), U64(0x92FAE24291F2B3F1), U64(0x63E22C147B9C3403), U64(0xC678B6D860284A1C), - U64(0x5873888850659AE7), U64(0x0981DCD296A8736D), U64(0x9F65789A6509A440), U64(0x9FF38FED72E9052F), - U64(0xE479EE5B9930578C), U64(0xE7F28ECD2D49EECD), U64(0x56C074A581EA17FE), U64(0x5544F7D774B14AEF), - U64(0x7B3F0195FC6F290F), U64(0x12153635B2C0CF57), U64(0x7F5126DBBA5E0CA7), U64(0x7A76956C3EAFB413), - U64(0x3D5774A11D31AB39), U64(0x8A1B083821F40CB4), U64(0x7B4A38E32537DF62), U64(0x950113646D1D6E03), - U64(0x4DA8979A0041E8A9), U64(0x3BC36E078F7515D7), U64(0x5D0A12F27AD310D1), U64(0x7F9D1A2E1EBE1327), - U64(0xDA3A361B1C5157B1), U64(0xDCDD7D20903D0C25), U64(0x36833336D068F707), U64(0xCE68341F79893389), - U64(0xAB9090168DD05F34), U64(0x43954B3252DC25E5), U64(0xB438C2B67F98E5E9), U64(0x10DCD78E3851A492), - U64(0xDBC27AB5447822BF), U64(0x9B3CDB65F82CA382), U64(0xB67B7896167B4C84), U64(0xBFCED1B0048EAC50), - U64(0xA9119B60369FFEBD), U64(0x1FFF7AC80904BF45), U64(0xAC12FB171817EEE7), U64(0xAF08DA9177DDA93D), - U64(0x1B0CAB936E65C744), U64(0xB559EB1D04E5E932), U64(0xC37B45B3F8D6F2BA), U64(0xC3A9DC228CAAC9E9), - U64(0xF3B8B6675A6507FF), U64(0x9FC477DE4ED681DA), U64(0x67378D8ECCEF96CB), U64(0x6DD856D94D259236), - U64(0xA319CE15B0B4DB31), U64(0x073973751F12DD5E), U64(0x8A8E849EB32781A5), U64(0xE1925C71285279F5), - U64(0x74C04BF1790C0EFE), U64(0x4DDA48153C94938A), U64(0x9D266D6A1CC0542C), U64(0x7440FB816508C4FE), - U64(0x13328503DF48229F), U64(0xD6BF7BAEE43CAC40), U64(0x4838D65F6EF6748F), U64(0x1E152328F3318DEA), - U64(0x8F8419A348F296BF), U64(0x72C8834A5957B511), U64(0xD7A023A73260B45C), U64(0x94EBC8ABCFB56DAE), - U64(0x9FC10D0F989993E0), U64(0xDE68A2355B93CAE6), U64(0xA44CFE79AE538BBE), U64(0x9D1D84FCCE371425), - U64(0x51D2B1AB2DDFB636), U64(0x2FD7E4B9E72CD38C), U64(0x65CA5B96B7552210), U64(0xDD69A0D8AB3B546D), - U64(0x604D51B25FBF70E2), U64(0x73AA8A564FB7AC9E), U64(0x1A8C1E992B941148), U64(0xAAC40A2703D9BEA0), - U64(0x764DBEAE7FA4F3A6), U64(0x1E99B96E70A9BE8B), U64(0x2C5E9DEB57EF4743), U64(0x3A938FEE32D29981), - U64(0x26E6DB8FFDF5ADFE), U64(0x469356C504EC9F9D), U64(0xC8763C5B08D1908C), U64(0x3F6C6AF859D80055), - U64(0x7F7CC39420A3A545), U64(0x9BFB227EBDF4C5CE), U64(0x89039D79D6FC5C5C), U64(0x8FE88B57305E2AB6), - U64(0xA09E8C8C35AB96DE), U64(0xFA7E393983325753), U64(0xD6B6D0ECC617C699), U64(0xDFEA21EA9E7557E3), - U64(0xB67C1FA481680AF8), U64(0xCA1E3785A9E724E5), U64(0x1CFC8BED0D681639), U64(0xD18D8549D140CAEA), - U64(0x4ED0FE7E9DC91335), U64(0xE4DBF0634473F5D2), U64(0x1761F93A44D5AEFE), U64(0x53898E4C3910DA55), - U64(0x734DE8181F6EC39A), U64(0x2680B122BAA28D97), U64(0x298AF231C85BAFAB), U64(0x7983EED3740847D5), - U64(0x66C1A2A1A60CD889), U64(0x9E17E49642A3E4C1), U64(0xEDB454E7BADC0805), U64(0x50B704CAB602C329), - U64(0x4CC317FB9CDDD023), U64(0x66B4835D9EAFEA22), U64(0x219B97E26FFC81BD), U64(0x261E4E4C0A333A9D), - U64(0x1FE2CCA76517DB90), U64(0xD7504DFA8816EDBB), U64(0xB9571FA04DC089C8), U64(0x1DDC0325259B27DE), - U64(0xCF3F4688801EB9AA), U64(0xF4F5D05C10CAB243), U64(0x38B6525C21A42B0E), U64(0x36F60E2BA4FA6800), - U64(0xEB3593803173E0CE), U64(0x9C4CD6257C5A3603), U64(0xAF0C317D32ADAA8A), U64(0x258E5A80C7204C4B), - U64(0x8B889D624D44885D), U64(0xF4D14597E660F855), U64(0xD4347F66EC8941C3), U64(0xE699ED85B0DFB40D), - U64(0x2472F6207C2D0484), U64(0xC2A1E7B5B459AEB5), U64(0xAB4F6451CC1D45EC), U64(0x63767572AE3D6174), - U64(0xA59E0BD101731A28), U64(0x116D0016CB948F09), U64(0x2CF9C8CA052F6E9F), U64(0x0B090A7560A968E3), - U64(0xABEEDDB2DDE06FF1), U64(0x58EFC10B06A2068D), U64(0xC6E57A78FBD986E0), U64(0x2EAB8CA63CE802D7), - U64(0x14A195640116F336), U64(0x7C0828DD624EC390), U64(0xD74BBE77E6116AC7), U64(0x804456AF10F5FB53), - U64(0xEBE9EA2ADF4321C7), U64(0x03219A39EE587A30), U64(0x49787FEF17AF9924), U64(0xA1E9300CD8520548), - U64(0x5B45E522E4B1B4EF), U64(0xB49C3B3995091A36), U64(0xD4490AD526F14431), U64(0x12A8F216AF9418C2), - U64(0x001F837CC7350524), U64(0x1877B51E57A764D5), U64(0xA2853B80F17F58EE), U64(0x993E1DE72D36D310), - U64(0xB3598080CE64A656), U64(0x252F59CF0D9F04BB), U64(0xD23C8E176D113600), U64(0x1BDA0492E7E4586E), - U64(0x21E0BD5026C619BF), U64(0x3B097ADAF088F94E), U64(0x8D14DEDB30BE846E), U64(0xF95CFFA23AF5F6F4), - U64(0x3871700761B3F743), U64(0xCA672B91E9E4FA16), U64(0x64C8E531BFF53B55), U64(0x241260ED4AD1E87D), - U64(0x106C09B972D2E822), U64(0x7FBA195410E5CA30), U64(0x7884D9BC6CB569D8), U64(0x0647DFEDCD894A29), - U64(0x63573FF03E224774), U64(0x4FC8E9560F91B123), U64(0x1DB956E450275779), U64(0xB8D91274B9E9D4FB), - U64(0xA2EBEE47E2FBFCE1), U64(0xD9F1F30CCD97FB09), U64(0xEFED53D75FD64E6B), U64(0x2E6D02C36017F67F), - U64(0xA9AA4D20DB084E9B), U64(0xB64BE8D8B25396C1), U64(0x70CB6AF7C2D5BCF0), U64(0x98F076A4F7A2322E), - U64(0xBF84470805E69B5F), U64(0x94C3251F06F90CF3), U64(0x3E003E616A6591E9), U64(0xB925A6CD0421AFF3), - U64(0x61BDD1307C66E300), U64(0xBF8D5108E27E0D48), U64(0x240AB57A8B888B20), U64(0xFC87614BAF287E07), - U64(0xEF02CDD06FFDB432), U64(0xA1082C0466DF6C0A), U64(0x8215E577001332C8), U64(0xD39BB9C3A48DB6CF), - U64(0x2738259634305C14), U64(0x61CF4F94C97DF93D), U64(0x1B6BACA2AE4E125B), U64(0x758F450C88572E0B), - U64(0x959F587D507A8359), U64(0xB063E962E045F54D), U64(0x60E8ED72C0DFF5D1), U64(0x7B64978555326F9F), - U64(0xFD080D236DA814BA), U64(0x8C90FD9B083F4558), U64(0x106F72FE81E2C590), U64(0x7976033A39F7D952), - U64(0xA4EC0132764CA04B), U64(0x733EA705FAE4FA77), U64(0xB4D8F77BC3E56167), U64(0x9E21F4F903B33FD9), - U64(0x9D765E419FB69F6D), U64(0xD30C088BA61EA5EF), U64(0x5D94337FBFAF7F5B), U64(0x1A4E4822EB4D7A59), - U64(0x6FFE73E81B637FB3), U64(0xDDF957BC36D8B9CA), U64(0x64D0E29EEA8838B3), U64(0x08DD9BDFD96B9F63), - U64(0x087E79E5A57D1D13), U64(0xE328E230E3E2B3FB), U64(0x1C2559E30F0946BE), U64(0x720BF5F26F4D2EAA), - U64(0xB0774D261CC609DB), U64(0x443F64EC5A371195), U64(0x4112CF68649A260E), U64(0xD813F2FAB7F5C5CA), - U64(0x660D3257380841EE), U64(0x59AC2C7873F910A3), U64(0xE846963877671A17), U64(0x93B633ABFA3469F8), - U64(0xC0C0F5A60EF4CDCF), U64(0xCAF21ECD4377B28C), U64(0x57277707199B8175), U64(0x506C11B9D90E8B1D), - U64(0xD83CC2687A19255F), U64(0x4A29C6465A314CD1), U64(0xED2DF21216235097), U64(0xB5635C95FF7296E2), - U64(0x22AF003AB672E811), U64(0x52E762596BF68235), U64(0x9AEBA33AC6ECC6B0), U64(0x944F6DE09134DFB6), - U64(0x6C47BEC883A7DE39), U64(0x6AD047C430A12104), U64(0xA5B1CFDBA0AB4067), U64(0x7C45D833AFF07862), - U64(0x5092EF950A16DA0B), U64(0x9338E69C052B8E7B), U64(0x455A4B4CFE30E3F5), U64(0x6B02E63195AD0CF8), - U64(0x6B17B224BAD6BF27), U64(0xD1E0CCD25BB9C169), U64(0xDE0C89A556B9AE70), U64(0x50065E535A213CF6), - U64(0x9C1169FA2777B874), U64(0x78EDEFD694AF1EED), U64(0x6DC93D9526A50E68), U64(0xEE97F453F06791ED), - U64(0x32AB0EDB696703D3), U64(0x3A6853C7E70757A7), U64(0x31865CED6120F37D), U64(0x67FEF95D92607890), - U64(0x1F2B1D1F15F6DC9C), U64(0xB69E38A8965C6B65), U64(0xAA9119FF184CCCF4), U64(0xF43C732873F24C13), - U64(0xFB4A3D794A9A80D2), U64(0x3550C2321FD6109C), U64(0x371F77E76BB8417E), U64(0x6BFA9AAE5EC05779), - U64(0xCD04F3FF001A4778), U64(0xE3273522064480CA), U64(0x9F91508BFFCFC14A), U64(0x049A7F41061A9E60), - U64(0xFCB6BE43A9F2FE9B), U64(0x08DE8A1C7797DA9B), U64(0x8F9887E6078735A1), U64(0xB5B4071DBFC73A66), - U64(0x230E343DFBA08D33), U64(0x43ED7F5A0FAE657D), U64(0x3A88A0FBBCB05C63), U64(0x21874B8B4D2DBC4F), - U64(0x1BDEA12E35F6A8C9), U64(0x53C065C6C8E63528), U64(0xE34A1D250E7A8D6B), U64(0xD6B04D3B7651DD7E), - U64(0x5E90277E7CB39E2D), U64(0x2C046F22062DC67D), U64(0xB10BB459132D0A26), U64(0x3FA9DDFB67E2F199), - U64(0x0E09B88E1914F7AF), U64(0x10E8B35AF3EEAB37), U64(0x9EEDECA8E272B933), U64(0xD4C718BC4AE8AE5F), - U64(0x81536D601170FC20), U64(0x91B534F885818A06), U64(0xEC8177F83F900978), U64(0x190E714FADA5156E), - U64(0xB592BF39B0364963), U64(0x89C350C893AE7DC1), U64(0xAC042E70F8B383F2), U64(0xB49B52E587A1EE60), - U64(0xFB152FE3FF26DA89), U64(0x3E666E6F69AE2C15), U64(0x3B544EBE544C19F9), U64(0xE805A1E290CF2456), - U64(0x24B33C9D7ED25117), U64(0xE74733427B72F0C1), U64(0x0A804D18B7097475), U64(0x57E3306D881EDB4F), - U64(0x4AE7D6A36EB5DBCB), U64(0x2D8D5432157064C8), U64(0xD1E649DE1E7F268B), U64(0x8A328A1CEDFE552C), - U64(0x07A3AEC79624C7DA), U64(0x84547DDC3E203C94), U64(0x990A98FD5071D263), U64(0x1A4FF12616EEFC89), - U64(0xF6F7FD1431714200), U64(0x30C05B1BA332F41C), U64(0x8D2636B81555A786), U64(0x46C9FEB55D120902), - U64(0xCCEC0A73B49C9921), U64(0x4E9D2827355FC492), U64(0x19EBB029435DCB0F), U64(0x4659D2B743848A2C), - U64(0x963EF2C96B33BE31), U64(0x74F85198B05A2E7D), U64(0x5A0F544DD2B1FB18), U64(0x03727073C2E134B1), - U64(0xC7F6AA2DE59AEA61), U64(0x352787BAA0D7C22F), U64(0x9853EAB63B5E0B35), U64(0xABBDCDD7ED5C0860), - U64(0xCF05DAF5AC8D77B0), U64(0x49CAD48CEBF4A71E), U64(0x7A4C10EC2158C4A6), U64(0xD9E92AA246BF719E), - U64(0x13AE978D09FE5557), U64(0x730499AF921549FF), U64(0x4E4B705B92903BA4), U64(0xFF577222C14F0A3A), - U64(0x55B6344CF97AAFAE), U64(0xB862225B055B6960), U64(0xCAC09AFBDDD2CDB4), U64(0xDAF8E9829FE96B5F), - U64(0xB5FDFC5D3132C498), U64(0x310CB380DB6F7503), U64(0xE87FBB46217A360E), U64(0x2102AE466EBB1148), - U64(0xF8549E1A3AA5E00D), U64(0x07A69AFDCC42261A), U64(0xC4C118BFE78FEAAE), U64(0xF9F4892ED96BD438), - U64(0x1AF3DBE25D8F45DA), U64(0xF5B4B0B0D2DEEEB4), U64(0x962ACEEFA82E1C84), U64(0x046E3ECAAF453CE9), - U64(0xF05D129681949A4C), U64(0x964781CE734B3C84), U64(0x9C2ED44081CE5FBD), U64(0x522E23F3925E319E), - U64(0x177E00F9FC32F791), U64(0x2BC60A63A6F3B3F2), U64(0x222BBFAE61725606), U64(0x486289DDCC3D6780), - U64(0x7DC7785B8EFDFC80), U64(0x8AF38731C02BA980), U64(0x1FAB64EA29A2DDF7), U64(0xE4D9429322CD065A), - U64(0x9DA058C67844F20C), U64(0x24C0E332B70019B0), U64(0x233003B5A6CFE6AD), U64(0xD586BD01C5C217F6), - U64(0x5E5637885F29BC2B), U64(0x7EBA726D8C94094B), U64(0x0A56A5F0BFE39272), U64(0xD79476A84EE20D06), - U64(0x9E4C1269BAA4BF37), U64(0x17EFEE45B0DEE640), U64(0x1D95B0A5FCF90BC6), U64(0x93CBE0B699C2585D), - U64(0x65FA4F227A2B6D79), U64(0xD5F9E858292504D5), U64(0xC2B5A03F71471A6F), U64(0x59300222B4561E00), - U64(0xCE2F8642CA0712DC), U64(0x7CA9723FBB2E8988), U64(0x2785338347F2BA08), U64(0xC61BB3A141E50E8C), - U64(0x150F361DAB9DEC26), U64(0x9F6A419D382595F4), U64(0x64A53DC924FE7AC9), U64(0x142DE49FFF7A7C3D), - U64(0x0C335248857FA9E7), U64(0x0A9C32D5EAE45305), U64(0xE6C42178C4BBB92E), U64(0x71F1CE2490D20B07), - U64(0xF1BCC3D275AFE51A), U64(0xE728E8C83C334074), U64(0x96FBF83A12884624), U64(0x81A1549FD6573DA5), - U64(0x5FA7867CAF35E149), U64(0x56986E2EF3ED091B), U64(0x917F1DD5F8886C61), U64(0xD20D8C88C8FFE65F), - U64(0x31D71DCE64B2C310), U64(0xF165B587DF898190), U64(0xA57E6339DD2CF3A0), U64(0x1EF6E6DBB1961EC9), - U64(0x70CC73D90BC26E24), U64(0xE21A6B35DF0C3AD7), U64(0x003A93D8B2806962), U64(0x1C99DED33CB890A1), - U64(0xCF3145DE0ADD4289), U64(0xD0E4427A5514FB72), U64(0x77C621CC9FB3A483), U64(0x67A34DAC4356550B), - U64(0xF8D626AAAF278509), -}; - -uint64 *RandomPiece =Random64; -uint64 *RandomCastle =Random64+768; -uint64 *RandomEnPassant =Random64+772; -uint64 *RandomTurn =Random64+780; - - -uint64 -hash (int moveNr) -{ - int r, f, p_enc, squareNr, pieceGroup; - uint64 key=0, holdingsKey=0, Zobrist; - VariantClass v = gameInfo.variant; - - switch(v) { - case VariantNormal: - case VariantFischeRandom: // compatible with normal - case VariantNoCastle: - case VariantXiangqi: // for historic reasons; does never collide anyway because of other King type - break; - case VariantGiveaway: // in opening same as suicide - key += VariantSuicide; - break; - case VariantGothic: // these are special cases of CRC, and can share book - case VariantCapablanca: - v = VariantCapaRandom; - default: - key += v; // variant type incorporated in key to allow mixed books without collisions - } - - for(f=0; f= (int)BlackPawn) ? (int)BlackPawn :(int)WhitePawn; - if(j >= WhitePBishop && j != WhiteKing) promoted++, j -= WhiteTokin; - if(j > (int)WhiteQueen) j++; // make space for King - if(j > (int) WhiteKing) j = (int)WhiteQueen + 1; - p_enc = 2*j + ((int)p < (int)BlackPawn); - // holdings squares get nmbers immediately after board; first left, then right holdings - if(f == BOARD_LEFT-2) squareNr = (BOARD_RGHT - BOARD_LEFT)*BOARD_HEIGHT + r; else - if(f == BOARD_RGHT+1) squareNr = (BOARD_RGHT - BOARD_LEFT + 1)*BOARD_HEIGHT + r; else - squareNr = (BOARD_RGHT - BOARD_LEFT)*r + (f - BOARD_LEFT); - // note that in normal Chess squareNr < 64 and p_enc < 12. The following code - // maps other pieces and squares in this range, and then modify the corresponding - // Zobrist random by rotating its bitpattern according to what the piece really was. - pieceGroup = p_enc / 12; - p_enc = p_enc % 12; - Zobrist = RandomPiece[64*p_enc + (squareNr & 63)]; - if(pieceGroup & 4) Zobrist *= 987654321; - switch(pieceGroup & 3) { - case 1: // pieces 5-10 (FEACWM) - Zobrist = (Zobrist << 16) ^ (Zobrist >> 48); - break; - case 2: // pieces 11-16 (OHIJGD) - Zobrist = (Zobrist << 32) ^ (Zobrist >> 32); - break; - case 3: // pieces 17-20 (VLSU) - Zobrist = (Zobrist << 48) ^ (Zobrist >> 16); - break; - } - if(promoted) Zobrist ^= 123456789*RandomPiece[squareNr & 63]; - if(squareNr & 64) Zobrist = (Zobrist << 8) ^ (Zobrist >> 56); - if(squareNr & 128) Zobrist = (Zobrist << 4) ^ (Zobrist >> 60); - // holdings have separate (additive) key, to encode presence of multiple pieces on same square - if(f == BOARD_LEFT-2) holdingsKey += Zobrist * boards[moveNr][r][f+1]; else - if(f == BOARD_RGHT+1) holdingsKey += Zobrist * boards[moveNr][r][f-1]; else - key ^= Zobrist; - } - } - } - - if(boards[moveNr][CASTLING][2] != NoRights) { - if(boards[moveNr][CASTLING][0] != NoRights) key^=RandomCastle[0]; - if(boards[moveNr][CASTLING][1] != NoRights) key^=RandomCastle[1]; - } - if(boards[moveNr][CASTLING][5] != NoRights) { - if(boards[moveNr][CASTLING][3] != NoRights) key^=RandomCastle[2]; - if(boards[moveNr][CASTLING][4] != NoRights) key^=RandomCastle[3]; - } - - f = boards[moveNr][EP_STATUS]; - if(f >= 0 && f < 8){ - if(!WhiteOnMove(moveNr)){ - // the test for neighboring Pawns might not be needed, - // as epStatus already kept track of it, but better safe than sorry. - if((f>0 && boards[moveNr][3][f-1]==BlackPawn)|| - (f<7 && boards[moveNr][3][f+1]==BlackPawn)){ - key^=RandomEnPassant[f]; - } - }else{ - if((f>0 && boards[moveNr][4][f-1]==WhitePawn)|| - (f<7 && boards[moveNr][4][f+1]==WhitePawn)){ - key^=RandomEnPassant[f]; - } - } - } - - if(WhiteOnMove(moveNr)){ - key^=RandomTurn[0]; - } - return key + holdingsKey; -} - -#define MOVE_BUF 100 - -// fs routines read from memory buffer if no file specified - -static unsigned char *memBuf, *memPtr; -static int bufSize; -Boolean mcMode; - -int -fsseek (FILE *f, int n, int mode) -{ - if(f) return fseek(f, n, mode); - if(mode == SEEK_SET) memPtr = memBuf + n; else - if(mode == SEEK_END) memPtr = memBuf + 16*bufSize + n; - return memPtr < memBuf || memPtr > memBuf + 16*bufSize; -} - -int -fstell (FILE *f) -{ - if(f) return ftell(f); - return memPtr - memBuf; -} - -int -fsgetc (FILE *f) -{ - if(f) return fgetc(f); - if(memPtr >= memBuf + 16*bufSize) return EOF; - return *memPtr++ ; -} - -int -int_from_file (FILE *f, int l, uint64 *r) -{ - int i,c; - for(i=0;ikey=r; - ret=int_from_file(f,2,&r); - if(ret) return 1; - entry->move=r; - ret=int_from_file(f,2,&r); - if(ret) return 1; - entry->weight=r; - ret=int_from_file(f,2,&r); - if(ret) return 1; - entry->learnCount=r; - ret=int_from_file(f,2,&r); - if(ret) return 1; - entry->learnPoints=r; - return 0; -} - -int -find_key (FILE *f, uint64 key, entry_t *entry) -{ - int first, last, middle; - entry_t last_entry,middle_entry; - first=-1; - if(fsseek(f,-16,SEEK_END)){ - *entry=entry_none; - entry->key=key+1; //hack - return -1; - } - last=fstell(f)/16; - entry_from_file(f,&last_entry); - while(1){ - if(last-first==1){ - *entry=last_entry; - return last; - } - middle=(first+last)/2; - fsseek(f,16*middle,SEEK_SET); - entry_from_file(f,&middle_entry); - if(key<=middle_entry.key){ - last=middle; - last_entry=middle_entry; - }else{ - first=middle; - } - } -} - -static int xStep[] = { 0, 1, 1, 1, 0,-1,-1,-1 }; -static int yStep[] = { 1, 1, 0,-1,-1,-1, 0, 1 }; - -void -move_to_string (char move_s[20], uint16 move) -{ - int f,fr,ff,t,tr,tf,p; - int width = BOARD_RGHT - BOARD_LEFT, size; // allow for alternative board formats - - size = width * BOARD_HEIGHT; - p = move / (size*size); - move = move % (size*size); - f = move / size; - fr = f / width; - ff = f % width; - t = move % size; - tr = t / width; - tf = t % width; - snprintf(move_s, 9, "%c%d%c%d", ff + 'a', fr + 1 - (BOARD_HEIGHT == 10), tf + 'a', tr + 1 - (BOARD_HEIGHT == 10)); - - if(IS_SHOGI(gameInfo.variant) && p) { - if(p == 2) p = 10; // Lion moves, for boards so big that 10 is out of range - else if(p != 7) p = 8; // use '+' for all others that do not explicitly defer - } - - // kludge: encode drops as special promotion code - if(gameInfo.holdingsSize && p == 9) { - move_s[0] = f + '@'; // from square encodes piece type - move_s[1] = '@'; // drop symbol - p = 0; - } else if(p == 10) { // decode Lion move - int i = t & 7, j = t >> 3 & 7; - tf = ff + xStep[i] + xStep[j]; tr = fr + yStep[i] + yStep[j]; // calculate true to-square - snprintf(move_s, 20, "%c%d%c%d,%c%d%c%d", ff + 'a', fr + 1 - (BOARD_HEIGHT == 10), - ff + xStep[i] + 'a', fr + yStep[i] + 1 - (BOARD_HEIGHT == 10), - ff + xStep[i] + 'a', fr + yStep[i] + 1 - (BOARD_HEIGHT == 10), - tf + 'a', tr + 1 - (BOARD_HEIGHT == 10) ); - p = 0; - } - - // add promotion piece, if any - if(p){ - int len = strlen(move_s); - move_s[len] = promote_pieces[p]; - move_s[len+1] = '\0'; - } - - if(gameInfo.variant != VariantNormal) return; - - // correct FRC-style castlings in variant normal. - // [HGM] This is buggy code! e1h1 could very well be a normal R or Q move. - if(!strcmp(move_s,"e1h1")){ - safeStrCpy(move_s,"e1g1", 6); - }else if(!strcmp(move_s,"e1a1")){ - safeStrCpy(move_s,"e1c1", 6); - }else if(!strcmp(move_s,"e8h8")){ - safeStrCpy(move_s,"e8g8", 6); - }else if(!strcmp(move_s,"e8a8")){ - safeStrCpy(move_s,"e8c8", 6); - } -} - -int -GetBookMoves (FILE *f, int moveNr, entry_t entries[], int max) -{ // retrieve all entries for given position from book in 'entries', return number. - entry_t entry; - int offset; - uint64 key; - int count; - int ret; - - key = hash(moveNr); - if(appData.debugMode) fprintf(debugFP, "book key = %08x%08x\n", (unsigned int)(key>>32), (unsigned int)key); - - offset=find_key(f, key, &entry); - if(entry.key != key) { - return FALSE; - } - entries[0] = entry; - count=1; - fsseek(f, 16*(offset+1), SEEK_SET); - while(1){ - ret=entry_from_file(f, &entry); - if(ret){ - break; - } - if(entry.key != key){ - break; - } - if(count == max) break; - entries[count++] = entry; - } - return count; -} - -static int dirty; - -int -ReadFromBookFile (int moveNr, char *book, entry_t entries[]) -{ // retrieve all entries for given position from book in 'entries', return number. - static FILE *f = NULL; - static char curBook[MSG_SIZ]; - - if(book == NULL) return -1; - if(dirty) { if(f) fclose(f); dirty = 0; f = NULL; } - if(!f || strcmp(book, curBook)){ // keep book file open until book changed - strncpy(curBook, book, MSG_SIZ); - if(f) fclose(f); - f = fopen(book,"rb"); - } - if(!f){ - DisplayError(_("Polyglot book not valid"), 0); - appData.usePolyglotBook = FALSE; - return -1; - } - - return GetBookMoves(f, moveNr, entries, MOVE_BUF); -} - -// next three made into subroutines to facilitate future changes in storage scheme (e.g. 2 x 3 bytes) - -static int -wins(entry_t *e) -{ - return e->learnPoints; -} - -static int -losses(entry_t *e) -{ - return e->learnCount; -} - -static void -CountMove (entry_t *e, int result) -{ - switch(result) { - case 0: e->learnCount ++; break; - case 1: e->learnCount ++; // count draw as win + loss - case 2: e->learnPoints ++; break; - } -} - -#define MERGESIZE 2048 -#define HASHSIZE 1024*1024*4 - -entry_t *memBook, *hashTab, *mergeBuf; -int bookSize=1, mergeSize=1, mask = HASHSIZE-1; - -void -InitMemBook () -{ - static int initDone = FALSE; - if(initDone) return; - memBook = (entry_t *) calloc(1024*1024, sizeof(entry_t)); - hashTab = (entry_t *) calloc(HASHSIZE, sizeof(entry_t)); - mergeBuf = (entry_t *) calloc(MERGESIZE+5, sizeof(entry_t)); - memBook[0].key = -1LL; - mergeBuf[0].key = -1LL; - initDone = TRUE; -} - -char * -MCprobe (int moveNr) -{ - int count, count2, games, i, choice=0; - entry_t entries[MOVE_BUF]; - float nominal[MOVE_BUF], tot, deficit, max, min; - static char move_s[6]; - - InitMemBook(); - memBuf = (unsigned char*) memBook; bufSize = bookSize; // in MC mode book resides in memory - count = GetBookMoves(NULL, moveNr, entries, MOVE_BUF); - if(count < 0) count = 0; // don't care about miss yet - memBuf = (unsigned char*) mergeBuf; bufSize = mergeSize; // there could be moves still waiting to be merged - count2 = count + GetBookMoves(NULL, moveNr, entries+count, MOVE_BUF - count); - if(appData.debugMode) fprintf(debugFP, "MC probe: %d/%d (%d+%d)\n", count, count2,bookSize,mergeSize); - if(!count2) return NULL; - tot = games = 0; - for(i=0; i max) max = deficit, choice = i; - if(deficit < min) min = deficit; - } // note that a single move will never be underplayed - if(max - min > 0.5*sqrt(nominal[choice])) { // if one of the listed moves is significantly under-played, play it now. - move_to_string(move_s, entries[choice].move); - if(appData.debugMode) fprintf(debugFP, "book move field = %d\n", entries[choice].move); - return move_s; - } - return NULL; // otherwise fake book miss to force engine think, hoping for hitherto unplayed move. -} - -char -*ProbeBook (int moveNr, char *book) -{ // - entry_t entries[MOVE_BUF]; - int count; - int i, j; - static char move_s[6]; - int total_weight; - - if(moveNr >= 2*appData.bookDepth) return NULL; - if(mcMode) return MCprobe(moveNr); - - if((count = ReadFromBookFile(moveNr, book, entries)) <= 0) return NULL; // no book, or no hit - - if(appData.bookStrength != 50) { // transform weights - double power = 0, maxWeight = 0.0; - if(appData.bookStrength) power = (100.-appData.bookStrength)/appData.bookStrength; - for(i=0; i maxWeight) maxWeight = entries[i].weight; - for(i=0; i 0) - entries[i].weight = appData.bookStrength || weight == 1.0 ? 1e4*exp(power * log(weight)) + 0.5 : 0.0; - } - } - total_weight = 0; - for(i=0; i> 12; // create random < total_weight - total_weight = 0; - for(i=0; i j) break; - } - if(i >= count) DisplayFatalError(_("Book Fault"), 0, 1); // safety catch, cannot happen - move_to_string(move_s, entries[i].move); - if(appData.debugMode) fprintf(debugFP, "book move field = %d\n", entries[i].move); - - return move_s; -} - -extern char yy_textstr[]; -entry_t lastEntries[MOVE_BUF]; - -char * -MovesToText(int count, entry_t *entries) -{ - int i, totalWeight = 0; - char algMove[12]; - char *p = (char*) malloc(40*count+1); - for(i=0; i= 4) { - CoordsToAlgebraic(boards[currentMove], PosFlags(currentMove), i1-ONE+'0', c1-AAA, i2-ONE+'0', c2-AAA, c3, algMove); - } - buf[0] = NULLCHAR; - if(entries[i].learnCount || entries[i].learnPoints) - snprintf(buf, MSG_SIZ, " {%d/%d}", entries[i].learnPoints, entries[i].learnCount); - snprintf(p+strlen(p), 40, "%5.1f%% %5d %s%s\n", 100*entries[i].weight/(totalWeight+0.001), - entries[i].weight, algMove, buf); -//lastEntries[i] = entries[i]; - } - return p; -} - -static int -CoordsToMove (int fromX, int fromY, int toX, int toY, char promoChar) -{ - int i, width = BOARD_RGHT - BOARD_LEFT; - int to = toX - BOARD_LEFT + toY * width; - int from = fromX - BOARD_LEFT + fromY * width; - for(i=0; promote_pieces[i]; i++) if(promote_pieces[i] == promoChar) break; - if(!promote_pieces[i]) i = 0; - else if(i == 9 && gameInfo.variant == VariantChu) i = 1; // on 12x12 only 3 promotion codes available, so use 1 to indicate promotion - if(fromY == DROP_RANK) i = 9, from = ToUpper(PieceToChar(fromX)) - '@'; - if(killX >= 0) { // multi-leg move - int dx = killX - fromX, dy = killY - fromY; - for(i=0; i<8; i++) if(dx == xStep[i] && dy == yStep[i]) { - int j; - dx = toX - killX; dy = toY - killY; - for(j=0; j<8; j++) if(dx == xStep[j] && dy == yStep[j]) { - // special encoding in to-square, with promoType = 2. Assumes board >= 64 squares! - return i + 8*j + (2 * width * BOARD_HEIGHT + from) * width * BOARD_HEIGHT; - } - } - i = 0; // if not a valid Lion move, ignore kill-square and promoChar - } - return to + (i * width * BOARD_HEIGHT + from) * width * BOARD_HEIGHT; -} - -int -TextToMoves (char *text, int moveNum, entry_t *entries) -{ - int i, w, count=0; - uint64 hashKey = hash(moveNum); - int fromX, fromY, toX, toY; - ChessMove moveType; - char promoChar, valid; - float dummy; - - entries[0].key = hashKey; // make sure key is returned even if no moves - while((i=sscanf(text, "%f%%%d", &dummy, &w))==2 || (i=sscanf(text, "%d", &w))==1) { - if(i == 2) text = strchr(text, '%') + 1; // skip percentage - if(w == 1) text = strstr(text, "1 ") + 2; // skip weight that could be recognized as move number one - valid = ParseOneMove(text, moveNum, &moveType, &fromX, &fromY, &toX, &toY, &promoChar); - text = strstr(text, yy_textstr) + strlen(yy_textstr); // skip what we parsed - if(!valid || moveType != NormalMove && moveType != WhiteDrop && moveType != BlackDrop - && moveType != FirstLeg - && moveType != WhitePromotion && moveType != BlackPromotion - && moveType != WhiteCapturesEnPassant && moveType != BlackCapturesEnPassant - && moveType != WhiteKingSideCastle && moveType != BlackKingSideCastle - && moveType != WhiteQueenSideCastle && moveType != BlackQueenSideCastle - && moveType != WhiteNonPromotion && moveType != BlackNonPromotion) continue; - if(*text == ' ' && sscanf(text+1, "{%hd/%hd}", &entries[count].learnPoints, &entries[count].learnCount) == 2) { - text = strchr(text+1, '}') + 1; - } else { - entries[count].learnPoints = 0; - entries[count].learnCount = 0; - } - entries[count].move = CoordsToMove(fromX, fromY, toX, toY, promoChar); killX = killY = -1; - entries[count].key = hashKey; - entries[count].weight = w; - count++; - } - return count; -} - -Boolean bookUp; -int currentCount; - -Boolean -DisplayBook (int moveNr) -{ - entry_t entries[MOVE_BUF]; - int count; - char *p; - if(!bookUp) return FALSE; - count = currentCount = ReadFromBookFile(moveNr, appData.polyglotBook, entries); - if(count < 0) return FALSE; - p = MovesToText(count, entries); - EditTagsPopUp(p, NULL); - free(p); - addToBookFlag = FALSE; - return TRUE; -} - -void -EditBookEvent() -{ - bookUp = TRUE; - bookUp = DisplayBook(currentMove); -} - -void -int_to_file (FILE *f, int l, uint64 r) -{ - int i; - for(i=l-1;i>=0;i--) fputc(r>>8*i & 255, f); -} - -void -entry_to_file (FILE *f, entry_t *entry) -{ - int_to_file(f,8,entry->key); - int_to_file(f,2,entry->move); - int_to_file(f,2,entry->weight); - int_to_file(f,2,entry->learnCount); - int_to_file(f,2,entry->learnPoints); -} - -char buf1[4096], buf2[4096]; - -void -SaveToBook (char *text) -{ - entry_t entries[MOVE_BUF], entry; - int count = TextToMoves(text, currentMove, entries); - int offset, i, len1=0, len2, readpos=0, writepos=0; - FILE *f; - if(!count && !currentCount) return; - f=fopen(appData.polyglotBook, "rb+"); - if(!f){ DisplayError(_("Polyglot book not valid"), 0); return; } - offset=find_key(f, entries[0].key, &entry); - if(entries[0].key != entry.key && currentCount) { - DisplayError(_("Hash keys are different"), 0); - fclose(f); - return; - } - if(count != currentCount) { - readpos = 16*(offset + currentCount); - writepos = 16*(offset + count); - fsseek(f, readpos, SEEK_SET); - readpos += len1 = fread(buf1, 1, 4096 - 16*currentCount, f); // salvage some entries immediately behind change - } - fsseek(f, 16*(offset), SEEK_SET); - for(i=0; i writepos) { - fsseek(f, readpos, SEEK_SET); - readpos += len1 = fread(buf1, 1, 4096, f); - } else len1 = 0; // wrote already past old EOF - fsseek(f, writepos, SEEK_SET); - fwrite(buf2, 1, len2, f); - writepos += len2; - } while(len1); - } - dirty = 1; - fclose(f); -} - -void -NewEntry (entry_t *e, uint64 key, int move, int result) -{ - e->key = key; - e->move = move; - e->learnPoints = 0; - e->learnCount = 0; - CountMove(e, result); -} - -void -Merge () -{ - int i; - - if(appData.debugMode) fprintf(debugFP, "book merge %d moves (old size %d)\n", mergeSize, bookSize); - - bookSize += --mergeSize; - for(i=bookSize-1; mergeSize; i--) { - while(mergeSize && (i < mergeSize || mergeBuf[mergeSize-1].key >= memBook[i-mergeSize].key)) - memBook[i--] = mergeBuf[--mergeSize]; - if(i < 0) break; - memBook[i] = memBook[i-mergeSize]; - } - if(mergeSize) DisplayFatalError("merge error", 0, 0); // impossible - mergeSize = 1; - mergeBuf[0].key = -1LL; -} - -void -AddToBook (int moveNr, int result) -{ - entry_t entry; - int offset, start, move; - uint64 key; - int i, j, fromY, toY; - char fromX, toX, promo; -extern char moveList[][MOVE_LEN]; - - if(!moveList[moveNr][0] || moveList[moveNr][0] == '\n') return; // could be terminal position - - if(appData.debugMode) fprintf(debugFP, "add move %d to book %s", moveNr, moveList[moveNr]); - - // calculate key and book representation of move - key = hash(moveNr); - if(moveList[moveNr][1] == '@') { - sscanf(moveList[moveNr], "%c@%c%d", &promo, &toX, &toY); - fromX = CharToPiece(WhiteOnMove(moveNr) ? ToUpper(promo) : ToLower(promo)); - fromY = DROP_RANK; promo = NULLCHAR; - } else sscanf(moveList[moveNr], "%c%d%c%d%c", &fromX, &fromY, &toX, &toY, &promo), fromX -= AAA, fromY -= ONE - '0'; - move = CoordsToMove(fromX, fromY, toX-AAA, toY-ONE+'0', promo); - - // if move already in book, just add count - memBuf = (unsigned char*) memBook; bufSize = bookSize; // in MC mode book resides in memory - offset = find_key(NULL, key, &entry); - while(memBook[offset].key == key) { - if(memBook[offset].move == move) { - CountMove(memBook+offset, result); return; - } else offset++; - } - // move did not occur in the main book - memBuf = (unsigned char*) mergeBuf; bufSize = mergeSize; // it could be amongst moves still waiting to be merged - start = offset = find_key(NULL, key, &entry); - while(mergeBuf[offset].key == key) { - if(mergeBuf[offset].move == move) { - if(appData.debugMode) fprintf(debugFP, "found in book merge buf @ %d\n", offset); - CountMove(mergeBuf+offset, result); return; - } else offset++; - } - if(start != offset) { // position was in mergeBuf, but move is new - if(appData.debugMode) fprintf(debugFP, "add in book merge buf @ %d\n", offset); - for(i=mergeSize++; i>offset; i--) mergeBuf[i] = mergeBuf[i-1]; // make room - NewEntry(mergeBuf+offset, key, move, result); - return; - } - // position was not in mergeBuf; look in hash table - i = (key & mask); offset = -1; - while(hashTab[i].key) { // search in hash table (necessary because sought item could be re-hashed) - if(hashTab[i].key == 1 && offset < 0) offset = i; // remember first invalidated entry we pass - if(!((hashTab[i].key - key) & ~1)) { // hit - if(hashTab[i].move == move) { - CountMove(hashTab+i, result); - for(j=mergeSize++; j>start; j--) mergeBuf[j] = mergeBuf[j-1]; - } else { - // position already in hash now occurs with different move; move both moves to mergeBuf - for(j=mergeSize+1; j>start+1; j--) mergeBuf[j] = mergeBuf[j-2]; - NewEntry(mergeBuf+start+1, key, move, result); mergeSize += 2; - } - hashTab[i].key = 1; // kludge to invalidate hash entry - mergeBuf[start] = hashTab[i]; mergeBuf[start].key = key; - if(mergeSize >= MERGESIZE) Merge(); - return; - } - i = i+1 & mask; // wrap! - } - // position did not yet occur in hash table. Put it there - if(offset < 0) offset = i; - NewEntry(hashTab+offset, key, move, result); - if(appData.debugMode) - fprintf(debugFP, "book hash @ %d (%d-%d)\n", offset, hashTab[offset].learnPoints, hashTab[offset].learnCount); -} - -void -AddGameToBook (int always) -{ - int i, result; - - if(!mcMode && !always) return; - - InitMemBook(); - switch(gameInfo.result) { - case GameIsDrawn: result = 1; break; - case WhiteWins: result = 2; break; - case BlackWins: result = 0; break; - default: return; // don't treat games with unknown result - } - - if(appData.debugMode) fprintf(debugFP, "add game to book (%d-%d)\n", backwardMostMove, forwardMostMove); - for(i=backwardMostMove; i text && start[-1] != ' ' && start[-1] != '\t') start--; - while(*end && *++end != ' ' && *end != '\n') - ; *end = NULLCHAR; // find clicked word - if(start != end) TypeInDoneEvent(start); // fake it was typed in move type-in -} - -void -FlushBook () -{ - FILE *f; - int i; - - InitMemBook(); - Merge(); // flush merge buffer to memBook - - if(f = fopen(appData.polyglotBook, "wb")) { - for(i=0; i -#include -#if HAVE_UNISTD_H -# include -#endif - -#include "common.h" -#include "frontend.h" -#include "backend.h" /* for safeStrCpy */ - -#if !USE_PTYS -/* This code is for systems where pipes work properly */ - -void -SetUpChildIO (int to_prog[2], int from_prog[2]) -{ - signal(SIGPIPE, SIG_IGN); - pipe(to_prog); - pipe(from_prog); -} - -#else /* USE_PTYS == 1 */ -/* This code is for all systems where we must use ptys */ - -#include -#include -#include -#if HAVE_STROPTS_H -# include -#endif /* HAVE_STROPTS_H */ -#if HAVE_SYS_FCNTL_H -# include -#else /* not HAVE_SYS_FCNTL_H */ -# if HAVE_FCNTL_H -# include -# endif /* HAVE_FCNTL_H */ -#endif /* not HAVE_SYS_FCNTL_H */ - -int PseudoTTY P((char pty_name[])); - -int -SetUpChildIO (int to_prog[2], int from_prog[2]) -{ - char pty_name[MSG_SIZ]; - - if ((to_prog[1] = PseudoTTY(pty_name)) == -1) { - DisplayFatalError("Can't open pseudo-tty", errno, 1); - ExitEvent(1); - } - from_prog[0] = to_prog[1]; - to_prog[0] = from_prog[1] = open(pty_name, O_RDWR, 0); - -#if HAVE_STROPTS_H /* do we really need this?? pipe-like behavior is fine */ - if (ioctl (to_prog[0], I_PUSH, "ptem") == -1 || - ioctl (to_prog[0], I_PUSH, "ldterm") == -1 || - ioctl (to_prog[0], I_PUSH, "ttcompat") == -1) { -# ifdef NOTDEF /* seems some systems don't have or need ptem and ttcompat */ - DisplayFatalError("Can't ioctl pseudo-tty", errno, 1); - ExitEvent(1); -# endif /*NOTDEF*/ - } -#endif /* HAVE_STROPTS_H */ - -} - -#if HAVE_GRANTPT -/* This code is for SVR4 */ - -int -PseudoTTY (char pty_name[]) -{ - extern char *ptsname(); - char *ptss; - int fd; - - fd = open("/dev/ptmx", O_RDWR); - if (fd < 0) return fd; - if (grantpt(fd) == -1) return -1; - if (unlockpt(fd) == -1) return -1; - if (!(ptss = ptsname(fd))) return -1; - safeStrCpy(pty_name, ptss, sizeof(pty_name)/sizeof(pty_name[0])); - return fd; -} - -#else /* not HAVE_GRANTPT */ -#if HAVE__GETPTY -/* This code is for IRIX */ - -int -PseudoTTY (char pty_name[]) -{ - int fd; - char *ptyn; - - ptyn = _getpty(&fd, O_RDWR, 0600, 0); - if (ptyn == NULL) return -1; - safeStrCpy(pty_name, ptyn, sizeof(pty_name)/sizeof(pty_name[0])); - return fd; -} - -#else /* not HAVE__GETPTY */ -#if HAVE_LIBSEQ -/* This code is for Sequent DYNIX/ptx. Untested. --tpm */ - -int -PseudoTTY (char pty_name[]) -{ - int fd; - char *slave, *master; - - fd = getpseudotty(&slave, &master); - if (fd < 0) return fd; - safeStrCpy(pty_name, slave, sizeof(pty_name)/sizeof(pty_name[0])); - return fd; -} - -#else /* not HAVE_LIBSEQ */ -/* This code is for all other systems */ -/* The code is adapted from GNU Emacs 19.24 */ - -#ifndef FIRST_PTY_LETTER -#define FIRST_PTY_LETTER 'p' -#endif -#ifndef LAST_PTY_LETTER -#define LAST_PTY_LETTER 'z' -#endif - -int -PseudoTTY (char pty_name[]) -{ - struct stat stb; - register c, i; - int fd; - - /* Some systems name their pseudoterminals so that there are gaps in - the usual sequence - for example, on HP9000/S700 systems, there - are no pseudoterminals with names ending in 'f'. So we wait for - three failures in a row before deciding that we've reached the - end of the ptys. */ - int failed_count = 0; - -#ifdef PTY_ITERATION - PTY_ITERATION -#else - for (c = FIRST_PTY_LETTER; c <= LAST_PTY_LETTER; c++) - for (i = 0; i < 16; i++) -#endif - { -#ifdef PTY_NAME_SPRINTF - PTY_NAME_SPRINTF -#else - sprintf (pty_name, "/dev/pty%c%x", c, i); -#endif /* no PTY_NAME_SPRINTF */ - -#ifdef PTY_OPEN - PTY_OPEN; -#else /* no PTY_OPEN */ - if (stat (pty_name, &stb) < 0) - { - failed_count++; - if (failed_count >= 3) - return -1; - } - else - failed_count = 0; - fd = open (pty_name, O_RDWR, 0); -#endif /* no PTY_OPEN */ - - if (fd >= 0) - { - /* check to make certain that both sides are available - this avoids a nasty yet stupid bug in rlogins */ -#ifdef PTY_TTY_NAME_SPRINTF - PTY_TTY_NAME_SPRINTF -#else - sprintf (pty_name, "/dev/tty%c%x", c, i); -#endif /* no PTY_TTY_NAME_SPRINTF */ -#ifndef UNIPLUS - if (access (pty_name, 6) != 0) - { - close (fd); - continue; - } -#endif /* not UNIPLUS */ -#ifdef IBMRTAIX - /* On AIX, the parent gets SIGHUP when a pty attached - child dies. So, we ignore SIGHUP once we've started - a child on a pty. Note that this may cause xboard - not to die when it should, i.e., when its own - controlling tty goes away. - */ - signal(SIGHUP, SIG_IGN); -#endif /* IBMRTAIX */ - return fd; - } - } - return -1; -} - -#endif /* not HAVE_LIBSEQ */ -#endif /* not HAVE__GETPTY */ -#endif /* not HAVE_GRANTPT */ -#endif /* USE_PTYS */ diff --git a/childio.h b/childio.h deleted file mode 100644 index 497fad1..0000000 --- a/childio.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * childio.h -- set up communication with child processes - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -void SetUpChildIO P((int to_prog[2], int from_prog[2])); diff --git a/cmail.in b/cmail.in deleted file mode 100644 index 15d8b2b..0000000 --- a/cmail.in +++ /dev/null @@ -1,1836 +0,0 @@ -#! @PERLPATH@ -## (configure will change the top line to the location of perl on your system) -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## cmail: a tool to aid playing chess by email -## Copyright (C) 1993,2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. -## -## cmail is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or (at -## your option) any later version. -## -## cmail is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program. If not, see http://www.gnu.org/licenses/. * -## -## Email: evan@quadstone.co.uk -## Snailmail: Evan Welsh -## Quadstone Ltd -## 16 Chester Street -## Edinburgh EH3 7RA -## Scotland -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Print verbose diagnostics for debugging -sub debug { - if ($DEBUG) { - local ($old) = select ; ## Remember selected output - select (logfile) ; - $| = 1 ; ## Keep it flushed - print @_ ; ## Print arguments - select ($old) ; - } -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Create a directory for storing games in if it doesn't already exist -sub need_chess_dir { - local ($old) ; - - ## ################################################################# ## - ## Check for existence of the named chess directory - ## ################################################################# ## - - if (! (-d "$CMAILDIR")) { - - ## ############################################################# ## - ## Ask user for confirmation if attached to tty - ## ############################################################# ## - - if (-t) { - $old = select ; ## Remember selected output - select (stdout) ; ## Write to standard output - $| = 1 ; ## Keep it flushed - print ( "CMail directory \"$CMAILDIR\" does not exist." - . " Create it? [y/q]: ") ; - - $_ = ; ## Read response from tty - die "Bye!\n" if (/^[qQ].*/) ; ## Quit if q selected - - select ($old) ; ## Re-select the old output - } - - ## ############################################################# ## - ## Create a cmail directory or die - ## ############################################################# ## - - die "cmail: Can't create CMail directory: \"$CMAILDIR\"\n" - unless mkdir ("$CMAILDIR", 511) ; - print ( "Created cmail directory \"$CMAILDIR\".\n" - . "You can move it but remember to set the CMAIL_DIR" - . " environment variable.\n") ; - } - - ## ################################################################# ## - ## Change to the $CMAILDIR directory whether newly created or not - ## ################################################################# ## - - die "Couldn't changed directory to \"$CMAILDIR\"\n" - unless (chdir "$CMAILDIR") ; - - ## ################################################################# ## - ## Check for existence of the named chess directory - ## ################################################################# ## - - if (! (-d "$ARCDIR")) { - - ## ############################################################# ## - ## Ask user for confirmation if attached to tty - ## ############################################################# ## - - if (-t) { - $old = select ; ## Remember selected output - select (stdout) ; ## Write to standard output - $| = 1 ; ## Keep it flushed - print ( "Archive directory \"$ARCDIR\" does not exist." - . " Create it? [y/q]: ") ; - - $_ = ; ## Read response from tty - die "Bye!\n" if (/^[qQ].*/) ; ## Quit if q selected - - select ($old) ; ## Re-select the old output - } - - ## ############################################################# ## - ## Create a chess directory or die - ## ############################################################# ## - - die "cmail: Can't create archive directory: \"$ARCDIR\"\n" - unless mkdir ("$ARCDIR", 511) ; - print ( "Created archive directory \"$ARCDIR\".\n" - . "You can move it but remember to set the CMAIL_ARCDIR" - . " environment variable.\n") ; - } -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Parse command-line arguments -sub parse_flags { - ## ################################################################# ## - ## Set up defaults from the environment or from hard-wired constants - ## ################################################################# ## - - $SHOWC = 0 ; - $SHOWW = 0 ; - $OUTPUT_POS = $ENV{'CMAIL_OUTPUT_POS'} ; - $LOGFILE = $ENV{'CMAIL_LOGFILE'} ; - $MAILPROG = $ENV{'CMAIL_MAILPROG'} ; - $MAILPROG = "/usr/sbin/sendmail" if ( (-x "/usr/sbin/sendmail") - && (! $MAILPROG)) ; - $MAILPROG = "/usr/lib/sendmail" if ( (-x "/usr/lib/sendmail") - && (! $MAILPROG)) ; - $MAILPROG = "/etc/sendmail" if ( (-x "/usr/lib/sendmail") - && (! $MAILPROG)) ; - $MAILPROG = "/usr/ucb/Mail" if ( (-x "/usr/ucb/Mail") - && (! $MAILPROG)) ; - $MAILPROG = "/usr/ucb/mail" if ( (-x "/usr/ucb/mail") - && (! $MAILPROG)) ; - $MAILPROG = "Mail" unless ($MAILPROG) ; - $HOMEDIR = $ENV{'HOME'} ; - $CMAILDIR = $ENV{'CMAIL_DIR'} ; - $CMAILDIR = $ENV{'CHESSDIR'} unless ($CMAILDIR) ; - $CMAILDIR = "$HOMEDIR/Chess" unless ($CMAILDIR) ; - $CMAILDIR = "~/Chess" unless ($HOMEDIR) ; - $NUM_GAMES = "?" ; - $NUM_WGAMES = "?" ; - $NUM_BGAMES = "?" ; - $TIME_DELAY = $ENV{'CMAIL_TIME_DELAY'} ; - $TIME_DELAY = 0 unless ($TIME_DELAY) ; - $PW_NAME = &get_pw_name () ; - $MY_NNAME = $PW_NAME ; - $MY_NNAME = $ENV{'LOGNAME'} unless ($MY_NNAME) ; - $MY_NNAME = $ENV{'USER'} unless ($MY_NNAME) ; - $MY_NNAME = "?" unless ($MY_NNAME) ; - $PGN_EVENT = "Email correspondence game" ; - $PGN_SITE = "NET"; - $PGN_ROUND = "-"; - $PGN_MODE = "EM"; - $SEND_MAIL = 1 ; - $REMAIL = 0 ; - $LOAD_XBOARD = 1 unless $ENV{'CMAIL_NO_XBOARD'} ; - $REUSE = 1 ; - @TD_FLAGS = ("-td", $TIME_DELAY) ; - @NCP_FLAGS = ("-ncp") ; - - ## ################################################################# ## - ## Define the usage string - ## ################################################################# ## - - $USAGE = ("cmail - [-h] [-c] [-w] [-[x]v] [-[x]mail] [-[x]xboard] [-[x]reuse] [-remail] - [-game ] [-(w|b|)games ] [-(me|opp) ] - [-(w|b|my|opp)name ] [-(w|b|my|opp)na ] - [-dir ] [-arcdir ] [-mailprog ] - [-logFile ] [-event ] [-site ] [-round ] - [-mode ]") ; - - ## ################################################################# ## - ## Overwrite defaults if specified on the command-line - ## ################################################################# ## - - @UNREC_ARGS = () ; - while ($ARGV = shift) { - $UNREC = 0 if ($ARGV =~ /^-/) ; - if ("$ARGV" eq "-h") {die ("Usage: $USAGE\n") ;} - elsif ("$ARGV" eq "-c") {$SHOWC = 1 ;} - elsif ("$ARGV" eq "-w") {$SHOWW = 1 ;} - elsif ("$ARGV" eq "-v") {$DEBUG = 1 ; - @DEBUG_FLAGS = ("-debug") ;} - elsif ("$ARGV" eq "-xv") {$DEBUG = 0 ; - $QUIET = 1 ;} - elsif ("$ARGV" eq "-mail") {$SEND_MAIL = 1 ;} - elsif ("$ARGV" eq "-xmail") {$SEND_MAIL = 0 ;} - elsif ("$ARGV" eq "-xboard") {$LOAD_XBOARD = 1 ;} - elsif ("$ARGV" eq "-xxboard") {$LOAD_XBOARD = 0 ;} - elsif ("$ARGV" eq "-reuse") {$REUSE = 1 ;} - elsif ("$ARGV" eq "-xreuse") {$REUSE = 0 ;} - elsif ("$ARGV" eq "-remail") {$LOAD_XBOARD = 0 ; - $SEND_MAIL = 1 ; - $REMAIL = 1 ;} - elsif ("$ARGV" eq "-game") {$PGN_GAME = shift ;} - elsif ("$ARGV" eq "-games") {$NUM_GAMES = shift ;} - elsif ("$ARGV" eq "-wgames") {$NUM_WGAMES = shift ;} - elsif ("$ARGV" eq "-bgames") {$NUM_BGAMES = shift ;} - elsif ("$ARGV" eq "-me") {$MY_NNAME = shift ;} - elsif ("$ARGV" eq "-opp") {$OPP_NNAME = shift ;} - elsif ("$ARGV" eq "-myname") {$MY_FNAME = shift ;} - elsif ("$ARGV" eq "-oppname") {$OPP_FNAME = shift ;} - elsif ("$ARGV" eq "-wname") {$WHITE_FNAME = shift ;} - elsif ("$ARGV" eq "-bname") {$BLACK_FNAME = shift ;} - elsif ("$ARGV" eq "-myna") {$MY_ADDRESS = shift ;} - elsif ("$ARGV" eq "-oppna") {$OPP_ADDRESS = shift ;} - elsif ("$ARGV" eq "-wna") {$WHITENA = shift ;} - elsif ("$ARGV" eq "-bna") {$BLACKNA = shift ;} - elsif ("$ARGV" eq "-dir") {$CMAILDIR = shift ;} - elsif ("$ARGV" eq "-arcdir") {$ARCDIR = shift ;} - elsif ("$ARGV" eq "-mailprog") {$MAILPROG = shift ;} - elsif ("$ARGV" eq "-logFile") {$LOGFILE = shift ;} - elsif ("$ARGV" =~ /^-(td|timeDelay)$/) - {@TD_FLAGS = ($ARGV, - shift) ;} - elsif ("$ARGV" =~ /^-noChessComputer$/) - {@NCP_FLAGS = ($ARGV, - shift) ;} - elsif ("$ARGV" =~ /^-[x]?ncp$/) {@NCP_FLAGS = ($ARGV) ;} - elsif ("$ARGV" eq "-event") {$PGN_EVENT = shift ;} - elsif ("$ARGV" eq "-site") {$PGN_SITE = shift ;} - elsif ("$ARGV" eq "-round") {$PGN_ROUND = shift ;} - elsif ("$ARGV" eq "-mode") {$PGN_MODE = shift ;} - elsif ("$ARGV" =~ /^-/ || $UNREC) { - push(@UNREC_ARGS, $ARGV) ; - $UNREC = 1 ; - } else { - die("cmail: Unrecognised flag \"$ARGV\"\nUsage: $USAGE\n") ; - } - } - - ## ################################################################# ## - ## Assign a value to $ARCDIR if not specified on the command line - ## ################################################################# ## - - $ARCDIR = $ENV{'CMAIL_ARCDIR'} unless ($ARCDIR) ; - $ARCDIR = $CMAILDIR unless ($ARCDIR) ; - $ENV{'CMAIL_ARCDIR'} = $ARCDIR ; ## Make sure this is set for xboard - - ## ################################################################# ## - ## Propagate some CMAIL variables through xboard to the cmail - ## grandchild so that it uses the same important variables as this one - ## ################################################################# ## - - $ENV{'CMAIL_MAILPROG'} = $MAILPROG ; - $ENV{'CMAIL_DIR'} = $CMAILDIR ; - $ENV{'CHESSDIR'} = $CMAILDIR ; ## Make xboard use $CMAILDIR - $ENV{'CMAIL_ARCDIR'} = $ARCDIR ; - if ($LOGFILE) { - $ENV{'CMAIL_LOGFILE'} = $LOGFILE ; - } else { - $LOGFILE = "&STDERR" ; - } - - ## ################################################################# ## - ## Work out how many games of each colour will be played - ## ################################################################# ## - - die "cmail: Illegal number of games: $NUM_GAMES\n" - if ($NUM_GAMES < 0) ; - die "cmail: Illegal number of white games: $NUM_WGAMES\n" - if ($NUM_WGAMES < 0) ; - die "cmail: Illegal number of black games: $NUM_BGAMES\n" - if ($NUM_BGAMES < 0) ; - if ("$NUM_GAMES" ne "?") { - if ("$NUM_WGAMES" eq "?") { - if ("$NUM_BGAMES" eq "?") { - $NUM_BGAMES = int($NUM_GAMES / 2) ; - } - $NUM_WGAMES = $NUM_GAMES - $NUM_BGAMES ; - } elsif ("$NUM_BGAMES" eq "?") { - $NUM_BGAMES = $NUM_GAMES - $NUM_WGAMES ; - } - } elsif ("$NUM_WGAMES" eq "?") { - if ("$NUM_BGAMES" eq "?") { - $NUM_GAMES = 1 ; - $NUM_WGAMES = 1 ; - $NUM_BGAMES = 0 ; - } else { - $NUM_GAMES = $NUM_BGAMES ; - $NUM_WGAMES = 0 ; - } - } else { - if ("$NUM_BGAMES" eq "?") { - $NUM_GAMES = $NUM_WGAMES ; - $NUM_BGAMES = 0 ; - } else { - $NUM_GAMES = $NUM_WGAMES + $NUM_BGAMES ; - } - } - die "cmail: Illegal number of games: $NUM_GAMES\n" - if ("$NUM_GAMES" eq "0") ; - die ( "cmail: Inconsistent numbers of games specified:" - . " $NUM_WGAMES + $NUM_BGAMES != $NUM_GAMES\n") - unless ($NUM_GAMES == $NUM_WGAMES + $NUM_BGAMES) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Initialisation of variables and environment -sub showGPL { - ## ################################################################# ## - ## Show copyright notice - ## ################################################################# ## - - while () { - last if (/^{END OF GPL COPYRIGHT}$/) ; - s/\$Revision[:] (.*) \$/$1/ ; - print ; - } - - ## ################################################################# ## - ## Show conditions if requested - ## ################################################################# ## - - while () { - last if (/^{END OF GPL CONDITIONS}$/) ; - print if ($SHOWW) ; - } - - ## ################################################################# ## - ## Show warranty if requested - ## ################################################################# ## - - if ($SHOWC) { - print "\n" if ($SHOWW) ; - print while () ; - } - - - exit 0 if ($SHOWC || $SHOWW) ; ## Abort if showed conditions or warranty -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Initialisation of variables and environment -sub initialise { - local ($p) = "[.PRNBQKprnbqk]" ; - local ($l) = "$p $p $p $p $p $p $p $p\n" ; - local ($board) = "$l$l$l$l$l$l$l$l" ; - local ($tp) = ".* to play\n" ; - $posdiag = "\{--------------\n$board$tp--------------\}\n+" ; - - &parse_flags (@ARGV) ; ## Parse command-line arguments - - &showGPL unless $QUIET ; - - open (tty, "< /dev/tty") ; ## Open tty for reading - - &need_chess_dir () ; ## Check for the existence of CMAILDIR - - open (logfile, ">$LOGFILE") if ($DEBUG) ; ## Default is STDERR - - &debug ("Called \n") ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Prompt for a game name, if use a default -sub prompt_for_game_name { - &debug ("Called \n") ; - local ($old) = select ; ## Remember the selected output - select (stdout); ## Prompt goes to stdout - $| = 1 ; ## Keep it flushed - - print "Game name [ to use default]: " ; - die "cmail: tty not open\n" unless (-t) ; - =~ /(.*)/ ; ## Read line from tty - $PGN_GAME = "$1" ; ## Assign to game name - - select ($old) ; ## Re-select the old output -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Prompt for opponent's address -sub prompt_for_opp_address { - &debug ("Called \n") ; - local ($old) = select ; ## Remember the selected output - select (stdout); ## Prompt goes to stdout - $| = 1 ; ## Keep it flushed - - ## ################################################################# ## - ## Prompt for opponent's email address - ## ################################################################# ## - - print "Opponent's email address: " ; - die "cmail: tty not open\n" unless (-t) ; - =~ /(.*)/ ; - $OPP_ADDRESS = $1 ; - - ## ################################################################# ## - ## Use name as default if still blank - ## ################################################################# ## - - $OPP_ADDRESS = $OPP_NNAME if ("" eq $OPP_ADDRESS) ; - - select ($old) ; ## Re-select the old output -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Prompt for opponent's name -sub prompt_for_opp_name { - &debug ("Called \n") ; - local ($old) = select ; ## Remember the selected output - select (stdout) ; ## Prompt goes to stdout - $| = 1 ; ## Keep it flushed - print "Opponent's name: " ; - - die "cmail: tty not open\n" unless (-t) ; ## Check tty is open - =~ /(.*)/ ; ## Read line from tty - $OPP_NNAME = $1 ; ## Match! - die "cmail: Can't proceed without the opponent's name.\n" - unless ($OPP_NNAME) ; - - select ($old) ; ## Re-select the old output -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Prompt for move -sub prompt_for_move { - local ($prompt) = shift ; - local ($pattern) = shift ; - &debug ("Called \n") ; - - local ($move) = "" ; - local ($old) = select ; ## Remember the selected output - select (stdout) ; ## Write to stdout - $| = 1 ; ## Keep it flushed - die "cmail: tty not open\n" unless (-t) ; ## Check tty is open - - do { - print $prompt ; - =~ /(.*)/ ; ## Read line from tty - $move = $1 ; ## Match! - } until ($move =~ /^$pattern$/) ; - - select ($old) ; ## Re-select the old output - return ($move) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Load the game -sub play_game { - &debug ("Called \n") ; - - $| = 1 ; ## Start flushing output buffer - - ## ################################################################# ## - ## Load xboard unless inhibited by command-line arguments - ## ################################################################# ## - - if (($STARTING_NEW_GAME) && ($NUM_WGAMES == 0)) { - print ( "Bypassing xboard and mailing $NUM_BGAMES empty" - . " black games.\n") ; - } elsif ($LOAD_XBOARD) { - ## ############################################################# ## - ## Remove output file from previous run, but preserve - ## $PGN_GAME.game.out.* because they will be empty black games - ## ############################################################# ## - - unlink "$PGN_GAME.out" ; - - ## ############################################################# ## - ## Invoke xboard with loads of flags - ## ############################################################# ## - - if ($PGN_GAME) { - if (@ARCHIVE) { - local ($date) = &get_date_from_games (@ARCHIVE) ; - $XBOARD_ARGS = join (' ', (("-lgf", - "'$ARCDIR/$PGN_GAME.$date.archive'"), - @NCP_FLAGS, - "-xics", - @TD_FLAGS, - @DEBUG_FLAGS, - @UNREC_ARGS)) ; - } else { - $XBOARD_ARGS = join (' ', (("-cmail", "'$PGN_GAME'"), - @TD_FLAGS, - @NCP_FLAGS, - "-xics", - @DEBUG_FLAGS, - @UNREC_ARGS)) ; - } - } else { - $PGN_GAME = "unknown.cmail" ; - $XBOARD_ARGS = join (' ', (("-lgf", "'$PGN_GAME'"), - @NCP_FLAGS, - "-xics", - @TD_FLAGS, - @DEBUG_FLAGS, - @UNREC_ARGS)) ; - $REUSE = 0 ; - } - - $LOG_FILE = "$PGN_GAME.log" ; - &debug ("Invoking xboard with args: $XBOARD_ARGS\n") ; - $PID_FILE = "$PGN_GAME.pid" ; - if ( (! $REUSE) - || (! ( (-f $PID_FILE) - && ($XBOARD_PID = `cat '$PID_FILE'`) - && ("$XBOARD_PID" =~ /^\d+$/) - && (kill "SIGUSR1", $XBOARD_PID)))) { - print "Loading xboard for game \"$PGN_GAME\"..." ; -# system ("gdb xboard") ; - system ( "{ ({ xboard $XBOARD_ARGS & } ;" - . " echo \$! > '$PID_FILE' ;" - . " wait ;" - . " rm '$PID_FILE') & } >'$LOG_FILE' 2>&1") ; - print ( "done.\n" - . "If nothing happens look for an error message in\n" - . "$CMAILDIR/$LOG_FILE\n") ; - } else { - print ("Revived existing xboard for game \"$PGN_GAME\".\n" - . "If nothing happens" - . " remove $CMAILDIR/$PID_FILE and try again.\n") ; - } - - return 1 ; - } - return 0 ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Enter moves on tty instead of xboard -sub play_on_tty { - &debug ("Called \n") ; - - local (@results) = @_ ; - - local (@games, $game, $to_play) ; - - ## ################################################################# ## - ## Check we have access to tty - ## ################################################################# ## - - if (open(STDIN, '/dev/tty')) { - ## ############################################################# ## - ## Read in games - ## ############################################################# ## - - local ($infile) = "$PGN_GAME.game.in" ; - if (-f $infile) { - @games = &get_games_from_file($infile) ; - &debug ("Read in games from \"$infile\"\n") ; - - if (@results) { - foreach $game (@games) { - $result = shift (@results) ; - if ($result && ($game =~ /\[Result\s+"[^*]+"\]/)) { - $game = "" ; - } - } - } - - ## ################################################################# ## - ## Accept move on tty for each game in turn - ## ################################################################# ## - - local ($comment_orig, $comment, $comment_line, - $pos, $move, $normal_move, $action, $result) ; - - foreach $game (@games) { - next unless $game ; - - $game =~ s/[\s\n]*[*]?[\s\n]*$// ; - $pos = "" ; - $pos = $1 if ($game =~ s/($posdiag)//) ; - print $game, "\n\n", $pos ; - - ($number, $to_play) = &get_to_play ($game) ; - - $comment_orig = "" ; - $game_nocomment = $game ; - if ($game_nocomment =~ s/\n?{\n?([^{]*)}$//) { - $comment_orig = $1 ; - $comment_orig =~ s/([^\n])$/$1\n/ ; -# &debug ("Comment is:\n{\n$comment_orig}\n") ; - } - if ($game =~ /\[Result\s+"[^*]+"\]/) { - &prompt_for_move ("Game finished, press \"Return\" to continue: ", "") ; - next ; - } - - $tmpgame = $game_nocomment ; - $comment = $comment_orig ; - - outer: - while (1) { - if ($game =~ /{\n?.* offers a draw\n?}$/) { - $move = &prompt_for_move ("Enter move [MOVE/(r)esign/(a)ccept/(c)omment/re(t)ry]: ", - "([-a-h0-9PRNBQK][-a-h0-9PRNBQK]+|[ract])") ; - } else { - $move = &prompt_for_move ("Enter move [MOVE/(r)esign/(c)omment/re(t)ry]: ", - "([-a-h0-9PRNBQK][-a-h0-9PRNBQK]+|[rct])") ; - } - $normal_move = 0 ; - $result = "" ; - if ($move =~ /^\s*r\s*$/i) { - if ($to_play eq "White") { - $result = "0-1" ; - } else { - $result = "1-0" ; - } - $move = "\n{$to_play resigns} $result" ; - } elsif ($move =~ /^\s*a\s*$/i) { - $move = "\n{Draw agreed} $result" ; - } elsif ($move =~ /^\s*c\s*$/i) { - while ($comment_line = &prompt_for_move ("Enter comment: ", ".*")) { - $comment .= $comment_line . "\n" ; - } - next ; - } elsif ($move =~ /^\s*t\s*$/i) { - print $game, "\n\n", $pos ; - $tmpgame = $game_nocomment ; - $comment = $comment_orig ; - print "Try again.\n" ; - next ; - } else { - $normal_move = 1 ; - } - - $tmpgame .= "\n{\n" . $comment . "}" if ($comment) ; - if (! $normal_move) { - $tmpgame .= "$move" ; - } elsif ($to_play eq "White") { - $tmpgame .= "\n$number. $move" ; - } elsif ($tmpgame =~ /}$/) { - $tmpgame .= "\n$number. ... $move" ; - } else { - $tmpgame .= " $move" ; - } - - $tmpgame =~ s/\[Result\s+"(.*)"\]/[Result "$result"]/ if ($result) ; - $comment = "" ; - middle: - while (1) { - if ($normal_move) { - $action = &prompt_for_move ("Enter action [(d)raw/(c)omment/(s)end/re(t)ry]: ", - "[dcst]") ; - } elsif ($result) { - $action = &prompt_for_move ("Enter action [(s)end/re(t)ry]: ", - "[st]") ; - } else { - $action = &prompt_for_move ("Enter action [(c)omment/(s)end/re(t)ry]: ", - "[cst]") ; - } - if ($action =~ /^\s*d\s*$/i) { - if ($normal_move) { - $comment .= "$to_play offers a draw\n" ; - - while (1) { - $action = &prompt_for_move ("Enter action [(c)omment/(s)end/re(t)ry]: ", - "[cst]") ; - if ($action =~ /^\s*c\s*$/i) { - while ($comment_line = &prompt_for_move ("Enter comment: ", ".*")) { - $comment .= $comment_line . "\n" ; - } - next ; - } elsif ($action =~ /^\s*t\s*$/i) { - print $game, "\n\n", $pos ; - $tmpgame = $game_nocomment ; - $comment = $comment_orig ; - print "Try again.\n" ; - next outer; - } elsif ($action =~ /^\s*s\s*$/i) { - $tmpgame .= "\n{\n" . $comment . "}" ; - last middle ; - } - } - } else { - print "You can't offer a draw at this point.\n" ; - next ; - } - } elsif ($action =~ /^\s*c\s*$/i) { - if ($result) { - print "You can't enter a comment after the game is finished.\n" ; - } else { - while ($comment_line = &prompt_for_move ("Enter comment: ", ".*")) { - $comment .= $comment_line . "\n" ; - } - } - next ; - } elsif ($action =~ /^\s*t\s*$/i) { - print $game, $pos ; - $tmpgame = $game_nocomment ; - $comment = $comment_orig ; - print "Try again.\n" ; - next outer; - } elsif ($action =~ /^\s*s\s*$/i) { - $tmpgame .= "\n{\n" . $comment . "}\n" if ($comment) ; - last ; - } - } - - last ; - } - - $tmpgame .= "\n*" if ($normal_move) ; - $tmpgame .= "\n\n" ; - $game = $tmpgame ; - } - } else { - die "cmail: No games to be read\n" ; - } - } else { - die "cmail: Can't open tty" ; - } - - return (@games) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Find the game the user wants by any means possible -sub find_game { - &debug ("Called \n") ; - - ## ################################################################# ## - ## Ask user for a game name if not already known - ## ################################################################# ## - - &prompt_for_game_name () if ("" eq "$PGN_GAME") ; - - ## ################################################################# ## - ## Find out opponent's details - ## ################################################################# ## - - if ("" eq "$PGN_GAME") { - ## ############################################################# ## - ## Failed to find the game name so construct a default from players - ## ############################################################# ## - - &prompt_for_opp_name () if ("" eq "$OPP_NNAME") ; ## Ask user - die "cmail: Can't proceed without your opponent's short name (-opp)\n" - if ("" eq "$OPP_NNAME") ; - die "cmail: Can't proceed without your own short name (-me)\n" - if ("" eq "$MY_NNAME") ; - if ($NUM_WGAMES > 0) { - $PGN_GAME = "$MY_NNAME-vs-$OPP_NNAME" ; ## Construct default - } else { - $PGN_GAME = "$OPP_NNAME-vs-$MY_NNAME" ; ## Construct default - } - } elsif (("" eq "$OPP_ADDRESS") && ("" ne "$RETURN_ADDRESS")) { - $OPP_ADDRESS = $RETURN_ADDRESS ; ## Use return address instead - &debug ( "Using return address \"$OPP_ADDRESS\"" - . " for opponent address\n") ; - } - - ## ################################################################# ## - ## If no $PGN_GAME.game.in file, assume we're starting a new game - ## ################################################################# ## - - &start_new_game () unless (-f "$PGN_GAME.game.in") ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get the date -sub get_date { - local ($the_time) = time ; - local ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = - localtime ($the_time) ; - $mon ++ ; - $year += 1900 ; - if ($mon < 10) { - $mon = "0$mon" ; - } - if ($mday < 10) { - $mday = "0$mday" ; - } - "$year.$mon.$mday" ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Start a new game -sub start_new_game { - print ( "Starting new game" - . " -- $NUM_WGAMES as white, $NUM_BGAMES as black.\n") ; - local ($to_play) = "white" ; - $move_num = 0 ; - $STARTING_NEW_GAME = 1 ; - - local (@game) ; - - ## ################################################################# ## - ## Ask user for opponent's email address if unknown - ## ################################################################# ## - - &prompt_for_opp_address () if ("" eq "$OPP_ADDRESS") ; - - ## ################################################################# ## - ## Give up if we haven't got anywhere to send a move to - ## ################################################################# ## - - die "cmail: Can't proceed without your opponent's email address.\n" - if ("" eq "$OPP_ADDRESS") ; - - ## ################################################################# ## - ## Create an empty game file - ## ################################################################# ## - - open (GAMEFILE, "> $PGN_GAME.game.in") ; - for ($j = 1; $j <= $NUM_GAMES; $j ++) { - $PW_GCOS = &get_pw_gcos () ; - - $PGN_MYCOL = $MY_FNAME ; - $PGN_MYCOL = $PW_GCOS unless $PGN_MYCOL ; - $PGN_MYCOL = $MY_NNAME unless $PGN_MYCOL ; - $PGN_MYCOLNA = $MY_ADDRESS ; - $PGN_MYCOLNA = "?" unless ($PGN_MYCOLNA) ; - - $PGN_OPPCOL = $OPP_FNAME ; - $PGN_OPPCOL = "?" unless ($PGN_OPPCOL) ; - $PGN_OPPCOLNA = $OPP_ADDRESS ; - $PGN_OPPCOLNA = "?" unless ($PGN_OPPCOLNA) ; - - if ($j > $NUM_WGAMES) { - $PGN_WHITE = $PGN_OPPCOL ; - $PGN_BLACK = $PGN_MYCOL ; - $PGN_WHITENA = $PGN_OPPCOLNA ; - $PGN_BLACKNA = $PGN_MYCOLNA ; - } else { - $PGN_WHITE = $PGN_MYCOL ; - $PGN_BLACK = $PGN_OPPCOL ; - $PGN_WHITENA = $PGN_MYCOLNA ; - $PGN_BLACKNA = $PGN_OPPCOLNA ; - } - - ## ######################################################### ## - ## If we only have one colour of game then allow command-line - ## colour specs to override - ## ######################################################### ## - - if (! ($NUM_WGAMES && $NUM_BGAMES)) { - $PGN_WHITE = $WHITE_FNAME if ($WHITE_FNAME) ; - $PGN_BLACK = $BLACK_FNAME if ($BLACK_FNAME) ; - $PGN_WHITENA = $WHITENA if ($WHITENA) ; - $PGN_BLACKNA = $BLACKNA if ($BLACKNA) ; - } - - $PGN_DATE = &get_date () ; - $PGN_DATE = "?" unless ($PGN_DATE) ; - - if ($NUM_GAMES > 1) { - $SUFFIX = ".$j" ; - } else { - $SUFFIX = "" ; - } - @game = ("[Event \"$PGN_EVENT\"]\n", - "[Site \"$PGN_SITE\"]\n", - "[Date \"$PGN_DATE\"]\n", - "[Round \"$PGN_ROUND\"]\n", - "[White \"$PGN_WHITE\"]\n", - "[Black \"$PGN_BLACK\"]\n", - "[Result \"*\"]\n", - "[WhiteNA \"$PGN_WHITENA\"]\n", - "[BlackNA \"$PGN_BLACKNA\"]\n", - "[Mode \"$PGN_MODE\"]\n", - "[CmailGameName \"$PGN_GAME$SUFFIX\"]\n\n*\n") ; - if ($j > $NUM_WGAMES) { - open (GAMEOUTFILE, "> $PGN_GAME.game.out.$j") ; - print GAMEOUTFILE @game ; - close (GAMEOUTFILE) ; - } else { - print GAMEFILE @game ; - } - } - close (GAMEFILE) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get the password file gcos (full name) entry -sub get_pw_entry { - local ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = - getpwuid ($<); - ($name, $gcos) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get password file gcos (full name) entry -sub get_pw_gcos { - local ($PW_GCOS) ; - if (! $PW_GCOS) { - ($dummy, $PW_GCOS) = &get_pw_entry () ; - $PW_GCOS =~ s/^\s*([^,()]+[^ ,()])[ ]*[,()].*$/$1/; - if ($PW_GCOS =~ /^([^,()]+)\s+([^\s,()]+)$/) { ## Multi-word name - $PW_GCOS = $2 . ", " . $1 ; - } elsif ($PW_GCOS !~ /^([^\s,()]+)/) { ## No sensible gcos entry - $PW_GCOS = "" ; - } ## Else leave it as one word - &debug ("PW full name is \"$PW_GCOS\"\n"); - } - return $PW_GCOS ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get password file user name entry -sub get_pw_name { - local ($PW_NAME) ; - ($PW_NAME, $dummy) = &get_pw_entry () ; - &debug ("PW name is $PW_NAME\n"); - - return $PW_NAME ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Analyse the email message -sub analyse_email_message { - local ($new_result, $delete_result, $unfinished, $finished) - = (0, 0, 0, 0) ; - local ($gamefile, @games) ; - - ## ################################################################# ## - ## Slurp the mail message - ## ################################################################# ## - - die "cmail: No games on standard input" - unless (@games = &get_games_from_file ("STDIN")) ; - - ## ################################################################# ## - ## Is the message a real cmail message or just a chess game? $PGN_GAME - ## will have been set by calling get_games_from_file if it's real - ## ################################################################# ## - - print "Processing game message..." ; - - if ($PGN_GAME) { - ## ############################################################# ## - ## Restore the results file from the archive if - ## necessary. This is helpful if the user pipes in an old - ## message for take-back purposes or whatever. - ## ############################################################# ## - - if (! -f "$PGN_GAME.res") { - ## Find what date would have been used to create the archive - foreach (@games) { - if (/\[Date\s"(.*)"\]/) { - $date = $1 ; - last ; ## Assume all dates are the same - } - } - ## Restore results file from archive directory if it exists - if ($date && (-f "$ARCDIR/$PGN_GAME.$date.archive")) { - if (system ("cp", - "$ARCDIR/$PGN_GAME.$date.archive", - "$PGN_GAME.res")) { - print stderr ( "\nWarning: couldn't restore results file" - . " from archive\n") ; - } else { - print "restored results file from archive..." ; - } - } - } - - ## ############################################################# ## - ## Find existing results, if any. - ## ############################################################# ## - - local (@results) = &get_games_from_file ("$PGN_GAME.res") ; - - ## ############################################################# ## - ## Parse each game - ## ############################################################# ## - - foreach $game (@games) { - next unless ($game) ; - - ($game_name, $game_num) = &get_game_name_and_number ($game) ; - - $result = 0 ; - @game = split("\n", $game) ; - foreach (@game) { - if (/^\[(Black|White)\s*"[?]"\]$/) { - $colour = $1; - $PW_GCOS = &get_pw_gcos () unless ($PW_GCOS) ; - $PW_GCOS = "$MY_NNAME" unless ($PW_GCOS) ; - s/".*"/"$PW_GCOS"/ ; - &debug ("Changed $colour tag to be $_") ; - } elsif (/^\[((Black|White)NA)\s*"(.*)"\]$/) { - $NA = $3 ; - if ($NA eq "?") { - if ($RETURN_ADDRESS) { - $NA = $RETURN_ADDRESS ; - } else { - $NA = "??" ; - } - $_ = "[$1 \"$NA\"]" ; - &debug ("Changed $1 tag.\n") ; - } - if ($2 eq "White") { - $PGN_WHITENA = $NA ; - &debug ("WhiteNA tag is \"$PGN_WHITENA\"\n") ; - } else { - $PGN_BLACKNA = $NA ; - &debug ("BlackNA tag is \"$PGN_BLACKNA\"\n") ; - } - } elsif (/\[Result\s*"(.*)"\]$/) { - if ($1 ne "*") { - $result = 1 ; - $finished ++ ; - } else { - $unfinished ++ ; - } - } elsif (/^(.*[^\d]+)?\d+[.]\s*([^\s*]*\s+)?[^\s.*]+(\s*\d+[.]\s*)?[\s*]*$/) { - if ($2) { - $to_play = "white" ; - } else { - $to_play = "black" ; - } - &debug ("$to_play to play\n") ; - } - } - - ## ######################################################### ## - ## Reconstruct possibly edited game - ## ######################################################### ## - - $game = join ("\n", @game) . "\n\n" ; - - ## ######################################################### ## - ## Build up results array - ## ######################################################### ## - - if ($result) { - $results[$game_num] = $games[$game_num] ; - $new_result = 1 ; - } elsif ($results[$game_num]) { - ## Deleting a result does actually make sense if the user - ## pipes in an old message for take-back purposes or whatever - $results[$game_num] = "" ; - $delete_result = 1 ; - } - - ## ######################################################### ## - ## Remove old .out files - ## ######################################################### ## - - unlink <$PGN_GAME.game.out.*> ; - - ## ######################################################### ## - ## Write ongoing games to game file and append new results - ## ######################################################### ## - - die "cmail: Can't open file for writing:" - . " \"$CMAILDIR/$PGN_GAME.game.in\"\n" - unless open (gamefile, ">$PGN_GAME.game.in") ; - &debug (@games) ; - print gamefile @games ; - close (gamefile) ; - } - - ## ############################################################# ## - ## Print how many finished/unfinished games were found - ## ############################################################# ## - - printf ("%d unfinished %s and %d finished %s...", - $unfinished, ($unfinished == 1) ? "game" : "games", - $finished, ($finished == 1) ? "game" : "games") ; - - ## ############################################################# ## - ## Write results back to results file if there were any results - ## in the input - ## ############################################################# ## - - if ($new_result || $delete_result) { - die ( "cmail: Can't open results file for writing:" - . "\"$CMAILDIR/$PGN_GAME.res\"\n") - unless open (resfile, ">$PGN_GAME.res") ; - print resfile @results ; - close (resfile) ; - } - - ## ############################################################# ## - ## Archive results if there are no unfinished games - ## ############################################################# ## - - @ARCHIVE = @results unless ($unfinished) ; - - ## ############################################################# ## - ## Figure out return address if not known - ## ############################################################# ## - - if (! $RETURN_ADDRESS) { - if ($to_play eq "black") { - $RETURN_ADDRESS = $PGN_WHITENA unless ("$PGN_WHITENA" eq "?") ; - } else { - $RETURN_ADDRESS = $PGN_BLACKNA unless ("$PGN_BLACKNA" eq "?") ; - } - } - - ## ############################################################# ## - ## Decide to include position diagrams in output if not already - ## decided and a position diagram was found in the input - ## ############################################################# ## - - if ("$OUTPUT_POS" eq "") { - if (grep (/$posdiag/, @games)) { - $OUTPUT_POS = "y" ; # Output position only if it was input - } else { - $OUTPUT_POS = "n" ; - } - } - $ENV{'CMAIL_OUTPUT_POS'} = $OUTPUT_POS ; - - ## ############################################################# ## - ## Check that we have enough info about the players to continue - ## ############################################################# ## - - &find_game () ; - } else { - ## ############################################################# ## - ## Set up xboard for viewing non-cmail PGN file - ## ############################################################# ## - - local ($file) = "unknown.cmail" ; - print "done.\nDumping non-cmail file into $CMAILDIR/$file..." ; - - die "cmail: Can't open file for writing: \"$CMAILDIR/$file\"\n" - unless open (gamefile, ">$file") ; - print gamefile @games ; - close (gamefile) ; - } - - print "done.\n" ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Sort two filenames by the numeric suffix -sub sort_by_numeric_suffix { - $a =~ /[.](\d+)$/ ; local ($na) = $1 ; - $b =~ /[.](\d+)$/ ; local ($nb) = $1 ; - - return ($na <=> $nb) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -sub get_game_name_and_number { - local ($game) = join ("\n", @_) ; - - local ($game_name, $game_num) ; - - die "CMailGameName tag missing\n" - unless ($game =~ /\[C[Mm]ailGameName\s+"(.*)"\]/) ; - - ## ################################################################# ## - ## Set game name and number - ## ################################################################# ## - - $game_name = $1 ; - if ($game_name =~ s/^(.*)[.](\d+)$/$1/) { - $game_num = $2 ; - } else { - $game_num = 1 ; - } - - ## ################################################################# ## - ## Set $PGN_GAME as a side-effect or check validity - ## ################################################################# ## - - if ($PGN_GAME) { - die ( "cmail: Mismatched game names in input message:\n" - . "\"$PGN_GAME\", \"$game_name\"\n") - if ("$PGN_GAME" ne "$game_name") ; - } else { - $PGN_GAME = $game_name ; - &debug ("PGN_GAME set to \"$PGN_GAME\"\n") ; - } - - return ($game_name, $game_num) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Read in a file of games and split into separate games -sub get_games_from_file { - local ($file) = shift ; - - local (@file, $first_line) ; ## Slurp stdin - if ($file eq "STDIN") { - if ($first_line = ) { ## Necessary to handle no input case - @file = ; ## Slurp stdin - @file = ($first_line, @file) ; - - foreach (@file) { - ## Strip off leading quotation characters - s/^[^\s]*>// ; - s/^[ \t]+// ; - - ## Find return address and set it as a side-effect - if ( /^From:?.*<([^>]+)>.*\n$/ - || /^From:? *([^ ]*).*\n$/) { - $RETURN_ADDRESS = $1 ; ## Default for opp's email - &debug ("Found opponent's email address", - " \"$RETURN_ADDRESS\"\n") ; - } elsif (/\[C[Mm]ailGameName\s+"(.*)"\]/) { - $PGN_GAME = $1 ; - $PGN_GAME =~ s/[.]\d+$// ; - } - } - - return (@file) unless ($PGN_GAME) ; - if (grep (/\{--------------|\[Event/, @file)) { - shift (@file) while ($file[0] !~ /\{--------------|\[Event/) ; - } - } else { - return () ; - } - } else { - return () unless (open (file, "<$file")) ; - - @file = ; ## Slurp file - close (file) ; - } - - local (@games, $game_name, $game_num, $game, $tag) ; - - ## ################################################################# ## - ## Remove headers and leading blanks - ## ################################################################# ## - - local (@tgames) = split (/($posdiag\[Event|\[Event)/, join ('', @file)) ; - shift (@tgames) while (!$tgames[0]) ; - - ## ################################################################# ## - ## Set up @games array with proper game numbers - ## ################################################################# ## - - while (@tgames) { - $game = shift (@tgames) . shift (@tgames) ; - - ($game_name, $game_num) = &get_game_name_and_number ($game) ; - $games[$game_num] = $game ; - } - - return (@games) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Analyse output files and send the move -sub send_move { - &debug ("Called \n") ; - - ## ################################################################# ## - ## Cat the pos (if it exists), game and result (if it exists) files - ## into the .out file. - ## ################################################################# ## - - local ($unfinished, $finished) = (0, 0) ; - local (@results, $move, $move_msg, $to_play, $number) ; - - ## ################################################################# ## - ## Find any .game.out.* files - ## ################################################################# ## - - local (@outfiles) = (<$PGN_GAME.game.out.*>) ; - @outfiles = grep (/[.]\d+$/, @outfiles) ; ## Ignore autosave files - @outfiles = sort sort_by_numeric_suffix @outfiles ; ## Sort - - ## ################################################################# ## - ## Find .res file if it exists - ## ################################################################# ## - - local ($resfile) = "$PGN_GAME.res" ; - if (-f $resfile) { - @results = &get_games_from_file($resfile) ; - &debug ("Read in results\n") ; - } else { - @results = () ; - &debug ("No results to read\n") ; - } - - ## ################################################################# ## - ## Find .out file if it exists - ## ################################################################# ## - - local ($outfile) = "$PGN_GAME.out" ; - if (! ($REMAIL || $LOAD_XBOARD)) { - @games = &play_on_tty (@results) ; - } elsif (@outfiles) { - foreach (@outfiles) { - die "Can't open game file \"$_\" for reading" - unless (open (game, "<$_")) ; - die "Empty game file \"$_\"" - unless ($game = join ('', )) ; - close (game) ; - &debug ("Read in game file \"$_\"\n") ; - ## Remove position diagram if it wasn't in the input msg - $game =~ s/($posdiag)// if ("$OUTPUT_POS" ne "y") ; - ($game_name, $game_num) = &get_game_name_and_number ($game) ; - $games[$game_num] = $game ; - } - &debug ("Read in games from output files\n") ; - $games[0] = "" ; - } else { - &debug ("No games to read from STDIN\n") ; - if (-f $outfile) { - @games = &get_games_from_file($outfile) ; - } else { - die "Can't find any game files\n" unless (@results) ; - } - } - - ## ################################################################# ## - ## Process games - ## ################################################################# ## - - if (@games) { - ## ############################################################# ## - ## Find opponent's email address in games - ## ############################################################# ## - - $OPP_ADDRESS = &get_opp_address_from_games (@games) - unless ($OPP_ADDRESS) ; - - ## ############################################################# ## - ## Collect the .game.out.* files into the .out file, remembering - ## the move number of the last line and whether result or not - ## ############################################################# ## - - $unfinished = 0 ; - $move_num = 0 ; - $move = blank ; - - ## Write games to output file - die "Can't open output file \"$PGN_GAME.out\" for writing\n" - unless open (outfile, ">$PGN_GAME.out") ; - print outfile @games ; - close (outfile) ; - - $game_num = -1 ; - $num_games = 0 ; - foreach $game (@games) { - $game_num ++ ; - next unless ($game) ; - - $num_games ++ ; - ## Determine last move and whether result or not - $result = 0 ; - foreach (split(/\n/, $game)) { - if (/^(.*[^\d]+|)(\d+)[.]+\s*[^\s.]*\s+(\S+)\s*$/) { - $move_num = $2 ; - $move = $3 ; - } elsif (/^\[Result\s*"(.*)"\]$/) { - if ($1 ne "*") { - $result = 1 ; - $finished ++ ; - } else { - $unfinished ++ ; - } - } - } - - $results[$game_num] = $game if ($result) ; - } - - ## Write result files back to $PGN_GAME.res - if (@results) { - die "Can't open results file $PGN_GAME.res for writing\n" - unless open (resfile, ">$PGN_GAME.res") ; - print resfile @results ; - close (results) ; - } - - unlink <$PGN_GAME.game.out.*> ; - - ## ############################################################# ## - ## Just say how many games are in the message - ## ############################################################# ## - - if ($num_games > 1) { - $move_msg = "$num_games games" ; - } else { - $move_msg = "1 game" ; - } - - ## ############################################################# ## - ## Print how many finished/unfinished games were found - ## ############################################################# ## - - printf ("Sending %d unfinished %s and %d finished %s.\n", - $unfinished, ($unfinished == 1) ? "game" : "games", - $finished, ($finished == 1) ? "game" : "games") ; - - ## ############################################################# ## - ## Send the mail message to opponent's address unless bypassed - ## ############################################################# ## - - if ($SEND_MAIL) { - local ($subject) = "cmail $move_msg <$PGN_GAME>" ; - if ($MAILPROG =~ /sendmail/) { - $opened = open (mail, "|$MAILPROG $OPP_ADDRESS") ; - print mail "To: $OPP_ADDRESS\n"; - print mail "Subject: $subject\n"; - print mail "Mime-Version: 1.0\n"; - print mail "Content-Type: application/x-chess;name=$PGN_GAME.pgn\n\n"; - } else { - $opened = open (mail, "|$MAILPROG -s \"$subject\" $OPP_ADDRESS") ; - } - if ($opened) { - print mail @games ; - close (mail) ; - print ( "Mailed cmail message to \"$OPP_ADDRESS\":\n" - . "$move_msg <$PGN_GAME>\n") ; - @ARCHIVE = @results unless ($unfinished) ; - } else { - die "Failed to mail cmail message.\n" ; - } - } else { - print ( "Email not sent (as requested).\n" - . "Would have mailed cmail message to \"$OPP_ADDRESS\":\n" - . "$NUM_GAMES games <$PGN_GAME>\n") ; - } - } else { - if (@results) { - print "Email not sent (the game is over).\n" ; - } else { - die "No games found\n" ; - } - } -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get date from array of games -sub get_date_from_games { - local (@games) = @_ ; - - local ($date) = "nodate" ; - - foreach (@games) { - if (/\[Date\s"(.*)"\]/) { - $date = $1 ; - last ; ## Assume all dates are the same - } - } - - return ($date) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Determine which colour is to play and the move number -sub get_to_play { - &debug ("Called \n") ; - local ($game) = shift ; - - local ($number, $to_play) = (1, "White") ; - - $game =~ s/{[^}]*}//g ; - $game =~ s/[\s\n]*[*][\s\n]*$// ; - - if ($game =~ /(\d+)[.][\n ]*([.]*)[\n ]*([^\n.]*)[\n\s]*[10-]*[\n\s]*$/) { - $number = $1 ; - - if ($game =~ /\[Result "0-1"\]/) { - $to_play = "Black" ; - } elsif ($game =~ /\[Result "1-0"\]/) { - $to_play = "White" ; - } elsif (($2 ne "") || (($3 =~ / /) || ($3 eq ""))) { - $to_play = "White" ; - $number ++ ; - } else { - $to_play = "Black" ; - } - } - - &debug ("$to_play to play on move $number\n") ; - - return ($number, $to_play) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Get opp address from array of games -sub get_opp_address_from_games { - &debug ("Called \n") ; - local (@games) = @_ ; - - local ($opp_address) = "" ; - local ($number, $to_play, $tag) ; - - foreach (@games) { - next unless $_ ; - - ($number, $to_play) = &get_to_play ($_) ; - $tag = ( ($to_play eq "White") - ? "WhiteNA" - : "BlackNA") ; - - if (/\[$tag\s"(.*)"\]/) { - $opp_address = $1 ; - die "cmail: Empty \"$tag\" tag\n" unless ($opp_address) ; - &debug ("Found opponent's address \"$opp_address\" from games.\n") ; - last ; ## Assume all opp addresses are the same - } else { - die "cmail: Can't find \"$tag\" tag\n" ; - } - } - - die "cmail: Can't find opponent's email address\n" unless ($opp_address) ; - - return ($opp_address) ; -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Archive @ARCHIVE in the $ARCDIR directory -sub archive { - return () unless (@ARCHIVE) ; - - local ($date) = &get_date_from_games (@ARCHIVE) ; - - local ($file) = "$ARCDIR/$PGN_GAME.$date.archive" ; - if (open (archive, ">$file")) { - print archive @ARCHIVE ; - close (archive) ; - print "Archived game in $file\n" ; - local (@remove) = <$PGN_GAME*> ; - @remove = grep ($_ ne "$PGN_GAME.$date.archive", - @remove) ; ## Don't delete archive - unlink (@remove) ; - } else { - print "Couldn't open \"$file\" to archive game\n" ; - } -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# - - -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -## Main body -sub main { - local (@games) = () ; - - &initialise () ; ## Initialise variables etc. - - if (-t || $REMAIL) { ## No input directed (invoked from a shell rather than a mailer) - &debug ("Interactive!\n") ; - &find_game () ; ## Get the necessary info about the game - } else { - &debug ("Piping!\n") ; - &analyse_email_message () ; ## Analyse the mail message - } - - if (! &play_game ()) { ## Load the game - &send_move () ; ## Analyse output and send moves - } - - &archive () ; ## Archive games if all finished - - close (tty) ; ## Tidy up - close (logfile) if ($DEBUG) ; ## Tidy up -} -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -&main () ; -#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# -__END__ -cmail (From XBoard version @PACKAGE_VERSION@), Copyright (C) 1993 Free Software Foundation, Inc. -cmail comes with ABSOLUTELY NO WARRANTY; for details type `cmail -w'. -cmail is free software, and you are welcome to redistribute it -under certain conditions; type `cmail -c' for details. - -{END OF GPL COPYRIGHT} - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. -{END OF GPL CONDITIONS} - GNU GENERAL PUBLIC LICENSE - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - diff --git a/common.h b/common.h deleted file mode 100644 index c557257..0000000 --- a/common.h +++ /dev/null @@ -1,947 +0,0 @@ -/* - * common.h -- Common definitions for X and Windows NT versions of XBoard - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, - * Massachusetts. - * - * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free - * Software Foundation, Inc. - * - * Enhancements Copyright 2005 Alessandro Scotti - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard - * distributed by the Free Software Foundation: - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -#ifndef XB_COMMON -#define XB_COMMON - - -/* Begin compatibility grunge */ - -#if defined(__STDC__) || defined(WIN32) || defined(_amigados) -#define P(args) args -typedef void *VOIDSTAR; -#else -#define P(args) () -typedef char *VOIDSTAR; -#endif - -#ifdef WIN32 -typedef char Boolean; -typedef char *String; -#define popen _popen -#define pclose _pclose - -#else -#ifdef _amigados /* It is important, that these types have */ -typedef int Boolean; /* a length of 4 bytes each, as we are */ -typedef char *String; /* using ReadArgs() for argument parsing. */ -#ifdef _DCC -FILE *popen(const char *, const char *); -int pclose(FILE *); -#endif - -#else -#ifdef X11 -#include -#else -typedef char Boolean; -typedef char *String; -#define True 1 -#define False 0 -#endif -#endif -#endif - - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#define UNKNOWN -1 /* [HGM] nps */ - -#if !HAVE_RANDOM -# if HAVE_RAND48 -# define srandom srand48 -# define random lrand48 -# else /* not HAVE_RAND48 */ -# define srandom srand -# define random rand -# endif /* not HAVE_RAND48 */ -#endif /* !HAVE_RANDOM */ - -/* End compatibility grunge */ - -/* unsigned int 64 for engine nodes work and display */ -#ifdef WIN32 - /* I don't know the name for this type of other compiler - * If it not work, just modify here - * This is for MS Visual Studio - */ - #ifdef _MSC_VER - #define u64 unsigned __int64 - #define s64 signed __int64 - #define u64Display "%I64u" - #define s64Display "%I64d" - #define u64Const(c) (c ## UI64) - #define s64Const(c) (c ## I64) - #else - /* place holder - * or dummy types for other compiler - * [HGM] seems that -mno-cygwin comple needs %I64? - */ - #define u64 unsigned long long - #define s64 signed long long - #ifdef USE_I64 - #define u64Display "%I64u" - #define s64Display "%I64d" - #else - #define u64Display "%llu" - #define s64Display "%lld" - #endif - #define u64Const(c) (c ## ULL) - #define s64Const(c) (c ## LL) - #endif -#else - /* GNU gcc */ - #define u64 unsigned long long - #define s64 signed long long - #define u64Display "%llu" - #define s64Display "%lld" - #define u64Const(c) (c ## ull) - #define s64Const(c) (c ## ll) -#endif - -#define PROTOVER 2 /* engine protocol version */ - -// [HGM] license: Messages that engines must print to satisfy their license requirements for patented variants -#define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice" -#define FALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke" - -/* [HGM] Some notes about board sizes: - In games that allow piece drops, the holdings are considered part of the - board, in the leftmost and rightmost two files. This way they are - automatically part of the game-history states, and enjoy all display - functions (including drag-drop and click-click moves to the regular part - of the board). The drawback of this is that the internal numbering of - files starts at 2 for the a-file if holdings are displayed. To ensure - consistency, this shifted numbering system is used _everywhere_ in the - code, and conversion to the 'normal' system only takes place when the - file number is converted to or from ASCII (by redefining the character - constant 'a'). This works because Winboard only communicates with the - outside world in ASCII. In a similar way, the different rank numbering - systems (starting at rank 0 or 1) are implemented by redefining '1'. -*/ -#define BOARD_RANKS 17 /* [HGM] for in declarations */ -#define BOARD_FILES 16 /* [HGM] for in declarations */ -#define BOARD_HEIGHT (gameInfo.boardHeight) /* [HGM] made user adjustable */ -#define BOARD_WIDTH (gameInfo.boardWidth + 2*gameInfo.holdingsWidth) -#define BOARD_LEFT (gameInfo.holdingsWidth) /* [HGM] play-board edges */ -#define BOARD_RGHT (gameInfo.boardWidth + gameInfo.holdingsWidth) -#define CASTLING (BOARD_RANKS-1) /* [HGM] hide in upper rank */ -#define VIRGIN (BOARD_RANKS-2) /* [HGM] pieces not moved */ -#define TOUCHED_W CASTLING][(BOARD_FILES-6) /* [HGM] in upper rank */ -#define TOUCHED_B CASTLING][(BOARD_FILES-5) /* [HGM] in upper rank */ -#define EP_RANK CASTLING][(BOARD_FILES-4) /* [HGM] in upper rank */ -#define EP_FILE CASTLING][(BOARD_FILES-3) /* [HGM] in upper rank */ -#define EP_STATUS CASTLING][(BOARD_FILES-2) /* [HGM] in upper rank */ -#define HOLDINGS_SET CASTLING][(BOARD_FILES-1) /* [HGM] in upper-right corner*/ -#define ONE ('1'-(BOARD_HEIGHT==10)-appData.rankOffset) /* [HGM] foremost board rank */ -#define AAA ('a'-BOARD_LEFT) /* [HGM] leftmost board file */ -#define VIRGIN_W 1 /* [HGM] flags in Board[VIRGIN][X] */ -#define VIRGIN_B 2 -#define DROP_RANK -3 -#define MAX_MOVES 1000 -#define MSG_SIZ 512 -#define DIALOG_SIZE 256 -#define STAR_MATCH_N 16 -#define MOVE_LEN 32 -#define TIME_CONTROL "5" /* in minutes */ -#define TIME_DELAY_QUOTE "1.0" /* seconds between moves */ -#define TIME_DELAY ((float) 1.0) -#define MOVES_PER_SESSION 40 /* moves per TIME_CONTROL */ -#define TIME_INCREMENT -1 /* if >= 0, MOVES_PER_SESSION unused */ -#define WhiteOnMove(move) (((move) % 2) == 0) -#define ICS_HOST "chessclub.com" -#define ICS_PORT "5000" -#define ICS_COMM_PORT "" -#define FIRST_HOST "localhost" -#define SECOND_HOST "localhost" -#define TELNET_PROGRAM "telnet" -#define DEF_BITMAP_DIR BITMAPDIR -#define MATCH_MODE "False" -#define INIT_STRING "new\nrandom\n" -#define WHITE_STRING "white\ngo\n" -#define BLACK_STRING "black\ngo\n" -#define COMPUTER_STRING "computer\n" -#define REUSE_CHESS_PROGRAMS 1 -#define WHITE_PIECE_COLOR "#FFFFCC" -#define BLACK_PIECE_COLOR "#202020" -#define LIGHT_SQUARE_COLOR "#C8C365" -#define DARK_SQUARE_COLOR "#77A26D" -#define JAIL_SQUARE_COLOR "#808080" -#define HIGHLIGHT_SQUARE_COLOR "#FFFF00" -#define PREMOVE_HIGHLIGHT_COLOR "#FF0000" -#define LOWTIMEWARNING_COLOR "#FF0000" -#define BELLCHAR '\007' -#define NULLCHAR '\000' -#define FEATURE_TIMEOUT 10000 /*ms*/ -#define MATE_SCORE 100000 - -#define CLOCK_FONT 0 -#define MESSAGE_FONT 1 -#define COORD_FONT 2 -#define CONSOLE_FONT 3 -#define COMMENT_FONT 4 -#define EDITTAGS_FONT 5 -#define MOVEHISTORY_FONT 6 -#define GAMELIST_FONT 7 -#define NUM_FONTS 8 - -/* Default to no flashing (the "usual" XBoard behavior) */ -#define FLASH_COUNT 0 /* Number of times to flash */ -#define FLASH_RATE 5 /* Flashes per second */ - -/* Default delay per character (in msec) while sending login script */ -#define MS_LOGIN_DELAY 0 - -/* [AS] Support for background textures */ -#define BACK_TEXTURE_MODE_DISABLED 0 -#define BACK_TEXTURE_MODE_PLAIN 1 -#define BACK_TEXTURE_MODE_FULL_RANDOM 2 - -/* Zippy defaults */ -#define ZIPPY_TALK FALSE -#define ZIPPY_PLAY FALSE -#define ZIPPY_LINES "yow.lines" -#define ZIPPY_PINHEAD "" -#define ZIPPY_PASSWORD "" -#define ZIPPY_PASSWORD2 "" -#define ZIPPY_WRONG_PASSWORD "" -#define ZIPPY_ACCEPT_ONLY "" -#define ZIPPY_USE_I TRUE -#define ZIPPY_BUGHOUSE 0 -#define ZIPPY_NOPLAY_CRAFTY FALSE -#define ZIPPY_GAME_END "gameend\n" -#define ZIPPY_GAME_START "" -#define ZIPPY_ADJOURN FALSE -#define ZIPPY_ABORT FALSE -#define ZIPPY_VARIANTS "normal,fischerandom,crazyhouse,losers,suicide,3checks,twokings,bughouse,shatranj" -#define ZIPPY_MAX_GAMES 0 -#define ZIPPY_REPLAY_TIMEOUT 120 - -typedef VOIDSTAR ProcRef; -#define NoProc ((ProcRef) 0) -typedef VOIDSTAR InputSourceRef; - -typedef void (*DelayedEventCallback) P((void)); - -typedef enum { Press, Release } ClickType; - -typedef enum { - BeginningOfGame, MachinePlaysWhite, MachinePlaysBlack, - AnalyzeMode, AnalyzeFile, TwoMachinesPlay, - EditGame, PlayFromGameFile, EndOfGame, EditPosition, Training, - IcsIdle, IcsPlayingWhite, IcsPlayingBlack, IcsObserving, - IcsExamining - } GameMode; - -typedef enum { - /* [HGM] the order here is crucial for Crazyhouse & Shogi: */ - /* only the first N pieces can go into the holdings, and */ - /* promotions in those variants shift P-W to U-S */ - WhitePawn, WhiteKnight, WhiteBishop, WhiteRook, WhiteQueen, - WhiteFerz, WhiteAlfil, WhiteAngel, WhiteMarshall, WhiteWazir, WhiteMan, - WhiteCannon, WhiteNightrider, WhiteCardinal, WhiteDragon, WhiteGrasshopper, - WhiteSilver, WhiteFalcon, WhiteLance, WhiteCobra, WhiteUnicorn, WhiteLion, - WhiteSword, WhiteZebra, WhiteCamel, WhiteTower, WhiteWolf, - WhiteHat, WhiteDuck, WhiteAmazon, WhiteFlying, WhiteGnu, WhiteCub, - WhiteShield, WhiteHorse, WhiteWizard, WhiteCopper, WhiteIron, - WhiteViking, WhiteFlag, WhiteAxe, WhiteDolphin, WhiteCat, WhiteClaw, - WhiteWheel, WhiteButterfly, WhitePBishop, WhitePRook, WhiteHCrown, - WhiteShierd, WhiteMonarch, WhiteMother, WhiteNothing, WhiteDrunk, WhiteWheer, - WhiteTokin, WhitePKnight, WhitePCardinal, WhitePDragon, WhitePLance, - WhitePSilver, WhiteDagger, WhitePSword, WhitePDagger, WhiteCrown, WhiteKing, - BlackPawn, BlackKnight, BlackBishop, BlackRook, BlackQueen, - BlackFerz, BlackAlfil, BlackAngel, BlackMarshall, BlackWazir, BlackMan, - BlackCannon, BlackNightrider, BlackCardinal, BlackDragon, BlackGrasshopper, - BlackSilver, BlackFalcon, BlackLance, BlackCobra, BlackUnicorn, BlackLion, - BlackSword, BlackZebra, BlackCamel, BlackTower, BlackWolf, - BlackHat, BlackDuck, BlackAmazon, BlackFlying, BlackGnu, BlackCub, - BlackShield, BlackHorse, BlackWizard, BlackCopper, BlackIron, - BlackViking, BlackFlag, BlackAxe, BlackDolphin, BlackCat, BlackClaw, - BlackWheel, BlackButterfly, BlackPBishop, BlackPRook, BlackHCrown, - BlackShierd, BlackMonarch, BlackMother, BlackNothing, BlackDrunk, BlackWheer, - BlackTokin, BlackPKnight, BlackPCardinal, BlackPDragon, BlackPLance, - BlackPSilver, BlackDagger, BlackPSword, BlackPDagger, BlackCrown, BlackKing, - EmptySquare, DarkSquare, - NoRights, // [HGM] gamestate: for castling rights hidden in board[CASTLING] - ClearBoard, WhitePlay, BlackPlay, PromotePiece, DemotePiece /*for use on EditPosition menus*/ - } ChessSquare; - -/* [HGM] some macros that can be used as prefixes to convert piece types */ -#define WHITE_TO_BLACK (int)BlackPawn - (int)WhitePawn + (int) -#define BLACK_TO_WHITE (int)WhitePawn - (int)BlackPawn + (int) -#define PROMO (int)WhiteDragon - (int)WhiteRook + (int) -#define PROMOTED(X) (promoPartner[X]) -#define DEMOTED(X) (promoPartner[X]) -#define SHOGI (int)EmptySquare + (int) -#define CHUPROMOTED(X) (promoPartner[X]) -#define CHUDEMOTED(X) (promoPartner[X]) -#define IS_SHOGI(V) ((V) == VariantShogi || (V) == VariantChu) -#define IS_LION(V) ((V) == WhiteLion || (V) == BlackLion) - - -typedef ChessSquare Board[BOARD_RANKS][BOARD_FILES]; - -typedef enum { - EndOfFile = 0, - WhiteKingSideCastle, WhiteQueenSideCastle, - WhiteKingSideCastleWild, WhiteQueenSideCastleWild, - WhiteHSideCastleFR, WhiteASideCastleFR, - BlackKingSideCastle, BlackQueenSideCastle, - BlackKingSideCastleWild, BlackQueenSideCastleWild, - BlackHSideCastleFR, BlackASideCastleFR, - WhitePromotion, WhiteNonPromotion, - BlackPromotion, BlackNonPromotion, - WhiteCapturesEnPassant, BlackCapturesEnPassant, - WhiteDrop, BlackDrop, FirstLeg, - NormalMove, AmbiguousMove, IllegalMove, ImpossibleMove, - WhiteWins, BlackWins, GameIsDrawn, GameUnfinished, - GNUChessGame, XBoardGame, MoveNumberOne, Open, Close, Nothing, - Comment, PositionDiagram, ElapsedTime, PGNTag, NAG - } ChessMove; - -typedef enum { - ColorShout, ColorSShout, ColorChannel1, ColorChannel, ColorKibitz, - ColorTell, ColorChallenge, ColorRequest, ColorSeek, ColorNormal, - ColorNone, NColorClasses -} ColorClass; - -typedef enum { - SoundMove, SoundBell, SoundRoar, SoundAlarm, SoundIcsWin, SoundIcsLoss, - SoundIcsDraw, SoundIcsUnfinished, NSoundClasses -} SoundClass; - -/* Names for chess variants, not necessarily supported */ -typedef enum { - VariantNormal, /* Normal chess */ - VariantLoadable, /* "loadgame" command allowed (not really a variant)*/ - VariantWildCastle, /* Shuffle chess where king can castle from d file */ - VariantNoCastle, /* Shuffle chess with no castling at all */ - VariantFischeRandom, /* FischeRandom */ - VariantBughouse, /* Bughouse, ICC/FICS rules */ - VariantCrazyhouse, /* Crazyhouse, ICC/FICS rules */ - VariantLosers, /* Try to lose all pieces or get mated (ICC wild 17)*/ - VariantSuicide, /* Try to lose all pieces incl. king (FICS) */ - VariantGiveaway, /* Try to have no legal moves left (ICC wild 26) */ - VariantTwoKings, /* Weird ICC wild 9 */ - VariantKriegspiel, /* Kriegspiel; pawns can capture invisible pieces */ - VariantAtomic, /* Capturing piece explodes (ICC wild 27) */ - Variant3Check, /* Win by giving check 3 times (ICC wild 25) */ - VariantShatranj, /* Unsupported (ICC wild 28) */ - Variant29, /* Temporary name for possible future ICC wild 29 */ - Variant30, /* Temporary name for possible future ICC wild 30 */ - Variant31, /* Temporary name for possible future ICC wild 31 */ - Variant32, /* Temporary name for possible future ICC wild 32 */ - Variant33, /* Temporary name for possible future ICC wild 33 */ - Variant34, /* Temporary name for possible future ICC wild 34 */ - Variant35, /* Temporary name for possible future ICC wild 35 */ - Variant36, /* Temporary name for possible future ICC wild 36 */ - VariantShogi, /* [HGM] added variants */ - VariantChu, - VariantCourier, - VariantGothic, - VariantCapablanca, - VariantKnightmate, - VariantFairy, - VariantCylinder, - VariantFalcon, - VariantCapaRandom, - VariantBerolina, - VariantJanus, - VariantSuper, - VariantGreat, - VariantTwilight, - VariantMakruk, - VariantSChess, - VariantGrand, - VariantSpartan, - VariantXiangqi, - VariantASEAN, - VariantLion, - VariantChuChess, - VariantUnknown /* Catchall for other unknown variants */ -} VariantClass; - -#define VARIANT_NAMES { \ - "normal", \ - "normal", \ - "wildcastle", \ - "nocastle", \ - "fischerandom", \ - "bughouse", \ - "crazyhouse", \ - "losers", \ - "suicide", \ - "giveaway", \ - "twokings", \ - "kriegspiel", \ - "atomic", \ - "3check", \ - "shatranj", \ - "wild29", \ - "wild30", \ - "wild31", \ - "wild32", \ - "wild33", \ - "wild34", \ - "wild35", \ - "wild36", \ - "shogi", \ - "chu", \ - "courier", \ - "gothic", \ - "capablanca", \ - "knightmate", \ - "fairy", \ - "cylinder", \ - "falcon",\ - "caparandom",\ - "berolina",\ - "janus",\ - "super",\ - "great",\ - "twilight",\ - "makruk",\ - "seirawan",\ - "grand",\ - "spartan",\ - "xiangqi", \ - "asean",\ - "lion",\ - "elven",\ - "unknown" \ -} - -#define ENGINES 2 - -typedef struct { - char *language; -#if !defined(_amigados) - char *whitePieceColor; - char *blackPieceColor; - char *lightSquareColor; - char *darkSquareColor; - char *jailSquareColor; - char *highlightSquareColor; - char *premoveHighlightColor; - char *dialogColor; - char *buttonColor; -#else - int whitePieceColor; - int blackPieceColor; - int lightSquareColor; - int darkSquareColor; - int jailSquareColor; - int highlightSquareColor; - int premoveHighlightColor; -#endif - int movesPerSession; - float timeIncrement; - char *engInitString[ENGINES]; - char *computerString[ENGINES]; - char *chessProgram[ENGINES]; - char *directory[ENGINES]; - char *pgnName[ENGINES]; - Boolean firstPlaysBlack; - Boolean noChessProgram; - char *positionDir; - char *host[ENGINES]; - char *themeNames; - char *pieceDirectory; - char *border; - char *soundDirectory; - char *remoteShell; - char *remoteUser; - float timeDelay; - char *timeControl; - Boolean trueColors; - Boolean icsActive; - Boolean autoBox; - char *icsHost; - char *icsPort; - char *icsCommPort; /* if set, use serial port instead of tcp host/port */ - char *icsLogon; /* Hack to permit variable logon scripts. */ - char *icsHelper; - Boolean icsInputBox; - Boolean useTelnet; - Boolean seekGraph; - Boolean autoRefresh; - char *telnetProgram; - char *gateway; - char *loadGameFile; - int loadGameIndex; /* game # within file */ - char *saveGameFile; - char *autoInstall; - Boolean autoSaveGames; - Boolean onlyOwn; /* [HGM] suppress auto-saving of observed games */ - char *loadPositionFile; - int loadPositionIndex; /* position # within file */ - char *savePositionFile; - Boolean fischerCastling;/* [HGM] fischer: allow Fischr castling in any variant */ - Boolean matchMode; - int matchGames; - Boolean epd; - Boolean monoMode; - Boolean debugMode; - Boolean clockMode; - char *boardSize; - char *logoDir; - int logoSize; - Boolean Iconic; - char *searchTime; - int searchDepth; - Boolean showCoords; - char *clockFont; - char *messageFont; /* WinBoard only */ - char *coordFont; - char *font; /* xboard only */ - char *tagsFont; - char *commentFont; - char *historyFont; - char *gameListFont; - char *icsFont; - int analysisBell; - Boolean ringBellAfterMoves; - Boolean autoCallFlag; - Boolean flipView; - Boolean autoFlipView; - char *cmailGameName; /* xboard only */ - Boolean headers; - Boolean alwaysPromoteToQueen; - Boolean oldSaveStyle; - Boolean oneClick; - Boolean quietPlay; - Boolean showThinking; - Boolean ponderNextMove; - Boolean periodicUpdates; - Boolean autoObserve; - Boolean autoCreateLogon; - Boolean autoComment; - Boolean getMoveList; - Boolean testLegality; - Boolean topLevel; /* xboard, top-level auxiliary windows */ - Boolean titleInWindow; /* xboard only */ - Boolean localLineEditing; /* WinBoard only */ - Boolean zippyTalk; - Boolean zippyPlay; - int flashCount; /* Number of times to flash (xboard only) */ - int flashRate; /* Flashes per second (xboard only) */ - int msLoginDelay; /* Delay per character (in msec) while sending - ICS logon script (xboard only) */ - Boolean colorize; /* If True, use the following colors to color text */ - /* Strings for colors, as "fg, bg, bold" (strings used in xboard only) */ - char *colorShout; // [HGM] IMPORTANT: order must conform to ColorClass definition - char *colorSShout; - char *colorChannel1; - char *colorChannel; - char *colorKibitz; - char *colorTell; - char *colorChallenge; - char *colorRequest; - char *colorSeek; - char *colorNormal; - char *soundProgram; /* sound-playing program */ - char *soundShout; // [HGM] IMPORTANT: order must be as in ColorClass - char *soundSShout; - char *soundChannel1; - char *soundChannel; - char *soundKibitz; - char *soundTell; - char *soundChallenge; - char *soundRequest; - char *soundSeek; - char *soundMove; // [HGM] IMPORTANT: order must be as in SoundClass - char *soundBell; - char *soundRoar; - char *soundIcsAlarm; - char *soundIcsWin; - char *soundIcsLoss; - char *soundIcsDraw; - char *soundIcsUnfinished; - Boolean disguise; /* [HGM] Promoted Pawns look like pieces in bughouse */ - Boolean reuse[ENGINES]; - Boolean animateDragging; /* If True, animate mouse dragging of pieces */ - Boolean animate; /* If True, animate non-mouse moves */ - int animSpeed; /* Delay in milliseconds between animation frames */ - Boolean popupMoveErrors; - Boolean popupExitMessage; - int showJail; - Boolean highlightLastMove; - Boolean highlightDragging; - Boolean blindfold; /* if true, no pieces are drawn */ - Boolean premove; /* true if premove feature enabled */ - Boolean premoveWhite; /* true if premoving White first move */ - char *premoveWhiteText; /* text of White premove 1 */ - Boolean premoveBlack; /* true if premoving Black first move */ - char *premoveBlackText; /* text of Black premove 1 */ - Boolean icsAlarm; /* true if sounding alarm at a certain time */ - int icsAlarmTime; /* time to sound alarm, in milliseconds */ - Boolean autoRaiseBoard; - int fontSizeTolerance; /* xboard only */ - char *initialMode; - char *variant; - char *chatBoxes; - int protocolVersion[ENGINES]; - Boolean showButtonBar; - Boolean icsEngineAnalyze; - Boolean variations; /* [HGM] enable variation-tree walking */ - Boolean autoExtend; /* [HGM] enable playing move(s) of right-clicked PV in analysis mode */ - - /* [AS] New properties (down to the "ZIPPY" part) */ - Boolean scoreIsAbsolute[ENGINES]; /* If true, engine score is always from white side */ - Boolean saveExtendedInfoInPGN; /* If true, saved PGN games contain extended info */ - Boolean hideThinkingFromHuman; /* If true, program thinking is generated but not displayed in human/computer matches */ - Boolean useBitmaps; - Boolean useFont; - Boolean useBorder; - char * liteBackTextureFile; /* Name of texture bitmap for lite squares */ - char * darkBackTextureFile; /* Name of texture bitmap for dark squares */ - int liteBackTextureMode; - int darkBackTextureMode; - char * renderPiecesWithFont; /* Name of font for rendering chess pieces */ - char * fontToPieceTable; /* Map to translate font character to chess pieces */ - char * inscriptions; /* text (kanji) to write on top of a piece */ - int fontBackColorWhite; - int fontForeColorWhite; - int fontBackColorBlack; - int fontForeColorBlack; - int fontPieceSize; /* Size of font relative to square (percentage) */ - int overrideLineGap; /* If >= 0 overrides the lineGap value of the board size properties */ - int adjudicateLossThreshold; /* Adjudicate a two-machine game if both engines agree the score is below this for 6 plies */ - int delayBeforeQuit; - int delayAfterQuit; - char * nameOfDebugFile; - char * pgnEventHeader; - int defaultFrcPosition; - char * gameListTags; - Boolean saveOutOfBookInfo; - Boolean showEvalInMoveHistory; - int evalHistColorWhite; - int evalHistColorBlack; - Boolean highlightMoveWithArrow; - Boolean tourney; - char * tourneyOptions; - int highlightArrowColor; - Boolean useStickyWindows; - Boolean bgObserve; /* [HGM] bughouse */ - Boolean dualBoard; /* [HGM] dual */ - Boolean viewer; - char * viewerOptions; - int adjudicateDrawMoves; - Boolean autoDisplayComment; - Boolean autoDisplayTags; - Boolean pseudo[ENGINES]; /* [HGM] pseudo-engines */ - Boolean isUCI[ENGINES]; - Boolean hasOwnBookUCI[ENGINES]; - char * adapterCommand; - char * ucciAdapter; - char * polyglotDir; - Boolean usePolyglotBook; - Boolean defNoBook; - char * polyglotBook; - int bookDepth; - int bookStrength; - int defaultHashSize; - int defaultCacheSizeEGTB; - char * defaultPathEGTB; - int defaultMatchGames; - - /* [HGM] Board size */ - int NrFiles; - int NrRanks; - int rankOffset; - int holdingsSize; - int matchPause; - char * pieceToCharTable; - char * pieceNickNames; - char * colorNickNames; - Boolean allWhite; - Boolean upsideDown; - Boolean alphaRank; - Boolean testClaims; - Boolean checkMates; - Boolean materialDraws; - Boolean trivialDraws; - int ruleMoves; - int drawRepeats; - -#if ZIPPY - char *zippyLines; - char *zippyPinhead; - char *zippyPassword; - char *zippyPassword2; - char *zippyWrongPassword; - char *zippyAcceptOnly; - int zippyUseI; - int zippyBughouse; - int zippyNoplayCrafty; - char *zippyGameEnd; - char *zippyGameStart; - int zippyAdjourn; - int zippyAbort; - char *zippyVariants; - int zippyMaxGames; - int zippyReplayTimeout; /*seconds*/ - int zippyShortGame; /* [HGM] aborter */ -#endif - Boolean lowTimeWarning; /* [HGM] low time */ - Boolean quitNext; - char *lowTimeWarningColor; - - char *serverFileName; - char *serverMovesName; - char *finger; - Boolean suppressLoadMoves; - int serverPause; - int timeOdds[ENGINES]; - int drawDepth[ENGINES]; - int timeOddsMode; - int accumulateTC[ENGINES]; - int NPS[ENGINES]; - Boolean autoKibitz; - int engineComments; - int eloThreshold1; /* [HGM] select */ - int eloThreshold2; - int dateThreshold; - int searchMode; - int stretch; - int minPieces; - int maxPieces; - Boolean ignoreColors; - Boolean findMirror; - char *userName; - int rewindIndex; /* [HGM] autoinc */ - int sameColorGames; /* [HGM] alternate */ - int smpCores; /* [HGM] SMP */ - char *egtFormats; - int niceEngines; /* [HGM] nice */ - char *logo[ENGINES];/* [HGM] logo */ - char *pairingEngine;/* [HGM] pairing */ - Boolean autoLogo; - Boolean fixedSize; - Boolean noGUI; /* [HGM] fast: suppress all display updates */ - char *engOptions[ENGINES]; /* [HGM] options */ - char *fenOverride[ENGINES]; - char *features[ENGINES]; - char *featureDefaults; - char *sysOpen; - Boolean keepAlive; /* [HGM] alive */ - Boolean forceIllegal;/*[HGM] illegal */ - Boolean noJoin; /* [HGM] join */ - char *wrapContSeq; /* continuation sequence when xboard wraps text */ - Boolean useInternalWrap; /* use internal wrapping -- noJoin usurps this if set */ - Boolean pasteSelection; /* paste X selection instead of clipboard */ - int nrVariations; /* [HGM] multivar */ - int zoom; /* [HGM] evalGraph */ - int evalThreshold; /* [HGM] evalGraph */ - Boolean dropMenu; /* [HGM] pv */ - Boolean markers; /* [HGM] markers */ - Boolean autoCopyPV; - Boolean pieceMenu; - Boolean sweepSelect; - Boolean monoMouse; - Boolean whitePOV; - Boolean scoreWhite; - Boolean pvSAN[ENGINES]; - - int recentEngines; - char *recentEngineList; - char *message; - char *suppress; - char *fen; - char *men; - char *tourneyFile; - char *defName; - char *processes; - char *results; - char *participants; - char *afterGame; - char *afterTourney; - int tourneyType; - int tourneyCycles; - int seedBase; - Boolean roundSync; - Boolean cycleSync; - Boolean numberTag; -} AppData, *AppDataPtr; - -/* PGN tags (for showing in the game list) */ -#define LPUSERGLT_SIZE 64 - -#define GLT_EVENT 'e' -#define GLT_SITE 's' -#define GLT_DATE 'd' -#define GLT_ROUND 'o' -#define GLT_PLAYERS 'p' /* I.e. white "-" black */ -#define GLT_RESULT 'r' -#define GLT_WHITE_ELO 'w' -#define GLT_BLACK_ELO 'b' -#define GLT_TIME_CONTROL 't' -#define GLT_VARIANT 'v' -#define GLT_OUT_OF_BOOK 'a' -#define GLT_RESULT_COMMENT 'c' /* [HGM] rescom */ - -#define GLT_DEFAULT_TAGS "eprd" /* Event, players, result, date */ - -#define GLT_ALL_TAGS "esdoprwbtvac" - -#define PGN_OUT_OF_BOOK "Annotator" - -extern AppData appData; - -typedef struct { - /* PGN 7-tag info */ - char *event; - char *site; - char *date; - char *round; - char *white; - char *black; - ChessMove result; - /* Additional info */ - char *fen; /* NULL or FEN for starting position; input only */ - char *resultDetails; - char *timeControl; - char *extraTags; /* NULL or "[Tag \"Value\"]\n", etc. */ - int whiteRating; /* -1 if unknown */ - int blackRating; /* -1 if unknown */ - VariantClass variant; - char *variantName; - char *outOfBook; /* [AS] Move and score when engine went out of book */ - int boardWidth; /* [HGM] adjustable board size */ - int boardHeight; -/* [HGM] For Shogi and Crazyhouse: */ - int holdingsSize; /* number of different piece types in holdings */ - int holdingsWidth; /* number of files left and right of board, 0 or 2 */ -} GameInfo; - -/* [AS] Search stats from chessprogram, for the played move */ -// [HGM] moved here from backend.h because it occurs in declarations of front-end functions -typedef struct { - int score; /* Centipawns */ - int depth; /* Plies */ - int time; /* Milliseconds */ -} ChessProgramStats_Move; - -/* [AS] Layout management */ -typedef struct { - Boolean visible; - int x; - int y; - int width; - int height; -} WindowPlacement; - -extern WindowPlacement wpEngineOutput; -extern WindowPlacement wpEvalGraph; -extern WindowPlacement wpMoveHistory; -extern WindowPlacement wpGameList; -extern WindowPlacement wpTags; -extern WindowPlacement wpTextMenu; - -#define MAXENGINES 2000 - -// [HGM] chat -#define MAX_CHAT 5 -extern int chatCount; -extern char chatPartner[MAX_CHAT][MSG_SIZ]; - -// Some prototypes of routines so general they should be available everywhere -/* If status == 0, we are exiting with a benign message, not an error */ -void DisplayFatalError P((String message, int error, int status)); -void DisplayError P((String message, int error)); - -// [HGM] generally useful macros; there are way too many memory leaks... -#define FREE(x) if(x) free(x) -#define ASSIGN(x, y) if(x) free(x); x = strdup(y) - -// [HGM] for now we use the kludge to redefine all the unstructured options by their array counterpart -// in due time we would have to make the actual substitutions all through the source - -#define firstInitString engInitString[0] -#define secondInitString engInitString[1] -#define firstComputerString computerString[0] -#define secondComputerString computerString[1] -#define firstChessProgram chessProgram[0] -#define secondChessProgram chessProgram[1] -#define firstDirectory directory[0] -#define secondDirectory directory[1] -#define firstProtocolVersion protocolVersion[0] -#define secondProtocolVersion protocolVersion[1] -#define firstScoreIsAbsolute scoreIsAbsolute[0] -#define secondScoreIsAbsolute scoreIsAbsolute[1] -#define firstHasOwnBookUCI hasOwnBookUCI[0] -#define secondHasOwnBookUCI hasOwnBookUCI[1] -#define firstTimeOdds timeOdds[0] -#define secondTimeOdds timeOdds[1] -#define firstAccumulateTC accumulateTC[0] -#define secondAccumulateTC accumulateTC[1] -#define firstHost host[0] -#define secondHost host[1] -#define reuseFirst reuse[0] -#define reuseSecond reuse[1] -#define firstIsUCI isUCI[0] -#define secondIsUCI isUCI[1] -#define firstNPS NPS[0] -#define secondNPS NPS[1] -#define firstLogo logo[0] -#define secondLogo logo[1] -#define fenOverride1 fenOverride[0] -#define fenOverride2 fenOverride[1] -#define firstOptions engOptions[0] -#define secondOptions engOptions[1] - -#endif diff --git a/conf/chu b/conf/chu deleted file mode 100644 index 56ad943..0000000 --- a/conf/chu +++ /dev/null @@ -1,42 +0,0 @@ -; -; settings for oriental Chu-Shogi theme -; --variant chu -; -; pieces: supplied chu-shogi svg's, and flip them in flipView -; --pid ~~/themes/chu --flipBlack true --trueColors true -; -; board: no checkering (both w. and w.o. texture) -; --liteBackTextureFile "~~/themes/textures/wood_l.png" --darkBackTextureFile "~~/themes/textures/wood_l.png" --lightSquareColor #FF8040 --darkSquareColor #FF8040 -; -; detour under-promotion is less convenient when non-pawns promote -; --sweepPromotions false -; -; legality testing must be on for double-moves to work, no adjudication -; --testLegality true --trivialDraws false --materialDraws false -; -; make the Lion roar on double captures -; --soundRoar roar.wav -; -; redefine default engine -; --fcp hachu --scp hachu -; -; set up own persistence file, used for this theme only -; --settingsFile ~/.xboard-chu-rc --saveSettingsFile ~/.xboard-chu-rc - diff --git a/conf/ics b/conf/ics deleted file mode 100644 index 9823c73..0000000 --- a/conf/ics +++ /dev/null @@ -1,10 +0,0 @@ -; -; settings for Internet Chess Server client -; --ics -; -; set up own persistence file, used for ICS play -; --settingsFile ~/.xboard-ics-rc --saveSettingsFile ~/.xboard-ics-rc - diff --git a/conf/judkins b/conf/judkins deleted file mode 100644 index 250369d..0000000 --- a/conf/judkins +++ /dev/null @@ -1,19 +0,0 @@ -; -; additional settings for Judkins Shogi -; --variant shogi -; -; size overrides -; --boardWidth 6 --boardHeight 6 --holdingsSize 6 -; -; remove L from piece set -; --pieceToCharTable "PNBR.S...G.++++.+Kpnbr.s...g.++++.+k" -; -; provide initial position -; --loadPositionFile "~~/themes/conf/judkins.fen" - diff --git a/conf/judkins.fen b/conf/judkins.fen deleted file mode 100644 index d805858..0000000 --- a/conf/judkins.fen +++ /dev/null @@ -1,2 +0,0 @@ -rbnsgk/6p/6/6/P5/KGSNBR w 0 1 - diff --git a/conf/mini b/conf/mini deleted file mode 100644 index ee6fce6..0000000 --- a/conf/mini +++ /dev/null @@ -1,24 +0,0 @@ -; -; additional settings for mini-Shogi -; --variant shogi -; -; size overrides -; --boardWidth 5 --boardHeight 5 --holdingsSize 5 -; -; remove L and N from piece set -; --pieceToCharTable "P.BR.S...G.+.++.+Kp.br.s...g.+.++.+k" -; -; redefine default engine -; --fcp gnuminishogi --scp gnuminishogi -; -; provide initial position -; --loadPositionFile "~~/themes/conf/mini.fen" - diff --git a/conf/mini.fen b/conf/mini.fen deleted file mode 100644 index 7ddea3a..0000000 --- a/conf/mini.fen +++ /dev/null @@ -1,2 +0,0 @@ -rbsgk/4p/5/P4/KGSBR w 0 1 - diff --git a/conf/sho b/conf/sho deleted file mode 100644 index 7b48f27..0000000 --- a/conf/sho +++ /dev/null @@ -1,28 +0,0 @@ -; -; additional settings for Sho Shogi -; --variant shogi -; -; size overrides -; --boardWidth 9 --boardHeight 9 --holdingsSize 0 -; -; add Elephant to piece set -; --pieceToCharTable "PNBRLSE..G.+++++++Kpnbrlse..g.+++++++k" -; -; provide initial position -; --loadPositionFile "~~/themes/conf/sho.fen" -; -; must play with legality testing off, for +E and mate -; --testLegality false -; -; redefine default engine -; --fcp hachu --scp hachu - diff --git a/conf/sho.fen b/conf/sho.fen deleted file mode 100644 index 689e5a6..0000000 --- a/conf/sho.fen +++ /dev/null @@ -1,2 +0,0 @@ -lnsgkgsnl/1r2e2b1/ppppppppp/9/9/9/PPPPPPPPP/1B2E2R1/LNSGKGSNL w 0 1 - diff --git a/conf/shogi b/conf/shogi deleted file mode 100644 index f808c91..0000000 --- a/conf/shogi +++ /dev/null @@ -1,45 +0,0 @@ -; -; settings for oriental Shogi theme -; --variant shogi -; -; pieces: supplied shogi svg's, and flip them in flipView -; --pid ~~/themes/shogi --flipBlack true --trueColors true -; -; board: no checkering (both w. and w.o. texture) -; --liteBackTextureFile "~~/themes/textures/wood_l.png" --darkBackTextureFile "~~/themes/textures/wood_l.png" --lightSquareColor #FF8040 --darkSquareColor #FF8040 -; -; detour under-promotion is less convenient when non-pawns promote -; --sweepPromotions false -; -; no adjudication -; --trivialDraws false --materialDraws false -; -; direct Load Position to handicap positions -; --positionDir ~~/positions/shogihandicaps -; -; common non-compliant notations -; --colorNickNames "sg" -; -; redefine default engine -; --fcp gnushogi --scp gnushogi -; -; set up own persistence file, used for this theme only -; --settingsFile ~/.xboard-shogi-rc --saveSettingsFile ~/.xboard-shogi-rc - diff --git a/conf/xiangqi b/conf/xiangqi deleted file mode 100644 index 23aeb36..0000000 --- a/conf/xiangqi +++ /dev/null @@ -1,30 +0,0 @@ -; -; settings for oriental Xiangqi theme -; --variant xiangqi -; -; pieces: supplied xiangqi svg's -; --pid ~~/themes/xiangqi --trueColors true -; -; board: supplied board bitmap -; --liteBackTextureFile "~~/themes/textures/xqboard.png" --darkBackTextureFile "~~/themes/textures/xqboard.png" -; -; suppress square boundaries and highlight with arrow instead -; --overrideLineGap 0 --highlightMovesWithArrow true -; -; define common non-compliant notations -; --pieceNickNames ".N...MB..G..n...mb..g." --colorNickNames "r." -; -; set up own persistence file, used for this theme only -; --settingsFile ~/.xboard-xiangqi-rc --saveSettingsFile ~/.xboard-xiangqi-rc - diff --git a/conf/xq b/conf/xq deleted file mode 100644 index fe659ba..0000000 --- a/conf/xq +++ /dev/null @@ -1,36 +0,0 @@ -; -; settings for oriental Xiangqi theme -; --variant xiangqi -; -; pieces: supplied xiangqi svg's -; --pid ~~/themes/xiangqi --trueColors true -; -; board: supplied board bitmap -; --useBoardTexture true --liteBackTextureFile "~~/themes/textures/xqboard.png" --darkBackTextureFile "~~/themes/textures/xqboard.png" -; -; suppress square boundaries and highlight with arrow instead -; --overrideLineGap 0 --highlightMoveWithArrow true -; -; define common non-compliant notations -; --pieceNickNames ".N...MB..G..n...mb..g." --colorNickNames "r." -; -; set default engines -; --fcp maxqi --scp maxqi -; -; set up own persistence file, used for this theme only -; --settingsFile ~/.xboard-xiangqi-rc --saveSettingsFile ~/.xboard-xiangqi-rc - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 3306409..0000000 --- a/configure.ac +++ /dev/null @@ -1,603 +0,0 @@ -dnl| configure.in -dnl| -dnl| Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, 2007, -dnl| 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. -dnl| -dnl| GNU XBoard is free software: you can redistribute it and/or modify -dnl| it under the terms of the GNU General Public License as published by -dnl| the Free Software Foundation, either version 3 of the License, or (at -dnl| your option) any later version. -dnl| -dnl| GNU XBoard is distributed in the hope that it will be useful, but -dnl| WITHOUT ANY WARRANTY; without even the implied warranty of -dnl| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl| General Public License for more details. -dnl| -dnl| You should have received a copy of the GNU General Public License -dnl| along with this program. If not, see http://www.gnu.org/licenses/. -dnl| -dnl| -------------------------------------------------------------------- -dnl| -dnl| You can process this file with autoconf to produce a configure script. -dnl| However, normally the supplied configure script will work fine. -dnl| -dnl| If you do need to change the configure script, instead of editing -dnl| it directly, try to edit configure.in (in a way that will keep -dnl| it portable to sites and systems other than your own), and run autoconf -dnl| to regenerate configure. Then submit your changes to be folded into -dnl| the standard version of xboard. - -dnl| define second argument as MAJOR.MINOR.PATCHLEVEL. e.g. 4.4.0 -dnl| MAJOR means large changes -dnl| MINOR can includes new features and bug fixes -dnl| PATCHLEVEL is used for bugfixes only -dnl| pre-release version have a -YYYYMMDD attached, e.g 4.9.0-20160313 -AC_INIT([xboard],[4.9.0-20160402],[bug-xboard@gnu.org]) - -dnl| need this to be able to compile some files in a subdir (filebrowser) -AM_INIT_AUTOMAKE([subdir-objects]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_CONFIG_HEADERS([config.h]) - -dnl | a bunch of templates for defines used below -AH_TEMPLATE([FIRST_PTY_LETTER],[template]) -AH_TEMPLATE([HAVE_FCNTL_H],[template]) -AH_TEMPLATE([HAVE_GETHOSTNAME],[template]) -AH_TEMPLATE([HAVE_GETTIMEOFDAY],[template]) -AH_TEMPLATE([HAVE_RANDOM],[template]) -AH_TEMPLATE([HAVE_SYS_SOCKET_H],[template]) -AH_TEMPLATE([IBMRTAIX],[template]) -AH_TEMPLATE([LAST_PTY_LETTER],[template]) -AH_TEMPLATE([PTY_ITERATION],[template]) -AH_TEMPLATE([PTY_NAME_SPRINTF],[template]) -AH_TEMPLATE([PTY_OPEN],[template]) -AH_TEMPLATE([PTY_TTY_NAME_SPRINTF],[template]) -AH_TEMPLATE([REMOTE_SHELL],[template]) -AH_TEMPLATE([RTU],[template]) -AH_TEMPLATE([UNIPLUS],[template]) -AH_TEMPLATE([USE_PTYS],[template]) -AH_TEMPLATE([X_WCHAR],[template]) -AH_TEMPLATE([ATTENTION],[template]) -AH_TEMPLATE([DEFINED_SYS_ERRLIST],[template]) -AH_TEMPLATE([USE_XAW3D],[template]) -AH_TEMPLATE([X_LOCALE],[template]) - - - -if test -z "$CFLAGS" ; then -dnl| Prevent the next macro from setting CFLAGS to -g - CFLAGS=" " -fi -AC_PROG_CC - -dnl| need this to be able to compile files in a subdir -AM_PROG_CC_C_O - -AC_PROG_CPP -AC_ISC_POSIX -AC_PROG_INSTALL - -dnl| add gettext support -AM_GNU_GETTEXT_VERSION(0.17) -AM_GNU_GETTEXT([external]) - -AC_CHECK_PROGS(RSH, remsh rsh, rsh) -AC_CHECK_PROGS(MINFO, makeinfo, makeinfo_not_found) -if test "$MINFO" = makeinfo_not_found ; then - echo Please install \"makeinfo\" - exit 1 -fi -AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH") -AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat) -AC_SUBST(NROFFFLAGS) -AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk) -AC_PATH_PROGS(PERLPATH, perl) - -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_SYS_WAIT -AC_HEADER_DIRENT -AC_TYPE_SIGNAL -AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h) -AC_CHECK_HEADERS(fcntl.h sys/fcntl.h, break) -AC_CHECK_HEADERS(sys/socket.h lan/socket.h, break) -AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1)) - -AC_CHECK_FUNCS(_getpty grantpt setitimer usleep) -AC_CHECK_FUNCS(gettimeofday ftime, break) -AC_CHECK_FUNCS(random rand48, break) -AC_CHECK_FUNCS(gethostname sysinfo, break) -AC_CHECK_FUNC(setlocale, [], - AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1))) - -AC_CHECK_LIB(seq, getpseudotty) - -dnl | add compiler warnings only if compiler understands them -AC_MSG_CHECKING(whether compiler understands -Wall -Wno-parentheses) -SAVE_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wall -Wno-parentheses" -AC_TRY_COMPILE([],[], - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - CFLAGS="$SAVE_CFLAGS") - -dnl | check for pkg-config -AC_CHECK_PROGS([PKGCONFIG], [pkg-config], pkgconfig_not_found) -AS_IF( [test "x$PKGCONFIG" = xpkgconfig_not_found], - AC_MSG_ERROR([cannot find pkg-config! Please install it.])) - -dnl | check for cairo and librsvg -PKG_CHECK_MODULES([CAIRO], [ cairo >= 1.2.0 pangocairo librsvg-2.0 >= 2.14.0 ]) -AC_SUBST(CAIRO_CFLAGS) -AC_SUBST(CAIRO_LIBS) - -dnl | check which front end to use -dnl | first check for gtk -dnl | then for Xaw3d -dnl | and then for Xaw -FRONTEND_CFLAGS="" -FRONTEND_LIBS="" - -AC_ARG_WITH([gtk], - [AS_HELP_STRING([--with-gtk],[use GTK front-end (default)])], - [with_GTK=$withval], - [with_GTK="yes"]) - -AC_ARG_WITH([Xaw3d], - [AS_HELP_STRING([--with-Xaw3d],[use Xaw3d front-end (not fully supported anymore)])], - [with_Xaw3d="$withval"], - [with_Xaw3d="no"]) -dnl | overwrite default gtk -AS_IF([test "x$with_Xaw3d" = xyes], [with_GTK="no"]) - -AC_ARG_WITH([Xaw], - [AS_HELP_STRING([--with-Xaw],[use Xaw front-end])], - [with_Xaw="$withval"], - [with_Xaw="no"]) -dnl | overwrite default gtk -AS_IF([test "x$with_Xaw" = xyes], [with_GTK="no"]) - -AC_ARG_WITH([iconsdir], - [AS_HELP_STRING([--with-iconsdir=DIR], - [path where icons get installed (default: $datadir/icons/hicolor/48x48/apps)])], - [ICONSDIR="$withval"], - [ICONSDIR='$(datadir)/icons/hicolor/48x48/apps']) - -AC_ARG_WITH([svgiconsdir], - [AS_HELP_STRING([--with-svgiconsdir=DIR], - [path where svg icons get installed (default: $datadir/icons/hicolor/scalable/apps)])], - [SVGICONSDIR="$withval"], - [SVGICONSDIR='$(datadir)/icons/hicolor/scalable/apps']) - -AC_ARG_WITH([desktopdir], - [AS_HELP_STRING([--with-desktopdir=DIR], - [path where desktop files get installed (default: $datadir/applications)])], - [DESKTOPDIR="$withval"], - [DESKTOPDIR='$(datadir)/applications']) - -AC_ARG_WITH([mimedir], - [AS_HELP_STRING([--with-mimedir=DIR], - [path where mime files get installed (default: $datadir/mime/packages)])], - [MIMEDIR="$withval"], - [MIMEDIR='$(datadir)/mime/packages']) - -AC_ARG_WITH([gamedatadir], - [AS_HELP_STRING([--with-gamedatadir=DIR], - [path where game data files get installed (default: $datadir/games/xboard)])], - [GAMEDATADIR="$withval"], - [GAMEDATADIR='$(datadir)/games/xboard']) - -AC_ARG_ENABLE([update-mimedb], - [AS_HELP_STRING([--disable-update-mimedb],[disable the update-mime-database after install [default=no]])], - [enable_mimedb="no"], - [enable_mimedb="yes"]) - -AC_ARG_ENABLE([osxapp], - [AS_HELP_STRING([--enable-osxapp],[build a OSX app [default=no]])], - [enable_OSXAPP=$enableval], - [enable_OSXAPP="no"]) - -AS_IF([test x"$enable_OSXAPP" = x"yes"], [ - prefix=`pwd`/XBoard.app/Contents - AC_DEFINE([OSXAPP], [1], [We are building an OSX APP, redefine some functions]) - with_GTK="yes" - enable_mimedb="no" - datarootdir='$(prefix)/Resources' - datadir='$(datarootdir)/share' - sysconfdir='$(datarootdir)/etc' - infodir='$(datadir)/info' - mandir='$(datadir)/man' - bindir='$(prefix)/MacOS' - localedir='$(datadir)/locale' - GAMEDATADIR='$(datadir)/xboard'],[]) - -AM_CONDITIONAL(OSX_APP, test x"$enable_OSXAPP" = x"yes") - -AM_CONDITIONAL(NLS_ENABLED, test x"$USE_NLS" = x"yes") - -AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x"$enable_mimedb" = x"yes") -if test x"$enable_mimedb" = x"yes"; then - AC_PATH_PROG([XDG_MIME],[xdg-mime]) - AC_SUBST(XDG_MIME) - AC_PATH_PROG([XDG_DESKTOP_MENU],[xdg-desktop-menu]) - AC_SUBST(XDG_DESKTOP_MENU) - AC_PATH_PROG([XDG_ICON_RESOURCE],[xdg-icon-resource]) - AC_SUBST(XDG_ICON_RESOURCE) -fi - -AC_SUBST(ICONSDIR) -AC_SUBST(SVGICONSDIR) -AC_SUBST(DESKTOPDIR) -AC_SUBST(MIMEDIR) -AC_SUBST(GAMEDATADIR) - -dnl | check for libraries -if test x"$with_GTK" = x"yes" ; then - PKG_CHECK_MODULES([GTK], [ gtk+-2.0 >= 2.16.0 gmodule-2.0 ]) - FRONTEND_CFLAGS=$GTK_CFLAGS - FRONTEND_LIBS=$GTK_LIBS - with_Xaw="no" -fi - -if test x"$with_GTK" = x"no" ; then - -dnl | general check for Xaw and Xaw3d - AC_PATH_XTRA - if test -n "$no_x" ; then - AC_MSG_ERROR([ " $PACKAGE requires the X Window System header files and libraries! - They were not found on your system. See FAQ topic C.2. - configure failed"]) - fi - - save_cflags="$CFLAGS" - save_cppflags="$CPPFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADER([X11/Intrinsic.h],[xt="yes"],[xt="no"]) - CFLAGS="$save_cflags" - CPPFLAGS="$save_cppflags" - - if test "$xt" = "no" ; then - AC_MSG_ERROR([Xt headers not found. Please install the X11 packages.]) - fi - -dnl | check availability of Xaw3d - FRONTEND_LIBS= - AS_IF([test x"$with_Xaw3d" != x"no"], - [AC_CHECK_LIB([Xaw3d], - [XawTextReplace], - [ FRONTEND_LIBS="-lXaw3d" - AC_DEFINE([USE_XAW3D], [1], [Define if you want to use Xaw3d])], - [AC_MSG_ERROR([--with-Xaw3d was given, but test for Xaw3d failed. Make sure that you have Xaw3d installed, else you might want to try the configure option --without-Xaw3d])], - [-lXaw])]) - -dnl | no Xaw3d, check for Xaw; make it the default - if test x"$with_Xaw3d" = x"no" ; then - with_Xaw=yes - save_cflags="$CFLAGS" - save_cppflags="$CPPFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADER([X11/Xaw/Dialog.h],[xaw_headers="yes"], [xaw_headers="no"]) - CFLAGS="$save_cflags" - CPPFLAGS="$save_cppflags" - - if test x"$xaw_headers" = x"no" ; then - AC_MSG_ERROR([Xaw headers not found. Please install the Xaw package and headers.]) - fi - - FRONTEND_LIBS="-lXaw" - fi - -fi - -dnl | make results available in Makefile.am -AM_CONDITIONAL([withGTK], [test x"$with_GTK" = x"yes"]) -AM_CONDITIONAL([withXaw], [test x"$with_Xaw3d" = x"yes" || test x"$with_Xaw" = x"yes"]) - -dnl | end Front-end check - -AC_CANONICAL_HOST - -dnl| The following info is mostly gathered from GNU Emacs 19.24. Basically, -dnl| we are trying to find out whether this is a System-V derivative in -dnl| which pipes don't work with select() and if so, whether there is anything -dnl| strange about the way to open a pty. Some of the work was done above -dnl| by looking for _getpty, grantpt, and getpseudotty. A few other strange -dnl| properties of particular systems are also handled here. - -dnl| 4/6/97 I'm not sure there really are any systems where pipes -dnl| don't work with select(), and ptys cause problems on many -dnl| systems, so I'm changing the default to disable ptys in all -dnl| cases. I will change it back if I get bug reports that are fixed -dnl| by doing a "configure --enable-ptys" - -USE_PTYS=0 -case "$host" in - *-*-hpux* ) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) -dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - else - -dnl| Note: You might be able to build xboard even if your compiler does not -dnl| support ANSI C (-Aa). xboard itself does not require ANSI C. I don't -dnl| know whether the X header files on HP-UX require it. - - CONF_CFLAGS="-Aa -D_HPUX_SOURCE" - fi - -dnl| HP doesn't supply a full set of X header files and libraries. People -dnl| often have some things installed in one place and some in another. -dnl| AC_PATH_XTRA will find only one place, so we try to add all the -dnl| likely ones that might be missing here. It might be better to -dnl| change AC_PATH_XTRA to try to extract this information from imake, -dnl| since folks who install the missing bits often configure their -dnl| imake to find them, but I don't want to delve into autoconf and -dnl| hack on its internals. - - if test -d /opt/hppd/include/X11; then - X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" - X_LIBS="$X_LIBS -L/opt/hppd/lib" - elif test -d /usr/contrib/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" - elif test -d /usr/contrib/mitX11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" - elif test -d /MIT/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" - X_LIBS="$X_LIBS -L/MIT/X11R5/lib" - elif test -d /usr/local/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" - X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" - fi - if test -d /usr/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" - X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" - elif test -d /usr/include/X11R4; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" - X_LIBS="$X_LIBS -L/usr/lib/X11R4" - fi - ;; - - romp-ibm-aix* ) - AC_DEFINE(IBMRTAIX, 1) -dnl| USE_PTYS=1 - ;; - - i386-ibm-aix ) -dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - - *-*-aix3* | *-*-bosx* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));]) -dnl| USE_PTYS=1 - ;; - - *-*-cxux* ) - AC_DEFINE(FIRST_PTY_LETTER, 'A') - AC_DEFINE(LAST_PTY_LETTER, 'P') -dnl| USE_PTYS=1 - ;; - - *-*-uniplus* ) - AC_DEFINE(UNIPLUS, 1) -dnl| USE_PTYS=1 - ;; - - *-*-rtu* ) - AC_DEFINE(FIRST_PTY_LETTER, 'z') - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyp%x", i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty%x", i);]) - AC_DEFINE(RTU, 1) -dnl| USE_PTYS=1 - ;; - - *-*-iris* | *-*-irix3* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));]) -dnl| USE_PTYS=1 - ;; - - *-*-irix* ) -dnl| USE_PTYS=1 - ;; - - *-*-sunos4* | *-*-solaris1* ) - -dnl| Work around a bug in the SunOS 4.x linker. Not needed if you have patches -dnl| 100512-02 and 100573-03 from Sun. The X FAQ says that the following is -dnl| "overkill," but doesn't explain what should be done instead. - - if test "$GCC" = yes; then - PRE_XMULIB="-static" - POST_XMULIB="-dynamic" - else - PRE_XMULIB="-Bstatic" - POST_XMULIB="-Bdynamic" - fi - ;; - - *-*-sunos5* | *-*-solaris2* ) -dnl| USE_PTYS=1 - -dnl| I'm not sure -lelf is needed, but it was in the old Imakefile. -dnl| The other libraries should all be found by Ac_PATH_XTRA or other -dnl| code above. - - X_LIBS="$X_LIBS -lelf" - ;; - - *-*-sco* ) - AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);]) -dnl| USE_PTYS=1 - ;; - - *-*-dynix* | *-*-ptx* ) -dnl| USE_PTYS=1 - ;; - - *-*-esix* ) -dnl| USE_PTYS=1 - ;; - - *-*-usg5-4* | *-*-sysvr4* ) -dnl| USE_PTYS=1 - ;; - - *-*-usg* | *-*-sysv* | *-*-aix* ) -dnl| USE_PTYS=1 - ;; - - vax-*-ultrix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - -dnl| add some libs for OS X - *-apple-* ) - AC_MSG_WARN([Apple support is experimental, please report any problems to bug-xboard@gnu.org]) - AC_MSG_WARN([use --enable-osxapp to enable the build target and automatically adjust target directories]) - AC_MSG_WARN([Building an OSX app currently relies on some programs such as dylib that we don't test for]) - AC_MSG_WARN([patches welcome ;)]) - AC_PATH_PROG(SW_VERS, sw_vers) - if test "x$SW_VERS" != "x"; then - AC_MSG_CHECKING(Mac OS X version) - MACOSX_VERSION=`$SW_VERS -productVersion` - AC_MSG_RESULT([$MACOSX_VERSION]) - fi - FRONTEND_LIBS="$FRONTEND_LIBS -headerpad_max_install_names " - if test x"$enable_OSXAPP" = x"yes" ; then - FRONTEND_LIBS="$FRONTEND_LIBS -lgtkmacintegration-gtk2" - fi - FRONTEND_CFLAGS="$FRONTEND_CFLAGS -I/opt/local/include -L/opt/local/lib" - ;; -esac - - -AC_SUBST(FRONTEND_CFLAGS) -AC_SUBST(FRONTEND_LIBS) -AC_SUBST(PRE_XMULIB) -AC_SUBST(POST_XMULIB) -AC_SUBST(CONF_CFLAGS) -AC_SUBST(CONF_LDFLAGS) - -AC_MSG_CHECKING(whether ptys or pipes should be used) -AC_ARG_ENABLE( [ptys], - [AS_HELP_STRING([--enable-ptys],[force use of pseudo-ttys with child processes])], -[if test "$enableval" = yes; then - USE_PTYS=1 - enable_ptys="ptys" - AC_MSG_RESULT([ptys (user override)]) -fi -if test "$enableval" = no; then - USE_PTYS=0 - enable_ptys="pipes" - AC_MSG_RESULT([pipes (user override)]) -fi], -[if test "$USE_PTYS" = 1; then - AC_MSG_RESULT(ptys) - enable_ptys="ptys" -else - AC_MSG_RESULT(pipes) - enable_ptys="pipes" -fi]) -AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS) - - -dnl | define not to build zippy as a default, so that autoheader is happy -AC_ARG_ENABLE( [zippy], - [AS_HELP_STRING([--enable-zippy],[support interfacing a chess program to ICS (default)])], - [], - [enable_zippy="no"]) - -if test x"$enable_zippy" != x"no"; then - AC_DEFINE(ZIPPY, 1,[should zippy be enabled]) -else - AC_DEFINE(ZIPPY, 0,[should zippy be enabled]) -fi -AM_CONDITIONAL([ZIPPY], [test x$enable_zippy != xno]) - - -AC_ARG_ENABLE(sigint, -[AS_HELP_STRING([--enable-sigint],[sending SIGINT (^C) wakes up GNU Chess (default)])], -[if test "$enableval" = yes; then - AC_DEFINE(ATTENTION, 1) -fi -enable_sigint=$enableval -], -[enable_sigint="yes" -AC_DEFINE(ATTENTION, 1)]) - - -if test x"$with_Xaw3d" = x"yes" -o x"$with_Xaw" = x"yes" ; then -dnl | save all information for X in X_LIBS, also add the libraries themself -dnl | since AC_PATH_XTRA only adds the paths -X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXmu -lX11 -lXt " -AC_SUBST(X_CFLAGS) -AC_SUBST(X_LIBS) -fi - -dnl create a string with configure options that can be passed to the -dnl program, good for bug reports and version printout, see output below -CONFIGURE_OPTIONS="prefix=$prefix; datarootdir=$datarootdir; \ -datadir=$datadir; gamedatadir=$GAMEDATADIR; desktopdir=$DESKTOPDIR; \ -mimedir=$MIMEDIR; iconsdir=$ICONSDIR; svgiconsdir=$SVGICONSDIR; infodir=$infodir; \ -sysconfigdir=$sysconfigdir; update_mimedb=$enable_mimedb; NLS=$USE_NLS; \ -GTK=$with_GTK; Xaw3d=$with_Xaw3d; Xaw=$with_Xaw; \ -ptys=$enable_ptys; zippy=$enable_zippy; sigint=$enable_sigint" - -AC_SUBST(CONFIGURE_OPTIONS) - -dnl | output Makefile -AC_CONFIG_FILES([Makefile cmail po/Makefile.in osxapp/Info.plist]) -AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h]) -AC_CONFIG_COMMANDS([chmod-cmail],[chmod 755 cmail]) -AC_OUTPUT - -dnl -dnl Output a summary -dnl -echo "" -echo " Configurations summary:" -echo "" -echo " prefix: $prefix " -echo " datarootdir: $datarootdir " -echo " datadir: $datadir " -echo " gamedatadir: $GAMEDATADIR " -echo " desktopdir: $DESKTOPDIR " -echo " mimedir: $MIMEDIR " -echo " iconsdir: $ICONSDIR " -echo " svgiconsdir: $SVGICONSDIR " -echo " infodir: $infodir (info files will go here)" -echo " sysconfdir: $sysconfdir (xboard.conf will go here)" -echo "" -echo " update mimedb: $enable_mimedb" -echo "" -echo " NLS support: $USE_NLS" -echo "" -echo " GTK: $with_GTK" -echo " Xaw3d: $with_Xaw3d" -echo " Xaw: $with_Xaw" -echo "" -echo " ptys: $enable_ptys" -echo " zippy: $enable_zippy" -echo " sigint: $enable_sigint" diff --git a/copyright.texi b/copyright.texi deleted file mode 100644 index ba85156..0000000 --- a/copyright.texi +++ /dev/null @@ -1,55 +0,0 @@ - -@setfilename copyright.info - -Copyright @copyright{} 1991 Digital Equipment Corporation, Maynard, Massachusetts. - -All Rights Reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -Digital disclaims all warranties with regard to this software, including -all implied warranties of merchantability and fitness. In no event shall -Digital be liable for any special, indirect or consequential damages or -any damages whatsoever resulting from loss of use, data or profits, -whether in an action of contract, negligence or other tortious action, -arising out of or in connection with the use or performance of this -software. - -Enhancements copyright @copyright{} 1992-2003, 2004, 2005, 2006, 2007, -2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. - -@format -Published by the Free Software Foundation -59 Temple Place - Suite 330 -Boston, MA 02111-1307 USA -@end format - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through Tex and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU General Public License,'' -is included exactly as in the original, and provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that the section entitled ``GNU General Public License,'' -and this permission notice, may be included in translations approved by -the Free Software Foundation instead of in the original English. diff --git a/dialogs.c b/dialogs.c deleted file mode 100644 index 8624ff4..0000000 --- a/dialogs.c +++ /dev/null @@ -1,3392 +0,0 @@ -/* - * dialogs.c -- platform-independent code for dialogs of XBoard - * - * Copyright 2000, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. - * ------------------------------------------------------------------------ - * - * GNU XBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * GNU XBoard is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. * - * - *------------------------------------------------------------------------ - ** See the file ChangeLog for a revision history. */ - -// [HGM] this file is the counterpart of woptions.c, containing xboard popup menus -// similar to those of WinBoard, to set the most common options interactively. - -#include "config.h" - -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -#else /* not STDC_HEADERS */ -extern char *getenv(); -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if HAVE_UNISTD_H -# include -#endif -#include - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "xboard2.h" -#include "menus.h" -#include "dialogs.h" -#include "gettext.h" - -#ifdef ENABLE_NLS -# define _(s) gettext (s) -# define N_(s) gettext_noop (s) -#else -# define _(s) (s) -# define N_(s) s -#endif - - -int values[MAX_OPTIONS]; -ChessProgramState *currentCps; -char manDir[MSG_SIZ] = MANDIR; - -//----------------------------Generic dialog -------------------------------------------- - -// cloned from Engine Settings dialog (and later merged with it) - -char *marked[NrOfDialogs]; -Boolean shellUp[NrOfDialogs]; - -void -MarkMenu (char *item, int dlgNr) -{ - MarkMenuItem(marked[dlgNr] = item, True); -} - -void -AddLine (Option *opt, char *s) -{ - AppendText(opt, s); - AppendText(opt, "\n"); -} - -//---------------------------------------------- Update dialog controls ------------------------------------ - -int -SetCurrentComboSelection (Option *opt) -{ - int j; - if(currentCps) ; else - if(!opt->textValue) opt->value = *(int*)opt->target; /* numeric */else { - for(j=0; opt->choice[j]; j++) // look up actual value in list of possible values, to get selection nr - if(*(char**)opt->target && !strcmp(*(char**)opt->target, ((char**)opt->textValue)[j])) break; - opt->value = j + (opt->choice[j] == NULL); - } - SetComboChoice(opt, opt->value); - return opt->value; -} - -void -GenericUpdate (Option *opts, int selected) -{ - int i; - char buf[MSG_SIZ]; - - for(i=0; ; i++) - { - if(selected >= 0) { if(i < selected) continue; else if(i > selected) break; } - switch(opts[i].type) - { - case TextBox: - case FileName: - case PathName: - SetWidgetText(&opts[i], *(char**) opts[i].target, -1); - break; - case Spin: - sprintf(buf, "%d", *(int*) opts[i].target); - SetWidgetText(&opts[i], buf, -1); - break; - case Fractional: - sprintf(buf, "%4.2f", *(float*) opts[i].target); - SetWidgetText(&opts[i], buf, -1); - break; - case CheckBox: - SetWidgetState(&opts[i], *(Boolean*) opts[i].target); - break; - case ComboBox: - if(opts[i].min & COMBO_CALLBACK) break; - SetCurrentComboSelection(opts+i); - // TODO: actually display this (but it is never used that way...) - break; - case EndMark: - return; - default: - printf("GenericUpdate: unexpected case in switch.\n"); - case ListBox: - case Button: - case SaveButton: - case Label: - case Break: - break; - } - } -} - -//------------------------------------------- Read out dialog controls ------------------------------------ - -int -GenericReadout (Option *opts, int selected) -{ - int i, j, res=1; - char *val; - char buf[MSG_SIZ], **dest; - float x; - for(i=0; ; i++) { // send all options that had to be OK-ed to engine - if(selected >= 0) { if(i < selected) continue; else if(i > selected) break; } - switch(opts[i].type) { - case TextBox: - case FileName: - case PathName: - GetWidgetText(&opts[i], &val); - dest = currentCps ? &(opts[i].textValue) : (char**) opts[i].target; - if(*dest == NULL || strcmp(*dest, val)) { - if(currentCps) { - snprintf(buf, MSG_SIZ, "option %s=%s\n", opts[i].name, val); - SendToProgram(buf, currentCps); - } else { - if(*dest) free(*dest); - *dest = malloc(strlen(val)+1); - } - safeStrCpy(*dest, val, MSG_SIZ - (*dest - opts[i].name)); // copy text there - } - break; - case Spin: - case Fractional: - GetWidgetText(&opts[i], &val); - x = 0.0; // Initialise because sscanf() will fail if non-numeric text is entered - sscanf(val, "%f", &x); - if(x > opts[i].max) x = opts[i].max; - if(x < opts[i].min) x = opts[i].min; - if(opts[i].type == Fractional) - *(float*) opts[i].target = x; // engines never have float options! - else { - if(currentCps) { - if(opts[i].value != x) { // only to engine if changed - snprintf(buf, MSG_SIZ, "option %s=%.0f\n", opts[i].name, x); - SendToProgram(buf, currentCps); - } - } else *(int*) opts[i].target = x; - opts[i].value = x; - } - break; - case CheckBox: - j = 0; - GetWidgetState(&opts[i], &j); - if(opts[i].value != j) { - opts[i].value = j; - if(currentCps) { - snprintf(buf, MSG_SIZ, "option %s=%d\n", opts[i].name, j); - SendToProgram(buf, currentCps); - } else *(Boolean*) opts[i].target = j; - } - break; - case ComboBox: - if(opts[i].min & COMBO_CALLBACK) break; - if(!opts[i].textValue) { *(int*)opts[i].target = values[i]; break; } // numeric - val = ((char**)opts[i].textValue)[values[i]]; - if(currentCps) { - if(opts[i].value == values[i]) break; // not changed - opts[i].value = values[i]; - snprintf(buf, MSG_SIZ, "option %s=%s\n", opts[i].name, opts[i].choice[values[i]]); - SendToProgram(buf, currentCps); - } else if(val && (*(char**) opts[i].target == NULL || strcmp(*(char**) opts[i].target, val))) { - if(*(char**) opts[i].target) free(*(char**) opts[i].target); - *(char**) opts[i].target = strdup(val); - } - break; - case EndMark: - if(opts[i].target && selected != -2) // callback for implementing necessary actions on OK (like redraw) - res = ((OKCallback*) opts[i].target)(i); - break; - default: - printf("GenericReadout: unexpected case in switch.\n"); - case ListBox: - case Button: - case SaveButton: - case Label: - case Break: - case Skip: - break; - } - if(opts[i].type == EndMark) break; - } - return res; -} - -//------------------------------------------- Match Options ------------------------------------------------------ - -char *engineName, *engineChoice, *tfName; -char *engineList[MAXENGINES] = {" "}, *engineMnemonic[MAXENGINES]; - -static void AddToTourney P((int n, int sel)); -static void CloneTourney P((void)); -static void ReplaceParticipant P((void)); -static void UpgradeParticipant P((void)); -static void PseudoOK P((void)); - -static int -MatchOK (int n) -{ - ASSIGN(appData.participants, engineName); - if(!CreateTourney(tfName) || matchMode) return matchMode || !appData.participants[0]; - PopDown(MasterDlg); // early popdown to prevent FreezeUI called through MatchEvent from causing XtGrab warning - MatchEvent(2); // start tourney - return FALSE; // no double PopDown! -} - -static void -DoTimeControl(int n) -{ - TimeControlProc(); -} - -static void -DoCommonEngine(int n) -{ - UciMenuProc(); -} - -static void -DoGeneral(int n) -{ - OptionsProc(); -} - -#define PARTICIPANTS 6 /* This MUST be the number of the Option for &engineName!*/ - -static Option matchOptions[] = { -{ 0, 0, 0, NULL, (void*) &tfName, ".trn", NULL, FileName, N_("Tournament file: ") }, -{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("For concurrent playing of tourney with multiple XBoards:") }, -{ 0, 0, 0, NULL, (void*) &appData.roundSync, "", NULL, CheckBox, N_("Sync after round") }, -{ 0, 0, 0, NULL, (void*) &appData.cycleSync, "", NULL, CheckBox, N_("Sync after cycle") }, -{ 0, LR, 175, NULL, NULL, NULL, NULL, Label, N_("Tourney participants:") }, -{ 0, SAME_ROW|RR, 175, NULL, NULL, NULL, NULL, Label, N_("Select Engine:") }, -{ 200, T_VSCRL | T_FILL | T_WRAP, - 175, NULL, (void*) &engineName, NULL, NULL, TextBox, "" }, -{ 200, SAME_ROW|RR, - 175, NULL, (void*) engineMnemonic, (char*) &AddToTourney, NULL, ListBox, "" }, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" }, // to decouple alignment above and below boxes -//{ 0, COMBO_CALLBACK | NO_GETTEXT, -// 0, NULL, (void*) &AddToTourney, (char*) (engineMnemonic+1), (engineMnemonic+1), ComboBox, N_("Select Engine:") }, -{ 0, 0, 10, NULL, (void*) &appData.tourneyType, "", NULL, Spin, N_("Tourney type (0 = round-robin, 1 = gauntlet):") }, -{ 0, 1, 1000000000, NULL, (void*) &appData.tourneyCycles, "", NULL, Spin, N_("Number of tourney cycles (or Swiss rounds):") }, -{ 0, 1, 1000000000, NULL, (void*) &appData.defaultMatchGames, "", NULL, Spin, N_("Default Number of Games in Match (or Pairing):") }, -{ 0, 0, 1000000000, NULL, (void*) &appData.matchPause, "", NULL, Spin, N_("Pause between Match Games (msec):") }, -{ 0, 0, 0, NULL, (void*) &appData.saveGameFile, ".pgn .game", NULL, FileName, N_("Save Tourney Games on:") }, -{ 0, 0, 0, NULL, (void*) &appData.loadGameFile, ".pgn .game", NULL, FileName, N_("Game File with Opening Lines:") }, -{ 0, -2, 1000000000, NULL, (void*) &appData.loadGameIndex, "", NULL, Spin, N_("Game Number (-1 or -2 = Auto-Increment):") }, -{ 0, 0, 0, NULL, (void*) &appData.loadPositionFile, ".fen .epd .pos", NULL, FileName, N_("File with Start Positions:") }, -{ 0, -2, 1000000000, NULL, (void*) &appData.loadPositionIndex, "", NULL, Spin, N_("Position Number (-1 or -2 = Auto-Increment):") }, -{ 0, 0, 1000000000, NULL, (void*) &appData.rewindIndex, "", NULL, Spin, N_("Rewind Index after this many Games (0 = never):") }, -{ 0, 0, 0, NULL, (void*) &appData.defNoBook, "", NULL, CheckBox, N_("Disable own engine books by default") }, -{ 0, 0, 0, NULL, (void*) &DoTimeControl, NULL, NULL, Button, N_("Time Control") }, -{ 0, SAME_ROW, 0, NULL, (void*) &DoCommonEngine, NULL, NULL, Button, N_("Common Engine") }, -{ 0, SAME_ROW, 0, NULL, (void*) &DoGeneral, NULL, NULL, Button, N_("General Options") }, -{ 0, SAME_ROW, 0, NULL, (void*) &PseudoOK, NULL, NULL, Button, N_("Continue Later") }, -{ 0, 0, 0, NULL, (void*) &ReplaceParticipant, NULL, NULL, Button, N_("Replace Engine") }, -{ 0, SAME_ROW, 0, NULL, (void*) &UpgradeParticipant, NULL, NULL, Button, N_("Upgrade Engine") }, -{ 0, SAME_ROW, 0, NULL, (void*) &CloneTourney, NULL, NULL, Button, N_("Clone Tourney") }, -{ 0, SAME_ROW, 0, NULL, (void*) &MatchOK, "", NULL, EndMark , "" } -}; - -static void -ReplaceParticipant () -{ - GenericReadout(matchOptions, PARTICIPANTS); - Substitute(strdup(engineName), True); -} - -static void -UpgradeParticipant () -{ - GenericReadout(matchOptions, PARTICIPANTS); - Substitute(strdup(engineName), False); -} - -static void -PseudoOK () -{ - if(matchMode) return; - GenericReadout(matchOptions, -2); // read all, but suppress calling of MatchOK - ASSIGN(appData.participants, engineName); - ASSIGN(appData.tourneyFile, tfName); - PopDown(MasterDlg); // early popdown to prevent FreezeUI called through MatchEvent from causing XtGrab warning -} - -static void -CloneTourney () -{ - FILE *f; - char *name; - GetWidgetText(matchOptions, &name); - if(name && name[0] && (f = fopen(name, "r")) ) { - char *saveSaveFile; - saveSaveFile = appData.saveGameFile; appData.saveGameFile = NULL; // this is a persistent option, protect from change - ParseArgsFromFile(f); - engineName = appData.participants; GenericUpdate(matchOptions, -1); - FREE(appData.saveGameFile); appData.saveGameFile = saveSaveFile; - } else DisplayError(_("First you must specify an existing tourney file to clone"), 0); -} - -static void -AddToTourney (int n, int sel) -{ - int nr; - char buf[MSG_SIZ]; - if(sel < 1) buf[0] = NULLCHAR; // back to top level - else if(engineList[sel][0] == '#') safeStrCpy(buf, engineList[sel], MSG_SIZ); // group header, open group - else { // normal line, select engine - AddLine(&matchOptions[PARTICIPANTS], engineMnemonic[sel]); - return; - } - nr = NamesToList(firstChessProgramNames, engineList, engineMnemonic, buf); // replace list by only the group contents - ASSIGN(engineMnemonic[0], buf); - LoadListBox(&matchOptions[PARTICIPANTS+1], _("# no engines are installed"), -1, -1); - HighlightWithScroll(&matchOptions[PARTICIPANTS+1], 0, nr); -} - -void -MatchOptionsProc () -{ - if(matchOptions[PARTICIPANTS+1].type != ListBox) { - DisplayError(_("Internal error: PARTICIPANTS set wrong"), 0); - return; - } - NamesToList(firstChessProgramNames, engineList, engineMnemonic, ""); - matchOptions[9].min = -(appData.pairingEngine[0] != NULLCHAR); // with pairing engine, allow Swiss - ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName)); - ASSIGN(engineName, appData.participants); - ASSIGN(engineMnemonic[0], ""); - GenericPopUp(matchOptions, _("Tournament Options"), MasterDlg, BoardWindow, MODAL, 0); -} - -// ------------------------------------------- General Options -------------------------------------------------- - -static int oldShow, oldBlind, oldPonder; - -static int -GeneralOptionsOK (int n) -{ - int newPonder = appData.ponderNextMove; - appData.ponderNextMove = oldPonder; - PonderNextMoveEvent(newPonder); - if(!appData.highlightLastMove) ClearHighlights(), ClearPremoveHighlights(); - if(oldShow != appData.showCoords || oldBlind != appData.blindfold) DrawPosition(TRUE, NULL); - return 1; -} - -static Option generalOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.whitePOV, "", NULL, CheckBox, N_("Absolute Analysis Scores") }, -{ 0, 0, 0, NULL, (void*) &appData.sweepSelect, "", NULL, CheckBox, N_("Almost Always Queen (Detour Under-Promote)") }, -{ 0, 0, 0, NULL, (void*) &appData.animateDragging, "", NULL, CheckBox, N_("Animate Dragging") }, -{ 0, 0, 0, NULL, (void*) &appData.animate, "", NULL, CheckBox, N_("Animate Moving") }, -{ 0, 0, 0, NULL, (void*) &appData.autoCallFlag, "", NULL, CheckBox, N_("Auto Flag") }, -{ 0, 0, 0, NULL, (void*) &appData.autoFlipView, "", NULL, CheckBox, N_("Auto Flip View") }, -{ 0, 0, 0, NULL, (void*) &appData.blindfold, "", NULL, CheckBox, N_("Blindfold") }, -/* TRANSLATORS: the drop menu is used to drop a piece, e.g. during bughouse or editing a position */ -{ 0, 0, 0, NULL, (void*) &appData.dropMenu, "", NULL, CheckBox, N_("Drop Menu") }, -{ 0, 0, 0, NULL, (void*) &appData.variations, "", NULL, CheckBox, N_("Enable Variation Trees") }, -{ 0, 0, 0, NULL, (void*) &appData.headers, "", NULL, CheckBox, N_("Headers in Engine Output Window") }, -{ 0, 0, 0, NULL, (void*) &appData.hideThinkingFromHuman, "", NULL, CheckBox, N_("Hide Thinking from Human") }, -{ 0, 0, 0, NULL, (void*) &appData.highlightLastMove, "", NULL, CheckBox, N_("Highlight Last Move") }, -{ 0, 0, 0, NULL, (void*) &appData.highlightMoveWithArrow, "", NULL, CheckBox, N_("Highlight with Arrow") }, -{ 0, 0, 0, NULL, (void*) &appData.oneClick, "", NULL, CheckBox, N_("One-Click Moving") }, -{ 0, 0, 0, NULL, (void*) &appData.periodicUpdates, "", NULL, CheckBox, N_("Periodic Updates (in Analysis Mode)") }, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" }, -{ 0, 0, 0, NULL, (void*) &appData.autoExtend, "", NULL, CheckBox, N_("Play Move(s) of Clicked PV (Analysis)") }, -{ 0, 0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, N_("Ponder Next Move") }, -{ 0, 0, 0, NULL, (void*) &appData.popupExitMessage, "", NULL, CheckBox, N_("Popup Exit Messages") }, -{ 0, 0, 0, NULL, (void*) &appData.popupMoveErrors, "", NULL, CheckBox, N_("Popup Move Errors") }, -{ 0, 0, 0, NULL, (void*) &appData.showEvalInMoveHistory, "", NULL, CheckBox, N_("Scores in Move List") }, -{ 0, 0, 0, NULL, (void*) &appData.showCoords, "", NULL, CheckBox, N_("Show Coordinates") }, -{ 0, 0, 0, NULL, (void*) &appData.markers, "", NULL, CheckBox, N_("Show Target Squares") }, -{ 0, 0, 0, NULL, (void*) &appData.useStickyWindows, "", NULL, CheckBox, N_("Sticky Windows") }, -{ 0, 0, 0, NULL, (void*) &appData.testLegality, "", NULL, CheckBox, N_("Test Legality") }, -{ 0, 0, 0, NULL, (void*) &appData.topLevel, "", NULL, CheckBox, N_("Top-Level Dialogs") }, -{ 0, 0,10, NULL, (void*) &appData.flashCount, "", NULL, Spin, N_("Flash Moves (0 = no flashing):") }, -{ 0, 1,10, NULL, (void*) &appData.flashRate, "", NULL, Spin, N_("Flash Rate (high = fast):") }, -{ 0, 5,100, NULL, (void*) &appData.animSpeed, "", NULL, Spin, N_("Animation Speed (high = slow):") }, -{ 0, 1,5, NULL, (void*) &appData.zoom, "", NULL, Spin, N_("Zoom factor in Evaluation Graph:") }, -{ 0, 0, 0, NULL, (void*) &GeneralOptionsOK, "", NULL, EndMark , "" } -}; - -void -OptionsProc () -{ - oldPonder = appData.ponderNextMove; - oldShow = appData.showCoords; oldBlind = appData.blindfold; - GenericPopUp(generalOptions, _("General Options"), TransientDlg, BoardWindow, MODAL, 0); -} - -//---------------------------------------------- New Variant ------------------------------------------------ - -static void Pick P((int n)); - -static char warning[MSG_SIZ]; -static int ranksTmp, filesTmp, sizeTmp; - -static Option variantDescriptors[] = { -{ VariantNormal, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("Normal")}, -{ VariantMakruk, SAME_ROW, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("Makruk")}, -{ VariantFischeRandom, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("FRC")}, -{ VariantShatranj,SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("Shatranj")}, -{ VariantWildCastle, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("Wild castle")}, -{ VariantKnightmate,SAME_ROW,135,NULL,(void*) &Pick, "#FFFFFF", NULL, Button, N_("Knightmate")}, -{ VariantNoCastle, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("No castle")}, -{ VariantCylinder,SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("Cylinder *")}, -{ Variant3Check, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("3-checks")}, -{ VariantBerolina,SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("berolina *")}, -{ VariantAtomic, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("atomic")}, -{ VariantTwoKings,SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("two kings")}, -{ -1, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment -{ VariantSpartan,SAME_ROW, 135, NULL, (void*) &Pick, "#FF0000", NULL, Button, N_("Spartan")}, -{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("Board size ( -1 = default for selected variant):")}, -{ 0, -1, BOARD_RANKS-1, NULL, (void*) &ranksTmp, "", NULL, Spin, N_("Number of Board Ranks:") }, -{ 0, -1, BOARD_FILES, NULL, (void*) &filesTmp, "", NULL, Spin, N_("Number of Board Files:") }, -{ 0, -1, BOARD_RANKS-1, NULL, (void*) &sizeTmp, "", NULL, Spin, N_("Holdings Size:") }, -{ 0, 0, 275, NULL, NULL, NULL, NULL, Label, warning }, -{ 0, 0, 275, NULL, NULL, NULL, NULL, Label, N_("Variants marked with * can only be played\nwith legality testing off.")}, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, ""}, -{ VariantASEAN, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_("ASEAN")}, -{ VariantGreat, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("Great Shatranj (10x8)")}, -{ VariantSChess, 0, 135, NULL, (void*) &Pick, "#FFBFBF", NULL, Button, N_("Seirawan")}, -{ VariantFalcon, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("Falcon (10x8)")}, -{ VariantSuper, 0, 135, NULL, (void*) &Pick, "#FFBFBF", NULL, Button, N_("Superchess")}, -{ VariantCapablanca,SAME_ROW,135,NULL,(void*) &Pick, "#BFBFFF", NULL, Button, N_("Capablanca (10x8)")}, -{ VariantCrazyhouse, 0, 135, NULL, (void*) &Pick, "#FFBFBF", NULL, Button, N_("Crazyhouse")}, -{ VariantGothic, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("Gothic (10x8)")}, -{ VariantBughouse, 0, 135, NULL, (void*) &Pick, "#FFBFBF", NULL, Button, N_("Bughouse")}, -{ VariantJanus, SAME_ROW, 135, NULL, (void*) &Pick, "#BFBFFF", NULL, Button, N_("Janus (10x8)")}, -{ VariantSuicide, 0, 135, NULL, (void*) &Pick, "#FFFFBF", NULL, Button, N_("Suicide")}, -{ VariantCapaRandom,SAME_ROW,135,NULL,(void*) &Pick, "#BFBFFF", NULL, Button, N_("CRC (10x8)")}, -{ VariantGiveaway, 0, 135, NULL, (void*) &Pick, "#FFFFBF", NULL, Button, N_("give-away")}, -{ VariantGrand, SAME_ROW, 135, NULL, (void*) &Pick, "#5070FF", NULL, Button, N_("grand (10x10)")}, -{ VariantLosers, 0, 135, NULL, (void*) &Pick, "#FFFFBF", NULL, Button, N_("losers")}, -{ VariantShogi, SAME_ROW, 135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("shogi (9x9)")}, -{ VariantFairy, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("fairy")}, -{ VariantXiangqi, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("xiangqi (9x10)")}, -{ VariantLion, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("mighty lion")}, -{ VariantCourier, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFBF", NULL, Button, N_("courier (12x8)")}, -{ VariantChuChess, 0, 135, NULL, (void*) &Pick, "#BFBFBF", NULL, Button, N_("elven chess (10x10)")}, -{ VariantChu, SAME_ROW, 135, NULL, (void*) &Pick, "#BFFFBF", NULL, Button, N_("chu shogi (12x12)")}, -//{ -1, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment -// optional buttons for engine-defined variants -{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" }, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Skip, ""}, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, Skip, NULL }, -{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } -}; - -static void -Pick (int n) -{ - VariantClass v = variantDescriptors[n].value; - if(v == VariantUnknown) safeStrCpy(engineVariant, variantDescriptors[n].name, MSG_SIZ); else *engineVariant = NULLCHAR; - GenericReadout(variantDescriptors, -1); // read new ranks and file settings - if(!appData.noChessProgram) { - char buf[MSG_SIZ]; - if (!SupportedVariant(first.variants, v, filesTmp, ranksTmp, sizeTmp, first.protocolVersion, first.tidy)) { - DisplayError(variantError, 0); - return; /* ignore OK if first engine does not support it */ - } else - if (second.initDone && - !SupportedVariant(second.variants, v, filesTmp, ranksTmp, sizeTmp, second.protocolVersion, second.tidy)) { - snprintf(buf, MSG_SIZ, _("Warning: second engine (%s) does not support this!"), second.tidy); - DisplayError(buf, 0); /* use of second engine is optional; only warn user */ - } - } - - gameInfo.variant = v; - ASSIGN(appData.variant, VariantName(v)); - - shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */ - startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */ - appData.fischerCastling = FALSE; /* [HGM] fischer: no longer valid in new variant */ - appData.NrRanks = ranksTmp; - appData.NrFiles = filesTmp; - appData.holdingsSize = sizeTmp; - appData.pieceToCharTable = NULL; - ASSIGN(appData.pieceNickNames, ""); - ASSIGN(appData.colorNickNames, ""); - ASSIGN(appData.men, ""); - PopDown(TransientDlg); - Reset(True, True); - return; -} - -void -NewVariantProc () -{ - static int start; - int i, last; - ranksTmp = filesTmp = sizeTmp = -1; // prefer defaults over actual settings - if(appData.noChessProgram) sprintf(warning, _("Only bughouse is not available in viewer mode.")); else - sprintf(warning, _("All variants not supported by the first engine\n(currently %s) are disabled."), first.tidy); - if(!start) { - while(variantDescriptors[start].type != EndMark) start++; // locate spares - start += 2; // conditional EndMark and Break - } - last = -1; - for(i=0; variantDescriptors[start+i].type != EndMark; i++) { // create buttons for engine-defined variants - char *v = EngineDefinedVariant(&first, i); - if(v) { - last = i; - ASSIGN(variantDescriptors[start+i].name, v); - variantDescriptors[start+i].type = Button; - } else variantDescriptors[start+i].type = Skip; - } - if(!(last&1)) { // odd number, add filler - ASSIGN(variantDescriptors[start+last+1].name, " "); - variantDescriptors[start+last+1].type = Button; - variantDescriptors[start+last+1].value = Skip; - } - variantDescriptors[start-2].type = (last < 0 ? EndMark : Skip); - variantDescriptors[start-1].type = (last < 6 ? Skip : Break); - safeStrCpy(engineVariant+100, engineVariant, 100); *engineVariant = NULLCHAR; // yeghh... - GenericPopUp(variantDescriptors, _("New Variant"), TransientDlg, BoardWindow, MODAL, 0); - safeStrCpy(engineVariant, engineVariant+100, MSG_SIZ); // must temporarily clear to avoid enabling all variant buttons -} - -//------------------------------------------- Common Engine Options ------------------------------------- - -static int oldCores; -static char *egtPath; - -static int -CommonOptionsOK (int n) -{ - int newPonder = appData.ponderNextMove; - if(*egtPath != '/' && strchr(egtPath, ':')) { - ASSIGN(appData.egtFormats, egtPath); - } else { - ASSIGN(appData.defaultPathEGTB, egtPath); - } - // make sure changes are sent to first engine by re-initializing it - // if it was already started pre-emptively at end of previous game - if(gameMode == BeginningOfGame) Reset(True, True); else { - // Some changed setting need immediate sending always. - if(oldCores != appData.smpCores) - NewSettingEvent(False, &(first.maxCores), "cores", appData.smpCores); - appData.ponderNextMove = oldPonder; - PonderNextMoveEvent(newPonder); - } - return 1; -} - -static Option commonEngineOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, N_("Ponder Next Move") }, -{ 0, 0, 1000, NULL, (void*) &appData.smpCores, "", NULL, Spin, N_("Maximum Number of CPUs per Engine:") }, -{ 0, 0, 0, NULL, (void*) &appData.polyglotDir, NULL, NULL, PathName, N_("Polygot Directory:") }, -{ 0, 0,16000, NULL, (void*) &appData.defaultHashSize, "", NULL, Spin, N_("Hash-Table Size (MB):") }, -{ 0, 0, 0, NULL, (void*) &egtPath, NULL, NULL, PathName, N_("EGTB Path:") }, -{ 0, 0, 1000, NULL, (void*) &appData.defaultCacheSizeEGTB, "", NULL, Spin, N_("EGTB Cache Size (MB):") }, -{ 0, 0, 0, NULL, (void*) &appData.usePolyglotBook, "", NULL, CheckBox, N_("Use GUI Book") }, -{ 0, 0, 0, NULL, (void*) &appData.polyglotBook, ".bin", NULL, FileName, N_("Opening-Book Filename:") }, -{ 0, 0, 100, NULL, (void*) &appData.bookDepth, "", NULL, Spin, N_("Book Depth (moves):") }, -{ 0, 0, 100, NULL, (void*) &appData.bookStrength, "", NULL, Spin, N_("Book Variety (0) vs. Strength (100):") }, -{ 0, 0, 0, NULL, (void*) &appData.firstHasOwnBookUCI, "", NULL, CheckBox, N_("Engine #1 Has Own Book") }, -{ 0, 0, 0, NULL, (void*) &appData.secondHasOwnBookUCI, "", NULL, CheckBox, N_("Engine #2 Has Own Book ") }, -{ 0,SAME_ROW,0,NULL, (void*) &CommonOptionsOK, "", NULL, EndMark , "" } -}; - -void -UciMenuProc () -{ - oldCores = appData.smpCores; - oldPonder = appData.ponderNextMove; - if(appData.egtFormats && *appData.egtFormats) { ASSIGN(egtPath, appData.egtFormats); } - else { ASSIGN(egtPath, appData.defaultPathEGTB); } - GenericPopUp(commonEngineOptions, _("Common Engine Settings"), TransientDlg, BoardWindow, MODAL, 0); -} - -//------------------------------------------ Adjudication Options -------------------------------------- - -static Option adjudicationOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.checkMates, "", NULL, CheckBox, N_("Detect all Mates") }, -{ 0, 0, 0, NULL, (void*) &appData.testClaims, "", NULL, CheckBox, N_("Verify Engine Result Claims") }, -{ 0, 0, 0, NULL, (void*) &appData.materialDraws, "", NULL, CheckBox, N_("Draw if Insufficient Mating Material") }, -{ 0, 0, 0, NULL, (void*) &appData.trivialDraws, "", NULL, CheckBox, N_("Adjudicate Trivial Draws (3-Move Delay)") }, -{ 0, 0,100, NULL, (void*) &appData.ruleMoves, "", NULL, Spin, N_("N-Move Rule:") }, -{ 0, 0, 6, NULL, (void*) &appData.drawRepeats, "", NULL, Spin, N_("N-fold Repeats:") }, -{ 0, 0,1000, NULL, (void*) &appData.adjudicateDrawMoves, "", NULL, Spin, N_("Draw after N Moves Total:") }, -{ 0, -5000,0, NULL, (void*) &appData.adjudicateLossThreshold, "", NULL, Spin, N_("Win / Loss Threshold:") }, -{ 0, 0, 0, NULL, (void*) &first.scoreIsAbsolute, "", NULL, CheckBox, N_("Negate Score of Engine #1") }, -{ 0, 0, 0, NULL, (void*) &second.scoreIsAbsolute, "", NULL, CheckBox, N_("Negate Score of Engine #2") }, -{ 0,SAME_ROW, 0, NULL, NULL, "", NULL, EndMark , "" } -}; - -void -EngineMenuProc () -{ - GenericPopUp(adjudicationOptions, _("Adjudicate non-ICS Games"), TransientDlg, BoardWindow, MODAL, 0); -} - -//--------------------------------------------- ICS Options --------------------------------------------- - -static int -IcsOptionsOK (int n) -{ - ParseIcsTextColors(); - return 1; -} - -Option icsOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.autoKibitz, "", NULL, CheckBox, N_("Auto-Kibitz") }, -{ 0, 0, 0, NULL, (void*) &appData.autoComment, "", NULL, CheckBox, N_("Auto-Comment") }, -{ 0, 0, 0, NULL, (void*) &appData.autoObserve, "", NULL, CheckBox, N_("Auto-Observe") }, -{ 0, 0, 0, NULL, (void*) &appData.autoRaiseBoard, "", NULL, CheckBox, N_("Auto-Raise Board") }, -{ 0, 0, 0, NULL, (void*) &appData.autoCreateLogon, "", NULL, CheckBox, N_("Auto-Create Logon Script") }, -{ 0, 0, 0, NULL, (void*) &appData.bgObserve, "", NULL, CheckBox, N_("Background Observe while Playing") }, -{ 0, 0, 0, NULL, (void*) &appData.dualBoard, "", NULL, CheckBox, N_("Dual Board for Background-Observed Game") }, -{ 0, 0, 0, NULL, (void*) &appData.getMoveList, "", NULL, CheckBox, N_("Get Move List") }, -{ 0, 0, 0, NULL, (void*) &appData.quietPlay, "", NULL, CheckBox, N_("Quiet Play") }, -{ 0, 0, 0, NULL, (void*) &appData.seekGraph, "", NULL, CheckBox, N_("Seek Graph") }, -{ 0, 0, 0, NULL, (void*) &appData.autoRefresh, "", NULL, CheckBox, N_("Auto-Refresh Seek Graph") }, -{ 0, 0, 0, NULL, (void*) &appData.autoBox, "", NULL, CheckBox, N_("Auto-InputBox PopUp") }, -{ 0, 0, 0, NULL, (void*) &appData.quitNext, "", NULL, CheckBox, N_("Quit after game") }, -{ 0, 0, 0, NULL, (void*) &appData.premove, "", NULL, CheckBox, N_("Premove") }, -{ 0, 0, 0, NULL, (void*) &appData.premoveWhite, "", NULL, CheckBox, N_("Premove for White") }, -{ 0, 0, 0, NULL, (void*) &appData.premoveWhiteText, "", NULL, TextBox, N_("First White Move:") }, -{ 0, 0, 0, NULL, (void*) &appData.premoveBlack, "", NULL, CheckBox, N_("Premove for Black") }, -{ 0, 0, 0, NULL, (void*) &appData.premoveBlackText, "", NULL, TextBox, N_("First Black Move:") }, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" }, -{ 0, 0, 0, NULL, (void*) &appData.icsAlarm, "", NULL, CheckBox, N_("Alarm") }, -{ 0, 0, 100000000, NULL, (void*) &appData.icsAlarmTime, "", NULL, Spin, N_("Alarm Time (msec):") }, -//{ 0, 0, 0, NULL, (void*) &appData.chatBoxes, "", NULL, TextBox, N_("Startup Chat Boxes:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorize, "", NULL, CheckBox, N_("Colorize Messages") }, -{ 0, 0, 0, NULL, (void*) &appData.colorShout, "", NULL, TextBox, N_("Shout Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorSShout, "", NULL, TextBox, N_("S-Shout Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorChannel1, "", NULL, TextBox, N_("Channel #1 Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorChannel, "", NULL, TextBox, N_("Other Channel Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorKibitz, "", NULL, TextBox, N_("Kibitz Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorTell, "", NULL, TextBox, N_("Tell Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorChallenge, "", NULL, TextBox, N_("Challenge Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorRequest, "", NULL, TextBox, N_("Request Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorSeek, "", NULL, TextBox, N_("Seek Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &appData.colorNormal, "", NULL, TextBox, N_("Other Text Colors:") }, -{ 0, 0, 0, NULL, (void*) &IcsOptionsOK, "", NULL, EndMark , "" } -}; - -void -IcsOptionsProc () -{ - GenericPopUp(icsOptions, _("ICS Options"), TransientDlg, BoardWindow, MODAL, 0); -} - -//-------------------------------------------- Load Game Options --------------------------------- - -static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"), - N_("Same material"), N_("Material range (top board half optional)"), N_("Material difference (optional stuff balanced)"), NULL }; -static char *modeValues[] = { "1", "2", "3", "4", "5", "6" }; -static char *searchMode, *countRange; - -static int -LoadOptionsOK () -{ - appData.minPieces = appData.maxPieces = 0; - sscanf(countRange, "%d-%d", &appData.minPieces, &appData.maxPieces); - if(appData.maxPieces < appData.minPieces) appData.maxPieces = appData.minPieces; - appData.searchMode = atoi(searchMode); - return 1; -} - -static Option loadOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.autoDisplayTags, "", NULL, CheckBox, N_("Auto-Display Tags") }, -{ 0, 0, 0, NULL, (void*) &appData.autoDisplayComment, "", NULL, CheckBox, N_("Auto-Display Comment") }, -{ 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("Auto-Play speed of loaded games\n(0 = instant, -1 = off):") }, -{ 0, -1,10000000, NULL, (void*) &appData.timeDelay, "", NULL, Fractional, N_("Seconds per Move:") }, -{ 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("\noptions to use in game-viewer mode:") }, -{ 0, 0,300, NULL, (void*) &appData.viewerOptions, "", NULL, TextBox, "" }, -{ 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("\nThresholds for position filtering in game list:") }, -{ 0, 0,5000, NULL, (void*) &appData.eloThreshold1, "", NULL, Spin, N_("Elo of strongest player at least:") }, -{ 0, 0,5000, NULL, (void*) &appData.eloThreshold2, "", NULL, Spin, N_("Elo of weakest player at least:") }, -{ 0, 0,5000, NULL, (void*) &appData.dateThreshold, "", NULL, Spin, N_("No games before year:") }, -{ 0, 1,50, NULL, (void*) &appData.stretch, "", NULL, Spin, N_("Minimum nr consecutive positions:") }, -{ 0, 0,197, NULL, (void*) &countRange, "", NULL, TextBox, "Final nr of pieces" }, -{ 0, 0,205, NULL, (void*) &searchMode, (char*) modeValues, modeNames, ComboBox, N_("Search mode:") }, -{ 0, 0, 0, NULL, (void*) &appData.ignoreColors, "", NULL, CheckBox, N_("Also match reversed colors") }, -{ 0, 0, 0, NULL, (void*) &appData.findMirror, "", NULL, CheckBox, N_("Also match left-right flipped position") }, -{ 0, 0, 0, NULL, (void*) &LoadOptionsOK, "", NULL, EndMark , "" } -}; - -void -LoadOptionsPopUp (DialogClass parent) -{ - ASSIGN(countRange, ""); - ASSIGN(searchMode, modeValues[appData.searchMode-1]); - GenericPopUp(loadOptions, _("Load Game Options"), TransientDlg, parent, MODAL, 0); -} - -void -LoadOptionsProc () -{ // called from menu - LoadOptionsPopUp(BoardWindow); -} - -//------------------------------------------- Save Game Options -------------------------------------------- - -static Option saveOptions[] = { -{ 0, 0, 0, NULL, (void*) &appData.autoSaveGames, "", NULL, CheckBox, N_("Auto-Save Games") }, -{ 0, 0, 0, NULL, (void*) &appData.onlyOwn, "", NULL, CheckBox, N_("Own Games Only") }, -{ 0, 0, 0, NULL, (void*) &appData.saveGameFile, ".pgn", NULL, FileName, N_("Save Games on File:") }, -{ 0, 0, 0, NULL, (void*) &appData.savePositionFile, ".fen", NULL, FileName, N_("Save Final Positions on File:") }, -{ 0, 0, 0, NULL, (void*) &appData.pgnEventHeader, "", NULL, TextBox, N_("PGN Event Header:") }, -{ 0, 0, 0, NULL, (void*) &appData.oldSaveStyle, "", NULL, CheckBox, N_("Old Save Style (as opposed to PGN)") }, -{ 0, 0, 0, NULL, (void*) &appData.numberTag, "", NULL, CheckBox, N_("Include Number Tag in tourney PGN") }, -{ 0, 0, 0, NULL, (void*) &appData.saveExtendedInfoInPGN, "", NULL, CheckBox, N_("Save Score/Depth Info in PGN") }, -{ 0, 0, 0, NULL, (void*) &appData.saveOutOfBookInfo, "", NULL, CheckBox, N_("Save Out-of-Book Info in PGN ") }, -{ 0, SAME_ROW, 0, NULL, NULL, "", NULL, EndMark , "" } -}; - -void -SaveOptionsProc () -{ - GenericPopUp(saveOptions, _("Save Game Options"), TransientDlg, BoardWindow, MODAL, 0); -} - -//----------------------------------------------- Sound Options --------------------------------------------- - -static void Test P((int n)); -static char *trialSound; - -static char *soundNames[] = { - N_("No Sound"), - N_("Default Beep"), - N_("Above WAV File"), - N_("Car Horn"), - N_("Cymbal"), - N_("Ding"), - N_("Gong"), - N_("Laser"), - N_("Penalty"), - N_("Phone"), - N_("Pop"), - N_("Roar"), - N_("Slap"), - N_("Wood Thunk"), - NULL, - N_("User File") -}; - -static char *soundFiles[] = { // sound files corresponding to above names - "", - "$", - NULL, // kludge alert: as first thing in the dialog readout this is replaced with the user-given .WAV filename - "honkhonk.wav", - "cymbal.wav", - "ding1.wav", - "gong.wav", - "laser.wav", - "penalty.wav", - "phone.wav", - "pop2.wav", - "roar.wav", - "slap.wav", - "woodthunk.wav", - NULL, - NULL -}; - -static Option soundOptions[] = { -{ 0, 0, 0, NULL, (void*) (soundFiles+2) /* kludge! */, ".wav", NULL, FileName, N_("User WAV File:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundProgram, "", NULL, TextBox, N_("Sound Program:") }, -{ 0, 0, 0, NULL, (void*) &trialSound, (char*) soundFiles, soundNames, ComboBox, N_("Try-Out Sound:") }, -{ 0, SAME_ROW, 0, NULL, (void*) &Test, NULL, NULL, Button, N_("Play") }, -{ 0, 0, 0, NULL, (void*) &appData.soundMove, (char*) soundFiles, soundNames, ComboBox, N_("Move:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundIcsWin, (char*) soundFiles, soundNames, ComboBox, N_("Win:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundIcsLoss, (char*) soundFiles, soundNames, ComboBox, N_("Lose:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundIcsDraw, (char*) soundFiles, soundNames, ComboBox, N_("Draw:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundIcsUnfinished, (char*) soundFiles, soundNames, ComboBox, N_("Unfinished:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundIcsAlarm, (char*) soundFiles, soundNames, ComboBox, N_("Alarm:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundChallenge, (char*) soundFiles, soundNames, ComboBox, N_("Challenge:") }, -{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" }, -{ 0, 0, 0, NULL, (void*) &appData.soundDirectory, "", NULL, PathName, N_("Sounds Directory:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundShout, (char*) soundFiles, soundNames, ComboBox, N_("Shout:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundSShout, (char*) soundFiles, soundNames, ComboBox, N_("S-Shout:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundChannel, (char*) soundFiles, soundNames, ComboBox, N_("Channel:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundChannel1, (char*) soundFiles, soundNames, ComboBox, N_("Channel 1:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundTell, (char*) soundFiles, soundNames, ComboBox, N_("Tell:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundKibitz, (char*) soundFiles, soundNames, ComboBox, N_("Kibitz:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundRequest, (char*) soundFiles, soundNames, ComboBox, N_("Request:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundRoar, (char*) soundFiles, soundNames, ComboBox, N_("Lion roar:") }, -{ 0, 0, 0, NULL, (void*) &appData.soundSeek, (char*) soundFiles, soundNames, ComboBox, N_("Seek:") }, -{ 0, SAME_ROW, 0, NULL, NULL, "", NULL, EndMark , "" } -}; - -static void -Test (int n) -{ - GenericReadout(soundOptions, 1); - if(soundFiles[values[2]]) PlaySoundFile(soundFiles[values[2]]); -} - -void -SoundOptionsProc () -{ - free(soundFiles[2]); - soundFiles[2] = strdup("*"); - GenericPopUp(soundOptions, _("Sound Options"), TransientDlg, BoardWindow, MODAL, 0); -} - -//--------------------------------------------- Board Options -------------------------------------- - -static void DefColor P((int n)); -static void AdjustColor P((int i)); -static void ThemeSel P((int n, int sel)); -static int BoardOptionsOK P((int n)); - -static char oldPieceDir[MSG_SIZ]; -extern char *engineLine, *nickName; // defined later on - -#define THEMELIST 1 - -static Option boardOptions[] = { -{ 0,LR|T2T, 0, NULL, NULL, NULL, NULL, Label, N_("Selectable themes:") }, -{ 300,LR|TB,200, NULL, (void*) engineMnemonic, (char*) &ThemeSel, NULL, ListBox, "" }, -{ 0,LR|T2T, 0, NULL, NULL, NULL, NULL, Label, N_("New name for current theme:") }, -{ 0, 0, 0, NULL, (void*) &nickName, "", NULL, TextBox, "" }, -{ 0,SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, NULL }, -{ 0, 0, 70, NULL, (void*) &appData.whitePieceColor, "", NULL, TextBox, N_("White Piece Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#FFFFCC", Button, " " }, -/* TRANSLATORS: R = single letter for the color red */ -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -/* TRANSLATORS: G = single letter for the color green */ -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -/* TRANSLATORS: B = single letter for the color blue */ -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -/* TRANSLATORS: D = single letter to make a color darker */ -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 70, NULL, (void*) &appData.blackPieceColor, "", NULL, TextBox, N_("Black Piece Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#202020", Button, " " }, -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 70, NULL, (void*) &appData.lightSquareColor, "", NULL, TextBox, N_("Light Square Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#C8C365", Button, " " }, -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 70, NULL, (void*) &appData.darkSquareColor, "", NULL, TextBox, N_("Dark Square Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#77A26D", Button, " " }, -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 70, NULL, (void*) &appData.highlightSquareColor, "", NULL, TextBox, N_("Highlight Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#FFFF00", Button, " " }, -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 70, NULL, (void*) &appData.premoveHighlightColor, "", NULL, TextBox, N_("Premove Highlight Color:") }, -{ 1000, SAME_ROW, 0, NULL, (void*) &DefColor, NULL, (char**) "#FF0000", Button, " " }, -{ 1, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("R") }, -{ 2, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("G") }, -{ 3, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("B") }, -{ 4, SAME_ROW, 0, NULL, (void*) &AdjustColor, NULL, NULL, Button, N_("D") }, -{ 0, 0, 0, NULL, (void*) &appData.upsideDown, "", NULL, CheckBox, N_("Flip Pieces Shogi Style (Colored buttons restore default)") }, -//{ 0, 0, 0, NULL, (void*) &appData.allWhite, "", NULL, CheckBox, N_("Use Outline Pieces for Black") }, -{ 0, 0, 0, NULL, (void*) &appData.monoMode, "", NULL, CheckBox, N_("Mono Mode") }, -{ 0, 0, 200, NULL, (void*) &appData.logoSize, "", NULL, Spin, N_("Logo Size (0=off, requires restart):") }, -{ 0,-1, 5, NULL, (void*) &appData.overrideLineGap, "", NULL, Spin, N_("Line Gap (-1 = default for board size):") }, -{ 0, 0, 0, NULL, (void*) &appData.useBitmaps, "", NULL, CheckBox, N_("Use Board Textures") }, -{ 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".png", NULL, FileName, N_("Light-Squares Texture File:") }, -{ 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".png", NULL, FileName, N_("Dark-Squares Texture File:") }, -{ 0, 0, 0, NULL, (void*) &appData.trueColors, "", NULL, CheckBox, N_("Use external piece bitmaps with their own colors") }, -{ 0, 0, 0, NULL, (void*) &appData.pieceDirectory, "", NULL, PathName, N_("Directory with Pieces Images:") }, -{ 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" } -}; - -static int -BoardOptionsOK (int n) -{ - if(n && (n = SelectedListBoxItem(&boardOptions[THEMELIST])) > 0 && *engineList[n] != '#') { // called by pressing OK, and theme selected - ASSIGN(engineLine, engineList[n]); - } - LoadTheme(); - return 1; -} - -static void -SetColorText (int n, char *buf) -{ - SetWidgetText(&boardOptions[n-1], buf, TransientDlg); - SetColor(buf, &boardOptions[n]); -} - -static void -DefColor (int n) -{ - SetColorText(n, (char*) boardOptions[n].choice); -} - -void -RefreshColor (int source, int n) -{ - int col, j, r, g, b, step = 10; - char *s, buf[MSG_SIZ]; // color string - GetWidgetText(&boardOptions[source], &s); - if(sscanf(s, "#%x", &col) != 1) return; // malformed - b = col & 0xFF; g = col & 0xFF00; r = col & 0xFF0000; - switch(n) { - case 1: r += 0x10000*step;break; - case 2: g += 0x100*step; break; - case 3: b += step; break; - case 4: r -= 0x10000*step; g -= 0x100*step; b -= step; break; - } - if(r < 0) r = 0; if(g < 0) g = 0; if(b < 0) b = 0; - if(r > 0xFF0000) r = 0xFF0000; if(g > 0xFF00) g = 0xFF00; if(b > 0xFF) b = 0xFF; - col = r | g | b; - snprintf(buf, MSG_SIZ, "#%06x", col); - for(j=1; j<7; j++) if(buf[j] >= 'a') buf[j] -= 32; // capitalize - SetColorText(source+1, buf); -} - -static void -AdjustColor (int i) -{ - int n = boardOptions[i].value; - RefreshColor(i-n-1, n); -} - -void -ThemeSel (int n, int sel) -{ - int nr; - char buf[MSG_SIZ]; - if(sel < 1) buf[0] = NULLCHAR; // back to top level - else if(engineList[sel][0] == '#') safeStrCpy(buf, engineList[sel], MSG_SIZ); // group header, open group - else { // normal line, select engine - ASSIGN(engineLine, engineList[sel]); - LoadTheme(); - PopDown(TransientDlg); - return; - } - nr = NamesToList(appData.themeNames, engineList, engineMnemonic, buf); // replace list by only the group contents - ASSIGN(engineMnemonic[0], buf); - LoadListBox(&boardOptions[THEMELIST], _("# no themes are defined"), -1, -1); - HighlightWithScroll(&boardOptions[THEMELIST], 0, nr); -} - -void -BoardOptionsProc () -{ - strncpy(oldPieceDir, appData.pieceDirectory, MSG_SIZ-1); // to see if it changed - ASSIGN(engineLine, ""); - ASSIGN(nickName, ""); - ASSIGN(engineMnemonic[0], ""); - NamesToList(appData.themeNames, engineList, engineMnemonic, ""); - GenericPopUp(boardOptions, _("Board Options"), TransientDlg, BoardWindow, MODAL, 0); -} - -//-------------------------------------------- ICS Text Menu Options ------------------------------ - -Option textOptions[100]; -static void PutText P((char *text, int pos)); -static void NewChat P((char *name)); -static char clickedWord[MSG_SIZ], click; - -void -SendString (char *p) -{ - char buf[MSG_SIZ], buf2[MSG_SIZ], *q; - if(q = strstr(p, "$name")) { // in Xaw this is already intercepted - if(!shellUp[TextMenuDlg] || !clickedWord[0]) return; - strncpy(buf2, p, MSG_SIZ); - snprintf(buf2 + (q-p), MSG_SIZ -(q-p), "%s%s", clickedWord, q+5); - p = buf2; - } - if(!strcmp(p, "$copy")) { // special case for copy selection - CopySomething(clickedWord); - } else - if(!strcmp(p, "$chat")) { // special case for opening chat - NewChat(clickedWord); - } else - if(q = strstr(p, "$input")) { - if(!shellUp[TextMenuDlg]) return; - strncpy(buf, p, MSG_SIZ); - strncpy(buf + (q-p), q+6, MSG_SIZ-(q-p)); - PutText(buf, q-p); - } else { - snprintf(buf, MSG_SIZ, "%s\n", p); - SendToICS(buf); - } - if(click) { // popped up by memo click - click = clickedWord[0] = 0; - PopDown(TextMenuDlg); - } -} - -void -IcsTextPopUp () -{ - int i=0, j; - char *p, *q, *r; - if((p = icsTextMenuString) == NULL) return; - do { - q = r = p; while(*p && *p != ';') p++; - if(textOptions[i].name == NULL) textOptions[i].name = (char*) malloc(MSG_SIZ); - for(j=0; jnrOptions) { DisplayNote(_("Engine has no options")); return; } - currentCps = cps; - GenericPopUp(cps->option, _("Engine Settings"), TransientDlg, BoardWindow, MODAL, 0); -} - -void -FirstSettingsProc () -{ - SettingsPopUp(&first); -} - -void -SecondSettingsProc () -{ - if(WaitForEngine(&second, SettingsMenuIfReady)) return; - SettingsPopUp(&second); -} - -void -RefreshSettingsDialog (ChessProgramState *cps, int val) -{ - if(val == 1) { // option values changed - if(shellUp[TransientDlg] && cps == currentCps) { - GenericUpdate(cps->option, -1); // normally update values when dialog is up - } - return; // and be done - } - if(val == 2) { // option list changed - if(!shellUp[TransientDlg] || cps != currentCps) return; // our dialog is not up, so nothing to do - } - PopDown(TransientDlg); // make sure any other dialog closes first - SettingsPopUp(cps); // and popup new one -} - -//----------------------------------------------- Load Engine -------------------------------------- - -char *engineDir, *engineLine, *nickName, *params; -Boolean isUCI, isUSI, hasBook, storeVariant, v1, addToList, useNick, secondEng; - -static void EngSel P((int n, int sel)); -static int InstallOK P((int n)); - -static Option installOptions[] = { -{ 0,LR|T2T, 0, NULL, NULL, NULL, NULL, Label, N_("Select engine from list:") }, -{ 300,LR|TB,200, NULL, (void*) engineMnemonic, (char*) &EngSel, NULL, ListBox, "" }, -{ 0,SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, NULL }, -{ 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("or specify one below:") }, -{ 0, 0, 0, NULL, (void*) &nickName, NULL, NULL, TextBox, N_("Nickname (optional):") }, -{ 0, 0, 0, NULL, (void*) &useNick, NULL, NULL, CheckBox, N_("Use nickname in PGN player tags of engine-engine games") }, -{ 0, 0, 0, NULL, (void*) &engineDir, NULL, NULL, PathName, N_("Engine Directory:") }, -{ 0, 0, 0, NULL, (void*) &engineName, NULL, NULL, FileName, N_("Engine Command:") }, -{ 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("(Directory will be derived from engine path when empty)") }, -{ 0, 0, 0, NULL, (void*) &isUCI, NULL, NULL, CheckBox, N_("UCI") }, -{ 0, 0, 0, NULL, (void*) &isUSI, NULL, NULL, CheckBox, N_("USI/UCCI (uses specified -uxiAdapter)") }, -{ 0, 0, 0, NULL, (void*) &v1, NULL, NULL, CheckBox, N_("WB protocol v1 (do not wait for engine features)") }, -{ 0, 0, 0, NULL, (void*) &hasBook, NULL, NULL, CheckBox, N_("Must not use GUI book") }, -{ 0, 0, 0, NULL, (void*) &addToList, NULL, NULL, CheckBox, N_("Add this engine to the list") }, -{ 0, 0, 0, NULL, (void*) &storeVariant, NULL, NULL, CheckBox, N_("Force current variant with this engine") }, -{ 0, 0, 0, NULL, (void*) &InstallOK, "", NULL, EndMark , "" } -}; - -static int -InstallOK (int n) -{ - if(n && (n = SelectedListBoxItem(&installOptions[1])) > 0) { // called by pressing OK, and engine selected - ASSIGN(engineLine, engineList[n]); - } - PopDown(TransientDlg); // early popdown, to allow FreezeUI to instate grab - if(isUSI) { - isUCI = 2; // kludge to pass isUSI to Load() - if(!*appData.ucciAdapter) { ASSIGN(appData.ucciAdapter, "usi2wb -%variant \"%fcp\"\"%fd\""); } // make sure -uxiAdapter is defined - } - if(!secondEng) Load(&first, 0); else Load(&second, 1); - return FALSE; // no double PopDown! -} - -static void -EngSel (int n, int sel) -{ - int nr; - char buf[MSG_SIZ]; - if(sel < 1) buf[0] = NULLCHAR; // back to top level - else if(engineList[sel][0] == '#') safeStrCpy(buf, engineList[sel], MSG_SIZ); // group header, open group - else { // normal line, select engine - ASSIGN(engineLine, engineList[sel]); - InstallOK(0); - return; - } - nr = NamesToList(firstChessProgramNames, engineList, engineMnemonic, buf); // replace list by only the group contents - ASSIGN(engineMnemonic[0], buf); - LoadListBox(&installOptions[1], _("# no engines are installed"), -1, -1); - HighlightWithScroll(&installOptions[1], 0, nr); -} - -static void -LoadEngineProc (int engineNr, char *title) -{ - isUCI = isUSI = storeVariant = v1 = useNick = False; addToList = hasBook = True; // defaults - secondEng = engineNr; - if(engineLine) free(engineLine); engineLine = strdup(""); - if(engineDir) free(engineDir); engineDir = strdup("."); - if(nickName) free(nickName); nickName = strdup(""); - if(params) free(params); params = strdup(""); - ASSIGN(engineMnemonic[0], ""); - NamesToList(firstChessProgramNames, engineList, engineMnemonic, ""); - GenericPopUp(installOptions, title, TransientDlg, BoardWindow, MODAL, 0); -} - -void -LoadEngine1Proc () -{ - LoadEngineProc (0, _("Load first engine")); -} - -void -LoadEngine2Proc () -{ - LoadEngineProc (1, _("Load second engine")); -} - -//----------------------------------------------------- Edit Book ----------------------------------------- - -void -EditBookProc () -{ - EditBookEvent(); -} - -//--------------------------------------------------- New Shuffle Game ------------------------------ - -static void SetRandom P((int n)); - -static int -ShuffleOK (int n) -{ - ResetGameEvent(); - return 1; -} - -static Option shuffleOptions[] = { - { 0, 0, 0, NULL, (void*) &shuffleOpenings, NULL, NULL, CheckBox, N_("shuffle") }, - { 0, 0, 0, NULL, (void*) &appData.fischerCastling, NULL, NULL, CheckBox, N_("Fischer castling") }, - { 0,-1,2000000000, NULL, (void*) &appData.defaultFrcPosition, "", NULL, Spin, N_("Start-position number:") }, - { 0, 0, 0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("randomize") }, - { 0, SAME_ROW, 0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("pick fixed") }, - { 0,SAME_ROW, 0, NULL, (void*) &ShuffleOK, "", NULL, EndMark , "" } -}; - -static void -SetRandom (int n) -{ - int r = n==3 ? -1 : random() & (1<<30)-1; - char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%d", r); - SetWidgetText(&shuffleOptions[2], buf, TransientDlg); - SetWidgetState(&shuffleOptions[0], True); -} - -void -ShuffleMenuProc () -{ - GenericPopUp(shuffleOptions, _("New Shuffle Game"), TransientDlg, BoardWindow, MODAL, 0); -} - -//--------------------------------------------------- Fonts ------------------------------ - -static void AdjustFont P((int n)); - -static char *oldFont[7]; - -static int -NewFont (int n, int fnr, char *font) -{ // figure out if font changed, and if so, store it in the fonts table as a side effect - if(!strcmp(oldFont[n], font)) return 0; // not changed - ASSIGN(fontTable[fnr][initialSquareSize], font); - fontIsSet[fnr] = fontValid[fnr][initialSquareSize] = True; - return 1; // changed -} - -static int -FontsOK (int n) -{ - int i; - PopDown(TransientDlg); // Early popdown to prevent expose events frommasking each other - LockBoardSize(0); - if(NewFont(0, CLOCK_FONT, appData.clockFont)) DisplayBothClocks(); - if(NewFont(1, MESSAGE_FONT, appData.font)) { - ApplyFont(&mainOptions[W_MESSG], NULL); - for(i=1; i<6; i++) ApplyFont(&mainOptions[W_BUTTON+i], NULL); - } - LockBoardSize(1); // unlock - if(NewFont(3, EDITTAGS_FONT, appData.tagsFont)) ApplyFont(&tagsOptions[1], NULL); - if(NewFont(4, COMMENT_FONT, appData.commentFont)) ApplyFont(&commentOptions[0], NULL); - if(NewFont(5, MOVEHISTORY_FONT, appData.historyFont)) { - ApplyFont(&historyOptions[0], NULL); - ApplyFont(&engoutOptions[5], NULL); - ApplyFont(&engoutOptions[12], NULL); - } - if(NewFont(6, GAMELIST_FONT, appData.gameListFont)) ApplyFont(&gamesOptions[0], NULL); - if(NewFont(2, CONSOLE_FONT, appData.icsFont)) { - ApplyFont(&chatOptions[11], appData.icsFont); - AppendColorized(&chatOptions[6], NULL, 0); // kludge to replace font tag - } - DrawPosition(TRUE, NULL); // for coord font - return 0; // suppress normal popdown because already done -} - -static Option fontOptions[] = { - { 0, 60, 200, NULL, (void*) &appData.clockFont, NULL, NULL, TextBox, N_("Clocks (requires restart):") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.font, NULL, NULL, TextBox, N_("Message (above board):") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.icsFont, NULL, NULL, TextBox, N_("ICS Chat/Console:") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.tagsFont, NULL, NULL, TextBox, N_("Edit tags / book / engine list:") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.commentFont, NULL, NULL, TextBox, N_("Edit comments:") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.historyFont, NULL, NULL, TextBox, N_("Move history / Engine Output:") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 60, 70, NULL, (void*) &appData.gameListFont, NULL, NULL, TextBox, N_("Game list:") }, - { 1, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("+") }, - { 2, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("-") }, - { 3, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("B") }, - { 4, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("I") }, - { 666, SAME_ROW, 0, NULL, (void*) &AdjustFont, NULL, NULL, Button, N_("*") }, - { 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("\nThe * buttons will set the font to the one selected below:") }, - { 0, 0, 0, NULL, NULL, NULL, NULL, Button, "fontsel" }, - { 0, 0, 0, NULL, (void*) &FontsOK, "", NULL, EndMark , "" } -}; - -static char name[MSG_SIZ], *bold, *ital, points; - -static void -BreakUp (char *font) -{ - char *p = name, *norm; - safeStrCpy(name, font, MSG_SIZ); - bold = StrCaseStr(name, "bold"); - ital = StrCaseStr(name, "ital"); - norm = StrCaseStr(name, "normal"); - points = 0; - while(p && *p && !(points = atoi(p))) p = strchr(p+1, ' '); - if(points) p[*p == ' '] = 0; - if(bold) *bold = 0; - if(ital) *ital = 0; - if(norm) *norm = 0; -} - -static void -Collect () -{ - if(bold) strcat(name, "Bold "); - if(ital) strcat(name, "Italic "); - if(!ital && !bold && strlen(name) < 2) strncpy(name, "Normal ", MSG_SIZ); - if(points) sprintf(name + strlen(name), "%d", points); else strcat(name, "%d"); -} - -static void -AdjustFont (int n) -{ - int button = fontOptions[n].value, base = n - button; - char *oldFont; - GetWidgetText(&fontOptions[base], &oldFont); - BreakUp(oldFont); // take apart old font name - switch(button) { - case 1: points++; break; - case 2: points--; break; - case 3: if(bold) bold = NULL; else bold = name; break; - case 4: if(ital) ital = NULL; else ital = name; break; - } - Collect(); - SetWidgetText(&fontOptions[base], name, TransientDlg); - ApplyFont(&fontOptions[base], name); -} - -void -FontsProc () -{ - int i; - if(strstr(appData.font, "-*-")) { DisplayNote(_("This only works in the GTK build")); return; } - GenericPopUp(fontOptions, _("Fonts"), TransientDlg, BoardWindow, MODAL, 0); - for(i=0; i<7; i++) { - ApplyFont(&fontOptions[6*i], *(char**)fontOptions[6*i].target); - ASSIGN(oldFont[i], *(char**)fontOptions[6*i].target); - } -} - -//------------------------------------------------------ Time Control ----------------------------------- - -static int TcOK P((int n)); -int tmpMoves, tmpTc, tmpInc, tmpOdds1, tmpOdds2, tcType, by60; - -static void SetTcType P((int n)); - -static char * -Value (int n) -{ - static char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%d", n); - return buf; -} - -static Option tcOptions[] = { -{ 0, 0, 0, NULL, (void*) &SetTcType, NULL, NULL, Button, N_("classical") }, -{ 0,SAME_ROW,0,NULL, (void*) &SetTcType, NULL, NULL, Button, N_("incremental") }, -{ 0,SAME_ROW,0,NULL, (void*) &SetTcType, NULL, NULL, Button, N_("fixed max") }, -{ 0, 0, 0, NULL, (void*) &by60, "", NULL, CheckBox, N_("Divide entered times by 60") }, -{ 0, 0, 200, NULL, (void*) &tmpMoves, NULL, NULL, Spin, N_("Moves per session:") }, -{ 0, 0,10000, NULL, (void*) &tmpTc, NULL, NULL, Spin, N_("Initial time (min):") }, -{ 0, 0, 10000, NULL, (void*) &tmpInc, NULL, NULL, Spin, N_("Increment or max (sec/move):") }, -{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("Time-Odds factors:") }, -{ 0, 1, 1000, NULL, (void*) &tmpOdds1, NULL, NULL, Spin, N_("Engine #1") }, -{ 0, 1, 1000, NULL, (void*) &tmpOdds2, NULL, NULL, Spin, N_("Engine #2 / Human") }, -{ 0, 0, 0, NULL, (void*) &TcOK, "", NULL, EndMark , "" } -}; - -static int -TcOK (int n) -{ - char *tc, buf[MSG_SIZ]; - if(tcType == 0 && tmpMoves <= 0) return 0; - if(tcType == 2 && tmpInc <= 0) return 0; - GetWidgetText(&tcOptions[5], &tc); // get original text, in case it is min:sec - if(by60) snprintf(buf, MSG_SIZ, "%d:%02d", tmpTc/60, tmpTc%60), tc=buf; - searchTime = 0; - switch(tcType) { - case 0: - if(!ParseTimeControl(tc, -1, tmpMoves)) return 0; - appData.movesPerSession = tmpMoves; - ASSIGN(appData.timeControl, tc); - appData.timeIncrement = -1; - break; - case 1: - if(!ParseTimeControl(tc, tmpInc, 0)) return 0; - ASSIGN(appData.timeControl, tc); - appData.timeIncrement = (by60 ? tmpInc/60. : tmpInc); - break; - case 2: - searchTime = (by60 ? tmpInc/60 : tmpInc); - } - appData.firstTimeOdds = first.timeOdds = tmpOdds1; - appData.secondTimeOdds = second.timeOdds = tmpOdds2; - Reset(True, True); - return 1; -} - -static void -SetTcType (int n) -{ - switch(tcType = n) { - case 0: - SetWidgetText(&tcOptions[4], Value(tmpMoves), TransientDlg); - SetWidgetText(&tcOptions[5], Value(tmpTc), TransientDlg); - SetWidgetText(&tcOptions[6], _("Unused"), TransientDlg); - break; - case 1: - SetWidgetText(&tcOptions[4], _("Unused"), TransientDlg); - SetWidgetText(&tcOptions[5], Value(tmpTc), TransientDlg); - SetWidgetText(&tcOptions[6], Value(tmpInc), TransientDlg); - break; - case 2: - SetWidgetText(&tcOptions[4], _("Unused"), TransientDlg); - SetWidgetText(&tcOptions[5], _("Unused"), TransientDlg); - SetWidgetText(&tcOptions[6], Value(tmpInc), TransientDlg); - } -} - -void -TimeControlProc () -{ - if(gameMode != BeginningOfGame) { - DisplayError(_("Changing time control during a game is not implemented"), 0); - return; - } - tmpMoves = appData.movesPerSession; - tmpInc = appData.timeIncrement; if(tmpInc < 0) tmpInc = 0; - tmpOdds1 = tmpOdds2 = 1; tcType = 0; - tmpTc = atoi(appData.timeControl); - by60 = 0; - GenericPopUp(tcOptions, _("Time Control"), TransientDlg, BoardWindow, MODAL, 0); - SetTcType(searchTime ? 2 : appData.timeIncrement < 0 ? 0 : 1); -} - -//------------------------------- Ask Question ----------------------------------------- - -int SendReply P((int n)); -char pendingReplyPrefix[MSG_SIZ]; -ProcRef pendingReplyPR; -char *answer; - -Option askOptions[] = { -{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, NULL }, -{ 0, 0, 0, NULL, (void*) &answer, "", NULL, TextBox, "" }, -{ 0, 0, 0, NULL, (void*) &SendReply, "", NULL, EndMark , "" } -}; - -int -SendReply (int n) -{ - char buf[MSG_SIZ]; - int err; - char *reply=answer; -// GetWidgetText(&askOptions[1], &reply); - safeStrCpy(buf, pendingReplyPrefix, sizeof(buf)/sizeof(buf[0]) ); - if (*buf) strncat(buf, " ", MSG_SIZ - strlen(buf) - 1); - strncat(buf, reply, MSG_SIZ - strlen(buf) - 1); - strncat(buf, "\n", MSG_SIZ - strlen(buf) - 1); - OutputToProcess(pendingReplyPR, buf, strlen(buf), &err); // does not go into debug file??? => bug - if (err) DisplayFatalError(_("Error writing to chess program"), err, 0); - return TRUE; -} - -void -AskQuestion (char *title, char *question, char *replyPrefix, ProcRef pr) -{ - safeStrCpy(pendingReplyPrefix, replyPrefix, sizeof(pendingReplyPrefix)/sizeof(pendingReplyPrefix[0]) ); - pendingReplyPR = pr; - ASSIGN(answer, ""); - askOptions[0].name = question; - if(GenericPopUp(askOptions, title, AskDlg, BoardWindow, MODAL, 0)) - AddHandler(&askOptions[1], AskDlg, 2); -} - -//---------------------------- Promotion Popup -------------------------------------- - -static int count; - -static void PromoPick P((int n)); - -static Option promoOptions[] = { -{ 0, 0, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, -{ 0, SAME_ROW | NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } -}; - -static void -PromoPick (int n) -{ - int promoChar = promoOptions[n+count].value; - - PopDown(PromoDlg); - - if (promoChar == 0) fromX = -1; - if (fromX == -1) return; - - if (! promoChar) { - fromX = fromY = -1; - ClearHighlights(); - return; - } - if(promoChar == '=' && !IS_SHOGI(gameInfo.variant)) promoChar = NULLCHAR; - UserMoveEvent(fromX, fromY, toX, toY, promoChar); - - if (!appData.highlightLastMove || gotPremove) ClearHighlights(); - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; -} - -static void -SetPromo (char *name, int nr, char promoChar) -{ - ASSIGN(promoOptions[nr].name, name); - promoOptions[nr].value = promoChar; - promoOptions[nr].min = SAME_ROW; -} - -void -PromotionPopUp (char choice) -{ // choice depends on variant: prepare dialog acordingly - count = 8; - SetPromo(_("Cancel"), --count, -1); // Beware: GenericPopUp cannot handle user buttons named "cancel" (lowe case)! - if(choice != '+' && !IS_SHOGI(gameInfo.variant)) { - if (!appData.testLegality || gameInfo.variant == VariantSuicide || - gameInfo.variant == VariantSpartan && !WhiteOnMove(currentMove) || - gameInfo.variant == VariantGiveaway) { - SetPromo(_("King"), --count, 'k'); - } - if(gameInfo.variant == VariantSpartan && !WhiteOnMove(currentMove)) { - SetPromo(_("Captain"), --count, 'c'); - SetPromo(_("Lieutenant"), --count, 'l'); - SetPromo(_("General"), --count, 'g'); - SetPromo(_("Warlord"), --count, 'w'); - } else { - SetPromo(_("Knight"), --count, 'n'); - SetPromo(_("Bishop"), --count, 'b'); - SetPromo(_("Rook"), --count, 'r'); - if(gameInfo.variant == VariantCapablanca || - gameInfo.variant == VariantGothic || - gameInfo.variant == VariantCapaRandom) { - SetPromo(_("Archbishop"), --count, 'a'); - SetPromo(_("Chancellor"), --count, 'c'); - } - SetPromo(_("Queen"), --count, 'q'); - if(gameInfo.variant == VariantChuChess) - SetPromo(_("Lion"), --count, 'l'); - } - } else // [HGM] shogi - { - SetPromo(_("Defer"), --count, '='); - SetPromo(_("Promote"), --count, '+'); - } - promoOptions[count].min = 0; - GenericPopUp(promoOptions + count, "Promotion", PromoDlg, BoardWindow, NONMODAL, 0); -} - -//---------------------------- Chat Windows ---------------------------------------------- - -static char *line, *memo, *chatMemo, *partner, *texts[MAX_CHAT], dirty[MAX_CHAT], *inputs[MAX_CHAT], *icsLine, *tmpLine; -static int activePartner; -int hidden = 1; - -void ChatSwitch P((int n)); -int ChatOK P((int n)); - -#define CHAT_ICS 6 -#define CHAT_PARTNER 8 -#define CHAT_OUT 11 -#define CHAT_PANE 12 -#define CHAT_IN 13 - -void PaneSwitch P((void)); -void ClearChat P((void)); - -WindowPlacement wpTextMenu; - -int -ContextMenu (Option *opt, int button, int x, int y, char *text, int index) -{ // callback for ICS-output clicks; handles button 3, passes on other events - int h; - if(button == -3) return TRUE; // supress default GTK context menu on up-click - if(button != 3) return FALSE; - if(index == -1) { // pre-existing selection in memo - strncpy(clickedWord, text, MSG_SIZ); - } else { // figure out what word was clicked - char *start, *end; - start = end = text + index; - while(isalnum(*end)) end++; - while(start > text && isalnum(start[-1])) start--; - clickedWord[0] = NULLCHAR; - if(end-start >= 80) end = start + 80; // intended for small words and numbers - strncpy(clickedWord, start, end-start); clickedWord[end-start] = NULLCHAR; - } - click = !shellUp[TextMenuDlg]; // request auto-popdown of textmenu when we popped it up - h = wpTextMenu.height; // remembered height of text menu - if(h <= 0) h = 65; // when not available, position w.r.t. top - GetPlacement(ChatDlg, &wpTextMenu); - if(opt->target == (void*) &chatMemo) wpTextMenu.y += (wpTextMenu.height - 30)/2; // click in chat - wpTextMenu.x += x - 50; wpTextMenu.y += y - h + 50; // request positioning - if(wpTextMenu.x < 0) wpTextMenu.x = 0; - if(wpTextMenu.y < 0) wpTextMenu.y = 0; - wpTextMenu.width = wpTextMenu.height = -1; - IcsTextPopUp(); - return TRUE; -} - -Option chatOptions[] = { -{ 0, 0, 0, NULL, NULL, NULL, NULL, Label , N_("Chats:") }, -{ 1, SAME_ROW|TT, 75, NULL, (void*) &ChatSwitch, NULL, NULL, Button, N_("New Chat") }, -{ 2, SAME_ROW|TT, 75, NULL, (void*) &ChatSwitch, NULL, NULL, Button, N_("New Chat") }, -{ 3, SAME_ROW|TT, 75, NULL, (void*) &ChatSwitch, NULL, NULL, Button, N_("New Chat") }, -{ 4, SAME_ROW|TT, 75, NULL, (void*) &ChatSwitch, NULL, NULL, Button, N_("New Chat") }, -{ 5, SAME_ROW|TT, 75, NULL, (void*) &ChatSwitch, NULL, NULL, Button, N_("New Chat") }, -{ 250, T_VSCRL | T_FILL | T_WRAP | T_TOP, 510, NULL, (void*) &memo, NULL, (void*) &ContextMenu, TextBox, "" }, -{ 0, 0, 0, NULL, NULL, "", NULL, Break , "" }, -{ 0, T_TOP, 100, NULL, (void*) &partner, NULL, NULL, TextBox, N_("Chat partner:") }, -{ 0, SAME_ROW, 0, NULL, (void*) &ClearChat, NULL, NULL, Button, N_("End Chat") }, -{ 0, SAME_ROW, 0, NULL, (void*) &PaneSwitch, NULL, NULL, Button, N_("Hide") }, -{ 250, T_VSCRL | T_FILL | T_WRAP | T_TOP, 510, NULL, (void*) &chatMemo, NULL, (void*) &ContextMenu, TextBox, "" }, -{ 0, 0, 0, NULL, NULL, "", NULL, Break , "" }, -{ 0, 0, 510, NULL, (void*) &line, NULL, NULL, TextBox, "" }, -{ 0, NO_OK|SAME_ROW, 0, NULL, (void*) &ChatOK, NULL, NULL, EndMark , "" } -}; - -static void -PutText (char *text, int pos) -{ - char buf[MSG_SIZ], *p; - DialogClass dlg = ChatDlg; - Option *opt = &chatOptions[CHAT_IN]; - - if(strstr(text, "$add ") == text) { - GetWidgetText(&boxOptions[INPUT], &p); - snprintf(buf, MSG_SIZ, "%s%s", p, text+5); text = buf; - pos += strlen(p) - 5; - } - if(shellUp[InputBoxDlg]) opt = &boxOptions[INPUT], dlg = InputBoxDlg; // for the benefit of Xaw give priority to ICS Input Box - SetWidgetText(opt, text, dlg); - SetInsertPos(opt, pos); - HardSetFocus(opt, dlg); - CursorAtEnd(opt); -} - -int -IcsHist (int n, Option *opt, DialogClass dlg) -{ // [HGM] input: let up-arrow recall previous line from history - char *val = NULL; // to suppress spurious warning - int chat, start; - - if(opt != &chatOptions[CHAT_IN] && !(opt == &chatOptions[CHAT_PARTNER] && n == 33)) return 0; - switch(n) { - case 5: - if(!hidden) ClearChat(); - break; - case 8: - if(!hidden) PaneSwitch(); - break; - case 33: // - if(1) BoardToTop(); else - if(hidden) BoardToTop(); - else PaneSwitch(); - break; - case 15: - NewChat(lastTalker); - break; - case 14: - for(chat=0; chat < MAX_CHAT; chat++) if(!chatPartner[chat][0]) break; - if(chat < MAX_CHAT) ChatSwitch(chat + 1); - break; - case 10: // - chat = start = (activePartner - hidden + MAX_CHAT) % MAX_CHAT; - while(!dirty[chat = (chat + 1)%MAX_CHAT]) if(chat == start) break; - if(!dirty[chat]) - while(!chatPartner[chat = (chat + 1)%MAX_CHAT][0]) if(chat == start) break; - if(!chatPartner[chat][0]) break; // if all unused, ignore - ChatSwitch(chat + 1); - break; - case 1: - GetWidgetText(opt, &val); - val = PrevInHistory(val); - break; - case -1: - val = NextInHistory(); - } - SetWidgetText(opt, val = val ? val : "", dlg); - SetInsertPos(opt, strlen(val)); - return 1; -} - -void -OutputChatMessage (int partner, char *mess) -{ - char *p = texts[partner]; - int len = strlen(mess) + 1; - - if(!DialogExists(ChatDlg)) return; - if(p) len += strlen(p); - texts[partner] = (char*) malloc(len); - snprintf(texts[partner], len, "%s%s", p ? p : "", mess); - FREE(p); - if(partner == activePartner && !hidden) { - AppendText(&chatOptions[CHAT_OUT], mess); - SetInsertPos(&chatOptions[CHAT_OUT], len-2); - } else { - SetColor("#FFC000", &chatOptions[partner + 1]); - dirty[partner] = 1; - } -} - -int -ChatOK (int n) -{ // can only be called through in chat-partner text-edit, as there is no OK button - char buf[MSG_SIZ]; - - if(!hidden && (!partner || strcmp(partner, chatPartner[activePartner]) || !*partner)) { - safeStrCpy(chatPartner[activePartner], partner, MSG_SIZ); - SetWidgetText(&chatOptions[CHAT_OUT], "", -1); // clear text if we alter partner - SetWidgetText(&chatOptions[CHAT_IN], "", ChatDlg); // clear text if we alter partner - SetWidgetLabel(&chatOptions[activePartner+1], chatPartner[activePartner][0] ? chatPartner[activePartner] : _("New Chat")); - if(!*partner) PaneSwitch(); - HardSetFocus(&chatOptions[CHAT_IN], 0); - } - if(line[0] || hidden) { // something was typed (for ICS commands we also allow empty line!) - SetWidgetText(&chatOptions[CHAT_IN], "", ChatDlg); - // from here on it could be back-end - if(line[strlen(line)-1] == '\n') line[strlen(line)-1] = NULLCHAR; - SaveInHistory(line); - if(hidden || !*chatPartner[activePartner]) snprintf(buf, MSG_SIZ, "%s\n", line); else // command for ICS - if(!strcmp("whispers", chatPartner[activePartner])) - snprintf(buf, MSG_SIZ, "whisper %s\n", line); // WHISPER box uses "whisper" to send - else if(!strcmp("shouts", chatPartner[activePartner])) - snprintf(buf, MSG_SIZ, "shout %s\n", line); // SHOUT box uses "shout" to send - else if(!strcmp("c-shouts", chatPartner[activePartner])) - snprintf(buf, MSG_SIZ, "cshout %s\n", line); // C-SHOUT box uses "cshout" to send - else if(!strcmp("kibitzes", chatPartner[activePartner])) - snprintf(buf, MSG_SIZ, "kibitz %s\n", line); // KIBITZ box uses "kibitz" to send - else { - if(!atoi(chatPartner[activePartner])) { - snprintf(buf, MSG_SIZ, "> %s\n", line); // echo only tells to handle, not channel - OutputChatMessage(activePartner, buf); - snprintf(buf, MSG_SIZ, "xtell %s %s\n", chatPartner[activePartner], line); - } else - snprintf(buf, MSG_SIZ, "tell %s %s\n", chatPartner[activePartner], line); - } - SendToICS(buf); - } - return FALSE; // never pop down -} - -void -DelayedSetText () -{ - SetWidgetText(&chatOptions[CHAT_IN], tmpLine, -1); // leave focus on chat-partner field! - SetInsertPos(&chatOptions[CHAT_IN], strlen(tmpLine)); -} - -void -DelayedScroll () -{ // If we do this immediately it does it before shrinking the memo, so the lower half remains hidden (Ughh!) - SetInsertPos(&chatOptions[CHAT_ICS], 999999); - SetWidgetText(&chatOptions[CHAT_IN], tmpLine, ChatDlg); - SetInsertPos(&chatOptions[CHAT_IN], strlen(tmpLine)); -} - -void -ChatSwitch (int n) -{ - int i, j; - char *v; - if(chatOptions[CHAT_ICS].type == Skip) hidden = 0; // In Xaw there is no ICS pane we can hide behind - Show(&chatOptions[CHAT_PANE], 0); // show - if(hidden) ScheduleDelayedEvent(DelayedScroll, 50); // Awful! - else ScheduleDelayedEvent(DelayedSetText, 50); - GetWidgetText(&chatOptions[CHAT_IN], &v); - if(hidden) { ASSIGN(icsLine, v); } else { ASSIGN(inputs[activePartner], v); } - hidden = 0; - activePartner = --n; - if(!texts[n]) texts[n] = strdup(""); - dirty[n] = 0; - SetWidgetText(&chatOptions[CHAT_OUT], texts[n], ChatDlg); - SetInsertPos(&chatOptions[CHAT_OUT], strlen(texts[n])); - SetWidgetText(&chatOptions[CHAT_PARTNER], chatPartner[n], ChatDlg); - for(i=j=0; i