CGA Low Resolution 16-Color Graphics

CGA 16-Color Graphics

The original IBM-PC Color Graphics Adapter (CGA) could display text in 16 colors, but supported only 4 colors when in color graphics mode (at a resolution of 320×200 pixels). It was not widely known that the CGA graphics card could also display a 16-color graphics, albeit at a resolution of only 160×100 pixels. Wikipedia has a good description of the technical details of this low-res graphics mode. Also, see Life Before Demos.

I first came across this low-res graphics mode when I downloaded a game called Round 42, and was enthralled. I had to learn how to achieve this 16-color graphics mode it used.

round42-title round421

The only official description of this low-res graphics mode I’ve found is from the from the 1983 IBM Technical Reference Manual, in IBM Monochrome Display and Parallel Printer Adapter, Chapter 2: Hardware, where it lists:

CGA-color-graphics-modes-table--IBM-Technical-Ref-Manual

It later describes this low resolution color graphics mode as follows,

1. Low resolution color graphics (TV or monitor). (Note: This mode is not supported in ROM).

  • Up to 100 rows of 160 pels each (2×2)
  • 1 of 16 colors each pel specified by I, R, G and B
  • Requires 8000 byte of Read/Write Memory (on the adapter)
  • Memory mapped graphics (requires special memory map
    and set up to be defined later)

Somehow I managed to track down (this was before Google) a text file someone had written describing the how to tweak the graphics adapter display registers to produce 160×100 pixels in 16 colors. The gist of this technique is that the “graphics mode” is actually the 16-color text mode, with the 25 lines of text shortened to 1/4 normal height, allowing a total of 100 lines. If you then fill the screen with the left-half block IBM-PC character 221, “▌”, you can control the color of the even pixels by setting the text foreground color, and the odd pixels by setting the background color. To get the full 16 background colors, the “blink” feature needs to be disabled. By setting the appropriate display registers, this low resolution graphics mode can be achieved on CGA, EGA, MCGA, VGA, and even Monochrome graphics adapters (in 2 colors, of course).

Tunneler

Tunneler supports 16-color low resolution color graphics on all graphics boards. If a MCGA or VGA graphics card is detected, the color palette is improved to produce better brown dirt & gray rocks. Compare Tunneler in CGA and VGA:

Tunneler CGA Tunneler VGA

If characters other than the left-half block “▌” are used, other interesting effects result. I used the halftone dither shade characters 176 (“░”), 177 (“▒”), and 178 (“▓”) to mix colors from the 16-color palette to produce more shades, such as the dark blue background and the gray highlights and shadows in the energy/shield dashboard.

Games Using CGA 16-Color Graphics

Here are games I’ve seen using CGA 160×100 16-Color Graphics. Know of any others?

 

 

 

This entry was posted on by .

Leave a Reply

Your email address will not be published. Required fields are marked *