VOGONS


First post, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

This is something that I hacked together by modding the existing 2 colour CGA driver - it enables the colour burst bit and has a modified look up table for colour translation. I have only tested this in DosBox-X as I don't actually have a CGA machine with composite output. The CGA composite colours don't quite have a good match for all the EGA colours but I tried to fit them the best I could.

To use, just add the CGACOMPO.DRV file to your game directory and edit the RESOURCE.CFG to read:
videoDrv=CGACOMPO.DRV

Aca27qc.png
CE912qM.png
gDR7ygy.png
SjrXDkJ.png

Reply 1 of 16, by darry

User metadata
Rank l33t++
Rank
l33t++
jhhoward wrote on 2021-03-31, 14:14:
This is something that I hacked together by modding the existing 2 colour CGA driver - it enables the colour burst bit and has a […]
Show full quote

This is something that I hacked together by modding the existing 2 colour CGA driver - it enables the colour burst bit and has a modified look up table for colour translation. I have only tested this in DosBox-X as I don't actually have a CGA machine with composite output. The CGA composite colours don't quite have a good match for all the EGA colours but I tried to fit them the best I could.

To use, just add the CGACOMPO.DRV file to your game directory and edit the RESOURCE.CFG to read:
videoDrv=CGACOMPO.DRV

Aca27qc.png
CE912qM.png
gDR7ygy.png
SjrXDkJ.png

That looks great, IMHO . The different colours actually give the game a much more pleasant and less sterile look .

Nicely done!

Reply 2 of 16, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
jhhoward wrote on 2021-03-31, 14:14:

To use, just add the CGACOMPO.DRV file to your game directory and edit the RESOURCE.CFG to read:
videoDrv=CGACOMPO.DRV

Does the driver not show up in the installer?
I think it should, provided that you modified the strings in the file header.

Reply 3 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie
Benedikt wrote on 2021-03-31, 16:11:

Does the driver not show up in the installer?
I think it should, provided that you modified the strings in the file header.

Yes it should show up in the installer as 'CGA with composite color output'. I mentioned the instructions about editing the config file directly because the modern re-releases tend to have the install / setup programs stripped from them.

Reply 5 of 16, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Heck yes.

EDIT: I tried this with the EGA SCI1.0 games and it works, but like the older official CGA drivers, it doesn't like scrolling screens. Which means it won't work for KQ1SCI either.

Last edited by MusicallyInspired on 2021-03-31, 19:30. Edited 1 time in total.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 6 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

Took another look at the palette mapping and think I have generally improved it. New version is attached to this post

Here are some comparison screenshots of original EGA version vs composite CGA version:
bugB13q.png
kaoFgQR.png
pqhAyGM.png
bhjg4O5.png

Reply 7 of 16, by darry

User metadata
Rank l33t++
Rank
l33t++

I like both. Hard to say which one I prefer .

Reply 9 of 16, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
MusicallyInspired wrote on 2021-03-31, 19:19:

Heck yes.

EDIT: I tried this with the EGA SCI1.0 games and it works, but like the older official CGA drivers, it doesn't like scrolling screens. Which means it won't work for KQ1SCI either.

That can be patched in. The newer version has an additional function, i.e. the scroll function, and a matching additional entry right at the end of its jump table.
If that additional entry is missing, but the game expects it to be there, funny things happen.

Reply 10 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie
Benedikt wrote on 2021-03-31, 21:50:

That can be patched in. The newer version has an additional function, i.e. the scroll function, and a matching additional entry right at the end of its jump table.
If that additional entry is missing, but the game expects it to be there, funny things happen.

I had a go at trying to patch it in but it still locks up when scrolling (testing SQ1 EGA remake). I appended a function at the end of the driver and updated the jump table to include the address of the new function. I used your FOSS driver code(https://github.com/roybaer/foss_sci_drivers/b … er/src/pcplus.s) as a reference. I tried:
- Wrapping the update_rect function exactly like you did
- Stubbing the function entirely by just pointing to a ret instruction
- Tried using the scroll function from a newer CGA driver, which basically wraps the update_rect function with a few extra steps, looks like this:

and bx,0F8h
add dx,7h
and dx,0F8h
mov si,di
call update_rect
ret

I guess I could try stepping into the code with the DOSBox debugger to see how it locks up. Maybe the driver uses the 2 bytes immediately after the header so the jump location gets stomped on? I could try modding a newer CGA driver but the format of the look up table is different so I'd have to reverse engineer it again.

One thing I noticed is that the header on the actual driver has 3 extra bytes at the beginning of the file before the 'magic number' signature (00 21 43 65 87 00). Do you know what these are for?

Any suggestions?

Reply 11 of 16, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
jhhoward wrote on 2021-04-01, 12:28:

One thing I noticed is that the header on the actual driver has 3 extra bytes at the beginning of the file before the 'magic number' signature (00 21 43 65 87 00). Do you know what these are for?

Any suggestions?

That is a jump instruction to the dispatch routine. Execution starts right at the beginning of the file.

If everything else fails, we could still try to transplant your work into a new CGA driver based on pcplus.s.

Reply 12 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie
Benedikt wrote on 2021-04-01, 13:26:

That is a jump instruction to the dispatch routine. Execution starts right at the beginning of the file.

Ah yeah that actually makes a lot of sense now that I look at it!

I ended up patching the newer CGA driver and now it works with the later SCI games since it has the scroll function implementation. I've attached the new version of the driver that should work for more games.

One thing I have noticed though is that the mouse cursor hot spot position is incorrect for EGA versions of SQ1 remake and SQ4. Is that something that works properly in your driver?

I would say that due to the nature of the artwork in the EGA versions of SQ1/4, the driver is pretty ugly due to the way the backgrounds are dithered. Here is a VGA/EGA/CGA comparison:
pBHGuT7.png

Reply 13 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

I was experimenting with dithering - specifically for creating a dark grey as it is missing from the CGA composite palette.

I also experimented using dithering and scanlines to more closely match the EGA palette, although the result is very noisy! I wonder how they would actually look on a real CRT display from a CGA card.

LlYXZXF.png

Reply 14 of 16, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie

I guess there is only so much you can do when it comes to picture quality.
But maybe you could try the opposite direction and try to turn existing dithering into solid colors – or coarser new dithering – by processing pairs of pixels at a time.
This could help with SQ4.

Reply 15 of 16, by jhhoward

User metadata
Rank Newbie
Rank
Newbie

Just for reference I've attached the dither versions from my last post:
CGACOMPO.DRV - Mostly the same as the previous version except that dark grey is emulated with a dither pattern
CGADITH.DRV - Dither patterns to simulate EGA colours
CGASCAN.DRV - Scanline patterns to simulate EGA colours