You are here: The Oldskool PC/Oldskool PC Software/CGACAL

Download CGACAL

Source and .exe are both included.

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).

Color #6 Is Brown

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:

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:

IRGBColor
0000Black
0001Blue
0010Green
0011Cyan
0100Red
0101Magenta
0110Brown
0111White
1000Grey (=='light black')
1001Light Blue
1010Light Green
1011Light Cyan
1100Light Red
1101Light Magenta
1110Yellow
1111High 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:

  1. IBM calls that color 'brown' in the CGA TechRef description
  2. The CGA card doesn't do anything special with it, the obvious pattern of bits appears on the DE9 connector...
  3. ...but the monitor does. It contains circuitry to shift that color a little towards the red.

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.


[Oldskool Home] [Copyright and Usage] [Disclaimer] [Contact Me]

This page's content was last modified on Jun 5, 2008 7:19 pm.
If anything here has helped you, please consider donating to help keep this site alive.