schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
759 stars 62 forks source link

On-screen keyboard becomes distorted with non-standard resolutions #182

Closed PoloniumRain closed 7 months ago

PoloniumRain commented 3 years ago

When a game uses a non-standard resolution it will make the on-screen keyboard distorted. It will either become too tall or too wide. This seems to happen because the width and height of the keyboard seem to rely on the game having a standard 4:3 resolution, so visual distortion occurs whenever a game uses any resolution that isn't 4:3 aspect ratio.

One example is Quake - By selecting the unusual resolution of 320x480 you'll see a very squished looking on-screen keyboard.

The game 'Pinball Illusions' is an extreme example as it not only uses weird resolutions by default it also changes res constantly. So if you display the keyboard immediately after starting this game you can watch it constantly changing sizes and most of these sizes are distorted. Screenshots below.

I've found this page that shows several DOS games with non-standard resolutions (might come in handy for testing purposes).

distortion

schellingb commented 3 years ago

Though in Quake it matches how the graphics and text in the menu/console is squished :-)

Anyway, I changed it so it scales the keyboard to match the emulated aspect ratio so it should look mostly correct. The mouse cursor doesn't scale I hope you don't mind. Also the drawn keyboard graphic is 280 pixels wide, so on resolutions with a width smaller than that it will still be usable but the letters are barely readable..

And holy moly that start-up sequence in Pinball Illusions, it toggles rapidly through these funky resolutions.

The last mode seems wrong, it is supposed to use 800x600 but I guess SVGA is not working correctly? Wonder if it does in other DOSBox variants...

PoloniumRain commented 3 years ago

Nice, thanks again Bernhard! The mouse cursor shouldn't be a problem, it's far more important to clearly be able to read the keys.

The last mode seems wrong, it is supposed to use 800x600 but I guess SVGA is not working correctly? Wonder if it does in other DOSBox variants...

From what i can tell it's because DOSBox doesn't have overscan border support and the only variant that seems to have support is DOSBox SVN Daum. So that should display Pinball Illusions correctly, but i haven't tried it myself. According to the link in my first post It's also the same situation with the 304x224 resolution, because it's meant to be 320x240 (with a blue border around the outside) but most DOSBox variants only display 304x224 (cutting off the blue border).

But the biggest problem with Pinball Illusions is that the bottom of the screen looks like it's cut off when playing, because i can't see the pinball machine paddles but i can hear them moving. This is probably the border problem again. I don't know if you could implement the DOSBox SVN Daum support for overscan borders, but either way there's few games that will benefit from this and i'd much rather see something like 3dfx Voodoo support to be honest... ;)