Color Graphics Adapter

Information about Color Graphics Adapter



The Color Graphics Adapter (CGA), introduced in 1981, was IBM's first color graphics card (originally sold under the name "Color/Graphics Monitor Adapter"), and the first color computer display standard for the IBM PC.

The standard IBM CGA graphics card was equipped with 16 kilobytes of video memory, and could be connected either to a NTSC-compatible monitor or TV via an RCA jack, or to a dedicated RGBI CRT monitor. Based around the Motorola MC6845 display controller, the CGA card featured several graphics and text modes. The highest resolution of any mode was 640×200, and the highest color depth supported was 4-bit (16 colors).

The CGA color palette

Full CGA 16-color palette
0black
#000000
8(dark) gray
#555555
1blue
#0000AA
9bright blue
#5555FF
2green
#00AA00
10bright green
#55FF55
3cyan
#00AAAA
11bright cyan
#55FFFF
4red
#AA0000
12bright red
#FF5555
5magenta
#AA00AA
13bright magenta
#FF55FF
6brown
#AA5500
14yellow
#FFFF55
7white (light gray)
#AAAAAA
15bright white
#FFFFFF


The CGA's maximum color depth of four bits results in a palette of 16 colors. The lower three bits, representing red, green and blue, corresponded to the three cathode rays, with black meaning all three cathodes were almost off. Cyan was a mixture of blue and green, magenta was blue and red, and orange-brown was green and red. White (or light gray) used all three cathodes.

The remaining 8 colors were achieved by turning on a fourth "intensifier" bit, giving a brighter version of each color, although the dark gray color was indistinguishable from black with many monitors. CGA's "RGB plus intensity bit" design was also called RGBI.

Standard text modes

