Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing resolution, amount of colors, and the use of pages.

Status
Not open for further replies.

sandmann999

Programmer
Apr 28, 2001
52
0
0
US
Can someone tell me how I might possibly use 640x480 resolution in Screen 13? Or maybe how to use multiple pages (like Screen 7). Or how to possibly access 256 colors in screen 12?
Not exactly like that, but mainly on how to program in the use of different resolutions, colors, and amount of pages into any Screen type. I've heard that it can be done.
If you could help (without the recommendation of libraries) that would be great!
Every answer I've ever gotten on this question is "use libraries" which would be fine, but whenever I follow up with the question as to where to get them, no one ever knows. But if you know, that would be fine too. :)

Thanks for your help!
 
I'm with you, I don't like using libraries, but you don't have to use them(not exactly). Take the code from a library and just put it into subs.

I remember an old version of BASICA allowed you to make any screen resolution you wanted (it was monochrome though). I had programs that were 2000*2000*2

When Microsoft wrote Qbasic, they probably made the set screen resolutions to make it faster and so that it used less RAM

Most SVGA codes use interrupts, I've been looking into ways to make graphics with the OUT statement, but I haven't found the right address yet. I know it's possible to change the resolution, because of that old verson of BASICA.

We got rid of that computer though, If I find it again, I'll post the web address for it. It was called
VBASICA and I think it was version 1.2 or 1.3
 
Quickbasic contains no native support for SVGA screen modes. One way to access SVGA modes in your Quickbasic program is to use VESA. VESA is a standard which most video cards support to implement SVGA resolutions. I believe VESA can be used by calling interrupts. You can find detailed information on using VESA at
As you mentioned, others have created libraries to let you access SVGA in Quickbasic. One that I know of is Future Library, I haven't used it myself by I hear that it is very good. You can download this library here:
 
I downloaded this but couldn't get it to work. I kept getting the message "Sub program not defined" when ever I would run any of their examples."

I guess what I mainly want to do is have 256 colors in SCREEN 12 and be able to use pages like SCREEN 7.
I don't care if the resolution isn't above 640x480, that's fine with me. I just want the best features of each SCREEN mode summed up into one. Because SCREEN 13 and SCREEN 7 are low resolution, which is a pain, and they're the ones with the sweet features. Again, they aren't combined, one has one feature, and the other has the other feature. Which is either 256 colors, or pages. So, either I have high res, lots of colors, or pages.
I would just love to be able to use them all at once.
Anyone know how to do this?
I would love any help. :)
 
The problem here is video memory. When QB was written, the best video card that was commonly available was the VGA, which contained 256 kilobytes of RAM and has some very strange & bizarre video mode configuration options. In consideration of its design, the fact that a flat 320x200 256-color mode is available is really quite a privilege. All other modes are planar, which means that the pixels are broken up into bits and each bit is stored in a different block of memory.

The problem with multiple on-card pages of [tt]SCREEN 13[/tt] is that writing to video memory is done through the use of device-mapped memory. Memory starting at segment &HA000 actually exists on the video card and not in system memory (the system memory there exists too, but you can't access it without going into protected mode, for the most part). The problem, though, is that 320x200x8-bit uses 64,000 bytes of memory, which is well over half the size of a segment. Therefore, only one page of video can be "exposed" at once, so to say. To expose a different page, you need to directly communicate with the video card using 'OUT' statements.

As for 640x480x8-bit, a single frame requires 307,200 bytes of memory, which is more than the amount of memory available on the VGA. That is to say, the mode 640x480x256-color does not *exist* on an actual VGA card, and therefore the VGA standard has no way to enter this mode. Since QB is written to the VGA standard, QB also has no access to such a mode.

Doing 640x480x8-bit with multiple pages is plain out of the question, without invoking higher APIs, newer standards, such as the VESA extensions to which DigitlDud referred. The problem is that while the VGA standard means that most video cards can do all VGA modes in exactly the same way, there was no standard proposed for higher modes until it was already too late and all the manufacturers had made their own standards. As a result, accessing SVGA modes is different for every single video card, pretty much.

Another twist in the works to consider is that the higher video modes -- those that use more than 65,536 bytes to store a frame -- cannot be fully "exposed" in the device-mapped memory at any one time. This means that to access the entire screen's worth of data, you have to access it one piece at a time, advancing the visible "page" forward to access parts farther down on the screen. It is a pain, and it is slow.

To be honest, for a long time I have been of the opinion that writing programs to make use of modern hardware in QuickBASIC is, for the most part, a waste of time. Modern languages and systems provide a far more suitable environment for this sort of experimentation (such as DirectX under Windows, which really isn't as bad as everyone says, as long as you know C++ and are familiar with the component object model ^_^). However, I wish you luck with your project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top