VOGONS


First post, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Hi,

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?

Reply 2 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes, windowed mode.

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.

Reply 4 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Attachments

  • sample.png
    Filename
    sample.png
    File size
    83.92 KiB
    Views
    3538 views
    File license
    Fair use/fair dealing exception

Reply 5 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 7 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 8 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

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

http://www.si-gamer.net/gulikoza

Reply 9 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 11 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ah, that does seem to be more like it! 😀

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.

Reply 13 of 16, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

OT: Nice colourful avatar Ripsaw. Like it.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 14 of 16, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Attachments

  • Filename
    aspect.diff
    File size
    4.29 KiB
    Downloads
    283 downloads
    File comment
    vga.h and vga_draw.cpp changes
    File license
    Fair use/fair dealing exception

Reply 15 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

MiniMax, glad you like it... I even enhanced it a little more.

Harekiet, thank you for taking your time to look into it! Honestly, I'm very impressed with the response from the developers here.

Reply 16 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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

655745206: INT10:Set Video Mode 152
655745206: VGA:Blinking 0
655745206: MOUSE:Unhandled videomode BA on reset
655896836: VGA:h total 100 end 80 blank (80/98) retrace (84/96)
655896836: VGA:v total 449 end 400 blank (406/441) retrace (412/414)
655896836: VGA:Width 320, Height 400, fps 69.755013
655896836: VGA:double width, normal height aspect 1.169265
655912288: VGAMISC:Parts left: 2

VESA 2.0 640x400 (manually entered this res in config file):

503347280: INT10:Set Video Mode 100
503347280: VGA:Blinking 0
503347280: MOUSE:Unhandled videomode 68 on reset
503495688: VGA:h total 100 end 80 blank (80/98) retrace (84/96)
503495688: VGA:v total 449 end 400 blank (406/441) retrace (412/414)
503495688: VGA:Width 640, Height 400, fps 69.755013
503495688: VGA:normal width, normal height aspect 1.169265
503509952: 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.