Television Interface Adapter
Encyclopedia
The Television Interface Adaptor (TIA) is the custom computer chip that is the heart of the Atari 2600
Atari 2600
The Atari 2600 is a video game console released in October 1977 by Atari, Inc. It is credited with popularizing the use of microprocessor-based hardware and cartridges containing game code, instead of having non-microprocessor dedicated hardware with all games built in...

 game console, generating the screen display, sound effects, and reading input controllers. Its design was widely affected by an attempt to reduce the amount of RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 needed to operate the display. The resulting design is notoriously difficult to program, but at the same time offers flexibility well beyond the capabilities of contemporary designs. It remains a key reason that the 2600 maintains a strong homebrew
Homebrew
Homebrew may refer to:* Homebrewing of alcoholic beverages and other drinks* Homebrew * Homebrew - A package manager for Mac OS X* Homebrew ** Wii homebrew...

 following.

Development of the TIA was led by Jay Miner
Jay Miner
Jay Glenn Miner , was a famous integrated circuit designer, known primarily for his work in multimedia chips and as the "father of the Amiga"...

, later of Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

 fame. Atari later expanded on the design of the TIA for the Atari 400 and Atari 800 with the CTIA and GTIA chips.

Background

Early video games generally used two distinct types of graphics, the "players" which were controlled by the player or the computer (today known as sprites
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

), and the "playfield", or background graphics normally drawn under the players.

The conventional way to draw the playfield is to use a bitmap
Bitmap
In computer graphics, a bitmap or pixmap is a type of memory organization or image file format used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits. Now, along with pixmap, it commonly refers to...

 held in a framebuffer
Framebuffer
A framebuffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.The information in the memory buffer typically consists of color values for every pixel on the screen...

. Each memory location in the framebuffer holds a value that describes pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

s on the screen. The display circuitry reads these values out of the buffer and uses it to generate an analog signal for display on a computer monitor. The mapping of the memory to screen locations, or pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

s was often limited by the display hardware. On a conventional NTSC
NTSC
NTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...

 color television
Color television
Color television is part of the history of television, the technology of television and practices associated with television's transmission of moving images in color video....

, maximum resolutions generally fell between 256 and 320 pixels per line, and 192 to 240 lines per screen.

RAM-less design

At the time the 2600 was being designed, RAM
Random-access memory
Random access memory is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order with a worst case performance of constant time. Strictly speaking, modern types of DRAM are therefore not random access, as data is read in...

 was extremely expensive, measured in dollars (or cents) per byte. A typical 320 by 200 pixel display with even a single bit per pixel would require 8000 bytes of memory to store the framebuffer. This would not be suitable for a platform that aimed to cost only a few hundred dollars. Even dramatic reductions in the resolution would not reduce the cost of memory to reasonable levels. Instead, the design team decided to remove the memory-based framebuffer entirely.

The TIA differs from the conventional framebuffer approach in that the image on the screen is composed by manipulating five movable graphic objects (2 players, 2 missiles and 1 ball) and a static playfield object. These are all generated on every scan line from their respective registers, unlike as it is in a framebuffer mapped model, requiring the program to update these on every scan line. Horizontal resolution is not uniform, as its size depends on the particular graphics object. The smallest unit of pixel corresponds to 1 color clock cycle of the chip, of which there are 160 visible ones on a line.

The Playfield object consists of a two-and-a-half byte register (20 bits wide), which can be reflected symmetrically or copied as-is to the right half of the screen for 40 bits in total (each bit being 4 color cycles wide). The color that was drawn if the bit was a 1 or a 0 was selected from a pre-defined palette of up to 128 colors (see below) and held in other registers.

The TIA also supported five separate graphics objects consisting of:
  • Two 8-pixel horizontal lines which make up the 'sprite
    Sprite (computer graphics)
    In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

    s' Player 1 and Player 2. These are single color, can be stretched by a factor of 2 or 4, and can be duplicated or triplicated.
  • A 'ball' - a horizontal line that is the same color as the playfield. It can be one, two, four, or eight pixels wide.
  • Two 'missiles' - another horizontal line that is the same color as its respective player. It can be one, two, four, or eight pixels wide.


