![]() |
|
|
| |
|
||||
The Color Graphics Adapter (CGA), introduced in 1981, was IBM's first color graphics card, 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. The CGA card featured several graphics and text modes with a resolution of up to 640×200 and up to 16 colors (albeit not at that resolution). CGA was commonly considered to be able to display a maximum of 4 colors at a resolution of 320×200; however, there were several ways (some official, some not) to display more colors, even for graphics display purposes. The 320×200 4 color mode with its default colors — title screen from Alley Cat.
The CGA color palette
The CGA card worked with CRT RGB 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 could display the same 16 colors; however it was programmed differently from IBMs CGA and had fewer limitations, so that the rest of this article does not apply to it. Standard text modesCGA offered two text modes:
Standard graphics modes
CGA offered two commonly-used graphics modes:
The composite video modesLittle-known to many was an additional 160×200 graphics mode (pixel aspect ratio 1.67:1), which could utilize 16 different colors (not the same color table as the CGA color set, but similar). This mode, however, only worked with the RCA jack composite video output. This port, present on all IBM CGA cards and optional on clone cards, allowed the user to connect a TV set or composite color monitor to the computer. This composite color mode was rarely utilized in software. No BIOS support led to poor programmer adoption. Also, most users preferred a monitor, as the only modes that could be displayed via composite video in color were composite color mode, 40-column text mode and 320×200 graphics mode. The IBM PC was primarily viewed as a business computer, so the number of television sets connected to an IBM PC was very low. As such, only a handful of software titles used the 160×200 graphics mode, most of them games. Further graphics modes and tweaksA 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 [1] (http://www.mobygames.com/game/shots/p,2/gameId,1823/gameShotId,7722/) [2] (http://www.mobygames.com/attribute/sheet/p,2/attributeId,5/). Most software titles did not use these possibilities, but there were a few impressive exceptions. The 160×100 16 color modeTechnically, 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 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 character 221, 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 [3] (http://mobygames.com/game/shots/p,4/gameId,22/gameShotId,919/) 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. 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 [4] (http://www.oldskool.org/shrines/lbd/graphics/icon4.gif) [5] (http://www.oldskool.org/shrines/lbd/graphics/icon3.gif) [6] (http://www.oldskool.org/shrines/lbd/graphics/icon2.gif). Bugs and errataCGA'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). 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, 6, 8, 10, etc., till the end of the screen and the second half of CGA RAM was for rows 1, 3, 5, 7, 9, etc. This added extra calculation steps to most CGA graphics operations if the programmer wanted to avoid visual artifacts when updating the screen. Competing adaptersCGA had two main competitors:
The CGA card was succeeded by IBM's Enhanced Graphics Adapter (EGA) card, which supported most of the CGA modes, and added modes with up to 640×350 pixels with a software-selectable palette of 16 colors out of 64. The MC6845 as used in the Amstrad CPCThe Amstrad CPC series of 8-bit computers also used the MC6845 and so had a similar set of graphics modes to CGA but with more palette flexibility: 27 colors, of which any combination could be used in every graphic mode avaiable limited only by the available bit depth. The 160x200 16-color mode was very commonly used on the Amstrad CPC, even being accessible from the built-in Basic interpreter, and special overscan, "full color" or both could be achieved by directly manipulating the hardware via assembly, resulting in a maximum resolution of nearly 768*384 pixels with all 27 palette colors visible, although this was probably HAM mode. The Amstrad CPC's CRT monitors were fully analog and could probably handle bigger color depths and non-standard resolutions much better than most IBM-compatible CGA monitors. However, the text modes normally used under MS-DOS were either not supported or not widely used on the Amstrad CPC, being inadequate for the standard CPC monitors, which had a significantly lower resolution than a CGA or Hercules monitor of the times. References
See also
de:Color Graphics Adapter hu:CGA ja:Color Graphics Adapter sv:CGA |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
Copyright 2008 WordIQ.com - Privacy Policy
::
Terms of Use
:: Contact Us
:: About Us This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Cga". |