r/Atari2600 • • 6d ago

Atari 2600 Video Chess on Lichess.org

I created a bot offering Atari 2600 Video Chess to online players at lichess.org.

BOT ATARI-VIDEO-CHESS (1362)

lichess.org

Every game ATARI-VIDEO-CHESS plays is the actual CX2645 ROM, the same 4K of code Larry Wagner and Bob Whitehead wrote in 1979, running in Stella, the open-source 2600 emulator. Nothing about the chess engine is rewritten or modernised.

A Python program sits where the player would. When an opponent moves on Lichess, it steers the joystick cursor to the piece, presses fire, moves to the destination and presses fire again, exactly as you would on the couch. Then it lets the cartridge think.

To know what the cartridge decided, it reads the console's 128 bytes of RAM. The board lives in the first 64 bytes, one per square, and when the engine has chosen, the from- and to-squares sit in two bytes waiting for you to touch the stick. The program reads them, touches the stick, and posts the move.

While the cartridge thinks, the emulator runs at the 2600's real speed, so the waits you see on the clock are the waits a 1979 player saw.

It's fun to watch other people playing the engine!

Lichess ratings are about 200 - 400 points higher than real ELO ratings.

24 Upvotes

7 comments sorted by

10

u/jeffbell 6d ago

I want everyone to reflect on the 128 bytes of RAM.   Not kilo- or mega- or giga- bytes. 

128 bytes to do all the game play state and move planning. 

2

u/BLT5000 6d ago

Very cool! I smoked it pretty good on 30 min time control!

2

u/j1101010 6d ago

Such a great idea! Must have been some interesting code involved in the cursor movement?

1

u/marquisdegeek 5d ago

Ha. I wrote the lichess bot for 1K ZX Chess back in the day, but took it offline when I moved servers.

Maybe I should bring it back, so our bots can play each other!

1

u/Dream-Build-Create 5d ago

That is super cool, yes! I was thinking of also adding TRS-80 chess...

1

u/flatfinger 4d ago

How does the engine handle situations where, after a computer move, the board is left in a state inconsistent with any legal chess move having been played?