skip navigation

Code. Compile. Play. Setting up our ATARI 2600 Dev Tools

Description

In this episode we look at the basic tools that will make up the development environment for programming and testing a game for the ATARI 2600. We’ll install the Stella emulator, along with the Dasm 8-bit compiler. Afterwards we’ll use a code snippet to compile and test in the emulator.

Released:
February 6, 2021

Original Link:
https://youtube.com/watch/WcRtIpvjKNI

Transcription

Your support is greatly appreciated! https://www.patreon.com/8blit

Welcome back, friends! The ATARI began it’s life with the code name Stella, and was released as the ATARI VCS. However, in 1982 the game machine was rebranded as the ATARI 2600 to fall in line with the new naming conventions of their other newer line up of machines.

According to the user IHATETHEBEARS in the AtariAge message forum, there are 471 official games released for the 2600, not including the Sears branded versions, and other regionally modified versions of existing games.

In this episode we’re going to start down our path of developing a game of our own. What form this game will take, no one knows as we’re all learning this together. I’ve never programmed for the ATARI 2600, or any other game machines for that matter, and my experience with Assembly, the language we’ll use in this series, is minimal. Let’s go down this path together and see what we can come up with.

We’re not alone in our quest. Many people still develop unofficial games for the 2600, which is referred to as homebrew. There are currently over 100 released homebrew games, and it’s slowly growing each day.

I won’t assume you know assembly language, or have even programmed before. If we’re going to learn, let’s start at the beginning and go from there. With that, the first step is to set up our development environment. We’re going to start off with the basics. No bells and whistles for now. We’re going to set up an Atari 2600 emulator called Stella, a program called DASM to compile our code into a ROM file, which Stella can run, and use a basic text editor to write our code. We’ll stick with tools that are available on a variety of computers like Windows, MacOS, and Linux.

Now, I know, there are other tools we can use where everything is built in… but what fun in that?! Seriously though, we’ll look at those in a later episode once we have some ground under our feet.

First we’ll install Stella, and make sure it’s working by loading up the rom for space invaders.. Stella is a multi-platform Atari emulator, first created in 1995 and still in development today. It interprets the game code in the same way the hardware of a real Atari console would, allowing us to run games on many different operating systems.

The link to the Stella home page is below. Once there, you will see under Stable Releases, there are versions for a few operating systems. Choose the one that matches yours. When it’s down downloading, run the installation file. Due to security settings on my machine, I get a warning message. For me, this is ok so I’ll allow the installation to continue.

Choose where to install the application, and then click install, and finish.

Before we go any further, it’s important to check if our emulator is working correctly before we try to test any of our own code on it. So for this we’re going to take a ROM file for the game Space Invaders and see if we can get it working.

A quick word first, before we load up Space Invaders to test. ROM files of games are a legal grey area as the file contains the full game, and may be illegal due to copyright laws. In some cases making and possessing a copy of a games ROM may be legal if you own a physical copy of the game. In this case, I do own a copy of Space Invaders for the ATARI 2600.

Now let’s run Stella and select Space Invaders to test. Looks like everything is working perfectly.

Now that we have the ability to run some code, let’s get a compiler to turn our code into something the emulator can read. DASM is an 8-bit macro assembler first created in 1987, and still actively maintained. It takes our instructions and compiles them into a binary file able to be executed by the MOS 6507 processor at the heart of the ATARI 2600, and emulated by Stella. It’s available on many different operating systems as well.

Let’s go to the DASM webpage which is also below, and choose the package matching our operating system. We’re going to open that archive and copy the files into another folder. We can see the DASM executable in the root folder, and in the machines folder, there are a couple of special files included to be used for 2600 development.

So, let’s run a program. I copied a snippet of code from an online forum to test our development environment. When it’s running in Stella, it should simply change the background to the colour blue.

There are however a couple of lines we need to change. The lines pointing to two files, vcs.h and macro.h. These are those special files included with DASM. We just need to file where they are located and change these two lines.

Now we save the file, and then execute the compiler and tell it to turn our code into binary files using instructions for the MOS 6502 processor. Previously, I mentioned that the ATARI 2600 uses a MOS 6507, which is correct, but that processor is just a slightly modified version of a MOS 6502, and uses the 6502 instruction set.

Now let’s go into Stella and run our test ROM. Perfect, our screen is blue, and everything is good. We’ve made the first step of our journey. It will be a long and rocky road, but the fun is in the challenge.

The code used in this episode is available at the link below. If you know GIT, feel free to clone the repository. In the future, all the code used in all of the episodes will be available there.

Thanks for watching, I hope you stick around and join in on our mission to create a game for the Atari 2600. Make sure to subscribe to the channel to keep in touch, and share it with your like-minded friends.

What are your favorite 8-bit games, and what do you feel made them fun? Comment below, I’d love to know!

Back to top of page