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.)
- StellaX. I found this one to be the easiest
to use with a good Windows frontend, and with very good emulation.
- Z26. Some people consider this to be the
canonical emulator...as Manuel Polik puts
it, "Something running on the real thing
and not with Z26 must be due to a bug on the real thing! :-)" It generally is run from the commandline.
or you can try a front end like x26.
- PCAE is another emulator. Seems to have some nice debugging features,
but it has a rather unfriendly, engineer-ish interface. On the other hand, it includes
a debugger which can be very useful, though very difficult to use. That link is a local mirror,
it's webpage has gone missing.
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
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.
Now might be a good time to check out
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