VOGONS


First post, by ockiller

User metadata
Rank Newbie
Rank
Newbie

I don't know if this has already been tried, I can't find much information on the topic of making EGA modes work again on Turing+ (it's completely broken from that generation onwards, only VGA and VESA modes remains functional).

The idea that I wanted to try was that a VGA mode 12h (640x480 planar 16 colors) isn't much different from say mode EGA mode 0Dh (320x200 planar 16 colors), so maybe it's possible to trap mode 0Dh, ask for mode 12h instead and tweak it to a 320x200 version. And it works indeed! In fact, modern Geforces seem to just ignore all CGA/EGA mode requests, they are no-op, but it seems that manual mode settings via the VGA registers still mostly works (tested on an Ada Geforce RTX 4060 Ti).

So here is my proof-of-concept (NASM source included), a small TSR that for now traps mode 0Dh only, and reconstruct it as close as I could with my limited knowledge of the VGA registers from mode 12h. It should be possible make such workarounds for other legacy graphics modes like CGA or EGA's 640x350 modes.

I also included a fix attempt at the wrong color palette of these old modes (the green/yellow/cyan tint that exists at least from the Maxwell generation), and it's the result of many failed attempts for which I still don't fully understand. I reproduce this palette bug with my fake mode 0Dh even on DOSbox so here it's only my fault. As I couldn't get any success remapping the EGA palette to the VGA DAC (I suspect some games to overwrite them after setting the graphics mode), I simply set the corresponding DAC colors. Thing is, which DAC indices to fix depend on the game! So, as it only concerns the bright colors (8-15) I just repeat them over the whole DAC range 8-63, and it seems to do the job for all the games I tested, including the Commander Keen series.

In theory this TSR shouldn't have a visible effect on a graphics card with a perfectly sane VGA BIOS, so it could be used on Maxwell+ too to fix the wrong color palette.

Reply 1 of 1, by ockiller

User metadata
Rank Newbie
Rank
Newbie

I implemented the proper color palette behavior. It's the restriction to the 16 CGA colors in 200 lines EGA modes, and the layout of these colors is not obvious. Now I'm confident I'm doing the same thing as good VGA BIOS implementations.

I also added the other EGA color graphics modes. Mode 0Eh (640x200 16 colors) is often utilized by later VGA games as the EGA fallback (notably some Lucas Arts games), with heavy dithering. And mode 10h (640x350 16 colors).

Text modes other than mode 3 are also ignored on Turing+, so 40 column text modes are also broken. For now I added mode 1 (40x25 color text mode), it works with a 3D Tetris game named Block Out, which uses hi res EGA graphics in game but 40x25 text mode menus. So now this game is also fully working with an RTX. 40 column text mode doesn't behave very well in the command line though, I still haven't figured out why.

I don't handle monochrome modes, nor CGA modes. For these, I might make another TSR (CGAFIX?) as to not increase the TSR size for those that don't need them.