Close

Okay, Houston, we've had a problem here.

A project log for Commodore CHESSmate Reproduction

The plan is to make a reproduction of the dedicated chess computer CHESSmate released by Commodore in 1978.

michael-gardiMichael Gardi 02/07/2024 at 16:510 Comments

Just when I thought I was heading into the home stretch I noticed something not so good.  I had the CHESSmate manual out and was trying some of the various settings. One thing I tried was setting my CHESSmate reproduction to play white and have "it" make the first move to which it returned  H1 - H1. What? That sure doesn't  look right. The original plays C2 - C4. Similarly when I play white and make the conventional E2 - E4 kings pawn opening, the reproduction plays D7 - D5, while the original plays E7 - E5.  Crap.

My first though was that maybe the ROM that I downloaded was somehow corrupt. Since I have an original, I could, with some effort, get a fresh ROM image from it (even though I'd be a little apprehensive doing so given its rarity). So before I tried that I found two additional images. One was described as being another Commodore CHESSmate ROM, but the other was for a Novag Chess Champion Mk II, clearly a CHESSmate clone. All three images were identical! So not likely the ROM.

That only leaves a couple of alternatives. 

  1. My interface between the Sketch and the emulator is somehow incorrect. I find this hard to believe. I'm just mapping physical memory to the addresses that the CHESSmate firmware is expecting. If this interface were wrong the program would more than likely crash. Instead it runs fine processing millions of instructions.
  2. Unfortunately that leaves (in my mind) only one other alternative, there is a subtle underlying problem with the 6502 emulator.

OK, emulator issue. The first thing I did was to review what I had done to get the emulator working. Oscar Vermeulen had made extensive changes to Mike Chambers' code in order to get all of the cool features working in KIM Uno like Microchess, Programmable Calculator, KIM utilities, etc.. I had decided to start with a fresh copy of Mike's code because it would be less confusing.  I went back and looked at Oscar's code and found that he had applied a "BCD fix" to the emulator. Ah ha! That must be it! Unfortunately it was not. I applied the same fix and no joy. Same problem.

One thought I have as to why this issue did not crop up in KIM Uno running Microchess is that for CHESSmate Peter Jennings added "32 International standard openings in its memory and tries to follow them for 16 moves". The bug could be triggered by the new openings code.

I had a similar issue with my Sol-20 Reproduction. Everything seemed to be working (games, utilities, monitor, etc.), but when I tried to run BASIC (two different versions) it would fail. Now that was for an 8080 emulator, but I eventually found the problem by running test suites against the emulator until something broke. As I recall it was an obscure half-carry flag DAA instruction issue (also BCD related - coincidence?). 

For my Challenger 4P Reproduction I used a 6502 Python based emulator running on a Raspberry Pi 4. This got me thinking that It would not take me very long to move CHESSmate over to a Pi. If it works, I know for sure that the issue on the ESP32 is emulator related. If not I can begin the tedious task of trying to find the emulator bug.  OK that's the new plan.

Discussions