The TIA has hardware collision detection for all of these objects and stores a bitmap of collisions, that are typically read during the VBLANK period. Registers in the TIA allow the programmer to control the positioning of the graphical objects and their color.

The TIA also provides two channels of one-bit sound. Each channel provides for 32 pitch values and 16 possible bit sequences. There is a 4 bit volume control.

Lastly, the TIA has inputs for reading up to four analog paddle controllers using potentiometer
Potentiometer
A potentiometer , informally, a pot, is a three-terminal resistor with a sliding contact that forms an adjustable voltage divider. If only two terminals are used , it acts as a variable resistor or rheostat. Potentiometers are commonly used to control electrical devices such as volume controls on...

s and for two joystick triggers.

Drawing the display

As the registers held data for only a single line of the display, creating a full screen required the game program to update the registers on the fly, a process known as "racing the beam".

To start the process, the game program running on the MOS Technology 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...

-based CPU would load the TIA's registers with the data needed to draw the first line of the display. The TIA would then wait until the television was ready to draw the line (under the command of the TIA's associated analog hardware) and read out the registers to produce a signal for that line. When the television was busy getting ready to draw the next line, the 6502 would quickly change the TIA's registers to the data needed for the next line. This process continued down the screen.

This process was made more difficult by the fact that the MOS Technology 6507
MOS Technology 6507
The 6507 is an 8-bit microprocessor from MOS Technology, Inc.It is essentially a 6502 chip in a smaller, cheaper 28-pin package. To do this, A15 to A13 and some other signals such as the interrupt lines are not accessible...

 used in the 2600 was a pin-reduced version of the 6502 which had no support for hardware interrupt
Interrupt
In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution....

s. Generally the analog side of the display system would generate an interrupt when it finished drawing a line and was getting ready for the next one (as in the Atari home computers, for instance). The interrupt would trigger the code needed to update the screen, and then return to the "main" program. The 6507 left these pins off of the CPU to save money. This meant that the programmer had to carefully time their programs to run in the exact number of cycles needed for the various screen-related events to take place. Getting it wrong meant the screen would not draw properly, so in addition to the complexity of the drawing the display, the programmer also had to carefully count the number of cycles that their program took to run, moving code around as necessary to ensure it fit cleanly within the limited CPU budget. The program needed to do this was known as the "kernel", and was fantastically complex compared to other systems.

Given this complexity, early games using the system tended to be quite simple in layout, using the TIA to create simple symmetric playfields with players on top. This was the original intention of the system, to be able to run the handful of arcade game
Arcade game
An arcade game is a coin-operated entertainment machine, usually installed in public businesses such as restaurants, bars, and amusement arcades. Most arcade games are video games, pinball machines, electro-mechanical games, redemption games, and merchandisers...

s Atari had already produced with simple playfields, like Tank
Tank (arcade game)
Tank is a two-player arcade game by Atari Inc. subsidiary Kee Games, originally released on November 5, 1974 and designed by Steve Bristow and Lyle Rains...

and Pong
Pong
Pong is one of the earliest arcade video games, and is a tennis sports game featuring simple two-dimensional graphics. While other arcade video games such as Computer Space came before it, Pong was one of the first video games to reach mainstream popularity...

. In these cases the playfield data was typically laid out in the 2 kB ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

 memory in the game cartridge
ROM cartridge
A ROM cartridge, sometimes referred to as a cart, is a removable enclosure containing read-only memory devices designed to be connected to a computer or games console....

. As each line used 20 bits of data, and there were 192 lines on an NTSC display, a display with a different layout on every line needed only 480 bytes (192 x 20 / 8) of the cartridge's 4 kB to hold a single hard-coded display. In this case the kernel simply advanced 20 bits through ROM for every line as the TIA advanced down the screen, a task that took only a few cycles of CPU time. This could be further reduced by using the same data for multiple lines, either doubling them vertically, or reading one way through the list for the top and then back the other way for the bottom, producing a vertically mirrored display of only 240 bytes.

A key advance was the licensing of Space Invaders
Space Invaders
is an arcade video game designed by Tomohiro Nishikado, and released in 1978. It was originally manufactured and sold by Taito in Japan, and was later licensed for production in the United States by the Midway division of Bally. Space Invaders is one of the earliest shooting games and the aim is to...

