VOGONS


DOSBox Scaling is Limited

Topic actions

First post, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie

I noticed something about the way DOSBox scales windows and why people have issues getting their games to look good. DOSBox only scales by 2. For example. If your game is 320x200, then you only have two options to scale the window on a 1080p monitor. At least if you want "pixel perfect" scaling. That would be 640x400 and 1280x800. You can not go higher than that, or else the next "pixel perfect" scaling would be 2560x1600. Anything in between would create blurry edge pixels.

Now why DOSBox can not scale by integer values other than 2, or continuously doubling by 2 each time, is beyond me. One should be able to make a 320x200 game look good at 960x600, 1600x1000, etc., scaling by integer 3 and 5. Anything beyond the last figure would require a screen/display higher than 1080p. As 1600x1000 would render a window size of 1606x1023. At least in classic mode on Windows XP.

As for fullscreen scaling, that's another issue too. And I'm not saying this out of experience. I'm a long time programmer myself and have done this before. The math is really quite easy.

Anyways, that's my DOSBox rant and hopefully it may help someone on understanding and scaling their games in DOSBox. Plus, I hope it gets fixed/added in a future release. It may save some headache just to add a feature that states to scale by 2,3,4,5,etc. Instead of writing in window dimensions because anything else is going to be blurry and/or distorted.

Reply 1 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie

As for fullscreen. Here's an example. If you have a 1080p monitor, then the 320x200 game automatically gets scaled to 1600x1000 in a resolution of 1920x1080, with a right and left pad of 160 and a top and bottom pad of 40. No it doesn't fill the screen but you can not fill a screen with a 320x200 game cleanly. It will need padding. Well, not unless you have a 1280x800 monitor.

Reply 3 of 25, by Auzner

User metadata
Rank Member
Rank
Member

I agree it's tricky to setup and is never straightforward. Ideally the output could be native to the monitor's resolution with scaling set afterwards. Not all monitors like taking weird resolutions, or won't stretch them full screen, or have issues stretching them fullscreen.

The source code is on sourceforge:
https://sourceforge.net/p/dosbox/code-0/HEAD/ … e/dosbox/trunk/

2560x1440: 320x200 --> 6x: 1920x1200 --> 4:3 correction = 1920x1440
1920x1200: 320x200 --> 5x: 1600x1000 --> 4:3 correction = 1600x1200
1920x1080: 320x200 --> 4x: 1280x800 --> 4:3 correction = 1280x960
3x = 960x640
2x = 640x480

Reply 4 of 25, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++

But what is the point of scaling to full screen when it is going to be stretched?

Just let it have black bars so it is the correct aspect ratio, is not stretched all funny, and is scaled properly.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 5 of 25, by Auzner

User metadata
Rank Member
Rank
Member
cyclone3d wrote:

Just let it have black bars so it is the correct aspect ratio, is not stretched all funny, and is scaled properly.

Chilly Willy wrote:

As for fullscreen. Here's an example. If you have a 1080p monitor, then the 320x200 game automatically gets scaled to 1600x1000 in a resolution of 1920x1080, with a right and left pad of 160 and a top and bottom pad of 40. No it doesn't fill the screen but you can not fill a screen with a 320x200 game cleanly. It will need padding. Well, not unless you have a 1280x800 monitor.

Ooooh...
That's your monitor's fault. Most modern LCDs don't like "non-standard" stuff outside of the WUXGA types. Their scalers ignore full sizing those (more DSP work) and just give you centered native. I think it might be possible with some GPU drivers to fake a native output and have the GPU scale the 2D to it. But maybe Dosbox cannot call that feature? I don't know about graphics programming.

Here's the render.cpp file where I imagine things would get going:
https://sourceforge.net/p/dosbox/code-0/HEAD/ … /gui/render.cpp

Looks like max resolution is hard coded anyhow
./include/render_scalers.h

#if RENDER_USE_ADVANCED_SCALERS>0
#define SCALER_MAXWIDTH 1280
#define SCALER_MAXHEIGHT 1024
#else
// reduced to save some memory
#define SCALER_MAXWIDTH 800
#define SCALER_MAXHEIGHT 600
#endif

#if RENDER_USE_ADVANCED_SCALERS>1
#define SCALER_COMPLEXWIDTH 800
#define SCALER_COMPLEXHEIGHT 600
#endif

#define SCALER_BLOCKSIZE 16

Reply 6 of 25, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
Chilly Willy wrote:

