QBasic => QB Discussion & Programming Help => Topic started by: Oz on September 03, 2005, 03:34:21 PM

Title: SCREEN resolution
Post by: Oz on September 03, 2005, 03:34:21 PM
I'd like to mention that the built in screen modes QBasic has are static, meaning that in, for example, SCREEN 12, the only pixel resolution you can ever have is 640x480

if you want a list of screen modes and their resolutions, go here (http://www.qbasicnews.com/qboho/qckscreen.shtml)

If you wish to have different colour modes, look into DOS and VESA or SVGA.  here (http://www.google.com/search?hl=en&lr=&q=DOS+VESA+SVGA&btnG=Search) is the google query.  Make some use of it.

if you are looking for libraries, search for UGL:. or FutureLib, but I'm sure that there are other good ones out there, too

Yes, there are SCREEN tweeks available, and even if they have to be set in a certain screen mdoe prior to the tweek, after the tweek, you are no longer running in that screen mode.


:: EDIT ::

Also, with each screen mode, there is a static screen bit depth and memory limit which WILL limit colours.

in screen 12, the buffer can only handle 16 colours at any given time.  No matter what you do, SCREEN 12 will only have 16 colours.

If you want 256 colours, QB will go as high as SCREEN 13, but only have 320x200 resolution.

Again, if you want hi res and lots of colours, use a library to achieve it - QB alone cannot achieve it without ASM


Title: SCREEN resolution
Post by: MystikShadows on September 03, 2005, 03:45:57 PM
There you go :-)

Title: SCREEN resolution
Post by: DrV on September 03, 2005, 07:43:32 PM
  • UGL: http://www.phatcode.net/downloads.php?id=195
  • Future.Library: http://www.phatcode.net/downloads.php?id=199
Both of these libraries allow the use of VESA SVGA modes in various bit depths.

Title: SCREEN resolution
Post by: The walrus on October 03, 2005, 10:30:47 AM
AK-LIB is also pretty good - and still in development. However, the documentation and homepage is in german.


Title: SCREEN resolution
Post by: Sebastian on October 03, 2005, 10:32:22 AM
Oh, I could translate the documentation into English if there's any interest. :)

Title: SCREEN resolution
Post by: axipher on December 04, 2005, 08:03:54 PM
english would be nice, and while ur at it y nt welsh lol, kidding

Title: SCREEN resolution
Post by: Sebastian on December 04, 2005, 08:20:42 PM
Oh, I forgot to post here. :) I finished the translation some time ago. The English version of the library is available here: http://forum.qbasicnews.com/viewtopic.php?t=10737


Title: SCREEN resolution
Post by: axipher on December 04, 2005, 10:26:14 PM
thanks for the translation, ive been wondering exactly wat AK lib does and now i know, props to u

Title: SCREEN resolution
Post by: GordonSweet on February 25, 2006, 11:31:07 AM
Just a little SCREEN tip when compiling using QuickBasic. If you compile the attached and run the EXE file you will find while running in the opening SCREEN 0 the display is minimised in the MSDOS window, but as soon as you activate SCREEN 9 the display is maximised.



PRINT "press a key for screen 9 and full screen"

SHOW: FOR n = 1 TO 20
          PRINT "Just testing"

Title: SCREEN resolution
Post by: Ralph on May 21, 2006, 01:50:47 AM
Hi, Gordon.

Just for curiosity, I ran your SCREEN 0, SCREEN 9 reversed, putting the SCREEN 9 code first, and ran it.  I got the full SCREEN 9, and I also got the full SCREEN 0!

I made the program toggle from one screen to the other.  With SCREEN 0 first, I get the window, then the full SCREEN 9, then, SCREEN 0 is full, as is SCREEN 9, as is SCREEN 0, and so on.

Same as above, with SCREEN 9 first.  ALL screens are now full!

With SCREEN 0 first, I added one line of code, just before the SCREEN 0.  That line?  SCREEN 1.  Now, SCREEN 0 is shown full, and the characters are wide.  Using the line of code, SCREEN 2, then SCREEN 7, then 8, 9, 10, 11, 12, and 13 worked the same, giving SCREEN 0 a full screen, though some of the screens modes show wide characters, with all showing the normal line height for SCREEN 0.


Title: SCREEN resolution
Post by: GordonSweet on May 21, 2006, 04:17:08 AM
You got me beat Ralph.

I expect it has something to do with the new graphic cards etc used with more modern PCS.


Title: SCREEN resolution
Post by: na_th_an on May 29, 2006, 03:38:25 AM
Switching from a 40 characters wide mode to textmode gives you textmode with 40 characters wide, as if you use "WIDTH 40, 25". This isn't something new, it's there since I can remember :)

Your windowed text mode problems can be solved configuring the _default.pif file so NTVDM programs are always executed fullscreen.

Title: SCREEN resolution
Post by: GordonSweet on May 29, 2006, 04:57:11 AM
Mornin' Nathan

As you are such a knowledgeable guy perhaps I might pick you brains again.

Because QB obviously has no way of creating speech without resort to using other software, I created a simple EXE file using BBC BASIC for Windows that produces  speech from any Command Line parameter such as        Speaker.exe this is speech.

One problem I cannot overcome, which might of course be a fault in BBC4W, is the QB screen minimises after using the SPEAKER.EXE for the first time, but usually works ok afterwards. As you know from my site I dabble in various Basics, and I can say the problem does not occur with Liberty basic. In fact it is even possible with LB to avoid the screen going in a blank black MSDOS like window while the speech is produced.

LB has it own excellent way of creating speech for using MS Agent and  based on tts_tool.c by Martin Goebel using stm.dll and ttw.dll by John White, but it needs a special MS Patch installing, which is not very easy to locate. BBC4W uses some other method that does not appear to need any special patches.

If necessary I will email the QB programs along with Speaker. Exe and anyone is welcome to a copy of Speaker.exe and the readable BAS code

Title: SCREEN resolution
Post by: na_th_an on May 29, 2006, 10:50:04 AM
Mixing Windows and MSDOS executables produces erratic behaviour most of the time. I remember when everyone started using windows-based slaves which could be controlled in several ways from a MSDOS executable - it was unstable and "untrustworthy", if you let me invent that word ;)

Every solution which mixes several programs which run in turn or even paralelly tends to be not very robust, that's why I usually advise against it. I know this is not an answer to your post, but I'm pretty sure that any solutions we might find for the problem will only work in some computers.

When a MSDOS tries to execute a command, the control is passed over the OS. If this command spawns a Windows application (as in your case, from what I understand), the process where the MSDOS application is being executed loses focus. If your MSDOS application is running in full screen mode, this means that, as the focus is not longer on the MSDOS app, the Windows environment should be made visible again just in case, so the OS returns to the desktop view and the MSDOS gets minimized.

The problem is just that MSDOS and your program execute in different processes, unlike MSDOS program shelled from another MSDOS program, which happen to execute in the same process. That's why there's a "Window swap" as one process loses focus and the other one gets it. Why does it minimize the first time and then it works okay? Well, I don't know :D this is what I called "erratic behaviour". Maybe in my computer it doesn't minimize, or it minimizes always... Who knows. I've seen some video card drivers which let you run a graphics mode in a MSDOS window (this is, the old solution of SCREEN 9: SCREEN 0 would be of little avail, as the drivers are capable of displaying the graphis screen mode windowed) -  I mean, this stuff depends on the system.

There might be a solution: if you build your Windows application to run completely in the background with no window and no focus.

This is the kind of problems you get when you try running applications that are designed for other operating systems. Same kind of problems you get running Windows software on Linux, for instance.

Again, this ain't a true answer, but I'd rather take a glance at fB 'cause you can do everything you do with your several Basics, and get just one executable which does everything, without needing to shell to extern programs to do some tasks. You end with just one fast, robust executable which runs natively under your OS. You can port your QB app to fB and you can play the Speech from fB as well.

Title: SCREEN resolution
Post by: GordonSweet on May 29, 2006, 11:18:38 AM
Thanks Nathan, I supected I was probably asking too much.

