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.
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 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 CGAs market share. 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.
The standard IBM CGA graphics card was equipped with 16 kilobytes of video memory. 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 best known mode, used for most CGA games, displayed 4-color graphics at a resolution of 320×200.
While 4-color display was generally considered the limit for graphics on CGA, there were several ways (some official, some not) to display more colors.
| | |
|---|---|
| 0 — black | 8 — (dark) gray |
| 1 — blue | 9 — bright blue |
| 2 — green | 10 — bright green |
| 3 — cyan | 11 — bright cyan |
| 4 — red | 12 — bright red |
| 5 — magenta | 13 — bright magenta |
| 6 — brown | 14 — yellow |
| 7 — white (light gray) | 15 — bright white |
The CGA card worked with CRT RGBI color monitors. It was based around the Motorola MC6845 display controller and had a palette of 16 colors. Red, green and blue corresponded to the three cathode rays and black meant all rays were almost off. Cyan was a mix between the blue and green rays, magenta was a mix between blue and red and orange-brown was a mix between green and red. White (or light gray) was a mix between all three rays.
The remaining 8 colors were achieved by turning on an "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.
The Commodore 128 used the same method of transmitting colors on its RGBI output and thus could use the same monitors and display the same 16 colors.
There is some confusion regarding color #6 on RGBI monitors: If one strictly follows the RGBI color model, color #6 would appear as dark yellow (#AAAA00) (see below). However, IBM chose to include additional circuitry in the 5153 color monitor to detect color #6 and lower the green component to yield a more pleasing brown-tone (#AA5500), so most "CGA compatible" monitors do the same. As to why IBM chose to do this, the predominant theory is that IBM wanted to make the colors more closely match the colors of the 3270 mainframe terminal, specifically the 3279. (This information has not yet been verified by multiple sources, however.)
| Fixed CGA 4-color palette #1 | |
| default | 5 — magenta |
| 3 — cyan | 7 — white (light gray) |
| Fixed CGA 4-color palette #2 | |
| default | 4 — red |
| 2 — green | 6 — brown (orange) |
CGA offered two commonly-used graphics modes:
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.
A common misconception is that Composite color mode was supported on some RGB-equipped machines, but this is a direct contradiction to how composite color mode technically functioned. A more likely explanation for the misconception is that people confuse the 160×200 modes of the PCjr/Tandy 1000 and Amstrad CPCs as being the same thing (they are identical in resolution, but not color and memory organization). Attempting to set Composite color mode on any card with an RGB monitor attached would appear identical to the 640×200 graphics mode.
| "Tweaked" 3rd Fixed CGA 4-color palette | |
| default | 4 - red |
| 3 — cyan | 7 — white (light gray) |
A number of official and unofficial features existed that could be exploited to achieve better graphics on a monitor.
Some of these above tweaks could even be combined. Examples could be found in several games *. Most software titles did not use these possibilities, but there were a few impressive exceptions.
| Character 221. |
| 221 with blue text and red background color. |
| 221 with red text and blue background color. |
| Character 222. |
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.
More detail could be achieved in this mode by using other characters, combining ASCII art with the aforesaid technique.
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 *.
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 | ||
| #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.
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.
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.
Computer graphics | Graphics cards
CGA | Color Graphics Adapter | Color Graphics Adapter | Color Graphics Adapter | CGA | CGA | Color Graphics Adapter | CGA | Color Graphics Adapter | Color Graphics Adapter | Color Graphics Adapter | CGA | CGA | CGA | 彩色图形适配器
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Color Graphics Adapter".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world