I noticed something about the way DOSBox scales windows and why people have issues getting their games to look good. DOSBox only scales by 2. ... Now why DOSBox can not scale by integer values other than 2, or continuously doubling by 2 each time, is beyond me.

This is simply not true even in vanilla DosBox 0.74. In your dosbox.conf file you can set scaler=normal3x or scaler=hq3x etc.
The 3x scaling is working as expected although it requires an output that supports scaling, so the default output=surface is not the optimal one.
Anyway there are already DosBox patches/forks that achieve pixel perfect scaling:
VIDEO Patch for pixel-perfect scaling (SDL1)
Also DosBox ECE includes the above patch.

PS:
You also mentioned distortion. To be clear: if you apply pixel perfect scaling to games that use 320x200/Mode 13h video mode you always get distortion since 320x200 is NOT a square-pixel mode. The 320x200 resolution was intended to be aspect ratio corrected to 4/3 (like 320x240 or 640x480) since its pixel aspect ratio is 1:1.2 not 1:1.
http://doom.wikia.com/wiki/Aspect_ratio
So it is not possible to get both pixel perfect and non-distorted image at the same time with 320x200 video mode on modern LCD displays...
If you set aspect=true in dosbox.conf you can get a proper aspect ratio, or with DosBox ECE a pixel perfect scaling.

Last edited by Falcosoft on 2018-01-11, 08:07. Edited 1 time in total.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 7 of 25, by Yesterplay80

User metadata
Rank Oldbie
Rank
Oldbie
Chilly Willy wrote:

Anyways, that's my DOSBox rant and hopefully it may help someone on understanding and scaling their games in DOSBox. Plus, I hope it gets fixed/added in a future release. It may save some headache just to add a feature that states to scale by 2,3,4,5,etc. Instead of writing in window dimensions because anything else is going to be blurry and/or distorted.

Why not give DOSBox ECE a try? It scales windowed mode up to 6x. And it has some other neat features you might like.

My full-featured DOSBox SVN builds for Windows & Linux: Vanilla DOSBox and DOSBox ECE (Google Drive Mirror)

Reply 8 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote:

PS:
You also mentioned distortion. To be clear: if you apply pixel perfect scaling to games that use 320x200/Mode 13h video mode you always get distortion since 320x200 is NOT a square-pixel mode. The 320x200 resolution was intended to be aspect ratio corrected to 4/3 (like 320x240 or 640x480) since its pixel aspect ratio is 1:1.2 not 1:1.

320x200 is square pixel. At least it is on my Tandy CM-11 monitor. When I play games on my Tandy 1000 HX, there are black bars on the top and bottom. The screen looks nice, clean, and not distorted. At 320x200, that's how the games were made. Even 160x200 stretches out to 320x200 but still looks clean and pixel perfect on my CM-11 monitor. I've never seen a 320x200 game stretched to 4:3 on a CGA monitor. There are always black bars on the top and bottom. Yes, you can adjust a dial to stretch the monitor image but that just makes the game image look funny to me. Plus, I don't even think it stretches all the way to fill the 4:3 screen. Even at max, there's black bars at the top and bottom.

Also, some people like adding a slight blur to the game image thinking it makes it look retro or something. Like I said above. My CM-11 looks pixel perfect. At least really close to a nice LED monitor. I'm not sure if you have a CGA monitor but I could take screen shots to show, games are not 4:3 on it.

I'm just saying, DOSBox doesn't need all these filters to try and correct the game image. Some basic math should cover all that. I've done it. Just check the monitors native resolution and calculate the math to make it scale properly, whether in window or fullscreen. Then the only filters DOSBox needs is those "make it look like a TV". If you're into that kind of thing.

Anyways, nice to see the feedback. I just think DOSBox could look better and done easily. 😉

Reply 9 of 25, by Auzner

User metadata
Rank Member
Rank
Member
Chilly Willy wrote:

I've never seen a 320x200 game stretched to 4:3 on a CGA monitor. There are always black bars on the top and bottom. Yes, you can adjust a dial to stretch the monitor image but that just makes the game image look funny to me. Plus, I don't even think it stretches all the way to fill the 4:3 screen. Even at max, there's black bars at the top and bottom.

Most game's artists designed the graphics intending for that to happen. Non-square pixels. The Doom wiki explains it well. You have stumpy wide-stretched nostalgia? 🤣