CGA offered two text modes:
  • 40×25 characters in up to 16 colors. Each character was a pattern of 8×8 dots. The effective screen resolution in this mode was 320×200 pixels (a pixel aspect ratio of 1:1.2), though individual pixels could not be addressed independently. The choice of patterns for any location was thus limited to one of the 256 available characters, the patterns for which were stored in a ROM chip on the card itself. The display font in text mode was therefore fixed and could not be changed (although when using the original IBM CGA in an original IBM PC it was possible to select one of two different fonts—normal or thin—by changing a jumper. Many clones didn't offer this possibility). This mode allowed each character a foreground and a background color, both of which could be freely chosen from the entire CGA palette (see table) — e.g. red on yellow text for one character, white on black for the next and cyan on gray for yet another. The card had sufficient video RAM for 8 different text pages in this mode.
  • 80×25 characters in up to 16 colors. Each character was again an 8×8 dot pattern (the same character set was used as for 40×25), in a pixel aspect ratio of 1:2.4. The effective screen resolution of this mode was 640×200 pixels. Again, the pixels could not be individually addressed. Since there were twice as many characters on the screen in this mode, the card had enough video RAM just for 4 different text pages.

Standard RGB graphics modes

Index Palette #1 Palette #2
0defaultdefault
13 — cyan2 — green
25 — magenta4 — red
37 — white6 — brown
Enlarge picture
Castle Master using palette 2 in high intensity.
Enlarge picture
Alley Cat using palette 1 in high intensity.


CGA offered two commonly-used graphics modes:
  • 320×200 pixels, as with the 40×25 text mode. In the graphics mode, however, each pixel could be addressed independently. The tradeoff was that only 4 colors could be displayed at a time. These four colors could not be freely chosen from the 16 CGA colors — there were only two official palettes for this mode:
  • Magenta, cyan, white and background color (black by default).
  • Red, green, brown/yellow and background color (black by default).
By setting the high-intensity bit, brighter versions of these modes could be accessed.
The 1:1.2 pixel aspect ratio needed to be taken into account when drawing large geometrical shapes on the screen.
  • 640×200 pixels, as with the 80×25 text mode. All pixels could be addressed independently. This mode was monochrome with a pixel aspect ratio of 1:2.4. By default the colors were black and white, but the foreground color (white) could be changed to any other color of the CGA palette. This could be done at runtime without refreshing the screen.
In text mode, font bitmap data came from the character ROM on the card, which was only available to the card itself. In graphics modes, text output by the BIOS used two separate tables: The first half of the character set (128 characters) was supplied by a table in the BIOS at F000:FA6E, and the second half was supplied by the location pointed to by interrupt 1F (0000:007C). The second half of the character set would display as blanks (or garbage, depending on implementation) unless they were explicitly defined, usually by a utility such as GRAFTABL or by the calling program.

Further RGB graphics modes and tweaks

Index 3d palette
0default
13 — cyan
24 — red
37 — white (light gray)
A number of official and unofficial features existed that could be exploited to achieve better graphics on an RGBI monitor.
  • In 320×200 graphics mode, the background color, which defaulted to black on mode initialization, could be changed to any of the other 15 colors of the CGA palette. This allowed for some variation, as well as flashing effects, as the background color could be changed without having to redraw the screen.
  • In 640×200 graphics mode, the foreground color could be changed from its usual white to any of the other 15 colors.
  • In text mode, the border color (displayed outside the regular display area) could be changed from its usual black to any of the other 15 colors.
  • A third 320×200 4-color palette was achieved by enabling the monochrome bit while in color graphics mode. This switched the current graphics palette to red, cyan, white and the background color.
  • Through precision timing, it was possible to switch to another palette while the screen content was still being drawn, allowing the use of any one of the 6 palettes per scanline. The best example of this in use is the game California Games http://www.mobygames.com/game/shots/p,2/gameId,1823/gameShotId,7722/ when run on a stock 4.77 MHz 8088. (Running it on a faster computer did not produce the effect, as the method the programmers used to switch palettes at predetermined locations was extremely sensitive to machine speed.) The same could be done with the background color, to create the river and road in Frogger http://www.mobygames.com/game/pc-booter/frogger/screenshots/gameShotId,132859/.
  • Additional colors were often approximated using dithering, although the low resolution made it very apparent. In particular, the game King's Quest used palette 2 at high intensity and high intensity blue as the background colour. This gave it the three primary RGB colours to work with (as well as yellow).
Some of these above tweaks could even be combined. Examples could be found in several games [1]. Most software titles did not use these possibilities, but there were a few impressive exceptions.

The 160×100 16 color mode

Technically, this mode was not a graphics mode, but a tweak of the 80×25 text mode. The character cell height register was changed to display only 2 lines per character cell instead of the normal 8 lines. This quadrupled the number of text rows displayed from 25 to 100. These "tightly squeezed" text characters were not full characters. The system only displayed their top two lines of pixels (8 each) before moving on to the next row.

   Character 221. 
   221 with blue text and red background color. 
   221 with red text and blue background color. 
   Character 222. 
Character 221 in the extended ASCII character set consisted of a box occupying the entire left half of the character matrix. (Character 222 consisted of a box occupying the entire right half.)

Because each character could be assigned different foreground and background colors, it could be colored (for example) blue on the left (foreground color) and bright red on the right (background color). This could be reversed by swapping the foreground and background colors.

Using either character 221 or 222, each half of each truncated character cell could thus be treated as an individual pixel — making 160 horizontal pixels available per line. Thus, 160×100 pixels at 16 colors, with an aspect ratio of 1:1.2, were possible. Although a roundabout way of achieving 16 color graphics display, this worked quite well [2] and the mode was even mentioned (although not explained) in IBM's official hardware documentation.

More detail could be achieved in this mode by using other characters, combining ASCII art with the aforesaid technique.

Because the CGA had 16384 bytes of graphics memory, not 16000, it was just as easy to set the number of lines in this mode to 102 instead of 100 for a resolution of 160×102. This used extra video memory that was normally unused. However, most games did not do this, perhaps out of fear it would only work on some monitors but not others.

The same text cell height reduction technique could also be used with the 40×25 text mode. This only made sense when using ASCII art, because without it the resulting resolution would only have been 80×100 [3] [4] [5].

Composite video display

While connecting a dedicated RGBI color monitor was the more common configuration, it was also possible to connect an NTSC-compatible composite color monitor, or even a normal TV set, to the CGA's RCA output jack. As is common with NTSC composite video, the separation between luminance and chrominance was far from perfect, yielding cross-color artifacts, or color "smearing". This was especially a problem with 80-column text:

Enlarge picture
80-column text on RGB (left) vs. composite monitor (right)


For this reason, using an RGBI color monitor was the preferred configuration.

A flaw turned into an advantage

However, programmers soon found out that this flaw could be turned into an asset, as distinct patterns of high-resolution dots would "smear" into consistent areas of solid colors, thus allowing the display of completely new colors. Since these new colors are the result of cross-color artifacting, they are often called artifact colors. Both the standard 320×200 four-color and the 640×200 black-and-white graphics modes could be used with this technique:


320×200 palette 1

320×200 palette 2

640×200


Thus, with the choice of 320×200 vs. 640×200 mode, the choice of palette (1 or 2) and the freely-selectable color 0 in 320×200 modes (see above), each one of these parameters resulted in a different set of artifact colors, making for a total gamut of well over a hundred colors, of which 16 could be displayed at the same time.

Availability

The 320×200 variant of this technique (see above) was just how the standard BIOS-supported graphics mode looked on a composite color monitor. The 640×200 variant however required modifying a bit (color burst disable) directly in the CGA's hardware registers, as a result, it is usually referred to as a separate "mode", often just as "the" composite color mode, since its more distinctive set of artifact colors led it to being more commonly used than the 320×200 variant.

Being completely dependent on the NTSC encoding/decoding process, composite color artifacting is not available on an RGBI monitor, nor is it emulated by EGA, VGA or contemporary graphics adapters.

Resolution and usage

Due to the relationship between the CGA's pixel clock and the NTSC color subcarrier, the effective horizontal resolution is reduced to 160 pixels of any color, or 320 pixels when limiting oneself to black and white pixels.

This low resolution led to composite color artifacting being used almost exclusively in games, with many of the more high-profile titles optionally, sometimes exclusively, offering graphics optimized for composite color monitors:


Ultima II

King's Quest


Bugs and errata

CGA's most noticeable hardware bug was snow in 80×25 text mode. The display RAM on the original IBM CGA card was not dual-ported — read and write access was not possible simultaneously. As such, random pixels were displayed whenever display memory was written to by the CPU at the same time as being read by the display hardware. This bug was fixed in most third-party clones, but still existed in some iterations (such as the AT&T PC 6300 display adapter). Programers dealt with this by polling a hardware port which changed value during the video retrace, and writing updates in a burst during this interval.

For programmers, another annoyance was that CGA display memory in graphics modes was interlaced. Normally, video memory is strictly linear: the next row of display data corresponds to the next row of pixels. But with CGA, the next row of display data corresponded to the row of pixels two rows down. This continued until the end of the screen and only with the second half of display data were the in-between rows addressed. So the first half of display memory was for rows 0, 2, 4, etc., until the end of the screen and the second half of CGA RAM was for rows 1, 3, 5, etc. This added calculation steps to most CGA graphics operations if the programmer wanted to avoid visual artifacts when updating the screen.

Dark Yellow
6#AAAA00
As previously mentioned, IBM designed the 5153 CGA monitor to intentionally darken color index #6 from dark yellow to brown; however, some clone monitors did not have this circuitry. On such monitors, or 5153 monitors where this circuitry had failed, color index #6 would remain dark yellow (see color example).

The total amount of video memory on a CGA card (16384 total bytes) is not fully utilised by all BIOS-initiated video modes (40×25 and 80×25 text modes, 320×200 and 640×200 graphics modes). Only by setting up video modes manually using CGA port writes can all 16384 bytes be displayed as pixel elements simultaneously.

Specifications

Connector

The Color Graphics Adapter uses a standard DE-9 connector.

Pin assignments
Pin Function
1Ground
2Ground
3Red
4Green
5Blue
6Intensity
7Reserved
8Horizontal Sync
9Vertical Sync

Signal

Type Digital, TTL
Resolution 640h × 200v, 320h × 200v
H-freq 15.75 kHz
V-freq 60 Hz
Colors 16

Competing adapters

CGA had two main competitors:
  • For business and word processing use, IBM launched its Monochrome Display Adapter (MDA) at the same time as CGA. The MDA produced a higher resolution text display in 80×25 mode, rendering each character in a box of 9×14 pixels, of which 7×11 were the character itself. This produced sharper characters than the CGA's 8×8 dots text character matrix allowed. Because of this and CGA's higher price at the time, MDA was often preferred for business use.
  • In 1982, the non-IBM Hercules Graphics Card (HGC) was introduced. In addition to an MDA-compatible text mode, it offered a monochrome graphics mode. With a resolution of 720×348 pixels, the graphics mode was better than what CGA could produce. The Hercules adapter's offer of better monochrome graphics and its ability to work with less expensive monochrome monitors made it a desirable choice for many. As early as 1985, emulator memory-resident programs such as SIMCGA were available, allowing the display of CGA graphics mode data in Hercules graphics modes (the result looking like crude dithering).
A less widely-used competitor was the Plantronics Colorplus, a CGA-compatible card which doubled the video RAM to 32k, thus allowing 16 colors at 320×200 resolution and 4 colors at 640×200 resolution. The "extended CGA" modes provided by the IBM PCjr and Tandy 1000 were similar to these modes.

Another extension in some CGA-compatible chipsets (including those in the Olivetti M24, the DEC VAXmate, and some Compaq and Toshiba portables) was a doubled vertical resolution. This gave a higher-quality text display and an extra 640×400 graphics mode.

The CGA card was succeeded in the consumer space by IBM's Enhanced Graphics Adapter (EGA) card, which supported most of CGA's modes, and added an additional resolution (640×350) as well as a software-selectable palette of 16 colors out of 64 in both text and graphics modes.

Market penetration

When IBM introduced its PC in 1981, the CGA standard, though introduced at the same time, was used relatively little at first. Most people bought PCs for business computing. For gaming, other brands of home computers were much more popular, and at that time color graphics were considered to have little more than toy value. Thus, most early PC buyers opted for the cheaper text-only Monochrome Display Adapter (MDA) instead of CGA.

In 1982 came the introduction of the Hercules Graphics Card, which offered monochrome-only graphics at a much higher resolution than the CGA card and was more compatible with MDA, further eroding CGA's market share. The HGC was arguably the most commonly-utilized card connected to monochrome monitors throughout the IBM PC's life.

Things changed in 1984 when IBM introduced the PC AT and the Enhanced Graphics Adapter (EGA). Along with this move, the price of the older CGA card was lowered considerably; it now became an attractive low-cost solution and was soon adopted by the new PC cloning companies as well. Entry-level non-AT PCs with CGA graphics sold very well during the next few years, and consequently there were many games released for such systems, despite their limitations. CGA's popularity started to wane after VGA became IBM's high-level solution and EGA the entry-level solution in 1987.

References

See also

External links

International Business Machines Corporation

Public (NYSE:  IBM )
Founded 1889, incorporated 1911
Headquarters Armonk, New York, USA

Key people Samuel J.
..... Click the link for more information.
computer display standards or display modes have been used in the history of the personal computer. They are often a combination of display resolution (specified as the width and height in pixels), color depth (measured in bits), and refresh rate (expressed in hertz).
..... Click the link for more information.
IBM PC Series IBM Personal Computer XT • IBM Portable Personal Computer • IBM PCjr ?

IBM PC (model 5150)
Type Personal computer
Released August 12, 1981
Discontinued April 2, 1987
Processor Intel 8088 @ 4.
..... Click the link for more information.
kilobyte (derived from the SI prefix kilo-, meaning 1,000) is a unit of information or computer storage equal to either 1,000 bytes or 1,024 bytes (210), depending on context.
..... Click the link for more information.
This article needs copy editing for grammar, style, cohesion, tone and/or spelling.
You can assist by [ editing it] now. A how-to guide is available, as is general .
This article has been tagged since October 2007.
..... Click the link for more information.
1. Electron guns 2. Electron beams 3. Focusing coils 4. Deflection coils 5. Anode connection 6. Mask for separating beams for red, green, and blue part of displayed image 7.
..... Click the link for more information.
Motorola Inc.

Public (NYSE: MOT )
Founded 1928
Headquarters Schaumburg, Illinois, USA

Key people Edward Zander, CEO & Chairman
Industry Telecommunications
Products Embedded systems
Microprocessors
Mobile phones
Two-Way radios
..... Click the link for more information.
Text mode is a kind of computer display mode in which the content of the screen is internally represented in terms of textual characters rather than individual pixels. Typically, the screen consists of a uniform grid of character cells
..... Click the link for more information.
In electronics and particularly computing, a jumper is a short length of conductor used to close a break in or bypass part of an electrical circuit. Jumpers are typically used to set up or adjust printed circuit boards, such as the motherboards of computers.
..... Click the link for more information.
California Games is a 1987 Epyx sports video game for many home computers and video game consoles. Branching from their popular Summer Games and Winter Games series, this game consisted of some sports purportedly popular in California.
..... Click the link for more information.
Frogger is an arcade game introduced in 1981. It was licensed for worldwide distribution by Sega/Gremlin, and developed by Konami. The game is regarded as a classic and was noted for its novel gameplay and theme.
..... Click the link for more information.
Dither is an intentionally applied form of noise, used to randomize quantization error, thereby preventing large-scale patterns such as contouring that are more objectionable than uncorrelated noise.
..... Click the link for more information.
King's Quest is an adventure game series made by the American computer game company Sierra On-Line (currently known as Sierra Entertainment). It is widely considered a classic title of the golden era of adventure games and was the series that primarily built the
..... Click the link for more information.
RGB color model is an additive model in which red, green, and blue (often used in additive light models) are combined in various ways to reproduce other colors. The name of the model and the abbreviation ‘RGB’ come from the three primary colors, red, green, and blue and
..... Click the link for more information.
ASCII art is an artistic medium that relies primarily on computers for presentation and consists of pictures pieced together from the 95 printable (from a total of 128) characters defined by the ASCII Standard from 1967 and ASCII compliant character sets with proprietary
..... Click the link for more information.
The Monochrome Display Adapter (MDA, also MDA card, Monochrome Display and Printer Adapter, MDPA) introduced in 1981 was IBM's standard video display card and computer display standard for the PC.
..... Click the link for more information.
19th century - 20th century - 21st century
1950s  1960s  1970s  - 1980s -  1990s  2000s  2010s
1979 1980 1981 - 1982 - 1983 1984 1985

Year 1982 (MCMLXXXII
..... Click the link for more information.
Hercules Graphics Card (HGC) was a computer graphics controller which, through its popularity, became a widely supported display standard. It was common on IBM PC compatibles connected to a monochrome monitor (green, amber, or page white).
..... Click the link for more information.
emulator duplicates (provides an emulation of) the functions of one system with a different system, so that the second system behaves like (and appears to be) the first system.
..... Click the link for more information.
Dither is an intentionally applied form of noise, used to randomize quantization error, thereby preventing large-scale patterns such as contouring that are more objectionable than uncorrelated noise.
..... Click the link for more information.
Plantronics Corporation

Public (NYSE:  PLT )
Founded 1962
Headquarters Santa Cruz, California

Key people Kenneth Kannappan (CEO)
Industry Consumer electronics
Products Headsets (Circumaural), Audio equipment
..... Click the link for more information.
The Plantronics Colorplus was a graphics card for IBM PC computers, first sold in 1982. It was a superset of the then-current CGA standard, using the same monitor standard and providing the same pixel resolutions.
..... Click the link for more information.
IBM PC Series ?

The IBM PCjr (read "PC junior") was IBM's first attempt to enter the market for relatively inexpensive educational and home-use personal computers.
..... Click the link for more information.
The Tandy 1000 was the first in a line of more or less IBM PC compatible home computer systems produced by the Tandy Corporation for sale in its Radio Shack chain of stores. It was followed by a series of models which appended two or three letters to the name, after a space (e.g.
..... Click the link for more information.
Ing. C. Olivetti & Co., SpA. is an Italian manufacturer of computers, printers and other business machines.

History

The company was founded as a typewriter manufacturer in 1908 in Ivrea, near Turin, by Camillo Olivetti.
..... Click the link for more information.
Digital Equipment Corporation was a pioneering American company in the computer industry. It is often referred to within the computing industry as DEC. (This acronym was frequently officially used by Digital itself,[1] but the official name was always DIGITAL.
..... Click the link for more information.
VAXmate was a personal computer produced by Digital Equipment Corporation. Introduced in 1986, it was the first diskless, network-connected personal computer. It was partially IBM compatible and was superseded by the DECstation 200 and 300 three years later.
..... Click the link for more information.
Compaq Computer Corporation was an American personal computer company founded in 1982, and is now a brand name of Hewlett-Packard.

The company was formed by Rod Canion, Jim Harris and Bill Murto — former Texas Instruments senior managers.
..... Click the link for more information.
Toshiba Corporation
株式会社東芝


Corporation TYO: 6502 , (LSE:  TOS )
Founded Tokyo, Japan (1904)
Headquarters Tokyo, Japan

Key people Atsutoshi Nishida, President & CEO
Industry Electronics & engineering
..... Click the link for more information.
Enhanced Graphics Adapter (EGA) is the IBM PC computer display standard specification located between CGA and VGA in terms of graphics performance (that is, color and space resolution).
..... Click the link for more information.

This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.