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

Windows specific questions.
angros47
Posts: 1315
Joined: Jun 21, 2005 19:04

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

Postby angros47 » Dec 07, 2017 23:06

QBASIC is for Dos, not for Windows. Have you tried porting your program to FreeBasic, using the windows version?
CGAMan
Posts: 15
Joined: Nov 24, 2017 18:23

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

Postby CGAMan » Dec 07, 2017 23:13

angros47 wrote:QBASIC is for Dos, not for Windows. Have you tried porting your program to FreeBasic, using the windows version?


No it's not. QBASIC runs perfectly fine in Windows XP. It's as close to native DOS as you can get.
angros47
Posts: 1315
Joined: Jun 21, 2005 19:04

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

Postby angros47 » Dec 07, 2017 23:39

But it doesn't run in some more recent versions of Windows, while FreeBasic does. Anyway, unless you are going to use FreeBasic, you are in the wrong forum.
dodicat
Posts: 4475
Joined: Jan 10, 2006 20:30
Location: Scotland

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

Postby dodicat » Dec 08, 2017 0:26

I started my old XP machine,
QuickBASIC runs well.
The ide looks good full screen, the program output (screen 12, even screen 9) looks OK.
FreeBASIC dos, likewise, looks reasonable on XP.

With Win 10 64 bit OS of course, I can run neither.

You can use the #lang "qb" option with freebasic to run quickbasic code (Nearly) straight off if you are lucky.
You should try FreeBASIC dos and FreeBASIC windows.
CGAMan
Posts: 15
Joined: Nov 24, 2017 18:23

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

Postby CGAMan » Dec 08, 2017 3:04

Hey folks, I think there might be a solution to my woes... I shall try to stretch an image in C# using DirectX. It should produce a different effect than those interpolation algos, hopefully better effects...

All I want is NOT to have to depend on XP/BASIC to stretch a 640x480 bitmap to full screen with good results.
grindstone
Posts: 359
Joined: May 05, 2015 5:35
Location: Germany

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

Postby grindstone » Dec 08, 2017 11:42

I don't know exactly what you're intended to do, but maybe this link will help:
http://www.dosgamers.com/dos/dosbox-dos-emulator/screen-resolution

If you're interested I could offer you a snippet to do the keystrokes automatically (by freeBasic).

Alternatively, have a look at https://www.freebasic.net/forum/viewtopic.php?p=240658#p240658. Something based upon

Code: Select all

#Include Once "fbgfx.bi"
ScreenRes(640, 480, 32, , fb.gfx_fullScreen)
Print "Hello world"
Sleep

maybe will do the job.
CGAMan
Posts: 15
Joined: Nov 24, 2017 18:23

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

Postby CGAMan » Dec 08, 2017 21:23

grindstone wrote:I don't know exactly what you're intended to do, but maybe this link will help:
http://www.dosgamers.com/dos/dosbox-dos-emulator/screen-resolution

If you're interested I could offer you a snippet to do the keystrokes automatically (by freeBasic).

Alternatively, have a look at https://www.freebasic.net/forum/viewtopic.php?p=240658#p240658. Something based upon

Code: Select all

#Include Once "fbgfx.bi"
ScreenRes(640, 480, 32, , fb.gfx_fullScreen)
Print "Hello world"
Sleep

maybe will do the job.



will this work in legacy qb mode?
CGAMan
Posts: 15
Joined: Nov 24, 2017 18:23

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

Postby CGAMan » Dec 08, 2017 21:33

Folks, I've made a break through: How to upscale a sub 640x480 image to fullscreen on a 1280x800 display in Windows 10 without it looking like arse.

Why would anyone do this?

Well I hate hard looking square pixels. The old CRT monitors that ran DOS progs have much softer pixel edges.

Here are the secret ingredients to emulate the CRT displays of old on Windows 10:

1. Instead of drawing with (line) thickness of 1, I used 2.

2. Use Windows display scaling of 150% to blow up everything afterwards. The magic number is 150%, not 125%, certainly not 250%.

3. The old IBM 16-color CGA palette (where color 6 was dark brown instead of dark yellow) no longer works. Use the new Windows 16 colors palette (Wikipedia) instead!


In terms of image sharpness (not to be confused with nearest neighbor interpolation that produces very hard blown up pixels):

.Net framework interpolation (any algo) - 5/10

Method in this post - 8.5/10
counting_pine
Site Admin
Posts: 5815
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

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

Postby counting_pine » Dec 08, 2017 23:40

As best I recall, natural LCD scaling tends to look something like this:

Code: Select all

function avg(col1 as long, col2 as long, w1 as single, w2 as single) as long
    dim as ubyte r1 = col1 shr 16, r2 = col2 shr 16
    dim as ubyte g1 = col1 shr  8, g2 = col2 shr 8
    dim as ubyte b1 = col1       , b2 = col2

    var r = r1 + (r2 - r1) * w2 / (w1 + w2)
    var g = g1 + (g2 - g1) * w2 / (w1 + w2)
    var b = b1 + (b2 - b1) * w2 / (w1 + w2)

    return rgb(r, g, b)
