VOGONS


First post, by caiot5

User metadata
Rank Newbie
Rank
Newbie

I was wondering why the heck when we're using 256 colors mode in Windows 95 or 98, sometimes the screen refreshes with wrong color palette and then if you open another window / close a program, all of sudden it goes back to normal?
I notice this behavior since my first PC back in the 90s but never found anyone who could answer me this. As retro gurus tribe lurks around this forum, thought it could be a nice place to ask 😉

Reply 1 of 13, by Tiido

User metadata
Rank l33t
Rank
l33t

Because everything has to share those same 256 colors. These colors however can be redefined and some programs have their own idea what they should that differs from others which makes all the others go crazy as you put it, at least until they come back into focus, then the previous one goes instead 🤣

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 2 of 13, by Thandor

User metadata
Rank Member
Rank
Member

Look up ‘VGA color palette’. You’ll see 256 colors like this. If you have a game that is 256 colors but uses more shades of green and less blue you can change (redefine like Tiido said) the palette to incorporate more green at a cost of less blue.

So 256 VGA can basically display more than 256 colors but not all at once.

thandor.net - hardware
And the rest of us would be carousing the aisles, stuffing baloney.

Reply 3 of 13, by wierd_w

User metadata
Rank Member
Rank
Member

The same is true of EGA palette, but with even fewer colors. EGA IIRC, has a register of 64 colors, that are software definable, of which 16 can be simultaneously displayed.

VGA palettes can be 4 color (for CGA compatibility), 16 color, for EGA compatibility, but also 64 color, 256 color, and pals.

You do not normally see these kinds of palette reprogramming artifacts on EGA, as very few games bother to reprogram the palette. However, the win3x EGA graphics display driver DOES reprogram the palette, (and with some fudging, *CAN* be used with win9x, which DOES make use of the palette reprogramming!! It looks really odd, but It totally works. Win95 on an EGA card is funny as hell, IMO.)

VGA palette was reprogrammed *A LOT* however, because some very interesting video effects can be gained "Cheaply" with just a few bytes written to the palette register. Such as "Fade to black", "Color cycling", and the like. The actual pixel values in memory DO NOT change, but the displayed colors DO, and this can be done very quickly and inexpensively (since memory is not being read or written to), with a wide selection of colors to pick from, with just a few bytes being prodded at the correct IO address for the card to respond to.

EGA was kinda slow on its responses, and even then, there were only 64 colors to pick from (instead of 256), and constraints needed to have nice looking general graphics meant sacrificing some palette space for fancy effects was just too costly in other areas.

Reply 5 of 13, by wbahnassi

User metadata
Rank Member
Rank
Member

EGA colors cannot be software redefinable. The pins on the connector are TTL with 2 bits for each color channel. You can never have anything outside the 64 value combinations possible with 6 bits of data. But yes, you can choose which 16 of those 64 are shown at a time on one screen.

But I wonder why most EGA games stuck to the standard 16-color CGA palette. I even never remember a game from the day that showed colors outside of the standard 16, so I always believed that EGA is 16 fixed colors (and CGA is 4 fixed colors 😅). Any examples of EGA games that redefine the 16 colors to other than the CGA palette?

In fact, Operation Wolf VGA mode is actually using the exact EGA graphics but just redefines the palette to nicer tones than its EGA mode, which stuck to the standard CGA 16 colors. So yeah, both VGA and EGA modes of the game are still 16 colors at a time on the screen.

Reply 6 of 13, by Jo22

User metadata
Rank l33t++
Rank
l33t++
wbahnassi wrote on 2024-01-26, 07:34:

But I wonder why most EGA games stuck to the standard 16-color CGA palette.

Hi, I'm not entirely sure, but I believe that's because this requires 640x350 graphics mode (mode 10h).

And this mode wasn't being used by games so often as it requires an EGA monitor (it has a second set of r/g/b pins, not just R/G/B).
Such EGA monitors weren't used by most home users, though. Instead, they've used a CGA monitor.

A CGA monitor in turn is pretty much like an ordinary TV set with a SCART connector.
Except that the TV has analog RGB (smooth colour levels) and the CGA monitor used TTL (steps of colour levels).

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 7 of 13, by Tiido

User metadata
Rank l33t
Rank
l33t
wbahnassi wrote on 2024-01-26, 07:34:

But I wonder why most EGA games stuck to the standard 16-color CGA palette. I even never remember a game from the day that showed colors outside of the standard 16, so I always believed that EGA is 16 fixed colors (and CGA is 4 fixed colors 😅). Any examples of EGA games that redefine the 16 colors to other than the CGA palette?

It is because of the monitors, 200 line mode is fixed to CGA standard and from the monitor itself even though the EGA card could show any of its 64 colors via the output connector, monitor will still treat it as CGA and only listen to 4 of the bits with brown override mechanism. Only in 350 line mode the full 6 bits output is unlocked (or by using VGA, where you can even use the full 18bit capability of the RAMDAC even in any of the EGA modes 🤣).

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 9 of 13, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi, a graphical representation of the classic 256c Windows palette can be seen here:

pal-256.png
Filename
pal-256.png
File size
2.12 KiB
Views
454 views
File license
Fair use/fair dealing exception
c-256.png
Filename
c-256.png
File size
6.78 KiB
Views
454 views
File license
Fair use/fair dealing exception

It's from a little article of a now defunct website. The article was named The Colors of Windows..

Edit:

Makes sense, and makes me feel even worse about selling our first PC back in the day: A full Samsung XT computer with Samsung EGA monitor. Sigh.

I'm not sure if this uplifting to you, but we all were a bit silly back then and gave things away. You did give it a new home, at least. 😎 👍
Also, you still have the memories and can rightfully say that you had worked with such a classic in first person at the time. 😀
Not all of us here did, after all. I for one did start with a 286 and VGA and had missed out on the XT era.

Last edited by Jo22 on 2024-01-26, 13:52. Edited 1 time in total.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 10 of 13, by mkarcher

User metadata
Rank l33t
Rank
l33t
wbahnassi wrote on 2024-01-26, 07:34:

But I wonder why most EGA games stuck to the standard 16-color CGA palette. I even never remember a game from the day that showed colors outside of the standard 16, so I always believed that EGA is 16 fixed colors (and CGA is 4 fixed colors 😅). Any examples of EGA games that redefine the 16 colors to other than the CGA palette?

IIRC, the Robot series of games (http://www.tom-games.de/robot/) uses redefined EGA colors. The screen shots show gold bars with distinctively orange pixels. This (100% red, 66% green) is one of the most useful non-standard EGA colors. That game is designed for 350 lines, and supports both Hercules and EGA graphics. It has no CGA support, and thus does not suffer from the limitation that you can't get non-standard colors in 200-line modes.

Reply 11 of 13, by Jo22

User metadata
Rank l33t++
Rank
l33t++

^Hi mkarcher, thanks for the info from my side, too! ^^
Speaking of EGA, I vaguely remember reading something about EGA having the ability to display 640x350 mode in reduced colour depth (4c ?) if the installed video RAM was too little.
But I can't exactly remember what this was about. Do you know a bit more about this, by any chance? It's not so important, maybe. It just came to mind right now.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 12 of 13, by mkarcher

User metadata
Rank l33t
Rank
l33t
Jo22 wrote on 2024-01-26, 13:58:

Speaking of EGA, I vaguely remember reading something about EGA having the ability to display 640x350 mode in reduced colour depth (4c ?) if the installed video RAM was too little.
But I can't exactly remember what this was about. Do you know a bit more about this, by any chance? It's not so important, maybe. It just came to mind right now.

Yes, I know perfectly what you were talking about. The EGA card internally has a 32-bit memory bus (pedantics might call it 2 sixteen bit memory busses that mostly operate in lock-step). The base version of the original IBM EGA card only had 64K of video RAM, which is organized 16K adresses of 32 bits. In native EGA graphics mode, the EGA card fetches a 32-bit word and generates 8 pixels from those 32 bits of data. If the RAM consists of 16K "words", you can generate 8*16K = 128K pixels from it. 640*350 on the other hand has 224K pixels, so it just won't fit. That's why IBM added an optional second mode to the pixel generation unit: It still fetches 32 bits at a time, but does not just generate 8 pixels from it (using 4 bits each), but generates 16(!) pixels from it, using 2 bits for each pixel. This is good for up to 16*16K = 256K pixels, which is sufficient for 640x350. On the other hand, this is absolutely not the same logic that is used for the CGA-compatible 4-color graphics mode.

Furthermore, in standard EGA graphics modes, 32 bits of video RAM are associated with each address, and programming of the graphics controller and the timing sequencer instruct the EGA card how to associate the 8 ISA bus bits to the 32 video RAM bits (which is a topic you can write a whole book about). This means that in standard 16-color operation, an EGA card with 64K of video RAM only uses the first 16K of that address window. If you select the 640x350 mode on an EGA card with just 64K RAM, the ISA bus interface is swichted into a different mode, though: In that mode, it maps two consecutive ISA addresses to the same location in video RAM, so the video RAM now covers 32K of the address window instead of 16K. At the same time, only 16 bits of the full word width of 32 bits are accessible at each ISA bus location: At even addresses, only bits 0..7 ("plane 0") and 16..23 ("plane 2") are visible (applies under certain conditions), while at odd addresses, only bits 8..15 ("plane 1") and 24..31 ("plane 3") are visible. This mode is called "odd/even" mode for likely obvious reasons. So the 16K x 32 RAM is mapped in a way that it appears to be 32K x 16. Certain kinds of EGA graphics operations work the same in 16-color modes and the high-res 4-color mode, so if you refrain from advanced graphics controller tricks, you might be able to re-use the code meant for 16-color graphics also in 4-color graphics mode. Because of the way the mapping is performed, the 4-color mode looks like only colors numbered 0,1,4 and 5 exist.

Reply 13 of 13, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Thank you very much for the explanation! It's well done, btw. I've always wondered what this was about! 😁

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//