You are here: The Oldskool PC/Oldskool PC Software/CGACAL
This program was created so that owners of CGA cards and monitors (and emulator authors) could adjust their hardware/software so as to get the "proper" authentic CGA palette. Simply download this program to your vintage PC and run it, answer the question, and then adjust the monitor so that it looks like this:
If running this program under Windows just to see what it does, make sure you hit ALT-ENTER so it is running fullscreen before you answer the initial hardware compatibility question. Otherwise the colors will be wrong, as it will be running in a window and using the incorrect Windows palette (instead of the VGA card's BIOS colors).
To anyone who looks at the CGA pinout, it appears that the logical color for #6 would be dark yellow instead of the much darker brown we are familiar with. But CGA monitors display brown, not dark yellow. How? It turns out that the monitor does the translation, and IBM intentionally added logic in the monitor to decrease the green component on color #6 so that it would appear brown.
Thanks to Chuck Guzis (for the schematic) and Tony Duell (for the info), here is an extensive explanation of how this is achieved. First, to follow along, download this schematic page of the monitor's circuit board (there are other schematics in the IBM Tech Ref but this page is the only one needed to follow along). Okay, now that you've done that, here's Tony's explanation:
Let's start on the CGA card itself. The attribute data from the video RAM is latechs in U35 ('273). The outputs of that go to a 4-bit 4-way multiplexer (U9, U10, '153), which, selects one set of 4 bits or the other depending on wheter that particular dot in the characer cell is set or not (OK, there's a lot more to it, blink mode, graphics modes, etc, but I don't want to have to explain all 6 pages of the schematic at this point).
The outputs from that mux are latched again (U101, '174), then buffered and sent to the DE9 socket. So the card outputs the 4 bits unchanged from the appropriate part of the attribute byte. And it's clear from the circuit that the bits are:
- Bit 0: Blue
- Bit 1: Green
- Bit 2: Red
- Bit 3: Intensity
So you could reasonably claim that 0110 was dark yellow and 1110 was light yellow. But IBM also included the following table in the tech ref:
I R G B Color 0 0 0 0 Black 0 0 0 1 Blue 0 0 1 0 Green 0 0 1 1 Cyan 0 1 0 0 Red 0 1 0 1 Magenta 0 1 1 0 Brown 0 1 1 1 White 1 0 0 0 Grey (=='light black') 1 0 0 1 Light Blue 1 0 1 0 Light Green 1 0 1 1 Light Cyan 1 1 0 0 Light Red 1 1 0 1 Light Magenta 1 1 1 0 Yellow 1 1 1 1 High Intensity White (=='light white')
OK, so why the odd name for color 0 1 1 0? Well, we now turn to the schematic of the CGA monitor. The 4 bits come in, and are buffered by 74S05 chips, Q201 and Q253 on the schematic. Now for the interesting bit: There are 4 of the open-collector inverters -- Q201d, Q201f, Q253e and Q253f -- whose outputs are connected together. This common signal will only be high if the input signals are... wait for it... I=0, R=1, G=1, B=0. That is, for this particular color 6. For that color, Q206 (a normal NPN transistor) is therefore turned on, and this will reduce the level of green in the final display. In other words this color is a little redder than you might expect.
So there's the magic: IBM intentionally turned #6 brown in the monitor.
(Tony also mentioned that he's worked on clone monitors that used a '138 to decode the input signals and detect color 6, although didn't have any schematics for those on hand. He also recalls that later monitors often used a PROM to decode the input signals, possibly allowing several color sets, and used 2 or 3 bit resistor DACs to feed the CRT driver stages. Now what that PROM contained, and whether color 6 was still special, he didn't know.)
So, to sum up:
Of course, there is still one unanswered question: Why did IBM go through the trouble of turning #6 from dark yellow to brown in the monitor? While I haven't been able to verify it absolutely, evidence strongly points to IBM doing this to more closely emulate the colors produced by the IBM 3270 terminal.