EbmChess

EbmChess is a free, open-source chess game for the Franklin eBookMan.

EbmChess screenshot

EbmChess is released under the GNU GPL version 2. EbmChess is based on OpenChess for PalmOS by Son Altesse, which is based on GNU Chess by the Free Software Foundation.


Features

  • Multiple levels of difficulty, plus settings to "tweak" the computer's gameplay.
  • Opening book with 241 different opening combinations
  • Human vs. Human play

Suggestions or comments are welcome; send e-mail to mpicker0@yahoo.com. I must warn you, though, I'm probably going to concentrate on actually playing chess at this point, rather than adding lots of neat features to the game. But I definitely intend to fix bugs.

Relevant links

Known problems and limitations

  • If you open the Options dialog several times (4 or 5) EbmChess may crash with an Out of Memory error. I am trying to find the cause of this; in the meantime, if you change the options more than a few times, exit and restart EbmChess to ensure they are saved.
  • If you exit the program (select Game...Exit) your game is lost. You don't have to exit the program to run another EBM application, so this is not a big deal. If you sync your EBM, it will exit the program for you, so finish your game first!
  • Computer vs. computer does not work at this time. (Wouldn't you rather play chess anyway???)
  • No way to interrupt the computer when it's thinking. So don't select a long think time unless you're prepared to wait. This may be corrected in the future.
  • Screen update delayed between player's and computer's turns (probably not a big deal)
  • Surely many others! Please let me know if you have problems; the more information you can give me, the better.

Changes

  • 2/19/2003 10:00 EST

    Version 1.0 Initial release

About the source code

In order to compile the code, you'll need the Franklin SDK. I don't know if it's available anymore, at least from Franklin. If you want to rebuild the resources (resource.rcp), you'll need Chris Warren-Smith's rpc2ebm.

The source code for EbmChess comes primarily from Palm OpenChess and GNU Chess (actually the modified gnuchess2.c that came with OpenChess was further modified for the eBookMan). Changes to the source are basically:

  • Changed Palm datatypes to Franklin datatypes, and replaced Palm API calls with Franklin equivalents (where possible)
  • Added curly braces to much of gnuchess2.c to get rid of "ambiguous else" warnings caused by Franklin C compiler
  • Removed swab (swap byte) calls from BuildOpenBook.c, since Franklin processor doesn't need them
  • Similar but slightly different drawing routines
  • Larger screen size :) The eBookMan's biggest feature. To take advantage of this, there are some status display things that aren't in the Palm version.
  • Different game loop (primarily because I don't know how to do a game loop on the EBM and couldn't figure out a way to implement the OpenChess game loop)
  • Some of the things in the prefs structure aren't used. Since PalmOS isn't really multitasking, Palm OpenChess had to save the game state whenever a new app was run. Franklin allows you to run other apps while EbmChess is still running, so there's no need to save the game state.

With optimization turned on, gnuchess2.c compiles, but certain routines like GenMoves don't work quite right. This caused weird behavior when trying to move; you could move up any amount but down only one square, and could move right any amount but left only one square. So you have to compile it without optimization:

/franklin/SDK/winXX/bin/sneak32-gcc -b sneak32 -g -fno-defer-pop -Wall -Wmissing-declarations -Werror -I/franklin/SDK/sneak32/include -o lib.snk32/gnuchess2.o -c gnuchess2.c

I'm sure there's a fancy way to put this into the Makefile, but I don't know it.

To generate the graphics (for example):

/franklin/SDK/winXX/bin/bmpconvert -image_struct -outfile pieces.cpp pieces.bmp

Again, this can surely be put in the Makefile by someone who knows what they're doing. I created my own crude makedist.sh script to handle all this stuff.