---------------------- ---- VGATools Q&A ---- ---------------------- This file contains questions you may have regarding VGATools. Please read it if you encounter problems. If you can't find the solution in this file, you may have stumbled on something we've overlooked. In that case, contact us. Consult VGATOOLS.DOC to find out how. ********************** *** GENERAL *** ********************** Q: VGATools just won't work. My system locks up, or the display is all messy. I've had the same problem with demos and newer games, too. What am I doing wrong ? A: VGATools (as well as many demos and games) requires a fully register compatible VGA-card with at least 256k memory. If your VGA-board doesn't follow these standards, VGATools (or at least part of it) will not work. There is a known problem with Tseng ET-4000-based VGA-boards which may be caused by incompatibilities in the registers. There is only one solution to your problem : buy a new VGA-board... Q: Where can I get an updated version of VGATools ? A: The very latest version of VGATools can be downloaded from our WHQ and our DistSites. For details, read the Insomnia Information Package, included in this release. Q: I'm using TP/BP's integrated debugger. Why is the screen all messed up as soon as the IDE interrupts the program ? A: TP/BP's IDE (Integrated Development Environment) doesn't save all VGA registers when the program being debugged is interrupted. As a result, the special VGA settings that VGATools invokes are lost as soon as the IDE takes control. You can fix this problem by using the VGADebug unit's SaveStatus and RestoreStatus procedures, like this : Let's say your program looks like this : PROGRAM YourProgram; USES Unit1, ..., UnitN; ... BreakStatement; ... END. where BreakStatement is any statement where you want to put a breakpoint. Now change your program like this : PROGRAM YourProgram USES Unit1, ..., UnitN, VGADebug; ... SaveStatus; BreakStatement; RestoreStatus; ... END. There you are ! When your program is interrupted, the status is saved, and when execution continues, the status is restored. Note that, when in the IDE, the 'User Screen' option (Alt-F5) will still be faulty. ********************** *** SCREEN MODES *** ********************** Q: The screen briefly flashes if I call SetYResolution or SetUserMode. Can't this be prevented ? A: As with changing from textmode to graphics mode and vice versa, some monitors flash when changing modes. This effect may be minimised by putting a VSync before the instruction. Q: I used SetUserMode to set my own resolution but now there is a very big black border around my screen. Can't I have a full screen display ? A: No. As far as I know, the ( register-compatible ) VGA-board has only two standard 256-color resolutions, i.e. 320x400 and 320x480, as well as the undocumented 320x560 mode. Any other mode must be derived from these modes, either by spreading the pixel lines over different scanlines (which is done in 100, 200 and 240 modes) or cutting off the edges of the screen. SuperVGA is NOT standard register-compatible VGA (although VGATools does support 640x400 SVGA mode on most boards). Q: InitSVGA640x400(vmAutoDetect) doesn't work. Is my VGA board faulty ? A: For every type of SVGA board, there's a different way of setting the SVGA 640x400 mode. This involves a mode number that should be included in the documentation or programs that came with your VGA board. If you can't find your mode number, try the ModeScan program included with VGATools. If even that fails, you may try Rolf Brown's Interrupt List (Int 10/00), PCGPE, or another source. Check out SOURCES.DOC for more information about these sources. Alternatively, if you can't find the 640x400x256 mode on your board, you may try any 640xYYYx256 mode instead. InitSVGA640x400 will then customise that mode to 640x400 mode. Lastly, try loading the VESA driver that should have come with your VGA board (if you don't have a VESA-compatible board, that is). If all that fails, please send me the specifications of your VGA-board. Q: The SuperVGA mode is all messed up. There are gaps or bars on the screen, or the screen is just plain messy. What's going on ? A: As SuperVGA is _NOT_ a standard, some VGA boards may not be entirely compatible with the way VGATools addresses it. This may be due to a number of reasons, varying from a totally incompatible board to an exception which VGATools can't handle... VGATools is _NOT_ a SVGA toolbox, but it's prima- rily directed towards VGA Mode-X. If SVGA works, consider yourself lucky. If it doesn't, don't kill yourself because of that. As a mather of fact, I recently bought a new computer with a Trident VLB board (9200 chipset), and it poses the problem of black vertical bars in the picture. If anyone knows of a solution to this and similar problems, contact me... Q: When using InitSVGA640x400 (vmAutoDetect), my monitor beeps and the display is unstable for a few seconds before the mode is initialised correctly. What the #$&^œ# are you doing to my monitor ? A: As there is no standard SVGA modenumber, the autodetection feature first scans through the most commonly used mode numbers, then scans all available mode numbers until it finds a number that corresponds to a 256-color mode with 640 pixel columns. While searching for this mode, it's possible that VGATools triggers a mode which is not supported by your monitor. Most monitors have a maximum resolutions of 1024 by 768 pixels. However, some VGA-boards can display modes up to 1280x1024 and more. If one of these modes is used, the monitor just kind of goes bezerk. If this happens, try one of the following : * Load in the VESA driver that came with your VGA board (or UNIVBE). * Consult your VGA-board's documentation for a mode number which initializes 640x400x256 or 640x480x256 mode and use this number as a parameter for InitSVGA640x400. * Use MODESCAN for finding this modenumber. Please send me the specifications of your graphics card if your card has a non-standard way of setting the mode, so that I can account for this. InitSVGA640x400 has been tested on Realtek (ISA), Cirrus (ISA & VLB) S3 (VLB), Tseng ET-4000 (ISA). Q: Why is only 640x400 SVGA mode supported ? Couldn't you do 800x600, or better still, 1024x768 ? A: VGATools is a register-compatible toolbox, rather than a SuperVGA toolbox. As VGATools has to work on EVERY register-compatible VGA, regardless of which SVGA chipset is used, I can only be sure of access to the first 256k of VGA memory. As 640x400 requires 256000 bytes, it is the best possible mode of a 256k VGA. I can do 800x600, but that requires a 512k+ board and an entirely different approach than the one used by VGATools. Q: I have a VGA with 512k or more, but setting the VGAHas512k variable to True doesn't give me a second page in 640x400, as stated in the DOC. A: The VGAHas512k variable must be set to True at the very beginning of your program. If you change it after Init is called, VGATools will ignore the setting. Q: I've tried setting VGAHas512k to True at the beginning of my program, but my computer just locks up, a protection error is displayed or some other weird stuff happens. A: This has to do with the usage of memory. Normally, graphics modes are accessed through the 64k memory region at A000:0000. However, in order to be able to actually use 512k of VGA memory, VGATools reprograms the VGA so that, in stead of this 64k, 128k from A000-BFFF is used as the VGA memory window. Normally, the memory area B000-B7FF is only used for monochrome text modes, so many memory managers assume this will never be used, and use this region as an extra 32k for running programs. To solve your problem, here's what you should do: If you are using EMM386.EXE : -Look in your CONFIG.SYS for a line that says DEVICE=EMM386.EXE. -Remove the parameter I=B000-B7FF. -Save CONFIG.SYS and reboot. or, if you have MS-DOS 6.0 or higher : -Run MemMaker and select advanced mode. -When prompted to select options, set 'Use monochrome region for running programs' to No. If you are using QEMM386 : -Look in your CONFIG.SYS for a line that says DEVICE=QEMM386.SYS. -Add X=B000-B7FF to this line. -Save CONFIG.SYS and reboot. -Run Qemm's Optimize if neccessary. If you have any other memory manager : -Look in the manual for the options that include or exclude memory regions. -Remove any option that includes the B000-B7FF region. -Add an option to exclude B000-B7FF. Q: I've set the user mode to a mode with X>320 and Y>480, and now the display expands beyond my monitor borders. On a friends monitor, it looks perfect. Is my monitor faulty ? A: Due to the limitations of some monitors, you shouldn't use modes with X>320 and Y>480 simultaneously. Both modes are non-standard VGA, and require a special trick to force the monitor to display these modes correctly. Some monitors have the ability to automaticly adapt the dot pitch (the distance between pixels) so that the picture is automaticly expanded to full-screen. However, as there is no way of knowing which monitor is attached to the VGA card, you should not use modes with both X>320 and Y>480. ********************** *** MISCELANEOUS *** ********************** Q: I experimented with some of the advanced procedures, and now none of the other VGATools procedures will work properly. A: As stated in VGATOOLS.DOC, the advanced procedures assume knowledge of the inner workings of the VGA-board. However, in most cases, you can use the following statements to reset the VGA-board to the settings assumed by all VGATools procedures: SetWriteMode (0); SetReadMode (0); Q: Can I have the source code of VGATools ? Please ? Pretty please ? Pretty, pretty please ? A: No. Most of VGATools' routines are optimised for speed and performance. There should be no need to change any code. As my RPG teacher (the language, not the games, unfortunately) would say, it's no use copying the source if you don't understand the reasoning behind it. Besides, some changes in VGATools' code can and will cause serious damage to the VGA- board or monitor, so I won't take the risk that some smeghead changes my code, blows up a few VGA-boards, and then blames me for it... You wouldn't ask ID to give you the source code for Heretic, now would you ? However, if you really want to do some serious coding, try out the sources listed in SOURCES.DOC or try our Low-Level VGA Tutor serious, which BTW does contain some of VGATools' source code. Q: I try to store a large portion of the screen in a Bitmap (Image), but when I put it back on screen, it's all messed up and some parts repeat themselves. Is this an error ? A: Bitmaps and Images have a size limit of 65535 bytes, including header. If you are unsure, you should use the BitmapSize (ImageSize) function to find out the needed size. If the function returns zero, then the region you requested is too large to be stored in the Bitmap (Image). Use several Bitmaps (Images) to store the desired region, use CopyPage, or load in a GIF or PCX. Q: FloodFill doesn't work properly, but only fills part of the region, leaves small lines, or just locks up. I get about the same results as with the BGIDEMO that uses the Graph. What's wrong ? A: The FloodFill procedure ran out of memory. As opposed to the static region allocated by Graph's FloodFill, VGATools' FloodFill will allocate up to 64k of Heap memory for its buffers. If, however, the Heap space availible to your Pascal program is very low, FloodFill might not be able to allocate enough memory for its buffers, producing faulty results. Check out the MaxAvail variable before calling FloodFill. If it's more than 65532, the error occurs because there are to many single points or edges in the region. This can only be prevented by splitting the region into different parts and then separately FloodFilling each part. If MaxAvail is below 65532, however, you may be able to get better results by freeing up memory, either by using FreeMem to free Heap space at runtime, or by changing the $M parameter to reserve more memory for your program. See Pascal's help or documentation for more information. Q: The BGIDemo doesn't work. The VGA-board stays in textmode, and I have to press ESC to get back to DOS. Is my board incompatible with VGATools ? A: BGIDemo is a little demonstration of the idiocy of the Graph unit that came with Borland/Turbo Pascal (sorry, Borland, that's just the way it is !). It particularily shows that the FloodFill procedure messes up whenever there are dithered patterns ('stars') in the area that is to be filled. To compare it with VGATools' FloodFill, a BGI-driver (Borland Graphics Interface), VESA.BGI, is used to access the 640x400x256 SVGA mode on VESA-compatible boards. If you don't have a VESA-compatible board and you don't have a VESA TSR, you can use any other BGI (including the standard BGI's) to try out the demo. If it doesn't work, don't worry : VGATools doesn't require BGI's anyway, and BGI's are far too slow to be used in graphics-intensive demos, applications, and the lot... Q: Why doesn't the effects unit work in modes with more than 400 pixel lines ? A: The effects unit uses the multi-page concept to 'copy' a page in a special way. As these screen modes allow for only one screen page, the effects can't possibly work. Q: I'm trying to use the Exec function in a program using the VGATLoad or other units, but I keep getting Heap Overflow errors when trying to load a picture. A: You've probably set heap space to 0. However, to ensure *fast* loading, the VGATLoad procedures use buffered disk access to speed things up. In Present and other units, some of the procedures need heap for temporary storage. Although VGATools doesn't require any permanent heap space, as opposed to some other VGA toolboxes, you should set your HeapMax to about 70k to avoid running out of temporary space. You can do this by putting something like this at the beginning of your program : {$M16384, 0, 70000} This will give VGATools some breathing room, whilst still allowing the Exec function to be properly executed. Alternatively, you can reduce the heap space used by VGATLoad procedures by assigning a value to the FBufSize variable in that unit. Q: I'm using the mouse unit, and when I draw something on the screen and the mouse is moved, some of the things I drew just disappear. What am I doing wrong ? A: When using the mouse unit, you MUST turn off the mouse cursor before any screen access (including reading). If you don't and the mouse is moved, the original background will be restored by the mouse handler, which will undo any changes you've made. ********************** *** MODESCAN *** ********************** Q: The ModeScan program doesn't seem to DO anything, or it locks up my system. Is my VGA faulty ? A: ModeScan uses advanced ways of 'detecting' available modes on the SVGA board. Normally, it will try every possible mode number. However, on some boards this may cause the system to lock up, so for extra compatibility, you can try the /L parameter (Limited testing). When started this way, ModeScan will not only try and detect the chipset of your SVGA board, as it always does, but it will only test modenumbers that are most commonly used on boards with such a chipset. As a result, ModeScan may fail to find 'special' modes that are indigenous to your specific board. As of version 2.0, ModeScan will detect chipset, VESA modes and regular modes on most boards. Q: I have a board capable of displaying 65536 or 16 million colors, but ModeScan reports these modes as 256-color modes. Should I contact my dealer? A: As there is no standard way of detecting these high-color modes, ModeScan can't detect the colors used in these modes, and thus labels them as 256 color modes... If anybody knows of a way to 'detect' these special modes, please contact me... ********************** *** VGASAVE *** ********************** Q: I loaded VGASave and now some of my programs just lock up. A: There is a war going on between VGASave and the other program. They both want the same: to control your computer. This is a known problem with programs written in Turbo Vision (including Borland IDE's). Reset your computer, then start the other program without loading VGASave. If you really need to grab a screen from such a program, try other grabbers or buy an Action Replay board. Q: VSV2GIF is really slow. It takes several minutes to convert a VSV to GIF. Is there something wrong ? A: If your system is too slow for acceptable conversion speed, you may wish to convert to BMP instead, after which you can use your favorite graphics utility (VPIC, GWS, PSP, ...) to convert the BMP to a GIF. ÚÄÄÄÄÄ úCoderúANSIúGFXúPPEú ÄÄÄÄÄÄúú ú ³ Ü ÜÄ¿ ÚÄÜÄÜ Ü ÚÄÜ ³ Û ÂÄÜ ßÄ¿ ÜÄ¿ ³ Û Û ÂÄÜ Ü ÃÄÛ ³ Û ³ Û ³ Û ³ ³ Û ³ Û Û ³ Û ³ ß Á ß ßÄÙ ßÄÙ Á ß Á ß ß Ù ßÄÄ¿ ÀÄÄþ Hairy Crashna þÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1996