I am not sure how I would run the BBC4W Speaker.exe in the background. I appreciate you can always run a number of programs with some minimised. But as this speaker.exe relies on a COMMAND$ function to accepts the text$ to be spoken on opening, I cannot fathom out to get it to accept such a command while it is still minimised in memory.
Also although BBC4W can activate any of 34 screen Windows MODES or allow you to decide any Window size. I would not know how to arrange for it to run with no window and no focus.


Title: SCREEN resolution
Post by: Ralph on May 29, 2006, 11:29:32 AM

I know that your reply is for Gordon, but, it is such a clear, detailed reply, that I just had to post to tell you, "Thanks".  Your replies that I have read in  the past have also been of this nature, and, very instructional.  One more time, THANKS!

Title: SCREEN resolution
Post by: na_th_an on May 29, 2006, 11:46:12 AM
@Gordonsweet: Well, I don't know about the compiler you are using. Normally, in a Windows application, you define a window for it, or you configure it to run as a console window, or you don't do either thing so your process just "runs" with no window.

This applies when coding in a low level language. As your BBC Basic for windows is a port of the BBC syntax, I'm afraid that the whole process of creating and managing the application window is hidden from the developer and is handled automaticly (like it happens with a plain fB application or a C + Allegro application, for example). Maybe you could ask other users of this compiler who could offer better insight (in the two examples cited, this is, fB and C + Allegro, the window is handled for you by default, but you can take over this, maybe you can with BBC4W as well).

@Ralph: Thank you for your message, seriously :) It's great to be among nice people.

Title: SCREEN resolution
Post by: GordonSweet on May 29, 2006, 12:01:42 PM
Thanks again Nathan.

If you get the time perhaps you might like to download the introductory Shareware versions of BBC4W from the first link below and likewise Liberty Basic from the second, to widen you no doubt extensive knowledge further. Both can be used with some limitations to create simple programs until you pay for registration for the full versions. QB code can be copied direct into LB and usually run much of it in its automatic MAINWINDOW that normally needs to be blocked when creating other Graphics or Text etc Windows.




Title: SCREEN resolution
Post by: na_th_an on May 29, 2006, 12:04:52 PM
I'll take a glance when I get home :) Now I'm on a Linux box.

Title: SCREEN resolution
Post by: GordonSweet on May 29, 2006, 01:42:48 PM
Me plugging yet again Nathan the forthcoming version 5 of LB is for Linux I understand.


Title: SCREEN resolution
Post by: Anonymous on May 29, 2006, 09:11:43 PM
fb owns all of this.. ;p post the code and i'll try to port it to fb, just to prove it.

Title: SCREEN resolution
Post by: GordonSweet on May 30, 2006, 05:30:33 AM
Chaos and Nathan

You or anyone are welcome to download my 3 QuickBasic efforts to activate Speech using the BBc4W Speaker.exe which is included from below.

Anyone is welcome to use the code in any way they wish such as with FreeBasic. You can see the object is to try to provide help for the disabled who cannot speak at all.



Title: SCREEN resolution
Post by: Anonymous on May 30, 2006, 08:13:35 PM
that code is wretched!

Title: SCREEN resolution
Post by: GordonSweet on May 31, 2006, 03:33:18 AM
Yes but it works, and I am strictly an Amateur!!

So improve on it and you are very welcome to market the result based on my ideas if you wish.

Title: SCREEN resolution
Post by: Anonymous on May 31, 2006, 07:07:12 AM
could you do me a favor and write a short summary of what each of the 3 .bas files does..? i can hardly infer it from the src, i got two of them compiling but i don't think they behave right.

Title: SCREEN resolution
Post by: GordonSweet on May 31, 2006, 07:38:02 AM
You should be able to run all the BAS files under QuickBasic OK  by starting as    QB /L QB    even if you do not use the SPEAKER.EXE for the speech options.

CHATBD.BAS just displays an alpha keyboard you activate the keys by a left click of the mouse for speaking or printout


MSGBOARD.BAS displays a number of phrases to be selected by the mouse, for speaking or printout.

TALKER.BAS allows speech from keyboard entries or by reading any ASCII TXT file.

As I explained on the earlier posts here the screen minimizes sometimes when you first use the SPEAKER.EXE for speech.

I do have BBC4W and LB versions that work perfect both using the SPEAKER.EXE or with LB using its own speech API calls