for the platform, which required many more player graphics to draw the enemy aliens. The solution was to change the player data for every line as the image was being drawn, creating an apparent large number of players. Space Invaders was the platform's killer app, quadrupling the system's sales. Another advance was made by (partially) coding the display as CPU instructions instead of storing it as fixed data in ROM. Adventure
Adventure (Atari 2600)
Adventure is a video game for the Atari 2600 video game console and is considered the first action-adventure game. Its creator, Warren Robinett, also introduced the first widely-known Easter egg to the gaming world.-History and design:...

used this concept to produce a wide variety of maps by combining different portions of the data in ROM, jumping back and forth through it during the screen drawing. This allowed the game to have 30 rooms, which would have otherwise required 14 kB of ROM.

As programmers grew more accustomed to the odd timing needed to get things to work properly on-screen, they began to use the inherent flexibility in the TIA to greatly improve the displays. One common "trick" was to change the color registers that were used to draw the 1 and 0 states of the playfield, resulting in displays with rainbow-like effects - this became a hallmark of the platform. Later games even managed to get the timing to the point where they could safely change the colors while the line was being drawn. Similar effects could be used to modify the playfield mid-line to generate asymmetric patterns and repositioning and changing player sprites mid-screen in order to generate additional sprites on screen. These tricks, collectively referred to as "racing the beam", in many cases allowed more graphically rich games than the hardware designers originally anticipated. Programming the TIA remains a real challenge which many homebrew programmers still enjoy today.

TIA Color Capabilities

The TIA uses different color palettes depending on the television signal format used. For NTSC
NTSC
NTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...

 format, a 128-color palette is provided, while only 104 colors are available for PAL
PAL
PAL, short for Phase Alternating Line, is an analogue television colour encoding system used in broadcast television systems in many countries. Other common analogue television systems are NTSC and SECAM. This page primarily discusses the PAL colour encoding system...

. Additionally, the SECAM
SECAM
SECAM, also written SÉCAM , is an analog color television system first used in France....

palette consists of only 8 colors.

NTSC palette

hue / luminance 0 2 4 6 8 10 12 14
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

PAL palette

hue / luminance 0 2 4 6 8 10 12 14
0,1,14,15
2
3
4
5
6
7
8
9
10
11
12
13

SECAM palette

0 2 4 6 8 10 12 14

Noise/Tone Generator (AUD0/1)

The TIA is capable of generating different flavors of pulse and noise out its two oscillators (or channels) AUD0 and AUD1. Each oscillator has a 5-bit frequency divider and a 4-bit audio control register which manipulates the waveform. There is also a 4-bit volume control register per channel.

Frequency Divider (AUDF0/1)

Frequencies are generated by taking 30 kHz and dividing by the 5-bit value supplied. The result is a cheap frequency divider capable of detuned notes and the odd tuned frequency. The TIA is not a musical chip unless the composer works within the frequency limits or modulates between two detuned frequencies to create a vibrato tuned note.

Audio Control (AUDC0/1)

The Audio Control register generates and manipulates a pulse wave to create complex pulses or noise. The following table (with designed duplicates) explains how its tones are generated:




































































































































































  D7 D6 D5 bordercolor="#000000">D4 D3 D2 D1 D0  
HEX     Type of noise or division:
0 0 0 0 0 Set to 1 (volume only)
1 0 0 0 1 4 bit poly
2 0 0 1 0 ÷ 15 face="Courier">→ 4 bit poly
3 0 0 1 1 5 bit poly 4 bit poly
4 0 1 0 0 ÷ 2
5 0 1 0 1 ÷ 2
6 0 1 1 0 ÷ 31
7 0 1 1 1 5 bit poly ÷
2
8 1 0 0 0 9-bit poly (white noise)
9 1 0 0 1 5-bit poly
A 1 0 1 0 ÷ 31
B 1 0 1 1 Set last 4 bits to 1
C 1 1 0 0 ÷ 6
D 1 1 0 1 ÷ 6
E 1 1 1 0 ÷ 93
F 1 1 1 1 5-bit poly ÷ 6



External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK