VOGONS


First post, by VileR

User metadata
Rank Oldbie
Rank
Oldbie

Something fun that I came across, maybe this will be interesting to some (I remember there was some talk about hacking different palettes for CGA games)

I've found this public domain utility here:
http://cd.textfiles.com/microhaus/mhblackbox2 … EN/CHGCOLOR.ZIP (documentation and source included)

This is an EGA palette changer that lets you remap each of the 16 onscreen colors to a value from the full 6-bit EGA palette.
But in contrast to other similar programs, your tweaks survive through mode changes, and they appear to affect 4-color CGA modes as well.

This works in DOSBox 0.74 with machine type ega and "up". I don't know if it really works that way on a real EGA card - perhaps someone would be interested in testing it... maybe this behavior is just an artifact of emulation. But anyway it works, and you get to play around with those ugly old palettes!

Easy to use, check the doc/source. You just remap colors 0-3 for CGA modes, and 0-15 for EGA. (Note that the target color values are EGA palette values, not CGA, so for example bright red is 60, not 12)

Downsides:

1. In low-res modes, you're stuck with the basic 16-color CGA palette (this is standard EGA behavior). If you remap to a color outside this palette, it seemes to get mapped to something "close enough"
2. For CGA modes - all other palette changes will be ignored, your custom palette will be the only one you'll get
3. For EGA modes - changing color 15 (high-intensity white) doesn't seem to work, at least in DOSBox

Sample DOSBox screenshots:

t2D2h.png I1nTM.png

ALLEY CAT - LEFT: original CGA palette; RIGHT: almost as ugly, but with 4 brand new colors

PMNQS.png PEdTH.png

LODE RUNNER - LEFT: original CGA palette; RIGHT: grey, red, bright green, bright blue

wjh3q.png 8lLPL.png

MONUMENTS OF MARS - LEFT: original CGA palette; RIGHT: "inverted greyscale" palette

3PvIu.png IjttF.png

SPACE COMMANDERS - LEFT: original CGA palette; RIGHT: looking swanky in custom colors

XOXNE.png hlUYV.png

CRYSTAL CAVES - LEFT: original EGA palette; RIGHT: with some (not very) clever 16-color tweaking

hj6qH.png Q2DRm.png

DUKE NUKEM - LEFT: original EGA palette; RIGHT: ...now in ugly CGA colors!

Reply 2 of 21, by DonutKing

User metadata
Rank Oldbie
Rank
Oldbie

I like the crystal caves one, it looks like an underwater/aquatic style game 😀

But what have you done to Duke 😳

If you are squeamish, don't prod the beach rubble.

Reply 3 of 21, by VileR

User metadata
Rank Oldbie
Rank
Oldbie

Just mapped the 16 colors to CGA-like ones. Actually I don't think that this EGA tool is very useful for 320x200 EGA games (you just get to re-arrange the same 16 colors that you had to begin with), but it's fun for CGA games, which probably wasn't even the intention behind it...

But here's what's funny - I just tested this ChgColor TSR outside of DOSbox, in WinXP's CMD.EXE in full screen mode, and it still works!!! It doesn't change text mode colors (in fact it just slows things down) but running a CGA game produces the same effect.

