Profile picture
Jim Leonard @MobyGamer
, 8 tweets, 2 min read Read on Twitter
I was asked to explain what color and palette remapping capabilities EGA had and thought I would make a thread about it. EGA isn't well-understood these days because of VGA's success, but it's worth going over for people wondering why you can't set custom colors in all EGA modes.
EGA was introduced in 1984 with (limited) compatibility with existing IBM CGA monitors: 200-line graphics modes (320x200, 640x200) could use any of the existing 16 text colors per pixel. Only the high-res 640x350 mode could pick additional colors from a fixed palette of 64.
People only familiar with VGA get confused talking about palettes with EGA, because they weren't programmed the same. To explain how they differed, let's define what a palette is: A palette is a table that maps indexes (0, 1, 2, etc.) to color values (#FF55AA, #7f7f7f, etc.).
Using this definition, let's establish capabilities. CGA (1981) had 6 palettes, each holding 4 indexes, with each index pointing to one of the 16 text colors. Indexes could not be manipulated, so each palette is "fixed" and points to a set of 4 colors that cannot be changed.
The IBM PCjr (1983) (and, later, Tandy) expanded on CGA such that 16-color modes had a single palette with 16 indexes that could change what color each index mapped to. By default, indexes point to all 16 colors (#0 -> 0, #1 -> 1, etc.) but you could switch these around at will.
VGA (1987) is well-known but worth restating: In 256-color graphics mode, VGA has one palette holding 256 indexes, which each index able to reference one of 262,144 colors. The number 262,144 comes from 2^18, or 2^(3*6), as there are 3 color components (RGB), each 6 bits wide.
So what can EGA (1984) do? 200-line modes behave like PCjr: You can change which of the fixed 16 text colors each index points to. In the high-res 350-line mode, EGA behaves like VGA: You can reference one of 64 colors, or 2^(3*2), colors, as each component is only 2 bits wide.
For more info on programming EGA (as well as what came before and after it), two excellent references are Richard Wilton's "Programmer's Guide to PC Video Systems" and Richard Ferraro's "Programmer's Guide to the EGA and VGA Cards". Ferraro's book in particular the best for EGA.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Jim Leonard
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!