DOSBox Scaling is Limited

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 06:36

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.
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 06:49

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.
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby squiggly » 2018-1-11 @ 07:00

And why scummVM does it so seamlessly...
squiggly
Member
 
Posts: 310
Joined: 2015-9-05 @ 00:46

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 07:03

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 ... box/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
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Re: DOSBox Scaling is Limited

Postby cyclone3d » 2018-1-11 @ 07:07

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.
User avatar
cyclone3d
l33t
 
Posts: 2058
Joined: 2015-4-08 @ 06:06
Location: Huntsville, AL USA

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 07:14

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

Looks like max resolution is hard coded anyhow
./include/render_scalers.h
Code: Select all
#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
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Re: DOSBox Scaling is Limited

Postby Falcosoft » 2018-1-11 @ 07:46

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:
viewtopic.php?f=41&t=49160
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-1-11 @ 08:07, edited 1 time in total.
User avatar
Falcosoft
Oldbie
 
Posts: 673
Joined: 2016-5-21 @ 13:46
Location: Pécs, Hungary

Re: DOSBox Scaling is Limited

Postby Yesterplay80 » 2018-1-11 @ 08:04

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 (without debugger) for Windows: Vanilla DOSBox and DOSBox ECE (Enhanced Community Edition)
User avatar
Yesterplay80
Member
 
Posts: 335
Joined: 2016-2-23 @ 11:02
Location: Germany

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 08:24

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. ;)
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 08:24

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? :lol:

I didn't know about these dosbox forks either. Thanks. I'll read through the threads too.
viewtopic.php?f=32&t=52414
viewtopic.php?f=41&t=49160
Last edited by Auzner on 2018-1-11 @ 08:29, edited 1 time in total.
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 08:28

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.
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 08:33

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? :lol:

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.
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Falcosoft » 2018-1-11 @ 08:41

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-Col ... hics_Array
http://www.vogons.org/viewtopic.php?t=17110
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.
User avatar
Falcosoft
Oldbie
 
Posts: 673
Joined: 2016-5-21 @ 13:46
Location: Pécs, Hungary

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 08:43

What? Alright good luck with your computers, Willy.
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 08:57

Falcosoft wrote:No, It's not... :) Have you read the linked DoomWiki article? Some more info:
https://en.wikipedia.org/wiki/Multi-Col ... hics_Array
viewtopic.php?t=17110
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. ;)
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 09:21

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/201 ... bm-pc.html
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Re: DOSBox Scaling is Limited

Postby James-F » 2018-1-11 @ 12:11

DOSBOX ECE.

output=opengl
aspect=true
scaler=normal5x forced

This gives the most 'accurate' scaling without much blur.
User avatar
James-F
Oldbie
 
Posts: 1428
Joined: 2015-11-30 @ 04:10

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 15:16

Auzner wrote:Looks like Elite Plus is actually one of those games:
http://nerdlypleasures.blogspot.com/201 ... bm-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. ;)

Image
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Chilly Willy » 2018-1-11 @ 15:16

James-F wrote:DOSBOX ECE.

output=opengl
aspect=true
scaler=normal5x forced

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

Thanks! Will try. ;)
User avatar
Chilly Willy
Newbie
 
Posts: 22
Joined: 2016-12-09 @ 02:31
Location: USA

Re: DOSBox Scaling is Limited

Postby Auzner » 2018-1-11 @ 18:33

Chilly Willy wrote:So is King's Quest V

Sierra games are easy to determine, since their start up logo is a circle
User avatar
Auzner
Member
 
Posts: 320
Joined: 2014-1-24 @ 11:28

Next

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 2 guests