Category Archives: Atari 2600

My Atari 2600 Pong Clock

While looking for something completely different, I ran across the code and binary images for my old Atari 2600 “Pong Clock”. I realized that my previous post on the matter didn’t have pictures of my final version, so just for fun, here are a couple of Stella screengrabs (in NTSC “TV” mode, for enhanced realism).

I included a tiny intro screen. I showed this at a 2010 get together. The Conway glider at the top is animated:

simple.bin_6

It plays a game of pong against itself, with the score representing the current time. You can set the time using the left joystick. When the minutes tick change, the right player wins. When the hours change, the left player does.

simple.bin_7

It also works on black and white tvs. I never did the changes necessary to make it play in PAL mode, although it should be pretty straightforward. The Atari 2600 was practically built for implementing Pong.

Still, it’s got some finesse in it. I never could have done it without all the hints from the Atari Age forums and the Stella 2600 emulator. My source code references a nice little bit of code from an Atari Age tutorial series, which I shamelessly purloined. I left a comment saying:

;;; According to the documentation, A isn’t really the position (0-160),
;;; you have to add +7 to the position. But I find that the offset in
;;; stella is +5. I haven’t done the cycle counting to figure it out,
;;; but I’ve had good luck trusting stella, so that’s what I’m going
;;; with.

Perhaps I’ll revisit that sometime and figure out what was right.

Ting-Tong? Pick-Pock? Keeping time on an Atari 2600…

Years ago, I remembered that someone (couldn’t remember who) had invented a clock which looked like a version of the classic video game “Pong”. A few minutes of searching now reveals who that was: Sander Mulder. I thought it was a cool idea, and I was thinking of a project that could get me back into programming the classic Atari 2600 again, so over the last three days, I hacked together my own version:

I did this using the same development environment that I used for my earlier magnum-opus, the Atari 2600 Enigma Machine

The assembler I used was an old version of P65, a 6502 assembler written in perl. It’s a tiny bit clunky, and doesn’t have any macro capability, but it does work. I have made use of the standard macro processor “m4” to make my source code a tiny bit tighter, and use the excellent Atari 2600 emulator Stella (available on Windows, Linux, or Mac OS X) to test and debug my program. The Atari clock fits rather nicely into 2K of ROM space, including a rather verbose splash screen.

I’ll probably write something up explaining why a grown man would work on writing any kind of software for a 30+ year old video game with only 128 bytes of memory, as soon as I can figure out something that doesn’t sound stupid.

Anyway, the clock seems to be working, and in simulation at least has kept rather excellent time (within one minute leaving it overnight) which isn’t bad at all. Once I get it burned into ROM, I’ll try to post the finished code and some pictures of the final clock.

Addendum: Here’s a short video showing the clock in action, filmed in truly crappy style with my iPhone.


httpv://www.youtube.com/watch?v=Q8_PfohAruc