When IBM released the Personal Computer back in 1981, it gave the buyer two choices for the video output. The buyer could buy a monochrome card and a special high resolution green screen monitor to go with it, or a color card and connect it to a color monitor. The buyer could even run both cards in the same system. If someone was on a tight budget, they could use a monochrome monitor with a color card, in this blog article we will explore what the results of that would be.
 |
| CGA 16-Color Palette |
Basic Capabilities of IBM's First Video Adapters
IBM's MDA card provided a digital video output to the IBM 5151 Display. This card only supports one PC BIOS video mode, Mode 07. This mode was a text mode showing 80 columns and 25 lines with character cells of 9x14 pixels. The card ran the monitor at a 50Hz refresh rate and could set the foreground and background of each text cell to on, off or intensity. The 9-pin DE-9 connector has a pin for video, a pin for intensity, a pin for horizontal sync and a pin for vertical sync. It also permitted each text cell to blink, show inverse video or underlining. The card possessed 4KiB of RAM, sufficient for only one video text page and insufficient for any kind of pixel graphics.
IBM's CGA card provided a digital video output which would eventually be fully utilized by the IBM 5153 Color Display which supported sixteen digitally-defined colors and an analog composite video output. The digital connector is a 9-pin DE-9 connector using a pin for the red signal, a pin for the green signal, a pin for the blue signal, a pin for an intensity signal, a pin for horizontal sync and a pin for vertical sync. IBM defined seven modes for this adapter in the IBM PC BIOS:
Mode 00 - 40x25 Text B&W
Mode 01 - 40x25 Text Color
Mode 02 - 80x25 Text B&W
Mode 03 - 80x25 Text Color
Mode 04 - 320x200 Graphics Color
Mode 05 - 320x200 Graphics B&W
Mode 06 - 640x200 Graphics B&W (Color)
All CGA modes run at 60Hz and all its text modes use 8x8 pixel character cells. CGA can set individual text cells to blink and can freely assign one color to the foreground and another color to the background of each cell.
 |
| CGA Palettes Modes 4 & 5 |
In the Mode 04 four colors can be shown but three of them are dictated by the palette selected. Palette 0 shows red, green and brown, Palette 1 shows cyan, magenta and white. Mode 05 allows only one palette to be selected, cyan, red and white. Intense versions of these palettes can be selected.
The border color can be freely set in the text mode. The background and border color can be freely set to the same color in 320x200 graphics modes. The foreground color can be freely set in the 640x200 graphics mode, the background and border will always be black.
The CGA card has 16KiB of RAM, supporting eight 40-column video pages, four 80-column video pages or a single page of graphics.
The 40 and 80-column text modes can be reprogrammed to show 80x100 and 160x100 pixels with all sixteen colors freely selectable but 80-column modes on an IBM CGA cards suffer from snow.
Composite Video
A composite video signal provides three elements over a single wire: sync, luminance and chrominance. Black and white video only requires the first two components, color needs the third. Color was added onto a black and white signal in such a way that existing black and white TVs could still show a picture with minimal loss of detail by filtering out the color components of the signal.
Luminance is a a continuously variable analog waveform where the voltage level of the signal determines the brightness of the beam at any given point on a CRT. Chrominance is a 3.58MHz sine or square wave which determines the color hue to be produced by the beam at any given point on a CRT by shifting the phase of the wave relative to a color burst signal produced at the beginning of each scanline. The strength of the waveform determines the saturation of the color.
 |
| Edit.com with default Blue Background |
As personal computers became more affordable and popular, they needed monitors which could display sharp text. A black and white signal can be very sharp, especially when it does not need to be demodulated from a broadcast antenna and separated from an audio signal. Special monitors were made to accept a composite monochrome signal and often supported green or amber phosphors instead of white as white can be hard on the eyes and can decay at a slower rate. These monitors were among the first which could display 80-column text with clarity that would be acceptable in the office for a 9-5 job.
A black and white TV normally filters out the color signal without too much loss to the underlying fidelity of the luma. A monochrome composite monitor does not filter the video signal more than necessary as video filtering leads to quality loss. What does it do with a color signal? The monitor treats it like it is modifying the black and white signal. Instead of seeing solid areas of color turned into gray, instead you will see patterns of stripes until the color changes on the line. In other words, you are seeing the peaks and valleys of a square wave affect the luma signal, which the eye will perceive as stripes or "jailbars".
 |
| Edit.com with black background |
Apple vs. IBM
The Apple II only supports composite video output and its video signal is "almost" a black and white signal. A pixel is either on or off, there is no corresponding color signal (produced by phase shifts) on the scanline. However, there is a color burst signal transmitted before each scanline (except in pure text modes). The color burst, combined with the high frequency components of the black and white signal at integer multiples of the color burst signal, tricks the NTSC color decoding circuitry into showing colored pixels at predictable points on the scanline.
 |
| Mode 04 Cyan/Magenta/White Palette Monochrome |
IBM CGA's card works almost identically to the Apple II in the video domain but it adds the feature of being able to generate hues directly. It shifts the color signal's phase over the scanline, something the Apple II cannot do. Although the CGA card can produce 16 direct composite "hues", four of them are just pure luma (black, light gray, dark gray, white). It does not modify the saturation of the signal.
 |
| Mode 04 Green/Red/Yellow Palette Monochrome |
From the start, IBM realized that some of its users would like the ability to use their existing color composite monitors and TVs. IBM did not have a color TTL RGB monitor for sale at launch. Such monitors were available but still rather unstandardized and pricey. To this end they included the RCA connector and a pin header on the board to attach an RF modulator for output to a TV. While the CGA card cost more than an MDA card, the MDA card and its special monitor cost more than a CGA card if the PC owner already had a monitor or TV set he or she intended to use with their new system.
 |
| Mode 05 Cyan/Magenta/White Palette |
In order to accommodate those customers who actually wanted to get work done with their PC and their TVs, IBM added in the "black and white" modes. With the black and white modes, no color burst or color signal is generated by the CGA card, only a luma signal is present. Color modes include the chroma signal. The black and white modes significantly improved the legibility of 40 and 80 column text by eliminating color fringing on the edges of text characters (if the text was on a black background as it usually was).
For Mode 06, the 640x200 graphics mode, the color burst is disabled as that mode is defined but can be turned on by flipping a bit in one of the CGA's registers. Mode 06 only supports one direct color but when the color signal is added, it can support sixteen via artifact colors. Mode 06 Color is not an official mode offered by the IBM PC BIOS but trivial to turn on via software.
This distinction only matters with composite video, not with RGBI video. The mode distinction was lost when video cards stopped supporting composite video output with EGA and later adapters with one exception. That exception is Mode 05. Mode 05 changes the colors shown on an RGBI monitor. If an EGA or VGA card has a special CGA compatibility mode which can be enabled, it may show Mode 05's special palette. Otherwise it will show Mode 04's palettes. Other black and white modes will appear identical to their color modes with the later cards.
 |
| Old CGA Monochrome Shades |
Old CGA vs. New CGA
80-column text proved challenging for monitors and displays of the time. The characters are packed in so tightly that many screens could not produce easily readable text. One early solution was the RGBI monitor, a monitor with a digital color input to eliminate any interference from the PC. The best RGBI monitors like the IBM 5153 came with high TVL/low dot pitch tubes. (Tandy's CM-4 & CM-5 are examples of crappy RGBI monitors).
The other solution was the monochrome monitor. Apple IIs more often than not used a green screen monitor like the Monitor II. For the Apple IIc it released a "portable" 9" green screen CRT called the Monitor IIc (which is being used for the photos incorporated into this blog). IBM released a monitor called the IBM 5144 for the IBM PC Convertible laptop which looks very similar to the Monitor IIc and functions identically.
Back in 1981 if someone wanted to use a monochrome monitor like the Monitor II (or III) they certainly could with CGA and the monitor would show 80-column text just fine, but it might be on the very edge of the bezel. But in 1984 IBM released a new product, the IBM 5155 Portable PC. This machine was an IBM PC/XT in a portable enclosure and included a 9" amber screen. This screen was a standard definition screen and the computer came with a full-length CGA card. But the CGA card as designed to then only supported four pure monochrome shades, which when dealing with programs designed to use color, was limiting.
 |
| New CGA Monochrome Shades |
IBM used discrete logic to turn all the digital signals into composite video. The circuit combines horizontal and vertical sync into composite sync. The RGBI bits are transformed into luma values through a simple DAC and color hue phases through flip flops and delay lines. Old CGA mixes all these signals and sends it to the video amplifier transistor and that goes out of the card. IBM's initial solution provided only 4 monochrome shades, with colors 1-7 and 9-15 sharing the same luminance.
IBM's solution was to redesign the composite video output path in the CGA cards that would accompany these machines and be available for purchase separately for IBM PC, XT, AT and XT/286 owners. In IBM's new design after the RGB color bits generate the chroma hue phases the circuitry passes these bits through a crude DAC with differently weighted outputs and mixes them again with video signal. The result is that a different extra voltage is added for each color to the output, which translates into new luma shades. While many of the shades are not very distinguishable when shown side by side, most of the time these combinations of shades are quite usable.
 |
| Tandy Mode Mono Command Shades |
Tandy MODE MONO
Unfortunately one problem with getting nice solid monochrome shades is that programs rarely invoke the black and white CGA modes, 01, 03 & 05. Tandy had a solution to this problem. By default, Tandy functions like new IBM CGA on monochrome monitors. Tandy must have seen what the standard CGA color modes did with monochrome monitors it sold like the VM-2 & VM-4. It came up with a unique solution to try to fix the ugly stripes for the Tandy 1000s. The Tandy 1000 could support 16 colors just like CGA but unlike CGA the Tandy graphics hardware supported 16 programmable palette registers. The palette registers are available in all modes, both the enhanced Tandy graphics modes, the standard CGA graphics modes and the CGA text modes. By manually programming the palette registers, you could assign any color to any pixel or text cell foreground or background. This can be useful for fast color cycling but it can also be useful by allowing Tandy 1000s to show better colors for graphics than CGA can in 4-color or 2-color modes.
Tandy decided to use the power of these programmable palettes with a special PC/MS-DOS MODE command, MODE MONO. While on an IBM PC MODE MONO switched between MDA and CGA cards, on a Tandy MS-DOS it reprogrammed all the palette registers to the four black and white shades, colors 0, 7-8 & 15. This eliminated stripey graphics in areas of solid hue for a monochrome monitor. Unfortunately it reduced the number of shades shown on the screen to 4 like old CGA. Moreover, colors 1-7 & 9-15 all shared the same shade. This often reduced the number of shades with 16-color and 4-color graphics to just 4 and 2! The command can turn this function ON and OFF by supplying those arguments after MODE.
Had Tandy reprogrammed the registers more intelligently to stagger the colors or offered the user the ability to assign shades, this problem of graphics loss would have been significantly mitigated. But it offered users a better way to address this problem, although it did not advertise it as such...
 |
| Tandy Mode Colormap Example Shades |
Tandy MODE COLORMAP
Another Tandy MS-DOS exclusive parameter was COLORMAP. It permits the user to redefine one color with another, in effect permitting the user to reprogram the palette registers at the DOS prompt. It takes the form of MODE COLORMAP [old color new color]. For the command the colors are named black, blue, green, cyan, red, magenta, yellow, gray, dark gray, light blue, light green, light cyan, light red, light magenta, light yellow & white. So for example if you want to replace magenta with red, you enter MODE COLORMAP MAGENTA RED. You can replace multiple colors by entering this command again and again with the color arguments changed.
When I discovered the COLORMAP parameter, I decided to try out color to grayscale substitutions in a batch file:
MODE COLORMAP BLUE DARK GRAY
MODE COLORMAP RED GRAY
MODE COLORMAP GREEN WHITE
MODE COLORMAP YELLOW DARK GRAY
MODE COLORMAP CYAN GRAY
MODE COLORMAP MAGENTA DARK GRAY
MODE COLORMAP LIGHT RED DARK GRAY
MODE COLORMAP LIGHT GREEN GRAY
MODE COLORMAP LIGHT YELLOW WHITE
MODE COLORMAP LIGHT CYAN GRAY
MODE COLORMAP LIGHT MAGENTA DARK GRAY
MODE COLORMAP LIGHT BLUE DARK GRAY
My idea was to assign colors to perceived luminance but otherwise to keep colors likely to be adjacent to each other from being the same shade of monochrome. You can see the result in the screenshot above. This is especially important for CGA modes. There are still only 4 monochrome shades to map 12 colors, so these choices may not be ideal for every program. Usually these assignments will "stick" when a program runs because most programs do not reprogram the color palette registers. Of course this will work on a color monitor as well, so if you do not like the default colors that a game gives, you can reassign them. This may be useful in CGA-only games which are only using 4-color modes. Of course the game must be runnable in DOS, PC booters cannot be recolorized. And of course, the colormap cannot be reprogrammed during a game.
Colormap Examples
Here are a pair of screenshots from Arkanoid and King's Quest I showing the default colors produced by a Tandy 1000 through a monochrome connection and after the Colormap batch file is applied:
No comments:
Post a Comment