Does anyone know what algo XP -> full screen DOS?

Windows specific questions.
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 06, 2017 20:47

Does anyone know what algo WinXP and below used to make a DOS program go full screen?

I used C# to emulate this in Win 7/8.1/10 by drawing a 640x480 bitmap, then upscaling to fit entire screen using bilinear, bicubic, various other custom interpolation algos. The results were very blurry, can't compare to how XP and below does it natively to DOS programs...
MrSwiss
Posts: 2097
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Does anyone know what algo XP -> full screen DOS?

Postby MrSwiss » Dec 06, 2017 22:02

Does this question relate (in any way), to FreeBASIC?

If yes: which OS-version of FBC are you using and, except DOS, the bitness (32/64-bit).
If no: wrong place, for such question ... (ask: Micosoft).
lizard
Posts: 83
Joined: Oct 17, 2017 11:35

Re: Does anyone know what algo XP -> full screen DOS?

Postby lizard » Dec 06, 2017 22:48

CGAMan wrote:Does anyone know what algo WinXP and below used to make a DOS program go full screen?


Not sure what you mean exactly. Maybe this helps:

Code: Select all

' DosScreen.bas

#Include "fbgfx.bi"

Dim as Integer  swidth, sheight

SCREENCONTROL FB.GET_DESKTOP_SIZE, swidth, sheight

IF SCREENRES(swidth, sheight,8,,FB.GFX_NO_FRAME or FB.GFX_ALWAYS_ON_TOP) THEN
  PRINT "Fehler: Grafikfenster konnte nicht initialisiert werden!"
  SLEEP
  END
END If

? "FB-Dos V 0.1 >"

Sleep




Based on this code you have endless possibilities to display in every resolution whatever you want.
jj2007
Posts: 180
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Does anyone know what algo XP -> full screen DOS?

Postby jj2007 » Dec 07, 2017 0:57

