Close
0%
0%

Toledo Atomchess for Atari VCS/2600

A chess game for Atari VCS/2600 with AI self-contained in 1K

Similar projects worth following
This is a port of my Toledo Atomchess game to 6502 code, including AI and adding a board display and square selection using the limited Atari VCS/2600 capabilities.

Features:
* Plays basic chess movements.
* Movements not validated.
* Promotion only to queen.
* No en passant or castling.
* Move cursor using joystick, press for origin square, press for target square.

Source code on the left (Github link) https://github.com/nanochess/Atomchess-6502

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 for the chessboard squares, given only 2 different bitmap objects can be shown in a line the board and it have "big" graphics, it shows alternate columns in 4 frames, this sustains for 15hz flicker.

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 30 bytes free for improvements.

  • 1 × Computer
  • 1 × dasm
  • 1 × Stella Development Kits, Boards and Systems / Programming, Debugging and Erasing Tools
  • 1 × Atari 2600 or Colecovision Expansion Module #1

  • Ported to Visual 6502

    Oscar Toledo01/16/2017 at 22:56 1 comment

    I've ported Atomchess 6502 to Visual6502, just follow this big URL and play with it in your browser :) (running at 123hz or 15 minutes per move, even slower if you enable the graphic view).

    Atomchess 6502 running with Visual6502

    Press play but before push the button "Trace less" to be faster.

    Also the source code now includes the assembly option.

    Once the chessboard appears, enter your move as D2D4 (no enter, no spaces)

  • Demostration video

    Oscar Toledo01/13/2017 at 21:11 0 comments

    Now that the contest is over, I've put together a demostration video including explanation, excuse my English! :)

  • Online emulation

    Oscar Toledo01/07/2017 at 03:54 0 comments

    Just found an interesting Atari emulator online to play Atomchess 6502 right away.

    From https://github.com/nanochess/Atomchess-6502/blob/master/toledo_atomchess_6502.asm select all the source code and press Ctrl+C, then open the emulator at http://8bitworkshop.com and click on left side, press Ctrl+A and then Ctrl+V and et voila! :)

    Amazingly this nifty project assembles all the source code right away and does syntax coloring, then the emulator runs it in real time.

  • It works in real hardware :)

    Oscar Toledo01/05/2017 at 21:27 0 comments

    Just tested over an Atari clone (the expansion Module 1 of Colecovision) and it works just fine. I've put a picture in the gallery.

    I've had to adjust the color for black pieces because there were essentially invisible, also the debouncing for joystick wasn't enough so added some rules like only white can be selected and cannot capture white, finally the computer playing sound was kind of harsh so I made it to fade off.

  • Hello world

    Oscar Toledo01/04/2017 at 18:57 0 comments

    I bite the bullet and uploaded the first working version of Atomchess 6502 for Atari VCS/2600.

    The port from my x86 version took 3 hours and another 2 hours this morning to debug, the visuals were coded last night in a crazy 3 hours and I'm happy because the vertical synchro generates exact 262 lines.

    Still going to test in real hardware, it should work just fine because Stella is a very good emulator.

View all 5 project logs

Enjoy this project?

Share      

Discussions

Arduino Enigma wrote 01/06/2017 at 22:38 point

A serious contender for the pachinko ball powered computer... ;)

  Are you sure? yes | no

Mark Sherman wrote 01/06/2017 at 06:37 point

Ok, you win.  Even Atari's chess was 4k.  How the heck?

  Are you sure? yes | no

Shaos wrote 01/06/2017 at 06:50 point

  Are you sure? yes | no

Mark Sherman wrote 01/07/2017 at 06:10 point

  Are you sure? yes | no

Shaos wrote 01/06/2017 at 06:04 point

Oscar, you win for sure :)

  Are you sure? yes | no

Mark VandeWettering wrote 01/05/2017 at 06:45 point

Damn.  If I was the judge, you'd win hands down.  Well done, sir.

  Are you sure? yes | no

Oscar Toledo wrote 01/05/2017 at 21:43 point

Thanks! although there are many good entries there, let us see what happen. :)

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates