Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Toledo Atomchess 6502 for Atari VCS/2600
(c) Copyright 2017 Oscar Toledo Gutierrez

Latest source at

This is a port of my Toledo Atomchess x86 game to 6502 code playable with Atari VCS/2600.

Besides the small AI it includes a graphical board and selection of pieces with joystick plus some wacko sounds.

Don't expect the greatest visuals, I coded this in a night for the Hackaday 1K contest

Assemble with dasm from 
Tested with Stella from
Tested with real Atari 2600 using Harmony cart.
Tested with online emulation from
Demostration video at


* Computer plays legal basic chess movements :)
* Move with joystick, push button to select, push button to drop.
* Promotion of pawns only to queen.
* No castling
* No enpassant
* No move validation (if you push button in the wrong square... well you can imagine it)
* Can be assembled also for although too slow for even playing.

Playing it in real hardware:

Using a Harmony cartridge you can load the 1K ROM into it an insert it to play over a real Atari VCS/2600.

For some older versions of Harmony cartridge you need to replicate the 1K ROM to 4K, using this series of commands:

    COPY /B atomchess.bin+atomchess.bin+atomchess.bin+atomchess.bin atom4k.bin

Or for Mac OS X:

    cat toledo_atomchess_6502.bin toledo_atomchess_6502.bin toledo_atomchess_6502.bin toledo_atomchess_6502.bin >atomchess4k.bin

Long description:

The 719 lines of assembler program (664 without comments) are separated in three well defined sections: the initialization, the display/controller and the AI engine.

Given the primitive Atari VCS/2600 doesn't provide routines or BIOS ROM, it's needed to take care of initializing the processor, reset all video, audio and controller registers.

It only has 128 bytes of RAM memory, of these 78 are allocated to the chessboard and 38 for stack (AI recursive search with 2-ply depth), remains 12 bytes for housekeeping.

The video display processor (TIA) works displaying line-by-line based on input registers, this means the CPU should update video register per each scanline in tight timings and turn on/off the vertical retrace.

If the CPU doesn't update the TIA in time, essentially we lose TV synchro, but to simplify the game, the AI engine works without updating the TIA.

The TIA can show only a 40 columns playfield (background), 2 bitmap objects per line (each one can be repeated upto 3 times) and 3 pixel objects.

The playfield is used to display the chessboard checkered pattern. Given there are only available 2 bitmap objects, the previous version of Atomchess displayed two columns of board on each frame, so 4 frames were needed to show the full chessboard, given a very intense 15hz flicker.

I've redesigned the display to use "venetian blinds" a technique common to Atari games, but I had a very difficult problem: it was developed for small repeated bitmaps, I developed many versions of this code trying to solve it, the TIA allows for repositioning the bitmap in the same scanline where it's draw but it wouldn't show again till an internal display counter has reached 160 pixels, so I solved it in 3 scanlines: 1. repositioning in one scan line, 2. displaying two pieces and moving to right (the only movement possible that complies with the condition of internal counter reaching 160 pixels), 3. displaying two pieces and repeating.

Even if pixel objects are a single pixel (but can be "fat") these can be draw over several lines, making a big object like the cursor which uses missile 0.

Of the 1024 bytes, the AI engine uses 429 bytes (initialization+engine+tables), the repetitive nature of the TIA display occupies the remaining bytes. Still remains 7 bytes free for improvements.

Just as a note, the Atari Flashback Portable doesn't support the new trick in its emulator and can only display the previous version (search for Jan/16/2017 in commits)

Code for Visual6502.ORG:

This a 596 bytes port, cut and paste in your browser address bar.

My suggestion is to press two times the "Trace less" button and then press the "Play" button.

Once the chessboard is displayed, enter your movement as D2D4 (no spaces, no Enter)
and the computer will start thinking.

It will be utterly SLOW!


* Peter Ferrie for some pretty cool optimizations.


Toledo Atomchess for Atari VCS/2600




No releases published


No packages published
You can’t perform that action at this time.