Wiki

Clone wiki

ultima-exodus / CGA_Composite

CGA Composite Mode

Today when we view CGA graphics output we are using an RGBI monitor with which to view it. However, it was once common to use an NTSC monitor (analog TV signaling) to the video card. When done so, the monitor would produce a color artifacting effect (aka color smearing) that would result in the creation of completely new colors. These colors were known as artifact colors (or composite colors) and could be produced when two different colors immediately neighbored each other. Since there are 4 different RGB colors output by a CGA card in 320x200 a composite display could produce a total of 16 colors in this graphics mode.

One of the tell-tale signs that a game was expected to be viewed in composite mode was that how it outputs it graphics: it would appear in an alternating color pattern on RGBI monitors. Ultima 2 and 3 are two such games where these patterns are noticeable. For example, U3 has a distinct magenta-and-black border as well as alternating white-and-black dots in the water tile. Both of these patterns were intended to be "smeared" on a composite display and produce a dark blue border and a light blue water tile.

Since those bygone days, RGB displays have proven to be far superior to NTSC displays and are thus the dominant type of display today. There is presently no way to view composite graphics modes with today's hardware. For this reason, the U3 Upgrade includes a driver which simulates the color smearing effect, thus rendering the game in the way it was intended to be experienced.

The driver essentially works by employing two video buffers and a VGA palette configured with the 16 composite coors. The first video buffer contains the CGA data as outputted by the game, but it is not outputted to the video card. When CGA data is written, the driver invokes a "flush" process that reads the CGA data from the first buffer, generates the composite color output, and writes it to the actual VGA video buffer. Because of this double-buffering there is a noticeable performance decrease when using this driver with DosBox's default CPU cycle of 3000. It is recommended that you increase the CPU cycles to at least 12000 in order achieve adequate performance.

It should be mentioned that DosBox has a means to simulate its own CGA composite mode, however I've not been able to activate it in Ultima 2 or 3. If anyone is able to do so, please email me with the information.

You can find more info at the following locations:


Generating Composite Colors

Here are the possible colors that can be produced in CGA RGB mode:

Index Data Color Palette 1
0 00 black
1 01 cyan
2 10 magenta
3 11 white

However in composite color mode (or at least, this approximation of it) pixels are colored in "pairs". The left-hand pixel of the pair tends to have a more reddish hue while the right-hand pixel has a blueish hue. Thus:

Index Data Pair RGB Color Pair Composite Color Used in U2/3
0 00-00 black-black black *
1 00-01 black-cyan dark green *
2 00-10 black-magenta dark blue *
3 00-11 black-white medium blue *
4 01-00 cyan-black brown
5 01-01 cyan-cyan light green *
6 01-10 cyan-magenta gray
7 01-11 cyan-white aqua
8 10-00 magenta-black red *
9 10-01 magenta-cyan grey
10 10-10 magenta-magenta purple
11 10-11 magenta-white light blue
12 11-00 white-black orange *
13 11-01 white-cyan yellow
14 11-10 white-magenta pink
15 11-11 white-white white *

Note that Ultima 2 & 3 only use 8 out of the total 16 colors.

Updated