Wiki
Clone wikiultima-exodus / EGA
This section describes the EGA video mode as used by the Ultima Upgrades. The upgrade drivers actually use VGA video mode 0x13 for simplicity, but work with EGA data.
EGA Palette
EGA data consists of sixteen colors:
Index | Color Palette |
---|---|
0 | black |
1 | blue |
2 | green |
3 | cyan |
4 | red |
5 | magenta |
6 | brown |
7 | light grey |
8 | dark grey |
9 | light blue |
10 | light green |
11 | light cyan |
12 | light red |
13 | light magenta |
14 | yellow |
15 | white |
EGA Data
Pixels are grouped by row such that each successive pixel represents a column in the current row. Once the end of a row is reached, the next byte begins the next row.
EGA pixels are 4 bits wide, so EGA data is represented as two pixels per byte. Each byte has pixels organized sequentially as follows:
p0-p1
For example, the following byte from EGA data as shown in binary:
00101110
Can be broken down into two pixels:
0010-1110
Which in decimal is color indices 2,14 and corresponds to EGA colors green and yellow.
EGA Video Buffer
Since the U3 Upgrade uses VGA mode 0x13 when working with EGA graphics, the pixels are expanded to two bytes before being output to the video buffer.
Updated