CTIA and GTIA
Color Television Interface Adaptor[1] (CTIA) and its successor Graphic Television Interface Adaptor[1] (GTIA) are custom chips used in the Atari 8-bit family of computers and in the Atari 5200 console. In these systems, a CTIA or GTIA chip works together with ANTIC to produce video display. The chips were designed by George McLeod with technical assistance of Steve Smith.[2][3]
Color Television Interface Adaptor and Graphic Television Interface Adaptor are names of the chips as stated in the Atari field service manual.[1] Various publications named the chips differently, sometimes using the alternative spelling Adapter[4][5] or Graphics,[3] or claiming that the "C" in "CTIA" stands for Colleen/Candy[4] and "G" in "GTIA" is for George.[3][4][5][6]
Contents |
[edit] History
The CTIA was designed in 1977 as part of the chipset for use in an improved successor of the Atari 2600 console.[7] The 2600 used a chip known as the Television Interface Adaptor (TIA). In terms of graphics support, the design of the CTIA followed that of the TIA - it had a "playfield" layer for background graphics along with several "players" and "missiles" (today known as sprites) for moving foreground objects. However, the sprites were improved in number, from two players and two missiles to four of each. A fifth sprite in the TIA, the "ball", was removed, as some of its capabilities were combined into the missiles. The four missiles could alternately be combined to form a fifth player, by setting a register.
During development, the home computer revolution started in earnest in the later half of 1977. In response, Atari decided to release two versions of the new machine, a low-end model as a games console, and a high-end version as a home computer.[7] In either role, a more complex playfield would be needed, especially support for character graphics in the computer role. For this purpose the new ANTIC chip was introduced to handle the storage and interpretation of a bitmap framebuffer, which the TIA did not support. Under the new model, the ANTIC would feed the CTIA with data, which would then be colored and sent into the video circuitry. This had the added advantage of greatly reducing programming complexity, compared to the "racing the beam" system used in the 2600.
As a result of these changes, the number and selection of graphics modes on the new models was greatly improved over the TIA. Instead of a single playfield mode with 20 or 40 bits of resolution, the CTIA/ANTIC can display six text modes and eight graphics modes with various resolutions and color depths, allowing the programmer to select a mode with the minimum memory needs they required for their display. Resolutions varied from 40 to 320 pixels horizontally, 24 to 192 vertically, and 2 to 4 colors per line. A particularly common mode for gaming purposes was a 160 x 192 x 4 color mode later known as "graphics 7.5".[8]
The original design of the CTIA circuit also included support for three additional color interpretations of the normal graphics modes. This featured provided alternate expressions of the Antic Mode F graphics (2 color, 320x192) as 16 color, 80x192 displays. This feature was ready before the computers' November 1979 debut, but was delayed so much in the development cycle that Atari had already ordered a batch of about 100,000 CTIA chips with the graphics modes missing. Not wanting to throw away the already-produced chips, the company decided to use them in the initial release of the Atari 400 and 800 models in the US market. The CTIA-equipped computers, lacking the 3 color modes, were shipped until October–November 1981.[4][5] From this point, all new Atari units were equipped with the new chip, now called GTIA, that supported the new color interpretation modes.[5][9]
The Atari computers' operating system ROM supported the 16-color graphic modes from the start,[9] which allowed for easy replacement of the CTIA with the GTIA once it was ready. Atari authorized service centers would install a GTIA chip in CTIA-equipped computers free of charge if the computer was under warranty; otherwise the replacement would cost $62.52.[5][6]
GTIA was also mounted in all later Atari XL and XE computers and Atari 5200 consoles.
[edit] Functions
The CTIA/GTIA is a television interface chip. It converts the digital commands from ANTIC into the signal that goes to the television. It also performs the following additional functions:
- It is responsible for adding color to the display.
- It draws sprites (known as Player/Missiles) over the background graphics (known as playfield).
- It checks for collisions among the sprites as well as between the sprites and the background.
It also performs a few additional minor tasks:
- It is responsible for reading state of joysticks' triggers (bottom buttons only in case of Atari 5200 controllers).
- It contains four input/output pins that are used in different ways depending on the system:
- In Atari 8-bit computers, three of the pins are used to read state of the console keys (Start/Select/Option). The fourth pin controls the speaker built into the Atari 400/800, used to generate keyboard clicks. On later models there is no internal speaker, but the keyclick is still generated by GTIA and mixed with the regular audio output.
- In the Atari 5200, the pins are used as part of the process that reads state of joysticks' keyboards.
[edit] Sprites (Player/Missile Graphics)
A hardware sprite system is handled by CTIA/GTIA. The official ATARI name for the sprite system is "Player/Missile Graphics", since it was designed to reduce the need to manipulate display memory for fast-moving objects, such as the "player" and his weapons, "missiles", in a shoot 'em up game.
A sprite is essentially a glyph 8 pixels wide and 256 TV lines tall, and has two colors: the background (transparent) (0 in the glyph) and the foreground (1). CTIA/GTIA mixes the "foreground" color with the pixel beneath it, and displays the pixel "behind" the background color (that is, the main display) without change. A register value can set the sprites pixels width to 1, 2, or 4 color clocks wide.
The sprite implementation by CTIA/GTIA is actually one 8-bit value or pattern that extends the height of the display including the screen border. That is, the sprite is essentially a stripe down the screen. While seemingly limited this method allows sprites to be used as alternate colored vertical borders or separators on a display, and when priority values are set to put sprite pixels behind playfield pixels they can be used to add additional colors to a display.
The conventional assumption of a sprite with an image/pattern that varies vertically is also built into the system. The ANTIC chip includes a feature to perform DMA automatically feeding new pixel patterns to CTIA/GTIA as the display is generated. This can be done for each scan line or every other scan line resulting in sprite pixels one or two scan lines tall. In this way the "sprite" could be considered an extremely tall character in a font, 8 bits/pixels wide, by the height of the display.
There are eight sprites; four "players" each eight pixels wide and four "missiles" each two pixels wide. Each player has its own horizontal position register. The four missiles have separate horizontal positions registers, but share one 8-bit data register for the image pattern. The four "missiles" can be grouped together to create a fifth, eight pixel wide "player". CTIA/GTIA has a color control register that causes the pixels of two sprites to generate a third color where the pixels overlap allowing multi-colored sprites at the expense of reducing the number of available sprites.
Moving the sprite horizontally is as simple as changing a register in the CTIA/GTIA (in Atari BASIC, a single POKE statement moves a player or missile horizontally). Moving the sprite vertically is achieved by block moving (or rotating) the definition of its glyph in memory which is quite fast in 6502 machine language, even though the 6502 lacks a block-move instruction like the 8080, because the sprite is exactly 128 or 256 bytes long and so the indexing can be easily accommodated in a byte-wide register on the 6502. However, block memory moves are painfully slow in Atari BASIC, and so BASIC programs using sprites will ordinarily include short USR() routines to perform the memory moves, or utilize a large string as the player/missile memory map and perform string move commands to accomplish the high speed memory moves.
Careful use of sprites with the other graphics features of the Atari hardware can make graphics programming, particularly games, significantly simpler.
[edit] GTIA enhancements
The GTIA chip was backward compatible with the CTIA, and added 3 color interpretations for the 14 "normal" graphics modes. With the normal color interpretation of the CTIA chip the Atari was limited to a maximum of 4 colors in graphics and 5 colors in text, unless special programming techniques were used. The 3 new color interpretations in GTIA theoretically provided a total of 56 graphics modes (14 modes multiplied by four possible color interpretations). However, only the graphics modes based on half color clock pixels (that is, Antic text modes 2, 3, and graphics mode F) are capable of fully expressing the color palettes of these 3 new color interpretations. The three additional color interpretations use the information in two color clocks (four bits) to generate a pixel in one of 16 color values. This changes a mode F display from 2 colors per pixel, 320 pixels horizontally, to 16 colors and 80 pixels horizontally, or 80x192 for a full screen. The additional color interpretations allowed the following:
- 16 shades of a single hue from the 16 possible hues in the Atari palette. This is also accessible in Atari BASIC as Graphics 9.
- 16 hues in a single shade/luminance value. This is accessible in Atari BASIC as Graphics 11.
- Finally, the last mode, accessible in Atari BASIC as Graphics 10, allows 9 colors per horizontal line in any hue and luminance from the entire Atari palette of 128 colors. This is accomplished using all five playfield color registers, and the four player/missile color registers.
Of these modes, Atari BASIC Graphics 9 is particularly notable. It enabled the Atari to display gray-scale digitized photographs, which despite their low resolution were very impressive at the time. Additionally, by allowing 16 shades of a single hue rather than the 8 shades available in other graphics modes, it increased the amount of different colors the Atari could display from 128 to 256. Unfortunately this feature was limited for use in this mode only, which due to its low resolution was not widely used.
The Antic 2 and 3 text modes are capable of displaying the same color ranges as mode F graphics when using the GTIA's alternate color interpretations. However, since the pixel reduction also applies and turns 8 pixel wide, 2 color text into 2 pixel wide, 16 color blocks these modes are unsuitable for actual text, and so these graphics modes are not popular outside of demos. Effective use of the GTIA color interpretation feature with text modes requires a carefully constructed character set treating characters as pixels. This method allows display of an apparent GTIA "high resolution" graphics mode that would ordinarily occupy 8K of RAM to instead use only about 2K (1K for the character set, and 1K for the screen RAM and display list.)
The GTIA also fixed an error in CTIA that caused graphics to be misaligned by "half a color clock". The side effect of the fix was that programs that relied on color artifacts in high-resolution monochrome modes would reverse their colors.[4]
Atari owners can determine if their machine is equipped with the CTIA or GTIA by executing the BASIC command POKE 623,64. If the screen blackens after execution, the machine is equipped with the new GTIA chip. If it stays blue, the machine has a CTIA chip instead.
[edit] Versions
by part number
- C012295 — NTSC CTIA[10]
- C014805 — NTSC GTIA[11]
- C014889 — PAL GTIA[11]
- C020120 — French SECAM GTIA (FGTIA)[11]
Atari, Inc. intended to combine functions of the ANTIC and GTIA chips in one integrated circuit to reduce production costs of Atari computers and 5200 consoles. Two such prototype circuits were being developed, however none of them entered production.
[edit] Bugs
The last Atari XE computers made for the Eastern European market were built in China. Many if not all have a buggy PAL GTIA chip. The luma values in Graphics 9 and higher are at fault, appearing as stripes. Replacing the chip fixes the problem. Also, there have been attempts to fix faulty GTIA chips with some external circuitry.
[edit] See also
[edit] References
- ^ a b c "I. Theory of Operation" (PDF). Atari Home Computer Field Service Manual - 400/800. Atari, Inc.. p. 1-10. http://www.digitpress.com/library/techdocs/Atari_400-800_Service_Manual.pdf. Retrieved 2010-09-10.
- ^ Neubauer, Doug (2009-06-20). "The Atari Years, by Doug Neubauer. Star Raiders, Solaris and Pokey". DougNeubauer.com. http://dougneubauer.com/atari/#headnumber3.
- ^ a b c Sherer, Robin Alan (6 1988). "GTIA Joystick Painter - Powerful Atari Animation Tool". ANTIC 7 (2): 37. ISSN 0113-1141. http://www.atarimagazines.com/v7n2/GTIAJoystickPainter.html. Retrieved 2011-01-26.
- ^ a b c d e Patchett, Craig; Sherer, Robin (1984). "Special Chips and ROM". The Master Memory Map for the Atari. Reston, Va.: Reston Publishing Company. ISBN 0-8359-4242-2. http://www.atariarchives.org/mmm/special_chips.php. Retrieved 2011-01-26.
- ^ a b c d e Mace, Scott (1982-03-15). "Atari quietly switches to a 16-color graphics chip". InfoWorld (Palo Alto, CA: Popular Computing) 4 (10): 3–4. ISSN 0199-6649. http://books.google.com/books?id=gD4EAAAAMBAJ&pg=PA3. Retrieved 2011-02-01.
- ^ a b Chamberlain, Craig (7 1982). "Atari Video Graphics And The New GTIA". Compute! (26): 124. ISSN 0194-357X. http://www.atarimagazines.com/compute/issue26/Atari_Video_Graphics_And_The_New_GTIA.php. Retrieved 2011-01-24.
- ^ a b Joe Decuir, "3 Generations of Game Machine Architecture", CGEXPO99
- ^ Carl Zahrt and Orson Scott Card, "Screenbyter", Compute!'s Second Book of Atari Graphics
- ^ a b Small, David; Small, Sandy; Blank, George (May 1983). "Design Philosophy and GTIA Demos". The Creative Atari. Creative Computing Press. ISBN 978-0916688349. http://www.atariarchives.org/creativeatari/Design_Philosophy_and_GTIA_Demos.php. Retrieved 2011-01-26.
- ^ Switzer, Steve (10 1983). "Atari Clinic". ANTIC 2 (7): 103. ISSN 0113-1141. http://www.atarimagazines.com/v2n7/atariclinic.html. Retrieved 2011-02-01.
- ^ a b c d e Boris, Dan. "Atari Chips". Dan B's Home Page. http://www.atarihq.com/danb/AtariChips.shtml. Retrieved 2011-02-01.
- ^ Vendel, Curt. "Atari 800XLCR". AtariMuseum.com. http://www.atarimuseum.com/computers/8bits/xl/800xl/800xlcr.html. Retrieved 2011-02-01.
- ^ Vendel, Curt. "KERI Performance Tester". AtariMuseum.com. http://www.atarimuseum.com/computers/8BITS/XL/keri.html. Retrieved 2011-02-01.
[edit] External links
- De Re Atari by Chris Crawford
- Mapping the Atari, Revised Edition by Ian Chadwick
- GTIA Chip data sheet
- CGIA Chip data sheet
- jindroush site(archived) GTIA info
- CTIA die shot
- GTIA die shot