8

Most memorable graphics mode in games for CGA was 320x200 which supported 4 colors. (I know there was 16 color composite mode trick, but let's ignore that.)

Those 4 colors could be selected from limited set of 6; 3 palettes, and 2 intensities for each (bright or dim):

  • Black, magenta, cyan, white
  • Black, red, cyan, white
  • Black, red, green, yellow

But first color, black, was actually selectable background color: It could be chosen from 16 colors.

Why were the other 3 colors not selectable? Why have these ugly predefined palette choices instead? Hardware seems to have everything needed, and they've had to just connect the dots.

It doesn't seem like memory would be an issue. You would only need extra 12 bits for entire screen.

It also doesn't seem like display hardware limitation. Text modes could display far more color combinations simultaneously.

1
  • 1
    My vague recollection from the time is that IBM semi-intentionally tried to assure that the CGA would be seen as suitable only for business graphics, not for games. They wanted to assure they were seen as a "serious" computer for business use, not a game machine that should/would compete directly with the Apple II, Commodore 64, etc. Commented Nov 13, 2023 at 4:57

1 Answer 1

5

TL;DR: It's a best effort result

It's all about squeezing a maximum in capabilities from a minimum in hardware.

  • CGA is a rather simple (*1) circuit build from basic TTL
  • CGA does not work with a loadable palette and multi level (analogue) output.
  • CGA uses RGB-I with one bit per colour and intensity.
  • This results in 8 possible colours of fixed value in two intensities.
  • With two bits per pixel (*2) 4 colours are possible.
  • Thus two palettes of 4 colours each were created
    • One using the 'even' colours Black/00(0), Green/01(0), Red/10(0) and Brown/11(0)
    • The other made from the 'odd' Blue/00(1), Cyan/01(1), Magenta/10(1) and White/11(1)
  • Intensity could be set for the whole screen to produce the complementary subset
  • By reusing the existing text mode border colour register for colour 00 (instead of fixed Black or Blue) it could be defined with a full 4 bit RGBI value.

The result were the four palettes of one definable and 3 fixed colours.It's all about squeezing the maximum graphics usability from a hardware primary designed for text display.

Mode 4 is what gives all possible colours.

Mode 5 in turn is Mode 4 but optimized/cut for grey scale output (*3). Exactly the same way as Mode 0/1 or 2/3 are for B&W or Colour. When used with a RGBI colour screen Mode 5 will produce artificial colours.


Questions

Those 4 colors could be selected from limited set of 6; 3 palettes, and 2 intensities for each (bright or dim):

It's as described, only two palettes of 4 each with one of them (00) being overwritten by border value. The 'third' being an artefact of using the B&W mode on an RGBI colour display.

Why were the other 3 colors not selectable?

Because that would have need the addition of more hardware, especially a real colour lookup logic. Something that only came with EGA/VGA.

Why have these ugly predefined palette choices instead?

Because they are the alternating colours of the full spectrum (which wasn't great to start with).

Hardware seems to have everything needed, and they've had to just connect the dots.

No, it doesn't. The cable may have had 4 lines to output 16 colours/intensities, the circuit didn't have the needed logic to define each on it's own. In fact, that colour 00 could be defined independently is a result ability to set a border colour in text mode. In 320x200 graphics mode this register was repurposed as source for colour 00, in 640x200 mode it was used as foreground colour. I'd say that's a quite good utilization of a singe register.

It doesn't seem like memory would be an issue. You would only need extra 12 bits for entire screen.

It's not bits but logic. it would have needed 3 more registers (that's 3 TTL) and a selector switch (another one), some decoder to write them and some glue logic. CGA is already quite packed:

enter image description here (Taken from Wikipedia)

Adding another 4 to 8 TTL would have been a lot to squeeze in for what would be a minor addition. After all, CGA in graphics mode was intended to show some business graphics where it's not really important if they are blueish, greenish or reddish as long as they can be distinct.

It also doesn't seem like display hardware limitation. Text modes could display far more color combinations simultaneously.

As mentioned, the cable doesn't care, but logic needed to generate does.

Also, not really far more, but yes, as they stored 4(+4) bit colour information in a dedicated byte per character. Doing similar in 320x200 mode would have required 32 KiB of memory and a multiplex logic to fetch alternating pixel ... plus a complete different way to access memory.

A 160x200 mode would have been somewhat in range for the way the CGA is designed - kind of shown by the infamous 160x100 mode.


*1 - From today's point of view, back then it was state of the art.

*2 - 320x200 = 64,000 pixel. CGA had 128 KiBit (16 KiB) of memory, thus a maximum of 2 bits are available for colour information per pixel.

*3 - Yes, one could have a PC with CGA and b/w screen.

9
  • "Because they are the alternating colours of the full spectrum." Except that one of the primary colors (Blue) is omitted for some reason.
    – dan04
    Commented Nov 8, 2023 at 16:32
  • 1
    How much would a 74LS670 4x4 register file have cost in 1980? Using one of those instead of the 6-bit latch at 0x3D9 and removing some other circuitry would have allowed arbitrary choice of four colors in medium resolution mode and arbitrary background as well as foreground in high resolution mode. The chip certainly existed when the PC was introduced, since the motherboard uses one to control the DMA high address nybble.
    – supercat
    Commented Nov 8, 2023 at 16:39
  • @dan04 Read again, it it isn't. Blue is what the odd (cyan) palette would have a as colour 00. It being often describes as 'black' is only true if the colour register is not loaded appropriate - like with 0001 to get blue ... or any other of the 16 shades. That's the beauty here.
    – Raffzahn
    Commented Nov 8, 2023 at 16:57
  • 2
    Additional points: a) The CGA card is so simplistic that when IBM decided they needed to tweak the one color that was too crappy to tolerate, they had to fix it by faking it in the monitor rather than changing the card (look up brown yellow CGA). b) The Motorola MC6845 display controller on the CGA was designed to run text-only terminals. That it could be twisted into doing graphics at all is a bit of a marvel Commented Nov 8, 2023 at 17:14
  • @EuroMicelli Well, yes and no. I'd say the twisting for yellow was an after though t improve it (a bit) past most uggly business graphics, but no, 6845 has been used for many graphic systems as well. After all, it's just a bunch of counters for frame and address generation, anything text or graphics related is up to external logic, only limited by max values of those counters.
    – Raffzahn
    Commented Nov 8, 2023 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .