I use the aspect correction feature in DOSBox, in windowed mode (not fullscreen), using the DDraw output method, and I like the result: corrected display aspect ratio achieved with subtle vertical blending of the pixel rows. But, I noticed something unexpected. I expected the 320x200 screens to be rendered at 320x240, or 640x480 using a 2x scaler... however the window areas are 320x233, or 640x467 with 2x. It doesn't seem to matter what scaler or output method I use; it still gives the same results. This is the case with 0.71, 0.65 and 0.63 (didn't check any farther back).
Can anyone explain why the aspect correction in DOSBox is using a 1.37:1 ratio instead of the 1.33:1 ratio that I was expecting?
Any game that uses a 320x200 resolution, 16 color or 256 color... and that's quite a few of them. 😉 Some of the games I tried allow you to chose between VGA and MCGA in their setup options, and that made no difference, either.
I thought you might ask for that eventually, so I was in the process of making one. Here is one from a fairly well-known game, including the window title and borders. It's using ddraw for the output method, normal2x scaler, aspect=true. As you will see, the contained client window area is 640x467.
Oh, as for the screenshot, I can post that if you really want it; but the captures seem to always be at the original res of the screen, with no stretching due to scaling or aspect correction.
I'm glad it's not just happening to me. FYI, the output method doesn't seem to matter. Surface and Overlay get the same result, but Surface leaves the pixels irregularly blocky rather than performing the more subtle blending that Overlay and DDraw use.
This has been like this since I can remember 😀
The Y scale factor comes from somewhere in the vga code, but I never managed to understand how dosbox calculates it or why it isn't 1.2 exactly...
I looked at render.cpp to see if I could find anything relevant; and as you've said, it's less than obvious what's being done, or why. I wasn't posting here to report what I felt was a bug, per se, as it's really a minor innacuracy... there is probably some rationale behind it, and I was just wondering what it might be.
By changing correct_ratio=(100.0/525.0) to correct_ratio=(100.0/539.0) in my test build it does make for a pixel aspect ratio of (almost) exactly 1.2 on 320x200 resolution modes. Not that this would be a general fix by any means, as it was apparently intended to provide correction for various VGA resolutions. Anyway, I'm not trying to get this thread moved to the development section, but it's fun to fiddle with it.
Well made a little patch that should hopefully make things a bit better.
This takes into account the different types of stretching a vga monitor does based on the polarity lines and just makes all resolution above 640x480 be screen filling.
The aspect correction changes in 0.72 are great, but I noticed those changes don't seem to be affecting VESA modes less than 640x480. You get the 1.169265 pixel aspect ratio as before instead of the 1.2 ratio that non-VESA modes now get.
These log entries are from Duke Nukem 3D; Shadow Warrior behaves the same.
VESA 2.0 320x400 (chosen from setup program):
1655745206: INT10:Set Video Mode 152 2655745206: VGA:Blinking 0 3655745206: MOUSE:Unhandled videomode BA on reset 4655896836: VGA:h total 100 end 80 blank (80/98) retrace (84/96) 5655896836: VGA:v total 449 end 400 blank (406/441) retrace (412/414) 6655896836: VGA:Width 320, Height 400, fps 69.755013 7655896836: VGA:double width, normal height aspect 1.169265 8655912288: VGAMISC:Parts left: 2
VESA 2.0 640x400 (manually entered this res in config file):
1503347280: INT10:Set Video Mode 100 2503347280: VGA:Blinking 0 3503347280: MOUSE:Unhandled videomode 68 on reset 4503495688: VGA:h total 100 end 80 blank (80/98) retrace (84/96) 5503495688: VGA:v total 449 end 400 blank (406/441) retrace (412/414) 6503495688: VGA:Width 640, Height 400, fps 69.755013 7503495688: VGA:normal width, normal height aspect 1.169265 8503509952: VGAMISC:Parts left: 1
I have seen some games that use a 320x400 mode without VESA, but I think in that case it's a double-height version of 320x200, and the 1.2 aspect ratio is being applied there.
Another thing I noticed is that VGA text mode, which is rendered at 640x400 pixels, has a 1.0 forced aspect ratio. This is probably done to keep text crisp, as aspect correction will somewhat blur it. In windowed mode the aspect-corrected text would be harder to read than when it's being blown up in fullscreen mode, where it's "squashedness" is more apparent. It would be nice to have the option to correct the aspect on text modes as well, but I guess it's a matter of personal preference.