Welcome to Homebrew 2600
This site is about creating homebrew games for the Atari 2600, also known as the Atari VCS. Homebrew is a term that has been adopted for people who create new games for obsolete consoles. Why do people do this? In my case it is a combination of nostalgia, challenge, but mostly because writing low-level code is something I love doing but rarely have the chance to do outside of homebrew development. This page provides a summary of how the 2600 works with links to more detailed information for those of you who are interested in the more technical side.
2 What made machines like the 2600 possible was the introduction of low-cost microprocessors. The one used in the 2600 was a variant of the MOS 6502 which also was used in many other machines such as the NES, the Commodore 64, and the Apple II. This is an 8 bit processor, meaning it could only work with one byte of information at a time. It was capable of addressing 64K of memory, though the 2600 had only 128 bytes of RAM with cartridges limited to 4KB of ROM (see cartridges below).
Because space was so limited, all programming for the machine was done in assembly language. The 6502 has a very nice language using 3 letter mnemonics that are fairly easy to learn. The tricky part of the chip is the numerous ways memory can be addressed. There are 13 different addressing modes with individual instructions only using a few of them.
The Arrow links to an article I have written a brief introduction to 6502 assembly language that covers the basics of the language. Assembly Language
3 The 2600 is not known for it's great graphics. The graphics for the system came from a custom chip known as the TIA (Television Interface Adaptor) and is very primitive compared to most other consoles. With later consoles, you had a separate screen memory that you would write to and the graphics chip would process the data separate from the game program. With the TIA, the programmer is actually responsible for drawing the screen as it is sent to the television. This was done by setting the various registers of the TIA while the scan-line was being drawn. This gave the programmer 76 processor cycles per scan line in order to display the contents of the game. This is where the book "Racing the Beam" gets its name.
The TIA supports one of the largest palettes for 8 bit systems, allowing for 128 colours, though each line of the display could only have 4 colours under normal circumstances. There is a background colour, a playfield colour, and two sprite colours. Sprites are the modern term for what the 2600 referred to as Player Missile Graphics. These are what was used to draw the players and projectiles on the screen. The TIA supported 2 separate player sprites, 2 separate missile sprites and one ball sprite.
The arrow links to a more detailed explanation of the TIA which while technical also links to a non-technical editor that lets you create TIA like images without requiring any programming. Just playing with this editor will give you an appreciation of what goes into creating a 2600 game! TIA Graphics Chip
4 The 2600 originally came with a set of joysticks and paddles. Most games tended to use the joystick. As can be seen by the photograph, the joystick was much simpler than today's devices. There was only a single button, and you could only move in 8 directions. While this may sound extremely limited to today's gamers who are use to having two thumb-sticks and 10 buttons, there were a lot of really fun games that worked well with such simple controls.
Additional controllers were possible, but as with today, games that required controllers not included with the console rarely did well. One exception to this rule was the game Star Raiders which included a 12 button keypad controller.
In addition to the controllers, the console itself had buttons for resetting the game, setting the difficulty levels for each player, and for selecting the game mode. These buttons have moved off of the console and onto the controller in modern systems.
The right arrow links to a detailed articles on how 2600 controllers work. Input and Controllers
The sound for the 2600 was very limited. There are two sound channels, but the only type of sound that is supported are 16 different tones that can be played at 32 different frequencies with 16 different volume levels. By combining these over the course of time, interesting sounds could be created, but the difficulty in doing this resulted in most games having very simplistic sounds.
I am not a sound person, but do have a brief article on programming sound. Sound...sort of
5 The 2600 was a cartridge based system. Cartridges ares similar to the memory cards that we use today in our mobile devices except they were much larger. The 2600, however, was not the first system to use cartridges, that honour went to the Fairchild's Channel F game console6 . Cartridges stored the game on ROM chips. As mentioned above, the 2600 only supported 4KB of ROM, but early game cartridges were only 2KB.
When the limitation of 4KB cartridges became too big of a restriction, extra circuitry was added to allow for bank-switching. This is a technique that allows multiple banks of memory to be placed in the cartridge and for the program to switch between different banks of memory allowing for much larger games. There were a number of bank-switching techniques used, with homebrew developers coming up with a few of their own.
Of course there is a more detailed article on cartridges and bank-switching. Cartridges and Bank Switching
How Games Work
Games are simply a combination of the above parts with the addition of game logic. Because of how tied to the hardware 2600 games are, the main logic of the game is mixed in with the code to display the screen. Modern programming practices try to separate logic from hardware, but this is simply not practical with the 2600. The typical 2600 program works as follows:
- Game loop (runs until console turns off):
- synchronizing with the TV
- display related game logic worked out before need to start drawing
- drawing the display
- reading controls and buttons then performing other game logic while over scan occurs
- repeat game loop.
The right arrow leads to a high-level language demo of a simple 2600 game. 2600 Prototype Game Demo