Atari 7800 Color Documentation

From 8BitDev.org - Atari 7800 Development Wiki
Jump to: navigation, search

NTSC and PAL Palettes

Atari 7800 color values are split into 2 parts - the upper 4 bits control the hue of the color, and the lower 4 bits control the brightness of the color. Atari 7800 color values are often represented in hexadecimal notation, since each digit in a single byte $XX hex number represents 4 bits.

A7800 Color Palette - NTSC factory tuned or "cool" setting A7800 Color Palette - NTSC factory tuned or "cool" setting

The 7800 uses very similar palettes for NTSC and PAL consoles, with some minor differences with the hue at any one register. With some careful selection of color indexes, most 7800 games should be able to use a common palette between the 2 platforms.

Technical Overview of Color Generation

Atari 7800 hue values shifting as the console warms up, overlaid on Y=0.5 IQ colorspace.

The color system in the 7800 is designed to efficiently generate color signals that are PAL or NTSC ready, with very little silicon and support circuitry. To better understand 7800 colors, it helps to have a general understanding of NTSC and PAL color encoding.

Both NTSC and PAL TV standards have a short colorburst signal near the beginning of each scanline. The colorburst serves 2 purposes. Its presence signals to the TV that the scanline will contain color information, but it also serves as a phase reference. If the same frequency is later detected by the TV during the display of a pixel, the TV will compare the frequency's phase relative to the original colorburst, and use the result as an index to a hue in the YIQ colorspace(NTSC) or YUV colorspace(PAL).

From a signal perspective, the top 4 bits of any color register actually determines the amount of phase-shift applied to the color frequency, and the bottom 4 bits determines the voltage level of the pixel.

The 7800 color system uses a uniform level of saturation for all of its color values, except for color values from $00 to $0F, which are displayed without any saturation. This allows for the display of black, shades of grey, and white.

Consistency Issues

There are a number of factors that result in inconsistency between the palettes of 7800 consoles:

  • Each 7800 console has a tunable resistor inside, which is used to modify the color signal frequency period. On any given console this resistor may be adjusted a number of different ways, with at least 2 published historic standards in play - one with hues ~25.7 degrees apart, and another with hues ~26.7 degrees apart.
  • As a 7800 console warms up, so do the components that produce the color signal frequency period, while the colorburst frequency remains constant, so the distance between the various hues in the palette stretch out. When cold, the console's hue values have ~24.7 degrees of separation, and as the console warms up, up to ~27.7 degrees of separation can be seen between the hues. The separation is cumulative, and so is more pronounced with higher hue values; the $Ex hue can shift from being green through yellow/brown, and $Fx can shift from an initial greenish-yellow/brown through to a reddish yellow/brown. The majority of this shifting will happen in the first 20 minutes of console operation, though some additional shifting can be seen hours later.
  • The NTSC and PAL standards don't consistently display the same colors from TV to TV, and almost all TVs allow the viewer to tune colors to their liking.

The largest factor in these consistency issues is typically the warm-up issue. Since the latter hues shift more than the earlier ones, a 7800 game designer should generally avoid the last 2 $Ex and $Fx hues for critical items that need faithful color. e.g. one may wish to avoid using $Ex for green grass, or $Fx for gold coins.

The warm-up effect can be seen in commercial 7800 title Choplifter, where the ground utilizes a $E8 color value, and consequently shifts from green to yellow-brown.

Color Artifacting

Artifacting colors from 2 different 7800 consoles compared

320 pixel modes on the 7800 are prone to artifacting colors. The 7800 pixel clock operates at twice the colorburst frequency, so from the TV's perspective, any alternating pattern of light and dark 320 mode pixels is indistinguishable from color information. If the light pixels are on even positions, one color is produced, and if dark pixels are on even positions, another color is produced.

A second set of artifact colors can be produced by alternating pairs of light pixels with pairs of dark pixels. This second set of artifact colors will be less intense, and striped in luminance.

The specific artifact colors produced can vary from console to console, depending on hardware modifications, and likely varying between MARIA revisions. Its also worth mentioning that if a console has been video-modified to produce s-video output, it won't be able to display artifact colors, since the pixel luminance signal will no longer be mixed with the chroma signal. Similarly, if you turn off the colorburst signal using the CTRL register, artifacting will be eliminated, along with the rest of the non-artifact colors.

If you're designing graphics and fonts for 320 mode display, and you wish to minimize artifacting, you need to ensure that any bright or dark pixels are horizontally followed by 1 or more pixels of the same luminance.