I didn't know about these dosbox forks either. Thanks. I'll read through the threads too.
DOSBox ECE (for Windows & Linux)
VIDEO Patch for pixel-perfect scaling (SDL1)

Last edited by Auzner on 2018-01-11, 08:29. Edited 1 time in total.

Reply 10 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
cyclone3d wrote:

But what is the point of scaling to full screen when it is going to be stretched?

Just let it have black bars so it is the correct aspect ratio, is not stretched all funny, and is scaled properly.

My thoughts exactly. CGA monitors that I own and have used always had black bars on the top and bottom of a 4:3 screen. Yes, some have dials to stretch the screen but that always looked improper. Even back in the 80's.

Reply 11 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
Auzner wrote:

Most game's artists designed the graphics intending for that to happen. Non-square pixels. The Doom wiki explains it well. You have stretched nostalgia? 🤣

I won't disagree that some developers may have done that. Why, I have no idea other than they thought their game needed to fill the screen. Seems silly to me. It's like watching a widescreen movie on a widescreen tv but there are still black bars on the top and bottom. It's just a wider movie. You don't zoom in and cut off the edges of the movie or make it scale vertically to make the actors and everything on the screen look taller.

Reply 12 of 25, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

320x200 is square pixel. At least it is on my Tandy CM-11 monitor. When I play games on my Tandy 1000 HX, there are black bars on the top and bottom. The screen looks nice, clean, and not distorted. At 320x200, that's how the games were made.

No, It's not... 😀 Have you read the linked DoomWiki article? Some more info:
https://en.wikipedia.org/wiki/Multi-Color_Graphics_Array
True aspect ratio of VGA mode 13h (320x200)?
Your mentioned 320x200 CGA mode's pixel aspect ratio is also 1:1.2 not 1:1. It's analogous to CGA mode 640×200 that had a pixel aspect ratio 1:2.4 and also was meant to be displayed as a 4/3 resolution and not as a 16/5 one.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 14 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
Falcosoft wrote:
No, It's not... :) Have you read the linked DoomWiki article? Some more info: https://en.wikipedia.org/wiki/Multi-Color_Graphi […]
Show full quote

No, It's not... 😀 Have you read the linked DoomWiki article? Some more info:
https://en.wikipedia.org/wiki/Multi-Color_Graphics_Array
True aspect ratio of VGA mode 13h (320x200)?
Your mentioned 320x200 CGA mode's pixel aspect ratio is also 1:1.2 not 1:1. It's analogous to CGA mode 640×200 that had a pixel aspect ratio 1:2.4 and also was meant to be displayed as a 4/3 resolution and not as a 16/5 one.

Yes, I understand that and yes some games were made in various ways for various reasons. Just like 160x200 games that were stretched to 320x200 in order to run on limited hardware but that does not mean every developer intended their 320x200 game to be stretched out to 4:3. Nor did they create the graphics in a squished fashion so they looked good in 4:3. Many games look good and played just fine at native res without stretching them.

Again, it like watching a widescreen movie on a 4:3 tv. You didn't scale it vertically (only) to fill the screen and make everything look tall. Now some developers may have design things in a certain way for their game, kind of like pan and scan on dvd's back in the day but not everyone.

I guess we will have to agree to disagree. 😉

Reply 15 of 25, by Auzner

User metadata
Rank Member
Rank
Member

Which games are you talking about? Everyone in the world used a 4:3 CRT on their home PC. That's why graphics needed to fill the screen.
"This game will not use fullscreen, because it's a widescreen game" is an anachronistic idea when talking 80s and 90s. "Home Video" was a different thing back then compared to today.

Looks like Elite Plus is actually one of those games:
http://nerdlypleasures.blogspot.com/2013/10/3 … for-ibm-pc.html

Reply 17 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
Auzner wrote:

Looks like Elite Plus is actually one of those games:
http://nerdlypleasures.blogspot.com/2013/10/3 … for-ibm-pc.html

So is King's Quest V and among other games. Look at the wagon wheels, water wheel, and the font. All stretch at 4:3. It looks better at 320x200 than 320x240, to me at least. 😉

KQV.jpg

Reply 18 of 25, by Chilly Willy

User metadata
Rank Newbie
Rank
Newbie
James-F wrote:
DOSBOX ECE. […]
Show full quote

DOSBOX ECE.

output=opengl
aspect=true
scaler=normal5x forced

This gives the most 'accurate' scaling without much blur.

Thanks! Will try. 😉