Hi lizard,
That works fine on Win7-64, but I am not sure if this is DOS fullscreen mode. If, for example, you use...
IF SCREENRES(swidth/2, sheight/2,8,
...then you get some kind of DOS-looking small window, plus a windowed DOS prompt. Not exactly "full". It seems more like FB trying to emulate a DOS window...
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Re: Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 07, 2017 2:17

Clarification:

Windows XP: 640x480 DOS output -> full screen (very excellent/elegant upscaling/image stretching to fit display)

Windows 7 and above; 640x480 DOS output -> use some sort of upscaling algo (bilinear, bicubic, others) to go fullscreen -> ew, blurry output!!

So, anybody really knows why XP does a DOS output full screen so elegantly?

(I'm only asking this coz if I can emulate a full screen DOS using C# exactly the way XP does it, I won't need to use QBASIC anymore...)
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Re: Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 07, 2017 2:59

A little OT, but I just thought of another thing... Windows Picture Viewer. It's the only software by Microsoft that actually yields good results when you blow up an image. Does anyone know what interpolation algo Windows Picture Viewer uses to change the size of an image?
lizard
Posts: 83
Joined: Oct 17, 2017 11:35

Re: Does anyone know what algo XP -> full screen DOS?

Postby lizard » Dec 07, 2017 3:58

I just rembered, Kubuntu worked in 640 x 480 when no graphics card was plugged in, only onboard graphics. So it seems it works somehow.
caseih
Posts: 1063
Joined: Feb 26, 2007 5:32

Re: Does anyone know what algo XP -> full screen DOS?

Postby caseih » Dec 07, 2017 4:14

Windows XP doesn't use any algorithm if I remember correctly. When viewing a full-screen DOS window, it actually uses the VGA's actual mode. Which, by the way looks awfully blurry on my LCD monitor because the monitor itself will do the upscaling. It is possible to ask Windows to change the resolution for a program; many games do this for their "full screen" mode.

If you want a sharp (jagged) representation of what the old DOS modes were, you'll need to choose the nearest integer scaling factor that gives you that resolution, and just deal with letterbox black areas (or black areas on the left and right). For example, my monitor runs at 1920x1200. So using a scaling factor of two is a perfect resolution of 960x600. A factor of 4 would give 480x300, probably suitable for emulating 320x200. Or doing a 4x6 pixel would give 480x200.

Unlike analog days, LCD monitors have a fixed resolution. There's no way to get lower resolutions without scaling of some kind, integer or floating point.

There are scaling algorithms that try to bring out detail and look sharp on high resolution screens, although the graphics may not look quite as they did. For examples, see https://en.wikipedia.org/wiki/Hqx

For upscaling algorithms in general, see https://en.wikipedia.org/wiki/Image_scaling
DamageX
Posts: 106
Joined: Nov 21, 2009 8:42

Re: Does anyone know what algo XP -> full screen DOS?

Postby DamageX » Dec 07, 2017 8:21

Windows XP doesn't use any algorithm if I remember correctly. When viewing a full-screen DOS window, it actually uses the VGA's actual mode.

Yes, exactly. Running a DOS program full-screen under Windows gets you the same thing as running it in DOS.

However there is another important thing to note. Newer video cards do not actually output VGA scanrates. Even though they have backwards compatibility for VGA modes (ie. you can still boot DOS and it shows up on the screen), the signal coming out of the card is not the same because the picture is upscaled by the card itself. My GeForce 7600GT still output a 31KHz signal when using full-screen 80x25 text mode, but when I replaced it with a GT240 the text mode would be upscaled to 1280x1024 (according to what the monitor reported).
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Re: Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 07, 2017 16:21

caseih wrote:Windows XP doesn't use any algorithm if I remember correctly. When viewing a full-screen DOS window, it actually uses the VGA's actual mode. Which, by the way looks awfully blurry on my LCD monitor because the monitor itself will do the upscaling. It is possible to ask Windows to change the resolution for a program; many games do this for their "full screen" mode.

If you want a sharp (jagged) representation of what the old DOS modes were, you'll need to choose the nearest integer scaling factor that gives you that resolution, and just deal with letterbox black areas (or black areas on the left and right). For example, my monitor runs at 1920x1200. So using a scaling factor of two is a perfect resolution of 960x600. A factor of 4 would give 480x300, probably suitable for emulating 320x200. Or doing a 4x6 pixel would give 480x200.

Unlike analog days, LCD monitors have a fixed resolution. There's no way to get lower resolutions without scaling of some kind, integer or floating point.

There are scaling algorithms that try to bring out detail and look sharp on high resolution screens, although the graphics may not look quite as they did. For examples, see https://en.wikipedia.org/wiki/Hqx

For upscaling algorithms in general, see https://en.wikipedia.org/wiki/Image_scaling


Exactly my point, to get a 640x480 full screen in Windows XP, the image has to be upscaled. Which is what this thread is about. Which upscale algo does XP use to achieve this? Currently can't seem to replicate this with C#. I have tried all those built ([highquality-]bilinear/[highquality-]bicubic/nearest neighbor) into the .NET framework = they all suck (produce blurry images). I have even tried those posted by others (copied their code from the web into my C# prog) = same sucky results. Why does only XP do this so good? What is the secret ingredient?

I guess the analogy is, all those old blocky Nintendo games look like arse on modern LCD TV's. Only a few handful modern emulators have gotten this right (Windows XP). How did they get it right?
angros47
Posts: 1315
Joined: Jun 21, 2005 19:04

Re: Does anyone know what algo XP -> full screen DOS?

Postby angros47 » Dec 07, 2017 18:39

CGAMan wrote:I guess the analogy is, all those old blocky Nintendo games look like arse on modern LCD TV's. Only a few handful modern emulators have gotten this right (Windows XP). How did they get it right?


Often by using shaders. Can you show us the piece of code you are using, to set the graphic mode?
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Re: Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 07, 2017 20:09

angros47 wrote:
CGAMan wrote:I guess the analogy is, all those old blocky Nintendo games look like arse on modern LCD TV's. Only a few handful modern emulators have gotten this right (Windows XP). How did they get it right?


Often by using shaders. Can you show us the piece of code you are using, to set the graphic mode?


I used the code from this page:

https://codereview.stackexchange.com/questions/139920/fast-bicubic-upscaling-in-c-for-image-scaling

It produces far better results than the ones built into .NET Framework (shame on you Microsoft). But no where as good as how WinXP blows up a 640x480 image to fit the screen. XP is simply the best at doing this! I wanna know how XP does it...


P.S: If you meant the QBASIC code. It's simply SCREEN 12, let Windows XP take care of upscaling it to full screen.
dodicat
Posts: 4471
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Does anyone know what algo XP -> full screen DOS?

Postby dodicat » Dec 07, 2017 20:53

You could use this (only 32 bit on win 10)

Code: Select all

#include "fbgfx.bi"
Declare Function MoveWindow Alias "MoveWindow"(As Any Ptr,As Integer,As Integer,As Integer,As Integer,As Integer) As Integer

dim as integer w,h

screencontrol(FB.GET_DESKTOP_SIZE ,w,h)

screenres 200,200,32,,FB.GFX_NO_FRAME or FB.GFX_ALWAYS_ON_TOP
Dim As Integer I
Screencontrol(FB.GET_WINDOW_HANDLE ,I)
Dim As Any Ptr Win = Cast(Any Ptr,I)
movewindow(win,0,0,w,h,1)
'movewindow (window handle, upper left corner X,upper left corner Y,new width,new height,1)

dim as integer mx,my
do
    getmouse mx,my
    screenlock
    cls
    locate 5,5
    color rgb(200,100,0)
    print time
    locate 10,5
    color rgb(0,100,0)
    print "Press a key to end"
    locate 15,5
     color rgb(0,100,200)
     print "mouse position"
     locate 20,5
     color rgb(100,100,200)
     print mx;",";my
    screenunlock
    sleep 5
    loop until len(inkey)
   

 
angros47
Posts: 1315
Joined: Jun 21, 2005 19:04

Re: Does anyone know what algo XP -> full screen DOS?

Postby angros47 » Dec 07, 2017 22:50



That code is not FreeBasic, so this is not the right place to ask about it. Please, move your question to a more suitable forum


P.S: If you meant the QBASIC code. It's simply SCREEN 12, let Windows XP take care of upscaling it to full screen.


This forum is not about QBASIC, it is about FreeBasic. FreeBasic has a compatible mode, but is not QBASIC. Graphics are managed in different ways.
Please, don't ask here questions that are about other languages.
CGAMan
Posts: 14
Joined: Nov 24, 2017 18:23

Re: Does anyone know what algo XP -> full screen DOS?

Postby CGAMan » Dec 07, 2017 22:56

Poor me... I'm stuck with an ancient OS (WinXP) and even more ancient language (BASIC) coz I want a full screen 640x480 and the ones starting from Vista can't produce the same good effects as XP.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests