6

It's long been an established fact that the EGA only had four memory planes, which limited the number of colors on the screen to (24) 16. The best compatible monitors at the time had six TTL color lines, meaning the screen was capable of displaying (26) 64 different colors. It was always my assumption that the EGA could be programmed via palette registers to arbitrarily choose any of the 64 display colors for the 16 memory colors, and that none of the EGA DOS games of the era bothered to reprogram the palette because... shrug? Now I'm starting to think there was a hardware limitation, but I'm trying to piece that together.

Based on my research, there were three monitors available in the EGA's heyday:

  • The Monochrome Display, with two pins (video/intensity) allowing for four shades of gray.
  • The Color Display, with four pins (red/green/blue/intensity) allowing for 16 colors.
  • The Enhanced Color Display, with six pins (R/G/B/R-Intensity/G-Intensity/B-Intensity) allowing for 64 colors.

From what I understand, the EGA card was capable of driving all three monitor types provided the selected video mode ran at a supported frequency. If a Color Display was plugged into the EGA card, the R/G/B pins would line up correctly and the monitor's Intensity pin would read the card's G-Intensity pin. The R-Intensity and B-Intensity card outputs would be unused. (In the opposite case -- an Enhanced Color Display plugged into a CGA card -- the monitor would never receive any R-Intensity or B-Intensity input and, presumably, the image would have an incorrect greenish tinge to it.)

It seems (based on discussions like this) that the designers of the EGA felt that CGA/Color Display compatibility was important enough to limit the output in 200-line video modes so it displayed the same on both color monitor types. Based on my own experimentation, I see these limitations as well.

In EGA mode Dh (320×200, 16 color), when calling BIOS INT 10h, AH=10h, AL=0h with various color values in BH, only four of the six bits seem to have any effect. The table of observed effects vs. expectations is:

Bit pos. │ Effect
─────────┼───────────────────────────────────────────
.......X │ Blue
......X. │ Green
.....X.. │ Red
....X... │ No Effect (expected Blue Intensity)
...X.... │ R+G+B Intensity (expected Green Intensity)
..X..... │ No Effect (expected Red Intensity)
00...... │ Not Used

Bits 3 and 5 have absolutely no effect on the image. The end result is that there are only four useful bits that can be set, limiting the output to 16 unique display colors. It appears that no matter how the registers are programmed, the most the programmer can achieve in video mode Dh is a rearrangement of the 16 RGBI colors, with the remaining 48 possible display colors completely out of reach.

Other video modes like 10h (460×350, 16 color) respond to all six bits, so I'm reasonably sure my test programs are correct.

Now, the questions:

  1. Was the 16-color display limitation explicitly documented somewhere? The EGA documentation, pgs. 56/59 sort of hints at this behavior if the reader expects it, but it doesn't directly state "the hardware does something different in 200-line modes"; you just sort of have to know that.
  2. Was the behavior implemented in the EGA card (i.e. the R-Intensity and B-Intensity pins were unconditionally tied to the G-Intensity pin output) or was it implemented in the Enhanced Color Display (i.e. the R-Intensity and B-Intensity pins did output the value the programmer placed in the palette registers, but the monitor ignored it -- sort of how the Color Display had a special case to change "low intensity yellow" into "brown")?
  3. Was there a way the programmer could alter values in the EGA registers to allow any of the "inaccessible" 48 display colors to be used in mode Dh that didn't destabilize the image or fail on certain hardware configurations?
  • 2
    On a VGA card you'd be able to program VGA palette registers to use the full VGA colour range in these modes. Certain EGA compatibles also let you change the EGA palette registers, but real EGA cards seem to be hardwired to use only CGA colours in 200 line modes. – Ross Ridge Aug 22 at 15:53
  • @RossRidge Indeed. If I understand correctly, Duke Nukem II used these VGA enhancements to get a more interesting palette while still being 16-color. – smitelli Aug 23 at 13:50
7
  1. It is a feature of the monitor. On an IBM EGA display, the 200-line mode is limited to only 4-bit RGBI color mode input, to be pin compatible with the 16 color IBM CGA display. The monitor ignores the remaining 2 color input bits in 200-line mode. Only on 350-line mode, all the 6 color bits are used as RrGgBb color mode input to allow for 64 colors.

2&3) No the card does not limit this. The EGA card initially sets the palette registers to match the 4-bit output in 200-line modes, but the palette registers can be freely changed by user. There is just little point in this since a standard IBM CGA or EGA monitor also expect 4-bit input in 200-line mode. If the monitor is a non-standard one that allows for 6-bit colors then 64 colors can be used in 200-line mode too.

| improve this answer | |
  • Ah, yep, here it is, mentioned on several of the pages. Thanks! – smitelli Aug 23 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.