VOGONS


First post, by x86++

User metadata
Rank Newbie
Rank
Newbie

Where the S3 emulation is active at 16-bit color, DOSBox displays 512x384 mode at double width. To correct this, made this workaround:

--- vga_draw.cpp	2016-02-14 18:19:20 -0500
+++ vga_draw-512H.cpp 2016-02-14 18:10:54 -0500
@@ -1386,7 +1386,7 @@ void VGA_SetupDrawing(Bitu /*val*/) {
// 15/16 bpp modes double the horizontal values
width<<=2;
if ((vga.crtc.mode_control & 0x8) || (svgaCard == SVGA_S3Trio && (vga.s3.pll.cmd & 0x10)))
- doublewidth = true;
+ doublewidth = false;
/* Use HW mouse cursor drawer if enabled */
VGA_ActivateHardwareCursor();
break;

However, this change only "fixes" 512H while the other <640H 16bpp modes are halved in width. For a temporary solution, it should be possible to read the vga register which stores the resolution and check it in the above if...then statement.

Reply 1 of 9, by leileilol

User metadata
Rank l33t++
Rank
l33t++

FWIW IIRC my S3 Trio64v back then showed 512x384 as doublescanned (requiring a 1024x768 supporting monitor to view correctly)

apsosig.png
long live PCem

Reply 2 of 9, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOSBox does not have a 512x384 resolution in its mode table, so you have to look closer at the software that is trying to create it.

Reply 3 of 9, by x86++

User metadata
Rank Newbie
Rank
Newbie

Thank you for the advice. This issue is specific to a driver which creates the above video mode and displays doublewidth.

DOSBox-X supports this 512x384/16 video mode where machine=svga_s3, so I looked for a difference between its video emulation and that in DOSBox. One possibility is that different variants of the S3Trio card were used.

Attached a DOSBox SVN patch to workaround the above issue for the specific case of machine=svga_s3 and the 512x384/16 mode.

Reply 4 of 9, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

A driver for what? If it has the flexibility of drivers, why not use 640x400 or any other standard VESA resolution?

Reply 5 of 9, by x86++

User metadata
Rank Newbie
Rank
Newbie

That's a good suggestion. I'll try that. One of the programs is a dos application, not a game, so I didn't think it would be of interest. I've also tested in drivers for Win31 and later.

Reply 6 of 9, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I'd be interested in seeing a Win3 driver for S3 Trio that offers that resolution at any bit depth; never seen one before.

Reply 7 of 9, by x86++

User metadata
Rank Newbie
Rank
Newbie

A Win31 generic SVGA driver will support VESA modes at different resolutions, although I haven't tested it at all bit depths. I mainly test in >Win3 at the different bit depths.

Reply 8 of 9, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The S3 driver 1.70.04 mentioned in the Win3 guide is recommended for machine=svga_s3.

I checked the SciTech 5.3a UNIVBE S3 driver and it adds mode numbers for 512x384 at 8, 15, 16, and 32 bpp. The 15/16 bpp modes do indeed display as double-width, but with aspect correction enabled they don't appear so wide as they do when aspect correction is disabled. 😀

Reply 9 of 9, by x86++

User metadata
Rank Newbie
Rank
Newbie

That's a very good solution on the vesa mode. The only drawback is the doubling of the aspect_ratio value in vga_draw.cpp, although it doesn't appear to cause any issues from looking at the code in that file.

Another possible advantage is for the 3dfx/Voodoo emulation patch where the video mode switching at 512x384 occurs without passing through double-width window sizes (in my testing).