Beginner help for DOS version

DOS specific questions.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Beginner help for DOS version

Post by Richard_ »

Hello - new to DOS version (have a little experience with WINDOWS version) - previously used MS PDS 7.1 (upgrade to MS QB4.5 and which was discontinued 30 years ago). Currently use MS PDS 7.1 with DosBox on Windows 10x64.

Installed latest version FreeBASIC-1.07.1-dos.zip, manually installed CWSDPMI.exe on Rufus Formatted USB stick with FreeDOS FD13-FullUSB.zip (rc3).

Trying to in DOS version do the following WINDOWS version program fragment:-

#include once "fbgfx.bi"
ScreenRes 3200,1800,32
Line (0,0)-(3196,1748), rgb(255,255,255), B ' white box


above code does not work in DOS version, best I can do is

ScreenRes 3200,1800,8
Line (0,0)-(3199,1799), 15, B ' white box


which has a very limited color range.


Hopefully it is something I am missing.

Thanks in advance
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

The best I can get in DOSBox is 1280x1024 in 8-bit graphics mode and 848x480 in 32-bit graphics mode. What version of DOSBox are you using?
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: Beginner help for DOS version

Post by Richard_ »

I cannot get the resolution mentioned in DosBox (a year or two old) for MS PDS 7.1. (I have not tried FreeBASIC DOS version in DosBox).

The 3200x1800 resolution was obtained using both DOS and WINDOWS version of FreeBASIC (latest versions) - DOS version on a Rufus formated USB stick.

The windows version, as per written above, allows me 32bit color - at present I only can get 8 bit color with DOS version.

My HP laptop display has a native resolution of 3200x1800 (something like a Q3 display).

There is a slight resolution difference between the DOS version (can get 3200x1800 BUT only 8 bits color as per written code) and WINDOWS - with the Windows version some display "real estate" is lost because of the Title Bar and the thin blue screen border.

The Windows version required the #include... as written above to allow me the high resolution and 32 bit mode - I am wondering if/what I have to include in the DOS version to alow 32 bit color.
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

It is a limitation of the standard version of DOSBox, not FreeBASIC itself.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: Beginner help for DOS version

Post by Richard_ »

@fatman2021 - thanks for reply BUT we are not "on the same frequency".

For the purpose of my request for help please do not refer to DosBox (and such)


My configuration for using FreeBASIC DOS version is:-

FreeBASIC-1.07.1-dos.zip installed on a 16GByte USB stick which was formatted using "Rufus"

The laptop computer (HP with 3200x1800 native display, Core i7 processor, 32 GB ram, 256 B SSD, Windows 10 x64) from a "cold start" is BOOTED from the USB stick (I used a USB stick because of more memory than my USB 3.5 inch floppy drive). On the boot-up, I get the classic look and feel of what I would have seen say 30 years ago on an IBM PC compatible computer - i.e. very large text (say 25 rows by 80 columns text) - filling up the entire display (ie 3200 x 1800 pixels).

This USB stick has CWSDPMI.exe on the root directory (I needed this "extra file" to make FreeBASIC DOS begin to work for me - this file was not present with FreeBASIC-1.07-1-dos.zip and I obtained it by a Google Search).

Also I installed FreeDOS FD13-FullUSB.zip (rc3). This release candidate 3 (rc3) I think is supposed to be a 32 bit DOS version of FreeDOS (still in its early days) - at present apparently there is NO 64 bit equivalent.

To be able to use FreeBASIC DOS, (and remembering the 8.3 filename requirements) I have fbc.exe, CWSDPMI.exe, and the inc, bin, doc, lib folders (from FreeBASIC DOS unzipped) in the root directory of the USB stick. My programs are also in the same root directory as where also the generated .exe files end up (after compilation).