(Of coruse this isnt useful at all since most CGA games aren't even playable in XP... but it leads me to believe that this program will work in a true DOS machine with an EGA/VGA adapter)

Too bad I can't program assembly... it would've been cool to add hotkeys to cycle between the colors. Or maybe to try doing a VGA version (VGA can customize the palette in 320x200x16, so it's possible you'd get even more colors to choose from)

Reply 4 of 21, by garrynichol

User metadata
Rank Newbie
Rank
Newbie

Nice stuff. I just wish I could get AnsiPLUS to work IN Dosbox although I already did a workaround.
Let me know if you have any luck. BTY AnsiPLUS is VGA. i can dig up the Authior's name if you want it or hopefully not becuase he might be dead or not.

Reply 5 of 21, by VileR

User metadata
Rank Oldbie
Rank
Oldbie
garrynichol wrote:

Nice stuff. I just wish I could get AnsiPLUS to work IN Dosbox although I already did a workaround.
Let me know if you have any luck. BTY AnsiPLUS is VGA. i can dig up the Authior's name if you want it or hopefully not becuase he might be dead or not.

Are you talking about this one? I've never tried it, but a quick search of the forum shows that people have been able to get it to work under dosbox.

If this is it, I'll check it out... looks promising.

Reply 6 of 21, by VileR

User metadata
Rank Oldbie
Rank
Oldbie

Nope, you're right - Ansiplus doesn't run correctly. I can only assume that it did work in earlier dosbox versions. Anyone who has managed to make it work (by any chance) on 0.74 / current SVN is welcome to post.

I've found some other VGA palette change utilities, but none that work in graphics modes *and* intercept/prevent interrupt requests that would reset the palette (in order to make your changes persistent).

for CGA games (as long as they still run on a VGA), such a utility could also let you to simulate a monochrome CGA monitor (gray/green/amber), with different intensities for shades... there is no native DOSbox support for this, even though these monitors were very common with early PC clones (and even an IBM model or two).

Reply 7 of 21, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOSBox does not fully emulate character devices, so when ANSI drivers try to replace the console device with their own, it doesn't work. However, if you boot real DOS in DOSBox, ANSI drivers should work fine.

INT 29h provides a hook into text output that ANSI drivers make use of, but DOSBox's console device does not send output through INT 29h as real DOS does. The attached TSR program redirects DOS text output functions through INT 29h, which should improve support for most ANSI drivers. I can't say this will make everything in ANSIPLUS work, but you should at least not see unprocessed escape sequences on the screen. Let me know if some specific part isn't working. Source code is included in the archive.

Attachments

  • Filename
    INT29.ZIP
    File size
    1.24 KiB
    Downloads
    745 downloads
    File license
    Fair use/fair dealing exception

Reply 8 of 21, by VileR

User metadata
Rank Oldbie
Rank
Oldbie

Hats off ripsaw - works beautifully! At least AnsiPlus seems to show and function correctly now. Much, much appreciated.

Just played around a bit with its palette functions, to try and make it do what I'm looking for... no real luck so far - AnsiPlus wasn't intended for use with 4-color modes, but even with 16 colors I'm getting some weird/funny results, so I'm probably doing something wrong. Will delve into the docs later on.

Man, if I could only make sense of assembly...

Reply 9 of 21, by dr.zeissler

User metadata
Rank Oldbie
Rank
Oldbie

I want to convert VGA 16/256 Color Images to real EGA 16 with 640x350.
How do I generate the EGA-Palette in Programs like PainShopPro5 or PhotoShop5 ?

Currently I downgrade a 256color pic to 64colors with diffusion, after that I reduce to 16 colors with no dithering,
but in background is always the VGA-Palette. I n order to make real EGA-Pics I have to change the Palette.

Any Idea, how to do this?

CPU: PII 133-333 MOBO: SNI-D981 RAM: 512- FDD: Dualfloppy 3,5"HD/5,25"HD - 3,5"HD - 5,25"DD ISA-Catweasel HDD: 2x40GB - DVD
ISA(3): Audician32-S2Dreamblaster - GusACE PCI(3): Monster3D- Intel NW AGP(1): 3dfx V3-3000

Reply 10 of 21, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
dr.zeissler wrote:

I want to convert VGA 16/256 Color Images to real EGA 16 with 640x350.

Look at VGA2EGA util. It converted .gif 640x350 to EGA mode
.gif made by Photoshop it may don't like, but after converting such .gif to compuserv format (by ACDSee, for example) it processes them

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 11 of 21, by leileilol

User metadata
Rank l33t++
Rank
l33t++

For the Direct3D builds out there you can use this shader to really fake EGA in real-time.

As for a TSR that does this, no idea. and it would probably torture computers of the period if there were one since lookups are expensive

by the way, DOSBox is not for running Windows 9x

Reply 12 of 21, by Scali

User metadata
Rank l33t
Rank
l33t

You can do the same trick on VGA as is done on EGA here: just overwrite the VGA registers which are mapped to the CGA/EGA colours.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 13 of 21, by VileR

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:

As for a TSR that does this, no idea. and it would probably torture computers of the period if there were one since lookups are expensive

I believe it only has to be done once per INT 10 mode set, and not too many registers to modify even then (at least if we're talking CGA modes), so really not that much torture.
I've gotten a little ASM practice since I wrote that post; haven't written any TSRs yet, but maybe that'll be my next exercise...

web  /   blog   /   tube

Reply 14 of 21, by Scali

User metadata
Rank l33t
Rank
l33t
VileRancour wrote:

I believe it only has to be done once per INT 10 mode set, and not too many registers to modify even then (at least if we're talking CGA modes), so really not that much torture.

That is correct. It was a common technique to use the full VGA palette in 16-colour modes. 16-colour modes were much faster than 256-colour in various circumstances, because you only had half the memory to process.
My 1991 donut intro uses that trick as well, it runs in mode 0Dh, which is EGA's 320x200 16-colour mode. It actually runs on real EGA as well, but when it detects VGA, it sets up some special VGA palettes (it actually uses palette banking, the logo at the top is a different set of 16 colours than the blue donut at the center, so you get 32 colours on screen).
It probably works the same on CGA modes, although I've never tried (why would you ever want a 4-colour mode when you can have 16 or 256?).

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 16 of 21, by Calvero

User metadata
Rank Member
Rank
Member
Scali wrote:

why would you ever want a 4-colour mode when you can have 16 or 256?

John Romero released Pyramids of Egypt in 1990. Most people had a CGA card back then, so he put CGA graphics in his game. When you ran the game on a EGA card, it would still have only 4 colors, but one of the colors was changed to red so he could put blood in his game 😎

Reply 18 of 21, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Alley Cat will also play the opening theme in 3-voice music on a PCjr., but all the in-game sounds will use the PC speaker.

I was only able to extract the executable from the archive link with 7zip, so in order to use this program, you do so like this :

chgcolor 0 1 1 15 2 30 3 63

The first value is the palette entry, the second value is the color value. Program uses decimal numbers from 0-63.

http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog

Reply 19 of 21, by dr.zeissler

User metadata
Rank Oldbie
Rank
Oldbie

Would be nice, to see an EGA game remapped 😀

CPU: PII 133-333 MOBO: SNI-D981 RAM: 512- FDD: Dualfloppy 3,5"HD/5,25"HD - 3,5"HD - 5,25"DD ISA-Catweasel HDD: 2x40GB - DVD
ISA(3): Audician32-S2Dreamblaster - GusACE PCI(3): Monster3D- Intel NW AGP(1): 3dfx V3-3000