Atari 2600/VCS#
Open 8bitworkshop IDE
Click here to program the Atari 2600 in the 8bitworkshop IDE now!
VCS Specifications#
- Lifespan
1977–1992
- Media
ROM cartridge (2K-64K)
- CPU 8-bit
MOS Technology 6507 @ 1.19 MHz
- Memory
128 bytes RAM (can be expanded by cartridge)
- Controllers
Joystick, paddles, driving, keypad, Trak-Ball
- Best-selling game
Pac-Man
History#
Atari was founded by Nolan Bushnell and Ted Dabney in 1972 to commercialize video games, which were at this time only found in university basements. They developed the arcade games Computer Space and Pong, the latter becoming a huge success. They also developed more complex games like Tank which included a ROM chip.
Atari developed a Pong home console, but wanted to develop a console that could play more than one game. In 1975 MOS Technology announced the 6502 CPU, which at $5 (volume pricing) made a programmable home console feasible. To save money on RAM, they’d omit the typical frame buffer, relying on the 6502 to program the TIA chip right before each scanline.
By 1974, Atari had acquired Cyan Engineering, and hired Joe Decuir to help debug the first prototype, codenamed “Stella”, and to demonstrate that it could play Tank (later released as the Combat cartridge.) Jay Miner worked on the ASIC design for the TIA chip, and they completed the second prototype by March 1976. The final system included these chips:
6507, a cost-reduced 6502 in a 28-pin package.
6532, with 128 bytes of RAM, 16 I/O ports, and a programmable timer
TIA, which generates video and audio
a 2K or 4K ROM via cartridge slot
Bushnell considered taking Atari public but instead sold the company to Warner Communications for US$28 million; subsequently, Warner provided approximately US$100 million in new funding, allowing Stella to be prioritized and fast-tracked.
The Atari VCS (Video Computer System) was released in time for Christmas 1977 at $199 ($840 adjusted for inflation), and shipped with two joysticks and a Combat cartridge. Other launch titles included Air-Sea Battle, Basic Math, Blackjack, Indy 500, Starship, Street Racer, Surround, and Video Olympics.
The VCS was the best-selling console during the 1979 holiday season, with more than 1 million units sold. It helped Atari earn more than $2 billion in 1980. In 1982 it was rebranded the Atari 2600.
Activision, formed by four former Atari VCS programmers, led the vanguard of third-party game development thanks to a victory in court. But changing market conditions made the boom short-lived. By mid-1984, software development for the 2600 had essentially stopped except for that of Atari and Activision. Atari’s Consumer Division was sold to Commodore founder Jack Tramiel, who shifted the business’ focus to home computers and ended all development of console games.
Programming#
Because of the precise timing required, the VCS is usually programmed in 6502 assembly language. A “kernel” runs while the video signal is active, setting up the TIA for each scanline. Other game logic usually runs during the blank portions of each frame.
batariBASIC is also available.
Registers (vcs.h)#
Hex |
Name |
Bit Mask |
Description |
---|---|---|---|
|
|
|
Vertical Sync |
|
|
|
Vertical Blank / Latched Port Enable |
|
|
|
Wait for Horizontal Blank |
|
|
|
Number-size Player/Missile 0 |
|
|
|
Number-size Player/Missile 1 |
|
|
|
Color – Player/Missile 0 |
|
|
|
Color – Player/Missile 1 |
|
|
|
Color – Playfield/Ball |
|
|
|
Color – Background |
|
|
|
Control Playfield, Ball |
|
|
|
Reflect Player 0 |
|
|
|
Reflect Player 1 |
|
|
|
Playfield 0 (pixels 0-3) |
|
|
|
Playfield 1 (pixels 4-11) |
|
|
|
Playfield 2 (pixels 12-19) |
|
|
|
Reset Player 0 |
|
|
|
Reset Player 1 |
|
|
|
Reset Missile 0 |
|
|
|
Reset Missile 1 |
|
|
|
Reset Ball |
|
|
|
Audio Control Channel 0 |
|
|
|
Audio Control Channel 1 |
|
|
|
Audio Frequency Channel 0 |
|
|
|
Audio Frequency Channel 1 |
|
|
|
Audio Volume Channel 0 |
|
|
|
Audio Volume Channel 1 |
|
|
|
Graphics Bitmap Player 0 |
|
|
|
Graphics Bitmap Player 1 |
|
|
|
Enable Missile 0 |
|
|
|
Enable Missile 1 |
|
|
|
Enable Ball |
|
|
|
Horizontal Motion Player 0 |
|
|
|
Horizontal Motion Player 1 |
|
|
|
Horizontal Motion Missile 0 |
|
|
|
Horizontal Motion Missile 1 |
|
|
|
Horizontal Motion Ball |
|
|
|
Vertical Delay Player 0 |
|
|
|
Vertical Delay Player 1 |
|
|
|
Vertical Delay Ball |
|
|
|
Reset Missile 0 to Player 0 |
|
|
|
Reset Missile 1 to Player 1 |
|
|
|
Apply Horizontal Motion (fine offsets) |
|
|
|
Clear Horizontal Motion Registers |
|
|
|
Clear Collision Latches |
|
|
|
Collision M0-P1, M0-P0 |
|
|
|
Collision M1-P0, M1-P1 |
|
|
|
Collision P0-PF, P0-BL |
|
|
|
Collision P1-PF, P1-BL |
|
|
|
Collision M0-PF, M0-BL |
|
|
|
Collision M1-PF, M1-BL |
|
|
|
Collision BL-PF |
|
|
|
Collision P0-P1, M0-M1 |
|
|
|
Dumped Input Port 0 |
|
|
|
Dumped Input Port 1 |
|
|
|
Dumped Input Port 2 |
|
|
|
Dumped Input Port 3 |
|
|
|
Latched Input Port 4 |
|
|
|
Latched Input Port 5 |
|
– |
|
128 Bytes RAM |
|
|
|
Joysticks/Controllers |
|
|
|
Port A DDR (Data Direction Register) |
|
|
|
Console Switches |
|
|
|
Port B DDR (hardwired as input) |
|
|
|
Timer Output |
|
|
|
Set 1 Cycle Timer |
|
|
|
Set 8 Cycle Timer |
|
|
|
Set 64 Cycle Timer |
|
|
|
Set 1024 Cycle Timer |
Macros (macro.h)#
CLEAN_START
Standardised start-up code at start of program.
VERTICAL_SYNC
Inserts the code required for a proper 3 scanline vertical sync sequence. Modifies A.
SLEEP
nSleep n cycles.
SET_POINTER
variable constantSet a 2 byte pointer to an absolute address. Modifies A.
SKIP_SCANLINES
nSkip a given # of scanlines. Sets X to 0.
Extra Macros (xmacro.h)#
TIMER_SETUP
linesThe timer will be set so that it expires before
lines
scanlines. A WSYNC will be done first.TIMER_WAIT
Use with
TIMER_SETUP
to wait for timer to complete. Performs a WSYNC afterwards.
Helpful Links#
Javatari.js, the emulator used by 8bitworkshop