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 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.

Attachments

  • Filename
    S3_512X384-16.diff
    File size
    1 KiB
    Downloads
    40 downloads
    File comment
    S3 512x384/16bpp mode patch (apply to workaround doublewidth issue)
    File license
    Fair use/fair dealing exception

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).