end function

function spoint(x1 as single, y1 as single, x2 as single, y2 as single) as long
    dim as long col1, col2
    dim as single w1, w2
    if int(x1) = int(x2) then
        if int(y1) = int(y2) then
            return point(x1, y1)
        else
            col1 = point(x1, y1)
            col2 = point(x1, y1+1)
            w1 = int(y1 + 1) - y1
            w2 = y2 - int(y2)
            return avg(col1, col2, w1, w2)
        end if
    else
        col1 = spoint(x1, y1, x1, y2)
        col2 = spoint(x2, y1, x2, y2)
        w1 = int(x1 + 1) - x1
        w2 = x2 - int(x2)
        return avg(col1, col2, w1, w2)
    end if
end function

screenres 1024, 768, 24

dim as integer w = 320, h = 240
dim as single dx = 320 / 1024, dy = 240 / 768

circle (160, 120), 100, &h00ff00
paint (160, 120), &h0000ff, &h00ff00
line (140, 100)-(180,140), &hff0000, b
sleep

for y as integer = 768 to 0 step -1
    for x as integer = 1024 to 0 step -1
        pset (x, y), spoint(x * dx, y * dy, (x + 1) * dx, (y + 1) * dy)
    next x
next y
sleep
It preserves the basic "rectangular" nature of the pixels, like with nearest neighbour scaling, but with blurrier edges between the original pixels.
It can be nicer than nearest-neighbour, because it doesn't give the horrible "jagged" effect that happens when one pixel is enlarged to a pixel wider than its neighbour.

The way I picture it is like laying a set of smaller mosaic tiles (say 1 square cm) over a set of larger mosaic tiles (say 1 square inch).
If the smaller mosaic tile lands entirely within a larger tile, it gets the colour of that tile.
Otherwise, if it straddles two tiles (or four tiles), its colour is the average of the tiles it covers, weighted by how much of the smaller tile covers it.

I don't know what this method is called. But it's pretty much what you'd get if you converted some pixel art to an SVG and zoomed in
caseih
Posts: 1064
Joined: Feb 26, 2007 5:32

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

Postby caseih » Dec 09, 2017 3:33

CGAMan wrote:Exactly my point, to get a 640x480 full screen in Windows XP, the image has to be upscaled.

Not quite. In Windows XP, the upscaling was done by the LCD monitor, not by Windows.

Anyway, you've found a workable solution, so that's good.
grindstone
Posts: 359
Joined: May 05, 2015 5:35
Location: Germany

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

Postby grindstone » Dec 09, 2017 11:19

CGAMan wrote:will this work in legacy qb mode?
Alas, SCREENRES doesn't work in qb mode.
fxm
Posts: 7475
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

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

Postby fxm » Dec 09, 2017 12:24

Screenres is not available in the -lang qb dialect unless referenced with the alias __Screenres.
lizard
Posts: 93
Joined: Oct 17, 2017 11:35

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

Postby lizard » Dec 09, 2017 12:52

grindstone wrote:maybe will do the job.


Right, this seems to be the best solution. Although dos had 16 colors, that would be 4 bit:

Code: Select all

#Include Once "fbgfx.bi"

Dim as Integer  swidth, sheight

ScreenRes(640, 480, 4, , fb.gfx_fullScreen)
? "FB-Dos V 0.3 >"

for i as integer = 1 to 25
? i
next

SCREENCONTROL FB.GET_DESKTOP_SIZE, swidth, sheight
? swidth & " x " + sheight
Sleep


Only need to change font.
Last edited by lizard on Dec 09, 2017 15:10, edited 1 time in total.
paul doe
Posts: 177
Joined: Jul 25, 2017 17:22
Location: Argentina

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

Postby paul doe » Dec 09, 2017 14:36

lizard wrote:Only need to change font.


Can be done like this:

Code: Select all

#include once "fbgfx.bi"

dim as integer sWidth, sHeight

screenRes( 640, 480, 32, , fb.gfx_fullScreen )
screenInfo( sWidth, sHeight )

width sWidth / 8, sHeight / 16

? "FB-Dos V 0.3 >"

for i as integer = 1 to 25
   ? i
next

screenControl( fb.get_desktop_size, swidth, sheight )

? str( swidth ) & " x " & str( sheight )

sleep()

I can't run fullscreen 4-bit modes, so the palette functionality can be emulated, I guess.
lizard
Posts: 93
Joined: Oct 17, 2017 11:35

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

Postby lizard » Dec 09, 2017 15:20

Paul, your version works, but the whole screen should have 25 lines and 80 columns. The numbers 1 - 25 span only a part of the screen here.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests