or
“Cycle counting for newbs!”
for the Atari Video Computer System
I realized quite a while ago that this picture would be relatively easy to replicate on the Atari VCS. I’ve been around and keeping tabs on the Atari homebrew scene for going on ten years by now, and this is what finally got me to get off my ass and learn how to program the console I love. And this is the result.
If you’re wondering how I’m running this on a real Atari, I have one of these.
Download link in the source. Included are the binary itself with associated listing and symbol files, source code, header files, and a text file explaining how the horizontal positioning works (it’s not very intuitive and I had to learn the details the hard way). The header files should only be used with the DASM assembler.
If you don’t have real hardware, I recommend running this in the cross-platform Stella emulator. It has great support for damn near every VCS ROM and bankswitching scheme under the sun and has a featureful debugger; that’s why I included the listing and symbol files, so you can step and trace through the code with the original, meaningful labels I used like “colorDraw” instead of “LF880”.
This program doesn’t do much, obviously, and besides being fun (and frustrating) to make, it’s a stepping stone for me to get familiar with how the Atari’s video chip works. Accordingly, it’s tiny: 176 bytes of code, 177 bytes of data, and lots of empty space in the 2K file.
oh my god
how did i never realize that
In another version of the program, I also had a little fun in deliberately crashing the Atari when the Select switch is pressed. That “feature” is not in the version I linked here. However, in the assembly file there are a couple bits of code and an interrupt vector that are commented out. If you uncomment the code and swap out the interrupt vector at the end of the file, and assemble the result, you’ll have a crash-on-demand version of this program. :)
I made a really stupid mistake in the code: I turned on vertical blank in the initialization routine and turned it off before the first frame, but then I never turned it back on inbetween frames. I guess the reason I didn’t notice is that by the end of a frame every object on the screen is already black.
But whatever, I fixed that and also tweaked Pinkie Pie’s mane and coat colors to give more accurate contrast. I’m also sharing the source code. So if any of you already downloaded the first version, please get the new, final one.