I have a simple text editor to write my programs also installed in the root directory ( I ended up using QBX.exe (which is part of MS PDS 7.1) saving files as "document" rather than ".bas" because I was not successful in getting any DOS text editor (half a dozen tried from Google searches) to actually work on my USB stick). I am trying to get away from MS PDS 7.1 (as a programming language) because it is very limited - it was discontinued by MS 30 years ago. I like to use FreeBASIC (in DOS) as it looks "promising" (compared to MS PDS 7.1) - for example 3200x1800 graphics. I am trying out NON-WINDOWS environment because of all sorts of issues with WINDOWS (e.g. high resolution timing problems, very large files not copied (only zero-length files created) on occasions. From the old "DOS days" I never recall having the strange windows behavior (despite numerous Windows 10 upgrades/updates).

On boot-up, from a cold start, I have C:\> prompt and this C: drive is now the USB stick (now understandably no knowledge of the SSD C: drive with windows on it).

I compile programs simply by saying (on the usb c: drive)

fbc x.bas (enter)

where x.bas is my program.

I similarly say x.exe to run the program (DosBox does not exist on my usb stick and do not use it at any stage with FreeBASIC DOS version).

At present, from the USB boot-up, I only have access to c: drive (the usb stick itself) - eventually I hope to expand on this (as well as memory management etc) - however I am doing one step at a time (I have forgotten about autoexec.bat and config.sys etc - its been 30 years since I customed these for my requirements). My focus at present is to try to sort out the 32 bit color mode with 3200x1800 graphics - at present, from my testing, I only get the 16 colors (as per plain screen 0 text screen), with ScreenRes 3200,1800,8 - I would like many more colors (32 bit would be nice).

If anyone can share a simple program (for the DOS version of FreeBASIC to simply draw the biggest (or close enough to it) white box on the highest (or best available/preferred) resolution that I can try on my setup - would be greatly appreciated

I am hoping that there might be something like an include file that I need to use to get 32 bit graphics.

In my tests so far, any of mention of say ScreenRes 3200, 1800, 32 (or 16) results in a blank screen (but I still can press any key to exit program and return to c:\> prompt).

PS you can still mention DosBox ( it is just that I do not want to use it with FreeBASIC (DOS) - I prefer to have the old fashioned DOS method (boot from floppy).
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

Code: Select all

#include once "fbgfx.bi"

using FB

Dim As uInteger x, y
Dim As uByte r, g, b, a
ScreenRes 3200,1800, 32, , GFX_ALPHA_PRIMITIVES: Cls
Bload "3200X1800IMG.BMP",0
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

Code: Select all

#include once "fbgfx.bi"

using FB

Dim As uInteger x, y
Dim As uByte r, g, b, a
ScreenRes 3200,1800, 32, , GFX_ALPHA_PRIMITIVES: Cls
Do Until x = 3199 and Y = 1799
r=r+1
if r>255 then r=r-1:g=g+1
if g>255 then g=g-1:b=b+1
if b>255 then b=b-1

pset(x,y),255 shl 24 + r shl 16 + g shl 8 + b
x=x+1: if x > 3199 then x = 0: y = y + 1
Loop
sleep
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Beginner help for DOS version

Post by paul doe »

@Richard_: Why don't you try loading a driver like UniVBE?
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

Re: Beginner help for DOS version

Post by DamageX »

I never would have expected a 3200x1800 screen mode to be available under DOS at all. And certainly not with UniVBE which hasn't been updated since 2002.
at present, from my testing, I only get the 16 colors (as per plain screen 0 text screen), with ScreenRes 3200,1800,8 - I would like many more colors (32 bit would be nice).
Are you sure it's only 16 colors? That command should give you 256 colors. What if you try to use the PALETTE command to configure the other colors in the 16-255 range?
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: Beginner help for DOS version

Post by Richard_ »

I estimate say about one week until I can give a detailed reply (on problems) I am experiencing with all of above - for me there are numerous things to sort out first (resulting from my lack of understanding/experience with FreeBASIC DOS and FreeBASIC Windows in general.

Many things I took for granted in Windows (eg ScreenShot, mouse/touchpad drivers, range of usb drives, etc) do not exist (yet) for me in the DOS version (soon I will hope to configure the AUTOEXEC.bat and CONFIG.SYS files etc for various features - generally speaking when I do Google searches more often than not - Google searches result in NON-working (for me) solutions).

Just a very quick follow up - I tried the second program example from fatman2021 using FreeBASIC (Windows version) as below:-

Program called fat2.bas

Code: Select all

#include once "fbgfx.bi"

using FB

Dim As uInteger x, y
Dim As uByte r, g, b, a
ScreenRes 3200,1800, 32, , GFX_ALPHA_PRIMITIVES: Cls
Do Until x = 3199 and Y = 1799
r=r+1
if r>255 then r=r-1:g=g+1
if g>255 then g=g-1:b=b+1
if b>255 then b=b-1

pset(x,y),255 shl 24 + r shl 16 + g shl 8 + b
x=x+1: if x > 3199 then x = 0: y = y + 1
Loop
sleep



Attached is a windows 10 screenshot of the output of fat2.bas.


The program result is not correct (I think) - NOTE program run in Windows using FreeBASIC windows version - (have not yet tried program in DOS version)


[img]

file:///C:/Users/HP%20Zbook/Downloads/FAT2.png

[/img]

[img]http:///C:/Users/HP%20Zbook/Downloads/FAT2.png[/img]





Image

EDIT:- How do I insert an image (screenshot)? I see {img} and {/img} in the edit window but nothing seems to happen when I drag my screenshot within this {img} {/image} sub-field.

EDIT EDIT Thanks (immediate next reply) - (now obsolete) trying out your suggestion for using imgbox.
Last edited by Richard_ on Nov 03, 2020 3:28, edited 3 times in total.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Beginner help for DOS version

Post by paul doe »

Richard_ wrote:...
The program result is not correct (I think) - NOTE program run in Windows using FreeBASIC windows version - (have not yet tried program in DOS version)
No, the snippet is just wrong. Try this one:

Code: Select all

sub paintScreen( byval w as integer, byval h as integer, byval g as integer )
  screenLock()
  
  for y as integer = 0 to h - 1
    for x as integer = 0 to w - 1
      pset( x, y ), rgb( 255 * ( x / w ), g, 255 * ( y / h ) )
    next
  next
  
  screenUnlock()
end sub

dim as integer _
  scrW = 800, scrH = 600, _
  green = 128

screenRes( scrW, scrH, 32 )

? "Press any key..."

sleep()

for g as integer = 0 to 255
  paintScreen( scrW, scrH, g )
  sleep( 1, 1 )
next

? "Done."

sleep()
It should show all the spectrum.
EDIT:- How do I insert an image (screenshot)? I see {img} and {/img} in the edit window but nothing seems to happen when I drag my screenshot within this {img} {/image} sub-field.
You can't. You need to use an external host for images, and use the link they provide you (I use ImgBox).
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

#include once "fbgfx.bi"

using FB

Dim As uInteger x, y, f0, f1, f2
Dim As uByte r, g, b, a
ScreenRes 3200,1800, 32, , GFX_ALPHA_PRIMITIVES: Cls
Do Until x = 1919 and Y = 1019

select case x mod 255
case &B000000 to &B001111: r = x mod 255
case &B010000 to &B011111: r = x - &B010000 mod 255 * 17 mod 255
case &B100000 to &B101111: r = x - &B100000 mod 255 * 17 mod 255
case &B110000 to &B111111: r = x - &B110000 mod 255 * 17 mod 255
end select

select case y mod 255
case &B000000 to &B001111: b = y mod 255
case &B010000 to &B011111: b = y - &B010000 mod 255 * 17 mod 255
case &B100000 to &B101111: b = y - &B100000 mod 255 * 17 mod 255
case &B110000 to &B111111: b = y - &B110000 mod 255 * 17 mod 255
end select
pset (x,y), 255 shl 24 + (x mod 255) shl 16 + (y mod 255) shl 8 + (x mod 255)
pset (x,y), rgba(r * 8, 0, b * 8, (r + b) * 4)
x=x+1: if x > 1799 then x = 0: y = y + 1
Loop
bsave "test5.bmp",0
sleep

Image
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: Beginner help for DOS version

Post by Richard_ »

@paul doe

Thanks for program.

I modified program to have 3200 x 1800 - otherwise is as per your work (Screenshot attached).



Image


Note - I don't know what I am doing wrong (or missed to do) - but I cannot exit the program (even the RED X Box at top right hand corner does not terminate program).

I had to use Task Manager to "End Task" for this program.

The program was run in FreeBASIC Windows version.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: Beginner help for DOS version

Post by Richard_ »

@fatman2021 Thanks for program - tested with FreeBASIC Windows version - Screenshot below.

Image

Image

As per previous reply (immediately above - program locks up on displaying - need Task Manager "End Task" to get back to Windows.

Soon will try all (working) programs in FreeBASIC DOS version to see how they go in 32bit graphics (as well as 8bit graphics).


EDIT - choose wrong image type (should have been full image (Need to practice more with imgbox)

EDIT EDIT - re at end - just curious, cannot find "test5.bmp" anywhere - looked on my usb stick where my .bas and .exe are generated AND in C:\Program Files (x86)\FreeBASIC folder
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

Re: Beginner help for DOS version

Post by fatman2021 »

It(test5.bmp) should be in the same folder that fat3.exe is in.
Post Reply