Posts

Maze Solving in 6510

Image
Not sure why, but I suddenly felt the strong urge to see if I could still program in 6510. So I implemented a backtracking solver that finds the path in a maze from the '-' symbol to the '+' symbol (actually an undergraduate programming exercise I did long time ago on a Motorola 68000). The result running on a Commodore 64 emulator is shown below. The active search path appears as white '*' symbols, dead end positions appear as '.' symbols. And below the solution has been found. You can find the assembler source file maze.s (and a 6510 cross-assembler) on my Commodore 64 page if you are interested. You can define a different maze in the .byte section (just make sure the active search path length cannot exhaust the small stack of the Commodore 64). Also don't forget to remove the artificial delay to appreciate how fast machine code runs!

Commodore 64

Image
Remember this screen? Yes, that's right. I too became interested in computer science because of the Commodore 64. Although I still have my Commodore 64 somewhere, nowadays it is much easier to relive the good old times with an emulator, such as CCS64 (Per HÃ¥kan Sundell), VICE (the VICE team), or MP64 (an emulator under development by Michael Plet). A while back I wrote a 6510 cross-assembler win2c64 that converts an assembler source file into a target file that can run on one of these emulators or, with some work, on the real Commodore 64 (an assembler converts human readable mnemonics, labels, and simple expressions into machine code; win2c64 is a cross -assembler because it runs on a Windows platform but generates machine code for the Commodore 64). If you are interested, you can find the cross-assembler and some sample programs at Aart's C64 page .

More Board Textures

Image
Now that I am enthusiastic about textures, I also added a board texture to the other games. For Reversi for Android this hopefully also addresses complaints that the board was "too green". For Checkers for Android, I simply reused the coffee table texture, as shown below.

Wood Texture

Image
A user "dragonfish" suggested to add texture to the wooden chess board in Chess for Android. So I took a picture of my coffee table and used that as texture for the dark squares. See the result below. Together with a minor engine improvement, this new feature has been released in v2.2.

Topeka

Image
I am now working for Topeka .

Copy to Clipboard (PGN/FEN)

Image
Version 1.2.9 of Chess for Android will enable users to export a game to another application, such as an editor, email, or another chess program: copy all moves to the clipboard as PGN (Portable Game Notation) copy the position to the clipboard as FEN (Forsyth–Edwards Notation) To use these options, long-press anywhere in the move list area. Then, the following menu appears. Select one, then exit the chess application and go to the application where you want to paste the game. For example, I picked Copy Moves as PGN and went to messaging and long-pressed the text area. Then Paste the contents of the clipboard into the message, and the game appears in PGN format (note that, for convenience, I use a slightly more elaborate algebraic chess notation than strictly required; readers should still accept that format though). Likewise, using Copy Position as FEN , the contents would look as follows.

Opening Book

Image
I added an opening book to Chess for Android. The opening book is small (slightly over 150 opening lines) and simple (transpositions are not recognized, unless the line is explicitly stored). Nevertheless, since the engine picks a matching line at random during the opening, the variety of play will increase. Version v1.2.8 (and onwards) supports the opening book, as well as a new copy-to-clipboard feature (more about that later). While still in an opening line, the message "opening" appears at the position that usually shows the engine evaluation, as shown below.

One Star Ratings

I don't mind constructive criticism. Really, I don't. But take two recent one-star reviews for Chess for Android: Stupid cant start a new game after youve lost greg Fri, Mar 12 01:31:00 UTC 2010 This game cheats. Pawns shouldnt be able to capture pieces next to them and then move diagonally. Eyal Wed, Mar 10 02:35:00 UTC 2010 Really, my game gets one star because you cannot find the menu button on your own phone, or because you don't know the en-passant rule (see also previous posting )? Please, if you don't like the game for a good reason, by all means give one star. But this?

Too Many Updates?!

While browsing through some recent comments posted on the Android market, I was surprised to read that some users complain that I am pushing too many updates. I usually work on these games in spurts, i.e. a lot of improvements in a short time followed by a period of relative quiet. Another problem is that the Android market does not enable me to push updates to specific platforms or builds only. So, for example, when I fix a bug for Android 1.1, some users will not see a change, but others may be happy to receive an update. Last, the Android market does not support a good way to show revision history. Luckily not all users feel that way, as reflected in the comment: Updates are a pain? Really? its wonderful when developers continually work on their FREE app to improve it. Be thankful not frustrated. Vin Fri, Feb 12 11:47:00 PST 2010 Thanks Vin!

Android 1.1 Bug Fix

I always test new releases on emulators for Android 1.5 and higher (api 3 and up), for various screen sizes and other settings, as well as on the two actual Android devices that I have. However, I found out there was a bug on Android 1.1 (api 2), which I fixed in the latest releases of Chess, Checkers, and Reversi for Android. Users with an "older" phone that have never updated to more recent builds may have experienced problems (apologies for that!). The games should work again for all platforms. Needless to say, I added the Android 1.1 emulator to my mandatory release criteria.