2600 101: The Development Environment

There's nothing like getting your feet wet with compiling and playing some real Atari programs to work up your appetite for making your own works. This page will tell you how to do that on a PC running Windows. (There's nothing to stop you from doing this on a Mac, but that's beyond the scope of this tutorial.)

Step One: The Emulation
One cool thing about making Atari games is that you get to play Atari games. (Call it "research".) A number of great emulators are available free for Windows that you play nearly any Atari game ever made. Here are the three I've played with: (You might want to stop and think about a logical layout for your stuff. I have a single "atari" directory, with different subdirectories for tools, emulators, bins, and misc. docs I've collected. Also, I made sure to name all directories with names less than 8 letters, with no spaces...this makes things a little simpler with Z26 and DASM (below), which have an old fashioned view of file systems... Life might be easier if you do something similar, but hey, it's your harddrive.)

Once you've downloaded your emulator, you should test to see that it works on your system. This can be a very pleasant task for obvious reasons (assuming there aren't any glitches, and there weren't for me), and also will familarize you with the keyboard/joystick setups. StellaX makes this very easy for you, with the ROMs (files that end in .BIN) preinstalled when you unpack the program. For the most part these are homebrew carts. (You can also point StellaX to a different directory from the Options menu, if you want to organize your life differently.)

There are also old Atari ROMs floating around. AtariAge has many of these.

Step Two: The Compilation
An assembler is a program that takes the Assembly source code and makes it into a binary image that an emulator can run. DASM is the assembler of choice. (local mirror of V2.20.07). The file you want is dasm.exe in the DASM\bin\DOS inside the zip.

You are now ready to compile and run your first Atari program. We'll use Chris "Crackers" Cracknell's 2600 Digital Clock (from hell!!!, I'm sure he'd be quick to add.) Here is the source code for it. Either right click and save it as "clock003.asm" or cut and paste the code into notepad and save. (Don't use an editor like Word that will much up the textfile with all sorts of formatting crap.) Incidentally, the ".asm" isn't crucial, just a convention people follow.

Now we're really ready! I'm going to assume you saved it in the same directory as DASM, otherwise make the appropriate path changes when you enter the following line:
	dasm clock003.asm -f3 -oclock.bin
The -f3 is crucial--I learned that the hard way, and had to get help from the Stella list. (It has to do with the format of the resulting binary file.) The other parts of this line should be obvious: assemble the file "clock003.asm", put the resulting file in "clock.bin".

If neccesary, move the .bin to the appropriate directory and run it from your emulator. You should see a big friendly 12:00 staring you in the face. And if you wait around, 12:01. (You can set the time using the joystick.)

Great! You've now assembled and ran your first Atari program. You're now mostly ready to assemble any source code that people post to the Stella list...but there's one big catch, and its name is "vcs.h". VCS.H is a file that sets up many constants that the Atari relies on, letting programmers use codes like "WSYNC" rather than ugly hex numbers like "$02". (One of the reasons I picked the clock example was because it made these definitions within the file itself instead of depending on an external VCS.H) This file should sit in the same directory as DASM. Historically there were a few versions of this file floating around, but the current standard can be downloaded from DASM's official homepage, the "Atari 2600 Support Files" Zip file. Here's a local copy of VCS.H.

Step Three
Now might be a good time to check out Adam Trionfo's Changing Atari VCS Graphics- The Easy Way (local mirror, or Google can get you an HTML version.) It's a painless way of learning how to hack the graphics in games like Space Invaders, and you'll be introduced to a few extra tools as well.

Next: Into The Breach
Introduction - The Development Environment - Into The Breach - My First Program -
Kernal Clink - The Joy of Sticks - Happy Face - PlayerBufferStuffer