
                                         
          
                                         
          
                                         
          
                                         
          
                                         
          
                                         
          
                                 REFERENCE MANUAL
          
                                         
          
                                      FOR THE
          
                                         
          
                                     SUPER VGA
          
                                         
          
                                 GRAPHICS LIBRARY
          
                                         
          
                                  TO BE USED WITH
          
                                         
          
                               MICROSOFT QUICKBASIC
          
                                         
          




            
          1993 by Zephyr Software - Stephen L. Balkum and Daniel A. Sill
          
          All rights reserved.  No part of this book shall be reproduced
          or transmitted by any means, electronic, mechanical,
          photocopying, recording or otherwise, without written
          permission from Zephyr Software - Stephen L. Balkum and Daniel
          A. Sill.
          
          Although every effort has been made to insure the accuracy of
          the material in this book, Zephyr Software, Stephen L. Balkum
          and Daniel A. Sill assume no responsibility for errors or
          omissions.  In addition no liability is assumed for damages
          resulting from the use of the information contained herein.
          
          Printed in the United States of America
          
          Trademarks
          
          QuickBasic and QuickC are trademarks of the Microsoft
          Corporation.
          The Graphics Interchange Format (c) is the Copyright property
          of CompuServe Incorporated.
          GIF (sm) is a Service Mark property of Compuserve Incorporated.
          All others are trademarks of their respective owners.
          




            
                            SOFTWARE LICENSE AGREEMENT
               
                 By using this software, you agree to the terms of
                                  this agreement.
               
               No warranties are expressed or implied.  In no event
               shall Zephyr Software, Stephen L. Balkum or Daniel
               A. Sill be held liable for damages resulting from
               the use or misuse of this product, including but not
               limited to implied warranties of fitness for a
               particular purpose.
               
               Shareware version may be freely distributed as long
               as all files stay together and are not modified in
               any way.  No cost may be charged for the shareware
               version beyond normal and reasonable copying and
               distribution expenses.
               
               No products developed with this software shall be
               sold unless this software has been registered with
               Zephyr Software, Stephen L. Balkum or Daniel A.
               Sill.
               
               At no time for any reason shall this software be
               reverse engineered, decompiled or disassembled.
               
               This software may not be rented or leased.
               
               This software may be used only on one terminal or
               one computer at any one given moment in time.  This
               software may not be installed on a network of any
               type.  Contact Zephyr Software, Stephen L. Balkum or
               Daniel A. Sill for networking options.
               
               United States Government Restricted Rights:
               Use, duplication or disclosure of this software and
               documentation by the U.S. Government is subject to
               the restrictions as set forth in subparagraph
               (c)(1)(ii) of the Rights in Technical Data and
               Computer Software clause at DFARS 252.227-7013.
               Contractor/manufacturer is Stephen L. Balkum and
               Daniel A. Sill, P.O. Box 7704, Austin, Texas 78713-
               7704.
               
               The ownership of this software may be transferred as
               long as Zephyr Software, Stephen L. Balkum or Daniel
               A. Sill is notified in writing of the transfer date
               and new owner.  The new owner must agree to this
               contract.  The transfer must include all registered
               updates and previously registered versions.  The
               original owner may not retain any copies in any form
               of the registered software or its documents.
          




            
          INTRODUCTION
          
          We spent weeks searching the depths of the internet ftp sites
          for a library that would allow the programmer full access to
          the abilities of Super VGA.  We wanted the colors VGA could
          provide and better resolution than EGA could provide.
          Professionally developed libraries with this ability were
          definitely out of our price range.  After our searches
          continuously returned nothing, we decided to fill the apparent
          void in the shareware market.
          
          Our searches did give two useful packages:  John Bridge's
          VGAKIT and Finn Thoegersen's VGADOC.  We began with these two
          works and developed a graphics library intended to allow the
          programmer access to the huge world of high resolution
          programming.
          
          On the surface the task appeared quite simple.  However, it
          quickly became obvious that the routines in this library would
          be required to affect extremely large amounts of data.
          Operations must be quick to be successful.  Therefore, every
          effort was made to create the fastest code possible - even at
          the expense of size.  For this reason we opted to write code
          with the 32 bit instructions of the 80386 and 80486 chips.  It
          is our opinion that anyone with a hi-res card in a lesser
          machine may have some priorities out of order. All routines
          are written in assembly and use absolutely no floating point
          values.  Anytime a real number was required, fixed point
          notation was used.  In addition we attempted to write the
          routines such that any reasonable argument passed can be
          interpretted intelligently by the library.
          
          With the numerous Super VGA cards available and no well
          established standard we chose John Bridge's identification and
          bank switching routines as a beginning.  These two routines
          have undergone some modification, but not enough to justify
          copyrighting this portion of the library's code by Zephyr
          Software.  We have no intentions of releasing our changes to
          these routines into the public domain.  From that point onward
          all code is original.  In some instances common algorithms
          were researched and original code written according to that
          algorithm.
          
          This Super VGA library gives the programmer transparent access
          to sixteen different Super VGA cards including the VESA
          standard.  The programmer only needs to verify that the end
          user's card has been identified, but not which card was
          recognized.  After proper identification, all functions react
          in exactly the same fashion.  The library contains functions
          to draw all of the major primitives.  In addition there are
          functions that modify the screen palette, write text on the
          screen with a choice of fonts and modify the reaction of the
          primitives.  Identification routines include not only the
          video card, but also the amount of video memory, type of
          




  
          processor and installed pointing devices.  Advanced functions
          provide full mouse support (when used with a Microsoft
          compatible driver) and joystick support.  Finally, support for
          two dimensional and three dimensional coordinate systems is
          provided including rotation, translation, scaling and projection.
          
          Development is ongoing.  We wrote this library to easily
          interact with Microsoft QuickBasic.  Versions for Microsoft C
          and Professional Basic exist as well.  We plan to release
          updates with new functions and faster code in the future.
          




            
          SUGGESTED METHODS FOR USING THIS LIBRARY
          
          USE WITH MICROSOFT QUICKBASIC
          
          We assume that the programmer is familiar with all of the
          capabilities of the Microsoft QuickBasic compiler and
          environment.  Understanding of the lib and link commands is
          encouraged as well as the use of quicklibraries.  However, to
          ensure you are able to get up and running quickly, the
          following commands may be helpful:
          
          To create a quicklibrary from SVGAQB10.LIB, type the command:
          
                 LINK /QU SVGAQB10.LIB, SVGAQB10.QLB, NUL, BQLB##
          
          where ## is the version of QuickBasic you are using (45 for
          QuickBasic version 4.5).
          
          If you wish to create a quicklibrary from SVGAQB10.LIB and
          additional libraries, type the command:
          
               LINK /QU SVGAQB10.LIB+????.LIB (continue as desired),
                             SVGAQB10.QLB, NUL, BQLB##
          
          where ## is the version of QuickBasic you are using (45 for
          QuickBasic version 4.5) and ????.LIB represents the additional
          desired libraries.
          
          After the quicklibrary has been created, you should start
          QuickBasic by typing:
          
                                  QB /L SVGAQB10
          
          This will tell the compilier to use the SVGAQB10.QLB
          quicklibrary when running and when creating an executable.
          
          VERIFICATION OF A COMPUTER'S HARDWARE
          
          It is strongly recommended that any program written with this
          library first verifies that the computer is a 80386 or better
          by calling the whichcpu function.  Many of the library's
          functions use 386 exclusive code which may cause a computer
          with a lesser processor to crash.  In addition whichmouse must
          be called before calling any of the mouse functions.  Lastly,
          it is recommended that whichjoystick be called before a
          program uses the joystick routines.
          
          It is required that a program call whichvga prior to any
          function that communicates with the video card.  If whichvga
          returns a zero for unknown card type, the program should not
          call any graphics function.  Without proper identification of
          the video card any graphics function will likely cause a
          system failure.  It is recommended, although not necessary,
          that a program call whichmem prior to calling any res
          




  
          function.  Although the video card was properly identified, it
          may not have sufficient onboard memory to support the desired
          resolution.  As a second check the res functions will do
          nothing if the video card has not been identified or if the
          video card does not support the specified resolution for
          memory or hardware reasons.
          
          USE OF 2-D AND 3-D FUNCTIONS
          
          In the interest of speed, the 2-D and 3-D functions were
          written to best work on multiple points at once.  We refer to
          these functions as object-oriented.  This means that the
          points defining an object (a box, a house, etc.) should be
          contained within one array and calls to the functions should
          act on all of the points in the array.  Calls to functions
          have a high speed overhead, therefore, placing more than one
          object in the same array and passing the entire array to the
          functions can be beneficial.  However, these functions will
          work on a single point as well.
          
          Another consequence of our object-oriented 2-D and 3-D
          functions is the use of the scaling functions.  When scaling
          objects, we recommend the object be defined about the origin.
          D2scale and d3scale both work with respect to the origin.
          This eliminates a significant number of translations that
          would otherwise be required by having a definable scale
          origin.  For example, to draw two boxes, one scaled by one-
          half of the other, each rotated by 45 degrees at the center of
          the screen, the recommended procedure is as follows:
          
            define an array box containing the 2-D points: (100, 100),
               (-100, 100), (-100, -100), (100, -100), (note: the box is
               centered about the origin.)
            rotate box by 45 degrees about (0, 0) and place the output
               in rbox,
            scale rbox by 50% (scaling factor would be 128, or 80 hex)
               and place output in srbox,
            translate rbox to the center of the screen - a translation
               of 320, 240 in 640x480 resolution - and place output in
               trbox,
            translate srbox to the center of the screen - same
               translation as for rbox - and place output in tsrbox,
            draw trbox and tsrbox on the screen.
          
          Notice that by defining the box centered about the origin the
          translation values were extremely intuitive.  Also notice that
          if we had scaled the second box after the translation, it
          would have been draw in the upper left quadrant of the screen
          instead of the center.
          
          In mathematics and many sciences it is customary that in a 2-D
          coordinate system the Y axis increases upward and the X axis
          increases to the right.  The computer industry has decided
          that the Y axis should increase downward.  The 2-D functions
          are not affected by the choice in coordinate systems.
          




  
          However, it is important to remember that a positive rotation
          in d2rotate rotates from the positive X axis to the positive Y
          axis.  Therefore, when using mathematical conventions, a
          positive rotation moves counter-clockwise.  On the computer
          screen a positive rotation moves clockwise.
          
          The 3-D coordinate system follows the mathematical conventions
          by using a right-handed coordinate system.  The easiest way to
          visualize this coordinate system is by using your right hand.
          Place your index finger and thumb at a right angle to one
          another as if to form an imaginary pistol.  Now place your
          second finger at a right angle to your index finger.  It
          should be at a right angle to your thumb as well.  This
          represents the three axes.  The index finger is the X axis,
          the second finger is the Y axis and the thumb is the Z axis.
          The easiest way to remember rotation directions in this system
          is cyclically.  A positive rotation about the X axis rotates
          the Y axis into the Z axis.  A positive rotation about the Y
          axis rotates the Z axis into the X axis.  A positive rotation
          about the Z axis rotates the X axis into the Y axis.
          
          After doing all necessary 3-D transformations, projection onto
          the 2-D computer screen is required.  Although the computer
          screen's coordinate system does not follow mathematical
          conventions, the d3project function automatically takes care
          of all conversions.  The programmer only needs to draw the
          resulting lines on the screen.
          
          THE CONCEPT OF SPRITE GRAPHICS
          
          The key to sprite graphics is the assumption that only a small
          percentage of the pixels in a graphics block are used by the
          animation and the remaining pixels should be treated as
          transparent, revealing the background behind the sprite.  The
          sprite routines in this library only act on non-transparent
          colors, thus, saving time by ignoring a large number of
          pixels.  When retrieving the background for a sprite, prior
          knowledge of the sprite itself permits obtaining background
          only where it is necessary.
          
          The following steps outline an example for the recommended
          procedure for using the sprite functions:
          
            1.draw the sprite on the screen - a white stick figure on a
               black background, for example
            2.use blkget to place the sprite in an array stick
            3.use spritegap to simultaneously retrieve the background
               into backstick and place stick on the screen, declaring
               black as the transparent color
            4.use spriteput to replace the background backstick in the
               same location as step 3
            5.repeat steps 3 and 4 as many times and in as many
               locations as desired
          
          CONVENTIONS USED IN THIS MANUAL
          




  
          
          All parameters, other than strings, passed to and from
          functions and procedures in this QuickBasic library are short
          (two byte) integers.  No floating point values are used.
          
          Whenever a pixel is written on the screen, a mode is required.
          Unless otherwise noted, there are four possible modes:  set,
          xor, or and and.  These modes are represented by the numbers
          one through four respectively.  Technically, set is the
          fastest mode.  However, xor maybe the most useful.  Xor'ing a
          point twice with the same color returns the original color.
          This can be used to cover and uncover graphics.  In addition
          when a reference to a color index is made, only values between
          and including 0 and 255 are valid.  Any integer will work, but
          only the lowest eight bits are recognized.
          




            
          BLKGET
            
           Syntax
            
            BLKGET X1, Y1, X2, Y2, GfxBlk
            
           Input
            
            X1, Y1 - top left corner of block
            X2, Y2 - bottom right corner of block
            GfxBlk - integer destination array
            
           Output
            
            If declared a function, Blkget returns 1 if successful, 0 if
            failed.
            
           Usage
            
            Blkget stores the pixel data contained within the block
            defined by (X1, Y1)-(X2, Y2) in the variable referenced by
            GfxBlk.  GfxBlk must be dimensioned as a short integer array
            with a size in integers equal to
          
                           [(X2-X1+1)*(Y2-Y1+1)] / 2+3.
                                         
            Note, however, that GfxBlk can be quite large.  If the size
            of GfxBlk is insufficient, Blkget will overwrite any data in
            memory contained beyond GfxBlk and may possibly cause the
            system to crash.  Blkget enforces X2X1 and Y2Y1.  Also, the
            coordinates must be valid on the screen at the current
            resolution.
            
           See Also
            
            BLKPUT, GETLASTSTRING, SPRITEGAP, SPRITEPUT
            
           Example
            
            REM PLACES 1/4 OF A CIRCLE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM BLOCKDATA(0 TO 483) AS INTEGER
            
            VMODE = VIDEOMODESET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWCIRCLE 1, 10, 30, 30, 20
            FILLAREA 30, 30, 10, 7
            
            BLKGET 0, 0, 30, 30, BLOCKDATA(0)
            BLKPUT 1, 320, 240, BLOCKDATA(0)
          




  
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
          




            
          BLKPUT
            
           Syntax
            
            BLKPUT Mode, X, Y, GfxBlk
            
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            X, Y - location for top left corner of block
            GfxBlk - integer source array
          
           Output
            
            If declared as a function, Blkput returns 1 if successful, 0
            if failed.
            
           Usage
            
            Blkput places the pixel data contained in the variable
            referenced by GfxBlk on the screen.  The top, left corner of
            the block is specified by (X, Y).  Any (X, Y) is acceptable
            and any portion of the block that lies outside of the
            currently defined viewport will not be drawn.
            
           See Also
            
            BLKGET, GETLASTSTRING, SPRITEGAP, SPRITEPUT, GIFPUT, SETVIEW
            
           Example
            
            REM PLACES 1/4 OF A CIRCLE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM BLOCKDATA(0 TO 483) AS INTEGER
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWCIRCLE 1, 10, 30, 30, 20
            FILLAREA 30, 30, 10, 7
            
            BLKGET 0, 0, 30, 30, BLOCKDATA(0)
            BLKPUT 1, 320, 240, BLOCKDATA(0)
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
          




            
          D2ROTATE
            
           Syntax
            
            D2ROTATE NumPoints, Xorigin, Yorigin, Angle, InArray,
            OutArray
            
           Input
            
            NumPoints - number of points to be rotated
            Xorigin, Yorigin - center of rotation
            Angle - angle of rotation about center
            InArray - P2Dtype array containing points to rotate
            OutArray - P2Dtype array holding rotated values
            
           Output
            
            no value returned
            
           Usage
            
            D2rotate takes the two dimensional points given in InArray
            and rotates them by the specified angle about Xorigin,
            Yorigin.  The results are returned in OutArray which can be
            the same as InArray.  A positive angle causes a clockwise
            rotation on the screen, from the positive X axis to the
            positive Y axis.
            
           See Also
            
            D2SCALE, D2TRANSLATE
            
           Example
            
            REM ROTATE A TRIANGLE ABOUT ONE CORNER
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM TRIO(1 TO 3) AS P2DType
            DIM TRI(1 TO 3) AS P2DType
            DIM TRI2(1 TO 3) AS P2DType
            
            TRIO(1).X = 0
            TRIO(1).Y = 0
            TRIO(2).X = -80
            TRIO(2).Y = 60
            TRIO(3).X = 80
            TRIO(3).Y = 60
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            GOSUB DRWTRI
          




  
            
            FOR I = 0 TO 360 STEP 2
            D2ROTATE 3, 0, 0, I, TRIO(1).X, TRI(1).X
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            GOSUB DRWTRI
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
            
            ERTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
          




            
          D2SCALE
            
           Syntax
            
            D2SCALE NumPoints, ScaleX, ScaleY, InArray, OutArray
            
           Input
            
            NumPoints - number of points to scale
            ScaleX - scale factor along X axis
            ScaleY - scale factor along Y axis
            InArray - P2Dtype array containing points to scale
            OutArray - P2Dtype array holding scaled values
            
           Output
            
            no value returned
            
           Usage
            
            D2scale multiplies each coordinate in the two dimensional
            array InArray by the corresponding scale factor ScaleX or
            ScaleY.  The results are stored in OutArray which can be the
            same as InArray.  A scale factor of 256 (100 hex) is
            considered 100 percent and results in no change.  Therefore,
            128 (80 hex) reduces values by one half and 512 (200 hex)
            doubles values.
            
           See Also
            
            D2ROTATE, D2TRANSLATE
            
           Example
            
            REM SCALE A TRIANGLE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM TRIO(1 TO 3) AS P2DType
            DIM TRI(1 TO 3) AS P2DType
            DIM TRI2(1 TO 3) AS P2DType
            
            TRIO(1).X = 0
            TRIO(1).Y = 0
            TRIO(2).X = -80
            TRIO(2).Y = 60
            TRIO(3).X = 80
            TRIO(3).Y = 60
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            GOSUB DRWTRI
          




  
            
            FOR I = 256 TO 512 STEP 4
            D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            
            FOR I = 512 TO 128 STEP -4
            D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            
            FOR I = 128 TO 256 STEP 4
            D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            
            GOSUB DRWTRI
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
            
            ERTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
          




            
          D2TRANSLATE
            
           Syntax
            
            D2TRANSLATE NumPoints, TransX, TransY, InArray, OutArray
            
           Input
            
            NumPoints - number of points to be translated
            TransX - distance to translate along X axis
            TransY - distance to translate along Y axis
            InArray - P2Dtype array containing points to translate
            OutArray - P2Dtype array holding translated values
            
           Output
            
            no value returned
            
           Usage
            
            D2translate takes the two dimensional points given in
            InArray and translates them by the specified number of
            pixels along each axis.  The results are returned in
            OutArray which can be the same as InArray.
            
           See Also
            
            D2ROTATE, D2SCALE
            
           Example
            
            REM TRANSLATE A TRIANGLE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM TRIO(1 TO 3) AS P2DType
            DIM TRI(1 TO 3) AS P2DType
            DIM TRI2(1 TO 3) AS P2DType
            
            TRIO(1).X = 0
            TRIO(1).Y = 0
            TRIO(2).X = -80
            TRIO(2).Y = 60
            TRIO(3).X = 80
            TRIO(3).Y = 60
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            GOSUB DRWTRI
            
            FOR I = 0 TO 100 STEP 4
            D2TRANSLATE 3, I, I, TRIO(1).X, TRI(1).X
          




  
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            
            FOR I = 100 TO 0 STEP -4
            D2TRANSLATE 3, I, I, TRIO(1).X, TRI(1).X
            GOSUB DRWTRI
            SDELAY 2
            GOSUB ERTRI
            NEXT I
            
            GOSUB DRWTRI
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
            
            ERTRI:
            D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
            DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
            DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
            DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
            RETURN
          




            
          D3PROJECT
          
           Syntax
          
            ret = D3PROJECT NumPoints, ProjParams, InArray, OutArray
            
           Input
          
            NumPoints - number of points to be projected
            ProjParams - structure containing parameters used in projection
              EyeX, EyeY, EyeZ - 3D location of viewer
              ScrD - distance from viewer to projection screen
              Theta - angle from positive 3D X axis to viewing direction
              Phi - angle from positive 3D Z axis to viewing direction
            InArray - P3Dtype array containing points to project
            OutArray - P2Dtype array holding projected values
          
           Output
          
            Returns 1 if successful, 0 if any one point failed.
          
           Usage
                      +Z axis 
                         |
                         |                   /\
                         |                  /  \
                         |            !     \ * \
                         |            !......X: /
                         |            ! Phi / \/
                         |            !    /  :
                         |            !   /   :
                         |            !  /    :
                         |       EyeX ! /ScrD :
                         |       EyeY !/      :
                         |       EyeZ *- - - -:- - - - - 
                         |           / `      : 
                         |          /   `     :
                         |         /      `   :
                         |        /      ---` :
                         |       /___----            
                         |      /     Theta
                         |
                         |________________________________________+Y axis
                        /
                       /
                      /
                     /
                    /
                   /
                  /
                 /
                /
               /
            +X axis
          




  
            
            D3project projects a specified number, NumPoints, of three
            dimensional points starting at InArray into two dimensions
            according to the parameters in ProjParams.  The two
            dimensional points are stored in OutArray.  The location of
            the viewer in this three dimensional space is given by
            EyeX, EyeY, EyeZ in the ProjParams structure.  The
            direction the viewer is facing is specified with ScrD,
            Theta, Phi in the ProjParams structure using spherical
            coordinates.  A virtual set of axes parallel to the true
            axes are placed at the viewer's location.  ScrD is the
            distance from the viewer to the center of the projection
            screen, ie. the currently defined viewport on the monitor's
            screen.  Theta is the angle in the virtual X-Y plane from
            the virtual X axis to the projection screen.  Positive
            angles rotate clockwise in the X-Y plane.  Lastly, the
            angle of elevation above or below the virtual X-Y plane is
            given by Phi.  Positive angles direct viewing above the
            plane; negative below.
            
            If a point is projected to a location behind the viewer, ie.
            on the side of the viewer opposite the projection screen,
            D3project returns a zero indicating one or more failed
            points.  The returned values of the X and Y for failed
            points will be -32768 to make them easily identified.
            
           See Also
          
            D3ROTATE, D3TRANSLATE, D3SCALE, SETVIEW
          
           Example
            
            REM DRAW A CUBE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM CUBE(1 TO 8) AS P3DType
            DIM PLOT(1 TO 8) AS P2DType
            DIM PROJPARAMS AS PROJType
            
            CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
            CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
            CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
            CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
            CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
            CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
            CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
            CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            PROJPARAMS.EYEX = -1040
            PROJPARAMS.EYEY = -600
          




  
            PROJPARAMS.EYEZ = -1200
            PROJPARAMS.SCRD = 1700
            PROJPARAMS.THETA = 30
            PROJPARAMS.PHI = 45
            
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, CUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWCUBE:
            FOR J=1 TO 3
            DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 1, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
            FOR J=5 TO 7
            DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 1, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
            FOR J=1 TO 4
            DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X,
            PLOT(J+4).Y
            NEXT J
            RETURN
          




            
          D3ROTATE
            
           Syntax
            
            D3ROTATE NumPoints, X, Y, Z, AngleZ, AngleY, AngleX,
            InArray, OutArray
            
           Input
            
            NumPoints - number of points to be rotated
            X, Y, Z - center of rotation
            AngleZ - angle of rotation about the Z axis
            AngleY - angle of rotation about the Y axis
            AngleX - angle of rotation about the X axis
            InArray - P3Dtype array containing points to rotate
            OutArray - P3Dtype array holding rotated values
            
           Output
            
            no value returned
            
           Usage
            
            D3rotate takes the three dimensional points given in InArray
            and rotates them by the specified angles about Xorigin,
            Yorigin, Zorigin.  The results are returned in OutArray
            which can be the same as InArray.  A virtual set of axes are
            placed at the origin of rotation and rotation takes place
            about these axes.  A positive angle causes a counter-
            clockwise rotation from the positive X axis to the positive
            Y axis.
            
           See Also
            
            D3PROJECT, D3SCALE, D3TRANSLATE
            
           Example
            
            REM ROTATE A CUBE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM CUBE(1 TO 8) AS P3DType
            DIM RCUBE(1 TO 8) AS P3DType
            DIM PLOT(1 TO 8) AS P2DType
            DIM PROJPARAMS AS PROJType
            
            CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
            CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
            CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
            CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
            CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
            CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
            CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
          




  
            CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            PROJPARAMS.EYEX = -1040
            PROJPARAMS.EYEY = -600
            PROJPARAMS.EYEZ = -1200
            PROJPARAMS.SCRD = 1700
            PROJPARAMS.THETA = 30
            PROJPARAMS.PHI = 45
            
            FOR I = 0 TO 360 STEP 5
            D3ROTATE 8, 0, 0, 0, I, I, I, CUBE(1).X, RCUBE(1).X
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, RCUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            SDELAY 2
            GOSUB DRWCUBE
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWCUBE:
            FOR J=1 TO 3
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
            FOR J=5 TO 7
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
            FOR J=1 TO 4
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X,
            PLOT(J+4).Y
            NEXT J
            RETURN
          




            
          D3SCALE
            
           Syntax
            
            D3SCALE NumPoints, ScaleX, ScaleY, ScaleZ, InArray, OutArray
            
           Input
            
            NumPoints - number of points to scale
            ScaleX - scale factor along X axis
            ScaleY - scale factor along Y axis
            ScaleZ - scale factor along Z axis
            InArray - P3Dtype array containing points to scale
            OutArray - P3Dtype array holding scaled values
            
           Output
            
            no value returned
            
           Usage
            
            D3scale multiplies each coordinate in the three dimensional
            array InArray by the corresponding scale factor ScaleX,
            ScaleY or ScaleZ.  The results are stored in OutArray which
            can be the same as InArray.  A scale factor of 256 (100 hex)
            is considered 100 percent and results in no change.
            Therefore, 128 (80 hex) reduces values by one half and 512
            (200 hex) doubles values.
            
           See Also
            
            D3PROJECT, D3ROTATE, D3TRANSLATE
            
           Example
            
            REM SCALE A CUBE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM CUBE(1 TO 8) AS P3DType
            DIM SCUBE(1 TO 8) AS P3DType
            DIM PLOT(1 TO 8) AS P2DType
            DIM PROJPARAMS AS PROJType
            
            CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
            CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
            CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
            CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
            CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
            CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
            CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
            CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
            
            VMODE = VIDEOMODEGET
          




  
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            PROJPARAMS.EYEX = -1040
            PROJPARAMS.EYEY = -600
            PROJPARAMS.EYEZ = -1200
            PROJPARAMS.SCRD = 1700
            PROJPARAMS.THETA = 30
            PROJPARAMS.PHI = 45
            
            FOR I = 256 TO 128 STEP -4
            D3SCALE 8, I, I, I, CUBE(1).X, SCUBE(1).X
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, SCUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            SDELAY 2
            GOSUB DRWCUBE
            NEXT I
            
            FOR I = 132 TO 256 STEP 4
            D3SCALE 8, I, I, I, CUBE(1).X, SCUBE(1).X
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, SCUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            SDELAY 2
            GOSUB DRWCUBE
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWCUBE:
            FOR J=1 TO 3
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
            FOR J=5 TO 7
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
            FOR J=1 TO 4
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X,
            PLOT(J+4).Y
            NEXT J
            RETURN
          




            
          D3TRANSLATE
            
           Syntax
            
            D3TRANSLATE NumPoints, TransX, TransY, TransZ, InArray,
            OutArray
            
           Input
            
            NumPoints - number of points to translate
            TransX - distance to translate along X axis
            TransY - distance to translate along Y axis
            TransZ - distance to translate along Z axis
            InArray - P3Dtype array containing points to translate
            OutArray - P3Dtype array holding translated points
            
           Output
            
            no value returned
            
           Usage
            
            D3translate takes the three dimensional points given in
            InArray and translates them by the specified number of
            pixels along each axis.  The results are returned in
            OutArray which can be the same as InArray.
            
           See Also
            
            D3PROJECT, D3ROTATE, D3SCALE
            
           Example
            
            REM TRANSLATE A CUBE NEAR THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM CUBE(1 TO 8) AS P3DType
            DIM TCUBE(1 TO 8) AS P3DType
            DIM PLOT(1 TO 8) AS P2DType
            DIM PROJPARAMS AS PROJType
            
            CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
            CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
            CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
            CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
            CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
            CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
            CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
            CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
          




  
            
            PROJPARAMS.EYEX = -1040
            PROJPARAMS.EYEY = -600
            PROJPARAMS.EYEZ = -1200
            PROJPARAMS.SCRD = 1700
            PROJPARAMS.THETA = 30
            PROJPARAMS.PHI = 45
            
            FOR I = 0 TO 100 STEP 2
            D3TRANSLATE 8, I, I, I, CUBE(1).X, TCUBE(1).X
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, TCUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            SDELAY 2
            GOSUB DRWCUBE
            NEXT I
            
            FOR I = 98 TO 0 STEP -2
            D3TRANSLATE 8, I, I, I, CUBE(1).X, TCUBE(1).X
            DUMMY = D3PROJECT 8, PROJPARAMS.EYEX, TCUBE(1).X, PLOT(1).X
            GOSUB DRWCUBE
            SDELAY 2
            GOSUB DRWCUBE
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
            
            DRWCUBE:
            FOR J=1 TO 3
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
            FOR J=5 TO 7
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X,
            PLOT(J+1).Y
            NEXT J
            DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
            FOR J=1 TO 4
            DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X,
            PLOT(J+4).Y
            NEXT J
            RETURN
          




            
          DRWBOX
            
           Syntax
            
            DRWBOX Mode, Color, X1, Y1, X2, Y2
          
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            Color - index to color in current palette
            X1, Y1 - location of top left corner
            X2, Y2 - location of bottom right corner
            
           Output
            
            no value returned
            
           Usage
            
            Drwbox draws a rectangle of the color specified using Mode
            with opposite vertices defined by (X1, Y1) and (X2, Y2).
            The vertices given do not need to be exactly the top left
            and bottom right.  They only have to reference opposite
            sides of the rectangle.  Any portion of the rectangle that
            lies outside of the currently defined viewport will not be
            drawn.
            
           See Also
            
            DRWLINE, SETVIEW
            
           Example
            
            REM DRAWS A BOX AROUND THE WHOLE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWBOX 1, 10, 0, 0, 639, 479
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWCIRCLE
            
           Syntax
            
            DRWCIRCLE Mode, Color, Xcenter, Ycenter, Radius
          
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            Color - index to color in current palette
            Xcenter, Ycenter - location of center of circle
            Radius - distance from center to edge of circle
            
           Output
            
            no value returned
            
           Usage
            
            Drwcircle draws a circle of the specified color using Mode
            with the center located at (Xcenter, Ycenter) and a radius
            of Radius.  All values of Xcenter, Ycenter and Radius are
            valid.  Any portion of the circle that lies outside of the
            currently defined viewport will not be drawn.
            
           See Also
            
            DRWELLIPSE, SETVIEW
            
           Example
            
            REM DRAWS A CIRCLE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWCIRCLE 1, 10, 320, 240, 200
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWELLIPSE
            
           Syntax
            
            DRWELLIPSE Mode, Color, Xcenter, Ycenter, RadiusX, RadiusY
            
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            Color - index to color in current palette
            Xcenter, Ycenter - location of center of ellipse
            RadiusX - radius parallel to X axis
            RadiusY - radius parallel to Y axis
            
           Output
            
            no value returned
            
           Usage
            
            Drwellipse draws an ellipse of the specified color using
            Mode with the center defined by (Xcenter, Ycenter).  The
            radius in the horizontal direction is RaduisX and the radius
            in the vertical direction is RadiusY.  All values of
            Xcenter, Ycenter, RadiusX and RadiusY are valid.  Any
            portion of the ellipse that lies outside of the currently
            defined viewport will not be drawn.
            
           See Also
            
            DRWCIRCLE, SETVIEW
            
           Example
            
            REM DRAWS AN ELLIPSE AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWELLIPSE 1, 10, 320, 240, 318, 238
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWLINE
            
           Syntax
            
            DRWLINE Mode, Color, X1, Y1, X2, Y2
            
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            Color - index to color in current Palette
            X1, Y1 - location of one endpoint of line
            X2, Y2 - location of other endpoint of line
            
           Output
            
            no value returned
            
           Usage
            
            Drwline draws a line of the specified color using Mode with
            endpoints located at (X1, Y1) and (X2, Y2).  All values of
            X1, Y1, X2 and Y2 are valid.  Any portion of the line that
            lies outside of the currently defined viewport will not be
            drawn.
            
           See Also
            
            DRWBOX, SETVIEW
            
           Example
            
            REM DRAWS A LINE FROM 0,0 TO THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWLINE 1, 10, 0, 0, 320, 240
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWPOINT
            
           Syntax
            
            DRWPOINT Mode, Color, X, Y
            
           Input
            
            Mode - pixel write mode (set=1, xor=2, or=3, and=4)
            Color - index to color in current palette
            X, Y - location of pixel to write
            
           Output
            
            no value returned
            
           Usage
            
            Drwpoint draws a single point of the specified color using
            Mode at (X, Y).  All values of X and Y are valid.  If the
            point (X, Y) lies outside of the currently defined viewport,
            no drawing will take place.
            
           See Also
            
            GETPOINT, SETVIEW
            
           Example
            
            REM DRAWS A POINT AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWPOINT 1, 10, 320, 240
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWSTRING
            
           Syntax
            
            DRWSTRING Mode, FColor, BColor, Strng$, X, Y
            
           Input
            
            Mode - pixel write mode (no action=0, set=1, xor=2, or=3,
            and=4)
            FColor - foreground index to color in current palette
            BColor - background index to color in current palette
            Strng$ - string of ASCII characters to be drawn
            X, Y - location of upper, left corner of block
            
           Output
            
            no value returned
            
           Usage
            
            Drwstring takes the ASCII characters contained in Strng$ and
            creates a graphics block similar to the blocks used by
            Blkget and Blkput and places this block on the screen at the
            specified coordinates.  The characters are drawn with color
            FColor using the current font and the background is color
            BColor.  When mode 0, no action, is used, the graphics block
            is created in memory retrievable by getlaststring, but no
            text is actually drawn on the screen.  (Note: the system
            font is automatically installed when Whichvga is called.)
            
           See Also
            
            FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRINGDN, DRWSTRINGLT,
            DRWSTRINGRT, GETLASTSTRING
            
           Example
            
            REM DRAWS SOME NORMAL TEXT AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            A$ = "HELLO WORLD"
            DRWSTRING 1, 10, 0, A$, 320, 240
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWSTRINGDN
            
           Syntax
            
            DRWSTRINGDN Mode, FColor, BColor, Strng$, X, Y
            
           Input
            
            Mode - pixel write mode (no action=0, set=1, xor=2, or=3,
                   and=4)
            FColor - foreground index to color in current palette
            BColor - background index to color in current palette
            Strng$ - string of ASCII characters to be drawn
            X, Y - location of lower, right corner of block
            
           Output
            
            no value returned
            
           Usage
            
            Drwstringdn takes the ASCII characters contained in Strng$
            and creates a graphics block similar to the blocks used by
            Blkget and Blkput.  The characters are drawn with color
            FColor using the current font and the background is color
            BColor.  When mode 0, no action, is used, the graphics block
            is created in memory retrievable by getlaststring, but no
            text is actually drawn on the screen.  (Note: the system
            font is automatically installed when Whichvga is called.)
            The text is drawn upside down with X, Y specifying the
            lower, right corner.  This corner corresponds to the upper,
            left corner when the text is oriented upright.
            
           See Also
            
            FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGLT,
            DRWSTRINGRT, GETLASTSTRING
            
           Example
            
            REM DRAWS SOME UP-SIDE-DOWN TEXT AT THE CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            A$ = "HELLO WORLD"
            DRWSTRINGDN 1, 10, 0, A$, 320, 240
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
          




  
            END
          




              
          DRWSTRINGLT
            
           Syntax
            
            DRWSTRINGLT Mode, FColor, BColor, Strng$, X, Y
            
           Input
            
            Mode - pixel write mode (no action=0, set=1, xor=2, or=3,
                   and=4)
            FColor - foreground index to color in current palette
            BColor - background index to color in current palette
            Strng$ - string of ASCII characters to be drawn
            X, Y - location of lower, left corner of block
            
           Output
            
            no value returned
            
           Usage
            
            Drwstringlt takes the ASCII characters contained in Strng$
            and creates a graphics block similar to the blocks used by
            Blkget and Blkput.  The characters are drawn with color
            FColor using the current font and the background is color
            BColor.  When mode 0, no action, is used, the graphics block
            is created in memory retrievable by getlaststring, but no
            text is actually drawn on the screen.  (Note: the system
            font is automatically installed when Whichvga is called.)
            The text block is rotated 90 to the left with X, Y
            specifying the lower, left corner.  This corner corresponds
            to the upper, left corner when the text is oriented upright.
            
            
           See Also
            
            FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGDN,
            DRWSTRINGRT, GETLASTSTRING
            
           Example
            
            REM DRAWS SOME TEXT ROTATED BY 90 DEGREES TO THE LEFT AT THE
            REM CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            A$ = "HELLO WORLD"
            DRWSTRINGLT 1, 10, 0, A$, 320, 240
            
            WHILE INKEY$ = ""
          




  
            WEND
            VIDEOMODESET VMODE
            END
          




              
          DRWSTRINGRT
            
           Syntax
            
            DRWSTRINGRT Mode, FColor, BColor, Strng$, X, Y
            
           Input
            
            Mode - pixel write mode (no action=0, set=1, xor=2, or=3,
                   and=4)
            FColor - foreground index to color in current palette
            BColor - background index to color in current palette
            Strng$ - string of ASCII characters to be drawn
            X, Y - location of upper, right corner of block
            
           Output
            
            no value returned
            
           Usage
            
            Drwstringrt takes the ASCII characters contained in Strng$
            and creates a graphics block similar to the blocks used by
            Blkget and Blkput.  The characters are drawn with color
            FColor using the current font and the background is color
            BColor.  When mode 0, no action, is used, the graphics block
            is created in memory retrievable by getlaststring, but no
            text is actually drawn on the screen.  (Note: the system
            font is automatically installed when Whichvga is called.)
            The text block is rotated 90 to the right with X, Y
            specifying the upper, right corner.  This corner corresponds
            to the upper, left corner if the text is oriented upright.
            
            
           See Also
            
            FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGDN,
            DRWSTRINGLT, GETLASTSTRING
            
           Example
            
            REM DRAWS SOME TEXT ROTATED BY 90 DEGREES TO THE RIGHT AT
            THE
            REM CENTER OF THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            A$ = "HELLO WORLD"
            DRWSTRINGRT 1, 10, 0, A$, 320, 240
            
          




  
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FILLAREA
            
           Syntax
            
            FILLAREA XSeed, YSeed, BorderColor, FillColor
            
           Input
            
            XSeed, YSeed - seed location to start fill
            BorderColor - color index at which filling stops
            FillColor - color index to fill within the border
            
           Output
            
            no value returned
            
           Usage
            
            Fillarea fills a region with a new color specified by
            FillColor.  The region is defined by any line or curve of
            the color BorderColor or by the edge of the viewport.  All
            graphics within the region are lost and covered with the
            FillColor.  The border is not effected.
            
           See Also
            
            FILLAREA, FILLSCREEN, FILLVIEW, SETVIEW
            
           Example
            
            REM FILLS A BOX WITH A COLOR
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWBOX 1, 10, 0, 0, 100, 100
            FILLAREA 1, 1, 10, 7
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FILLCOLOR
            
           Syntax
            
            FILLCOLOR XSeed, YSeed, OldColor, NewColor
            
           Input
            
            XSeed, YSeed - seed location to start fill
            OldColor - color index to change
            NewColor - color index to replace OldColor
            
           Output
            
            no value returned
            
           Usage
            
            THIS NEEDS TO BE REWORDED TO REFLECT A PATH!
            Fillcolor replaces every existence of OldColor with NewColor
            within a region.  The region is defined by any line or curve
            this not of OldColor or NewColor.  Therefore, only OldColor
            is modified and no other information is changed.
            
           See Also
            
            FILLCOLOR, FILLSCREEN, FILLVIEW, SETVIEW
            
           Example
            
            REM REPLACES THE BLACK COLOR WITH A NEW COLOR
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            DRWBOX 1, 10, 0, 0, 100, 100
            DRWBOX 1, 12, 20, 20, 80, 80
            FILLCOLOR 1, 1, 0, 7
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FILLSCREEN
            
           Syntax
            
            FILLSCREEN Color
            
           Input
            
            Color - index to color in current palette
            
           Output
            
            no value is returned
            
           Usage
            
            Fillscreen clears the entire screen with the specified
            color.  All information on the screen is lost.  (Note, a
            faster method to clear the screen is to call any of the
            'res###' functions.  These reset the graphics screen and
            automatically clear it to color index zero as well as reset
            the default palette.)
            
           See Also
            
            FILLCOLOR, FILLAREA, FILLVIEW
            
           Example
            
            REM FILLS THE SCREEN WITH A COLOR
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            FILLSCREEN 10
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FILLVIEW
            
           Syntax
            
            FILLVIEW Color
            
           Input
            
            Color - index to color in current palette
            
           Output
            
            no value is returned
            
           Usage
            
            Fillview fills the currently defined viewport with the
            specified color.  All information in the viewport is lost.
            
           See Also
            
            FILLCOLOR, FILLAREA, FILLSCREEN
            
           Example
            
            REM FILLS THE VIEWPORT WITH A COLOR
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            SETVIEW 100, 100, 539, 379
            FILLVIEW 10
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FONTGETINFO
            
           Syntax
            
            FONTGETINFO Width, Height
            
           Input
            
            no input parameters
            
           Output
            
            Width - width in pixels of current font
            Height - height in pixels of current font
            
           Usage
            
            Fontgetinfo returns in Width and Height the dimensions of
            the currently loaded font.
            
           See Also
            
            FONTSET, FONTSYSTEM
            
           Example
            
            REM GET INFO ON THE SYSTEM FONT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            FONTGETINFO WDTH, HGTH
            A$ = "SYSTEM FONT WIDTH =" + STR$(WDTH)
            B$ = "SYSTEM FONT HEIGHT =" + STR$(HGTH)
            DRWSTRING 1, 7, 0, A$, 0, 0
            DRWSTRING 1, 7, 0, B$, 0, 20
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FONTSET
            
           Syntax
            
            FONTSET
            
           Input
            
            Font$ = string * 4098 containing font data
            
           Output
            
            no value returned
            
           Usage
            
            Fontset loads the current font with the data found in Font$.
            The string must have at least 4098 members.
            
           See Also
            
            FONTGETINFO, FONTSYSTEM
            
           Example
            
            REM LOAD A FONT FROM DISK AND ENABLE IT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM NEWFONT AS STRING * 4098
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            OPEN "DRAGON.FNT" FOR BINARY AS #1
            GET #1, , NEWFONT
            CLOSE #1
            FONTSET NEWFONT
            DRWSTRING 1, 7, 0, "The Dragon Font!", 0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          FONTSYSTEM
            
           Syntax
            
            FONTSYSTEM
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Fontsystem sets the current font to the standard system
            font.  This font is automatically set when whichvga is
            called.
            
           See Also
            
            WHICHVGA, FONTGETINFO, FONTSET
            
           Example
            
            REM LOAD A FONT FROM DISK AND ENABLE IT
            REM THEN GO BACK TO THE SYSTEM FONT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            DIM NEWFONT AS STRING * 4098
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES640
            
            OPEN "DRAGON.FNT" FOR BINARY AS #1
            GET #1, , NEWFONT
            CLOSE #1
            FONTSET NEWFONT
            DRWSTRING 1, 7, 0, "The Dragon Font!", 0, 0
            FONTSYSTEM
            DRWSTRING 1, 7, 0, "The System Font!", 0, 20
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




              
          GETLASTSTRING
            
           Syntax
            
            GETLASTSTRING GfxBlk
            
           Input
            
            GfxBlk = integer destination array
            
           Output
            
            no value returned
            
           Usage
            
            Getlaststring returns the text drawn on the screen by the
            last called drwstring function.  The text is returned in
            GfxBlk which may be used with blkput or the sprite
            functions.  The text in GfxBlk is oriented in the same
            manner as the last called drwstring function.  A common
            practice is to call the drwstring function using mode 0
            which does not actually draw text on the screen.
            Getlaststring should be called immediately after the desired
            drwstring function to prevent possible loss of data caused
            by other functions.
            
            GfxBlk must be dimensioned as a short integer array with a
            size in integers equal to
            
                  [(fontwidth*stringlength)*(fontheight)] / 2+3.
                                         
            The font's dimensions can be obtained by calling fontgetinfo
            and the string's length can be obtained using QuickBasic's
            len function.  Note, however, that GfxBlk can be quite
            large.  If the size of GfxBlk is insufficient, getlaststring
            will overwrite any data in memory contained beyond GfxBlk
            and may possibly cause the system to crash.
            
           See Also
            
            DRWSTRING, DRWSTRINGDN, DRWSTRINGLT, DRWSTRINGRT,
            FONTGETINFO
            
           Example
            
            REM USES GETLASTSTRING TO DRAW SOME TEXT AT THE CENTER OF
            THE SCREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE=GETVIDEOMODE
            IF WHICHVGA = 0 THEN STOP
            RES640
          




  
            
            A$ = "HELLO WORLD"
            DRWSTRING 0, 10, 0, A$, 0, 0
            FONTGETINFO W, H
            L = LEN(A$)
            BLKSIZE = ( (W*L)*H )\2 + 3
            DIM BLK(0 TO BLKSIZE)
            GETLASTSTRING BLK(0)
            BLKPUT 1, 320, 240, BLK(0)
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            END
          




            
          GETPOINT
            
           Syntax
            
            Color = GETPOINT (X, Y)
            
           Input
            
            X, Y = location of pixel to read
            
           Output
            
            Color = color index of pixel at X, Y
            
           Usage
            
            Getpoint returns the value of the pixel at location X, Y.
            This value is a color index into the current palette.
            
           See Also
            
            DRWPOINT
            
           Example
            
            REM DRAW A POINT AND CHECK TO MAKE SURE IT IS THERE
            REM $INCLUDE: 'SVGAQB10.BI'
            
            DEFINT A-Z
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            VMODE = VIDEOMODEGET
            RES640
            
            DRWPOINT 1, 10, 320, 240
            POINTVALUE = GETPOINT(320, 240)
            
            A$ = "THE POINT VALUE IS:" + STR$(POINTVALUE)
            DRWSTRING 1, 7, 0, A$, 0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          GIFGETINFO
            
           Syntax
            
            ret = GIFGETINFO (Filename$, Width, Height, NumColors,
            Palette$)
           Input
            
            Filename$ = the filename of the gif image to read
            
           Output
            
            ret = return status of function (1 = success)
            Width = the width in pixels of the image
            Height = the height in pixels of the image
            NumColors = the number of colors in the image palette
            Palette$ = string*768 containing the image palette
            
           Usage
            
            Gifgetinfo reads Filename$ and returns the characteristics
            of the image.  The dimensions of the image are returned in
            Width, Height.  The number of colors in the image's palette
            is returned in NumColors and the palette is returned in
            Palette$.  Although the image's palette may contain less
            than 256 colors, Palette$ must be 768 characters in length.
            The image's palette will begin with the first character of
            Palette$.
            
            For ease of programming the gif decoder requires that the
            image be non-interlaced, use only a global color map and be
            compressed according to GIF87A specifications.
            
            If gifgetinfo determines that Filename$ is a satisfactory
            file, the function will return a one.  Otherwise, the
            function will return one of several error codes concerning
            Filename$ as listed below:
            
            0 =  does not exist or there is some disk I/O problem
            -1 = does not have the GIF87A signature
            -2 = image is interlaced
            -3 = does not use a global color map
            -4 = has some general error
            
           See Also
            
            GIFPUT
            
           Example
            
            REM DRAW A POINT AND CHECK TO MAKE SURE IT IS THERE
            REM $INCLUDE: 'SVGAQB10.BI'
            
            DEFINT A-Z
          




  
            DIM GIFPAL AS STRING * 768
            
            CLS
            INPUT "GIF FILE NAME"; GIFFILENAME$
            PRINT
            OK = GIFGETINFO(GIFFILENAME$, XSIZE, YSIZE, NUMCOL, GIFPAL)
            IF OK = 1 THEN
                A$ = "'" + GIFFILENAME$ + "' is identified as a 'Non-
            Interlaced' type"
                A$ = A$ + "'GIF87a' GIF."
                PRINT A$
                A$ = "Dimensions are:" + STR$(XSIZE) + " pixels wide
            and" + STR$(YSIZE)
                A$ = A$ + " pixels high"
                PRINT A$
                A$ = "Number of colors:" + STR$(NUMCOL)
                PRINT A$
            END IF
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          GIFPUT
            
           Syntax
            
            ret = GIFPUT (Mode, X, Y, Filename$)
            
           Input
            
            Mode = pixel write mode (set=1, xor=2, or=3, and=4)
            X, Y = the location of the top, left corner of the gif image
            Filename$ = filename of the gif image to read
            
           Output
            
            ret = return status of function (1 = success)
            
           Usage
            
            Gifput reads the gif image from Filename$ and places it on
            the screen with the top, left corner at X, Y.  The image is
            automatically clipped to the currently defined viewport.
            The image's palette should be previously obtained by using
            gifgetinfo.
            
            For ease of programming the gif decoder requires that the
            image be non-interlaced, use only a global color map and be
            compressed according to GIF87A specifications.
            
            If gifput encounters no problems, the function will return a
            one.  Otherwise, the function will return one of several
            error codes concerning Filename$ as listed below:
            
            0 =  does not exist or there is some disk I/O problem
            -1 = does not have the GIF87A signature
            -2 = image is interlaced
            -3 = does not use a global color map
            -4 = has some general error
            
           See Also
            
            GIFGETINFO, SETVIEW
            
           Example
            
            REM DRAW A POINT AND CHECK TO MAKE SURE IT IS THERE
            REM $INCLUDE: 'SVGAQB10.BI'
            
            DEFINT A-Z
            DIM GIFPAL AS STRING * 768
            
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            INPUT "GIF FILE NAME"; GIFFILENAME$
            
          




  
            VMODE = VIDEOMODEGET
            RES640
            
            OK = GIFGETINFO(GIFFILENAME$, XSIZE, YSIZE, NUMCOL, GIFPAL)
            IF OK = 1 THEN
                FIXIT = 0
                FOR A = 1 TO NUMCOL * 3 STEP 3
                    R = ASC(MID$(GIFPAL, A, 1))
                    G = ASC(MID$(GIFPAL, A + 1, 1))
                    B = ASC(MID$(GIFPAL, A + 2, 1))
                    IF R > 63 THEN
                        FIXIT = 1
                        EXIT FOR
                    END IF
                    IF G > 63 THEN
                        FIXIT = 1
                        EXIT FOR
                    END IF
                    IF B > 63 THEN
                        FIXIT = 1
                        EXIT FOR
                    END IF
                NEXT A
                IF FIXIT = 1 THEN
                    FOR A = 1 TO NUMCOL * 3
                        C = ASC(MID$(GIFPAL, A, 1))
                        MID$(GIFPAL, A, 1) = CHR$(C \ 4)
                    NEXT A
                END IF
                PALSET GIFPAL, 0, 255
                OK = GIFPUT(1, 0, 0, GIFFILENAME$)
                IF OK <> 1 THEN
                    SOUND 100, 5
                END IF
            END IF
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          JOYSTICKINFO
            
           Syntax
            
            JOYSTICKINFO JAX, JAY, JAButs, JBX, JBY, JBButs
            
           Input
            
            no input parameters
            
           Output
            
            JAX, JAY = horizontal and vertical values of joystick A
            JAButs = button status of joystick A
            JBX, JBY = horizontal and vertical values of joystick B
            JBBtus = button status of joystick B
            
           Usage
            
            Joystickinfo returns the current status of the two
            joysticks' position and buttons.  The position is returned
            in JAX, JAY for joystick A and JBX, JBY for joystick B.  The
            buttons' status is held in JAButs and JBButs.  For each
            joystick, button A - usually the fire button - is held in
            bit zero and button B is in bit one.  Button status is most
            easily checked with a bitwise and of JAButs (or JBButs) and
            the desired bit.
            
            Not all joysticks are constructed the same.  Therefore, it
            is recommended that any program using the joystick for more
            than just directional control complete a calibration of the
            joystick prior to usage.  For an example of joystick
            calibration, see the svgademo.exe source code.
            
           See Also
            
            WHICHJOYSTICK
            
           Example
            
            REM DISPLAY THE STATUS OF THE JOYSTICK PORT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            WHILE INKEY$ = ""
                JOYSTICKINFO JAX, JAY, JAButs, JBX, JBY, JBButs
                LOCATE 1, 1
                PRINT STRING$(40, 32)
                LOCATE 1, 1
                PRINT JAX; JAY; JAButs, JBX; JBY; JBButs;
                SDELAY 4
            WEND
            END
          




              
          MOUSEBUTPRESS
            
           Syntax
            
            MOUSEBUTPRESS ReqButton, X, Y, Num, MouseButs
            
           Input
            
            ReqButton = button for which information is requested
            
           Output
            
            X, Y = current location of mouse cursor
            Num = number of times button has been pressed since last
            request
            MouseButs = current status of mouse buttons
            
           Usage
            
            Mousebutpress returns in Num the number of times a mouse
            button has been pressed since the last call to
            mousebutpress.  In addition the current status of the mouse
            cursor and buttons is returned.  The position is returned in
            X, Y.  The buttons' status is held in MouseButs.  The left
            button is held in bit zero, right button in bit one and
            center button - for three button mice - in bit two.  Button
            status is most easily checked with a bitwise and of
            MouseButs and the desired bit.  The button for which a
            history is desired is identified by the bits in ReqBut.
            However, only one bit may be set.  Therefore, only the
            values of 1, 2 and 4 are permitted.  If more than one bit in
            ReqBut is set, the function will exit and no information
            will be returned.
            
           See Also
            
            MOUSEBUTRELEASE, MOUSESTATUS
            
           Example
            
            REM ENABLE, SHOW, MOUSE / DISPLAY LEFT BUTTON PRESS HISTORY
            REM FOR THE LAST 2 SECONDS
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            WHILE INKEY$ = ""
                MOUSEBUTPRESS 1, X, Y, N, MBUTS
          




  
                D$ = "MX=" + STR$(X)
                L = LEN(D$)
                IF L < 10 THEN
                    D$ = D$ + STRING$(8 - L, 32)
                END IF
                D$ = D$ + "MY=" + STR$(Y)
                L = LEN(D$)
                IF L < 20 THEN
                    D$ = D$ + STRING$(16 - L, 32)
                END IF
                D$ = D$ + "Number Of Times=" + STR$(N)
                DRWSTRING 1, 15, 8, D$, 0, 0
                SDELAY 80
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




            
          MOUSEBUTRELEASE
            
           Syntax
            
            MOUSEBUTRELEASE ReqButton, X, Y, Num, MouseButs
            
           Input
            
            ReqButton = button for which information is requested
            
           Output
            
            X, Y = current location of mouse cursor
            Num = number of times button has been released since last
            request
            MouseButs = current status of mouse buttons
            
           Usage
            
            Mousebutrelease returns in Num the number of times a mouse
            button has been released since the last call to
            mousebutrelease.  In addition the current status of the
            mouse cursor and buttons is returned.  The position is
            returned in X, Y.  The buttons' status is held in MouseButs.
            The left button is held in bit zero, right button in bit one
            and center button - for three button mice - in bit two.
            Button status is most easily checked with a bitwise and of
            MouseButs and the desired bit.  The button for which a
            history is desired is identified by the bits in ReqBut.
            However, only one bit may be set.  Therefore, only the
            values of 1, 2 and 4 are permitted.  If more than one bit in
            ReqBut is set, the function will exit and no information
            will be returned.
            
           See Also
            
            MOUSEBUTPRESS, MOUSESTATUS
            
           Example
            
            REM ENABLE, SHOW, MOUSE / DISPLAY LEFT BUTTON RELEASE
            HISTORY
            REM FOR THE LAST 2 SECONDS
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            WHILE INKEY$ = ""
          




  
                MOUSEBUTRELEASE 1, X, Y, N, MBUTS
                D$ = "MX=" + STR$(X)
                L = LEN(D$)
                IF L < 10 THEN
                    D$ = D$ + STRING$(8 - L, 32)
                END IF
                D$ = D$ + "MY=" + STR$(Y)
                L = LEN(D$)
                IF L < 20 THEN
                    D$ = D$ + STRING$(16 - L, 32)
                END IF
                D$ = D$ + "Number Of Times=" + STR$(N)
                DRWSTRING 1, 15, 8, D$, 0, 0
                SDELAY 80
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




            
          MOUSECURSORSET
            
           Syntax
            
            MOUSECURSORSET HotSpotX, HotSpotY, MouseCursor$
            
           Input
            
            HotSpotX, HotSpotY = location within mouse cursor of hotspot
            MouseCursor$ = string * 384 containing mouse cursor data
            
           Output
            
            no value returned
            
           Usage
            
            Mousecursorset defines the cursor according to the data in
            MouseCursor$.  The hot spot for the cursor is set by
            HotSpotX, HotSpotY.  The values for HotSpotX and HotSpotY
            must be within the cursor.  Valid HotSpotX values are from 0
            to 15 and HotSpotY ranges from 0 to 23.
            
           See Also
            
            MOUSECURSORDEFAULT, MOUSEENTER, MOUSESHOW
            
           Example
            
            REM MAKE A BIG CURSOR, THEN RESTORE IT BACK TO THE DEFAULT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            DIM BIGMOUSECURSOR AS STRING * 384
            FOR I = 1 TO 384
                READ A
                MID$(BIGMOUSECURSOR, I, 1) = CHR$(A)
            NEXT I
            MOUSECURSORSET 2, 2, BIGMOUSECURSOR
            MOUSERANGESET 0, 0, 639, 400
            MOUSESHOW
            A$ = "Press A Key To Return To The Default Cursor"
            DRWSTRING 1, 7, 0, A$, 0, 420
            WHILE INKEY$ = ""
            WEND
            MOUSECURSORDEFAULT
            A$ = "Press A Key To End                         "
          




  
            DRWSTRING 1, 7, 0, A$, 0, 420
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
            
            REM *BIG ARROW MOUSE CURSOR DATA
            DATA
            0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255
            DATA 0,15,15,0,0,255,255,255,255,255,255,255,255,255,255,255
            DATA 0,15,15,15,15,0,0,0,255,255,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,0,0,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,0,0,0,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,0,0,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,15,0,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,0,0,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,0,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,0,0,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,0,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,0,15,15,15,0,255,255,255,255,255
            DATA 0,15,15,15,15,0,0,15,15,15,0,255,255,255,255,255
            DATA 0,15,15,0,0,255,255,0,15,15,15,0,255,255,255,255
            DATA 0,15,0,255,255,255,255,0,15,15,15,0,255,255,255,255
            DATA 0,0,255,255,255,255,255,255,0,15,15,15,0,255,255,255
            DATA
            255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
            DATA
            255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
            DATA
            255,255,255,255,255,255,255,255,255,255,0,15,15,15,0,255
            DATA
            255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,0,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
            255
          




              
          MOUSECURSORDEFAULT
            
           Syntax
            
            MOUSECURSORDEFAULT
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Mousecursordefault defines the cursor to be a small arrow
            with the hot spot in the upper, left corner.  This is the
            cursor set when mouseenter is called.
            
           See Also
            
            MOUSECURSORSET, MOUSEENTER
            
           Example
            
            REM MAKE A BIG CURSOR, THEN RESTORE IT BACK TO THE DEFAULT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            DIM BIGMOUSECURSOR AS STRING * 384
            FOR I = 1 TO 384
                READ A
                MID$(BIGMOUSECURSOR, I, 1) = CHR$(A)
            NEXT I
            MOUSECURSORSET 2, 2, BIGMOUSECURSOR
            MOUSERANGESET 0, 0, 639, 400
            MOUSESHOW
            A$ = "Press A Key To Return To The Default Cursor"
            DRWSTRING 1, 7, 0, A$, 0, 420
            WHILE INKEY$ = ""
            WEND
            MOUSECURSORDEFAULT
            A$ = "Press A Key To End                         "
            DRWSTRING 1, 7, 0, A$, 0, 420
            
            WHILE INKEY$ = ""
          




  
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
            
            REM *BIG ARROW MOUSE CURSOR DATA
            DATA
            0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255
            DATA 0,15,15,0,0,255,255,255,255,255,255,255,255,255,255,255
            DATA 0,15,15,15,15,0,0,0,255,255,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,0,0,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,0,0,0,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,0,0,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,15,0,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,15,0,0,255,255
            DATA 0,15,15,15,15,15,15,15,15,15,15,0,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,0,0,255,255,255,255,255
            DATA 0,15,15,15,15,15,15,15,15,0,255,255,255,255,255,255
            DATA 0,15,15,15,15,15,0,15,15,15,0,255,255,255,255,255
            DATA 0,15,15,15,15,0,0,15,15,15,0,255,255,255,255,255
            DATA 0,15,15,0,0,255,255,0,15,15,15,0,255,255,255,255
            DATA 0,15,0,255,255,255,255,0,15,15,15,0,255,255,255,255
            DATA 0,0,255,255,255,255,255,255,0,15,15,15,0,255,255,255
            DATA
            255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
            DATA
            255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
            DATA
            255,255,255,255,255,255,255,255,255,255,0,15,15,15,0,255
            DATA
            255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,0,15,15,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0
            DATA
            255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
            255
          




              
          MOUSEENTER
            
           Syntax
            
            MOUSEENTER
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Mouseenter must be called before any other mouse functions.
            It initializes all of the mouse abilities including
            installing the SVGAQB10 mouse display driver.  Mouseenter
            initializes the default mouse cursor, the default
            sensitivity and sets the range to the current screen
            resolution.  The mouse cursor location is set to the middle
            of the screen.
            
           See Also
            
            MOUSEEXIT, MOUSEHIDE, MOUSESHOW
            
           Example
            
            REM ENABLE AND SHOW THE MOUSE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSEEXIT
            
           Syntax
            
            MOUSEEXIT
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Mouseexit properly disables all of the mouse abilities.
            This function also removes the SVGAQB10 mouse display
            driver.
            
           See Also
            
            MOUSEENTER, MOUSEHIDE, MOUSESHOW
            
           Example
            
            REM ENABLE AND SHOW THE MOUSE,THEN DISABLE IT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSEHIDE
            
           Syntax
            
            MOUSEHIDE
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Mousehide turns off the mouse display driver and removes the
            cursor from the display.  It is recommended to hide the
            mouse any time something will be drawn in its general
            vicinity.  Note, however, that although the cursor is not
            visible, all other mouse abilities remain active.
            
           See Also
            
            MOUSEENTER, MOUSEEXIT, MOUSESHOW
            
           Example
            
            REM ENABLE, SHOW, AND THE HIDE THE MOUSE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            WHILE INKEY$ = ""
            WEND
            MOUSEHIDE
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSEINFO
            
           Syntax
            
            MOUSEINFO MajorVersion, MinorVersion, MouseType, IRQ
            
           Input
            
            no input parameters
            
           Output
            
            MajorVersion = Microsoft compatible mouse driver major
            version number
            MinorVersion = Microsoft compatible mouse driver minor
            version number
            MouseType = type of mouse installed
            IRQ = the interrupt used by the mouse
            
           Usage
            
            Mouseinfo returns information about the mouse and its
            installed driver.  The driver must be Microsoft compatible.
            This information can be used to determine whether the mouse
            functions in this library will operate correctly.  For
            proper operation the driver version number must be greater
            than X.XX.  IRQ gives the interrupt number of the mouse -
            probably 3 or 4.  MouseType returns information about the
            type of hardware installed according to the following table:
            
            0 =  unknown type
            1 =  bus mouse
            2 =  serial mouse
            3 =  Inport mouse
            4 =  PS/2 mouse
            5 =  HP mouse
            
           See Also
            
            WHICHMOUSE
            
           Example
            
            REM RETURN INFORMATION ABOUT THE MOUSE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            MOUSE = WHICHMOUSE
            IF MOUSE > 0 THEN
                MOUSEINFO MJV, MNV, TP, I
                VER$ = STR$(MNV)
                L = LEN(VER$)
                VER$ = STR$(MJV) + "." + RIGHT$(VER$, L - 1)
          




  
                VER$ = "Software driver version is" + VER$
                VER$ = VER$ + " (Microsoft equalvalent version)."
                SELECT CASE TP
                    CASE IS = 1
                        TYPE$ = "bus mouse"
                    CASE IS = 2
                        TYPE$ = "serial mouse"
                    CASE IS = 3
                        TYPE$ = "Inport mouse"
                    CASE IS = 4
                        TYPE$ = "PS/2 mouse"
                    CASE IS = 5
                        TYPE$ = "HP mouse"
                    CASE ELSE
                        TYPE$ = "unknown type"
                END SELECT
                PRINT "Microsoft compatable " + TYPE$ + " detected
            with";
                PRINT STR$(MOUSE) + " buttons on IRQ" + STR$(I) + "."
                PRINT VER$
            ELSE
                PRINT "No Microsoft compatable mouse detected."
            END IF
            PRINT
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          MOUSELOCSET
            
           Syntax
            
            MOUSELOCSET X, Y
            
           Input
            
            X, Y = location on screen
            
           Output
            
            no value returned
            
           Usage
            
            Mouselocset moves the mouse cursor the location on the
            screen specified by X, Y.  If either X or Y is outside of
            the currently permitted mouse range, it is set to the
            closest border.  The currently permitted mouse range is the
            current screen resolution or the last called mouserangeset.
            
           See Also
            
            MOUSEENTER, MOUSERANGESET
            
           Example
            
            REM ENABLE AND SHOW THE MOUSE THEN MOVE IT TO THE ORIGIN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            WHILE INKEY$ = ""
            WEND
            MOUSELOCSET 0, 0
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSERANGESET
            
           Syntax
            
            MOUSERANGESET X1, Y1, X2, Y2
            
           Input
            
            X1, Y1 = location on screen of top, left corner of range
            X2, Y2 = location on screen of bottom, right corner of range
            
           Output
            
            no value returned
            
           Usage
            
            Mouserangset defines a permissible range on the screen for
            mouse movement.  The mouse is automatically positioned in
            the center of this range.
            
           See Also
            
            MOUSESTATUS
            
           Example
            
            REM ENABLE, SHOW, AND SET A RANGE FOR THE MOUSE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            DRWBOX 1, 10, 100, 100, 539, 379
            MOUSERANGESET 100, 100, 539, 379
            MOUSESHOW
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSERESTORESTATE
            
           Syntax
            
            MOUSERESTORESTATE MouseBuf
            
           Input
            
            MouseBuf = buffer holding complete mouse status information
            
           Output
            
            no value returned
            
           Usage
            
            Mouserestorestate completely restores a previously saved
            mouse status as contained in MouseBuf.  The mouse status
            must have been already stored in MouseBuf by mousesavestate.
            
           See Also
            
            MOUSESAVESTATE, MOUSESTORAGESIZE
            
           Example
            
            REM SAVE THE CURRENT MOUSE DRIVER STATUS,SHELL OUT, RESTORE
            IT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            IF WHICHMOUSE = 0 THEN STOP
            BUFSIZE = MOUSESTORAGESIZE \ 2 + 1
            DIM MBUFFER(0 TO BUFSIZE) AS INTEGER
            MOUSESAVESTATE MBUFFER(0)
            
            PRINT "TYPE 'EXIT' TO RETURN TO THE PROGRAM"
            SHELL
            
            CLS
            MOUSERESTORESTATE MBUFFER(0)
            PRINT "DRIVER RESTORED..."
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          MOUSESAVESTATE
            
           Syntax
            
            MOUSESAVESTATE MouseBuf
            
           Input
            
            MouseBuf = buffer holding complete mouse status information
            
           Output
            
            no value returned
            
           Usage
            
            Mousesavestate saves the complete mouse status in MouseBuf.
            The size of MouseBuf in bytes is defined by mousestoragesize
            which should called first.
            
           See Also
            
            MOUSERESTORESTATE, MOUSESTORAGESIZE
            
           Example
            
            REM SAVE THE CURRENT MOUSE DRIVER STATUS
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            IF WHICHMOUSE = 0 THEN STOP
            BUFSIZE = MOUSESTORAGESIZE \ 2 + 1
            DIM MBUFFER(0 TO BUFSIZE) AS INTEGER
            MOUSESAVESTATE MBUFFER(0)
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          MOUSESENSSET
            
           Syntax
            
            MOUSESENSSET XSens, YSens
            
           Input
            
            XSens = number of mickeys per pixel horizontally (default =
            8)
            YSens = number of mickeys per pixel vertically (default =
            16)
            
           Output
            
            no value returned
            
           Usage
            
            Mousesensset defines the relationship between mouse movement
            and cursor movement on the screen.  A mickey is defined as
            1/200th of an inch.  The ratio between mickeys and pixels is
            specified by XSens and YSens in the horizontal and vertical
            directions respectively.  The default values are assigned
            whenever mouseenter or mouseexit are called.
            
           See Also
            
            MOUSEENTER, MOUSEEXIT, MOUSESTATUS
            
           Example
            
            REM ENABLE, SHOW THE MOUSE AND MAKE IT VERY SENSITIVE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            MOUSESENSSET 100, 100, 5
            
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSESHOW
            
           Syntax
            
            MOUSESHOW
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Mouseshow enables the mouse display driver and places the
            cursor on the screen.  The cursor is only updated when the
            mouse is moved.  Therefore, it is recommended to hide the
            cursor when drawing on the screen to avoid unexpected
            results.
            
           See Also
            
            MOUSEENTER, MOUSEEXIT, MOUSEHIDE
            
           Example
            
            REM ENABLE AND SHOW THE MOUSE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            
            MOUSEENTER
            MOUSESHOW
            
            WHILE INKEY$ = ""
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            
            END
          




              
          MOUSESTATUS
            
           Syntax
            
            MOUSESTATUS X, Y, MouseButs
            
           Input
            
            no input parameters
            
           Output
            
            X, Y = mouse position on screen
            MouseButs = status of mouse buttons
            
           Usage
            
            Mousestatus returns the current status of the mouse position
            and buttons.  The position is returned in X, Y.  The
            buttons' status is held in MouseButs.  The left button is
            held in bit zero, right button in bit one and center button
            - for three button mice - in bit two.  Button status is most
            easily checked with a bitwise and of MouseButs and the
            desired bit.
            
           See Also
            
            MOUSERANGESET, MOUSESENSSET
            
           Example
            
            REM ENABLE, SHOW, DISPLAY MOUSE STATUS
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMOUSE = 0 THEN STOP
            RES640
            MOUSEENTER
            MOUSESHOW
            WHILE INKEY$ = ""
                MOUSESTATUS X, Y, MButs
                D$ = "MX=" + STR$(X)
                L = LEN(D$)
                IF L < 10 THEN
                    D$ = D$ + STRING$(8 - L, 32)
                END IF
                D$ = D$ + "MY=" + STR$(Y)
                L = LEN(D$)
                IF L < 20 THEN
                    D$ = D$ + STRING$(16 - L, 32)
                END IF
                D$ = D$ + "MBUTS=" + STR$(MButs)
          




  
                DRWSTRING 1, 15, 8, D$, 0, 0
            WEND
            MOUSEEXIT
            VIDEOMODESET VMODE
            END
          




            
          MOUSESTORAGESIZE
            
           Syntax
            
            bufsize = MOUSESTORAGESIZE
            
           Input
            
            no input parameters
            
           Output
            
            bufsize = size of buffer in bytes to store complete mouse
            status
            
           Usage
            
            Mousestoragesize determines the proper size buffer to hold
            the complete mouse status information.  This buffer should
            be created before calling Mousesavestate.
            
           See Also
            
            MOUSERESTORESTATE, MOUSESAVESTATE
            
           Example
            
            REM RETURN THE SIZE IN BYTES NEEDED TO SAVE THE MOUSE STATUS
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            IF WHICHMOUSE = 0 THEN STOP
            A$ = "The Mouse Driver Requires A" + STR$(MOUSESTORAGESIZE)
            + " Byte Buffer "
            A$ = A$ + "To Save Current Status."
            PRINT A$
            PRINT
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          OVERSCANSET
            
           Syntax
            
            OVERSCAN Color
            
           Input
            
            Color = index to color in current palette
            
           Output
            
            no value returned
            
           Usage
            
            Overscanset sets the overscan region to the specified color.
            The overscan region is the area between the usable pixel
            screen and the region not scanned by the monitor.  Normally,
            the overscan is color zero which is defined as black the
            majority of the time.  The overscan color is reset to zero
            anytime a res### function is called.
            
           See Also
            
            RES320, RES640, RES800, RES1024
            
           Example
            
            REM SET THE OVERSCAN COLOR TO GREEN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            RES320
            
            OVERSCANSET 10
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          PALCHGAUTO
            
           Syntax
            
            PALCHGAUTO Pal$, NewPal$, FirstColor, LastColor, Speed
            
           Input
            
            Pal$ = string * 768 containing initial palette
            NewPal$ = string *768 containing new palette
            FirstColor = index into palette where change will begin
            LastColor = index into palette where change will end
            Speed = speed of change
            
           Output
            
            no value returned
            
           Usage
            
            Palchgauto smoothly fades the colors between FirstColor and
            LastColor from the palette Pal$ to NewPal$.  The speed of
            the fade is set by Speed which is percentage change between
            each step of the fade.  Only values between 1 and 128 are
            valid where 1 represents a one percent change between steps
            and 128 (80 hex) represents fifty percent change between
            steps.  A Speed of 128 would then have only two steps.  A
            Speed outside of the valid range causes the function to
            immediately return without making any changes.  The time
            required to accomplish the entire fade is approximately
            equal to 0.033 seconds times 256 divided by Speed.
            Palchgauto does not modify either Pal$ or NewPal$.
            
           See Also
            
            PALCHGSTEP, PALDIMSTEP, PALIOAUTO
            
           Example
            
            REM AUTOFADE FROM ONE PALETTE TO ANOTHER AND BACK AGAIN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            DIM NEWPAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            FOR I = 1 TO 768
                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
            NEXT I
          




  
            COLR = 0
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
                COLR = COLR + 1
                IF COLR > 255 THEN
                    COLR = 0
                END IF
            NEXT I
            
            PALCHGAUTO PAL, NEWPAL, 0, 255, 2
            PALCHGAUTO NEWPAL, PAL, 0, 255, 2
            
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          PALCHGSTEP
            
           Syntax
            
            PALCHGSTEP Pal$, NewPal$, FirstColor, LastColor, Percent
            
           Input
            
            Pal$ = string * 768 containing initial palette
            NewPal$ = string * 768 containing new palette
            FirstColor = index into palette where change will begin
            LastColor = index into palette where change will end
            Percent = percent step from current palette to new palette
            
           Output
            
            no value returned
            
           Usage
            
            Palchgstep changes the palette colors between FirstColor and
            LastColor by Percent from Pal$ to NewPal$.  This function
            works very much like palchgauto except it only takes a
            single step and returns.  The step taken is a percentage
            specified by Percent where 256 (100 hex) is a 100 percent
            change.  The valid range for Percent is 0 to 256.  Values
            beyond this range cause the function to immediately return
            without making any changes.  A loop from 4 to 256 by fours
            using palchgstep would have similar results as palchgauto
            with a speed of 4.  Neither Pal$, nor NewPal$ are modified.
            
           See Also
            
            PALCHGAUTO, PALDIMSTEP, PALIOAUTO
            
           Example
            
            REM STEP FADE FROM ONE PALETTE TO ANOTHER AND BACK AGAIN
            FAST
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            DIM NEWPAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            FOR I = 1 TO 768
                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
            NEXT I
            COLR = 0
          




  
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
                COLR = COLR + 1
                IF COLR > 255 THEN
                    COLR = 0
                END IF
            NEXT I
            
            FOR I = 1 TO 255 STEP 2
                PALCHGSTEP PAL, NEWPAL, 0, 255, I
            NEXT I
            
            FOR I = 1 TO 255 STEP 16
                PALCHGSTEP NEWPAL, PAL, 0, 255, I
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          PALDIMSTEP
            
           Syntax
            
            PALDIMSTEP Pal$, FirstColor, LastColor, Percent
            
           Input
            
            Pal$ = string * 768 containing initial palette
            FirstColor = index into palette where dim will begin
            LastColor = index into palette where dim will end
            Percent = percent step from current palette to black
            
           Output
            
            no value returned
            
           Usage
            
            Paldimstep fades the specified palette to black by the given
            percentage between FirstColor and LastColor.  The percentage
            step from Pal$ to black is specified by Percent where 256
            (100 hex) is full black.  The valid range for Percent is 0
            to 256.  Values beyond this range cause the function to
            immediately return without making any changes.  Pal$ is not
            modified.
            
           See Also
            
            PALCHGAUTO, PALCHGSTEP, PALIOAUTO
            
           Example
            
            REM STEP FADE OUT AND BACK IN FAST
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            COLR = 0
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
                COLR = COLR + 1
                IF COLR > 255 THEN
                    COLR = 0
                END IF
            NEXT I
            
            FOR I = 255 TO 0 STEP -2
          




  
                PALDIMSTEP PAL, 0, 255, I
            NEXT I
            
            FOR I = 1 TO 255 STEP 16
                PALDIMSTEP PAL, 0, 255, I
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          PALGET
            
           Syntax
            
            PALGET Pal$, FirstColor, LastColor
            
           Input
            
            Pal$ = string * 768 to hold current palette
            FirstColor = index into palette where get will begin
            LastColor = index into palette where get will end
            
           Output
            
            Pal$ = string * 768 containing the current palette in the
            specified range
            
           Usage
            
            Palget returns in Pal$ the colors from the current palette
            between FirstColor and LastColor.  Only colors in the
            specified range are returned and all others in Pal$ are
            unchanged.  Pal$ must have a length of 768 characters
            despite the number of colors retrieved.
            
           See Also
            
            PALROTATE, PALSET
            
           Example
            
            REM GET THE CURRENT PALETTE IN THE VARABLE 'PAL'
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            VIDEOMODESET VMODE
            CLS
            PRINT "GOT IT IN 'PAL'..."
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          PALIOAUTO
            
           Syntax
            
            PALIOAUTO Pal$, FirstColor, LastColor, Speed
            
           Input
            
            Pal$ = string *768 containing initial palette
            FirstColor = index into palette where fade will begin
            LastColor = index into palette where fade will end
            Speed = speed of fade
            
           Output
            
            no value returned
            
           Usage
            
            Palioauto smoothly fades the colors between FirstColor and
            LastColor of Pal$ to or from solid black.  The speed of the
            fade is set by Speed which is the percentage change between
            each step of the fade.  A positive Speed corresponds to
            fading from Pal$ to black and a negative Speed fades from
            black to Pal$.  Only values between -128 and +128 are valid
            where 1 represents a one percent change between steps and
            128 (80 hex) represents fifty percent change between steps.
            A Speed of 128 would then have only two steps.  A Speed
            outside of the valid range causes the function to
            immediately return without making any changes.  The time
            required to accomplish the entire fade is approximately
            equal to 0.033 seconds times 256 divided by Speed.
            Palioauto does not modify Pal$.
            
           See Also
            
            PALCHGAUTO, PALCHGSTEP, PALDIMSTEP
            
           Example
            
            REM FADE OUT AND BACK IN FAST
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            COLR = 0
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
          




  
                COLR = COLR + 1
                IF COLR > 255 THEN
                    COLR = 0
                END IF
            NEXT I
            
            PALIOAUTO PAL, 0, 255, -2
            PALIOAUTO PAL, 0, 255, 16
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          PALROTATE
            
           Syntax
            
            PALROTATE Pal$, FirstColor, LastColor, Shift
            
           Input
            
            Pal$ = string * 768 containing current palette
            FirstColor = index into palette where shift will begin
            LastColor = index into palette where shift will end
            Shift = number of locations to shift colors
            
           Output
            
            no value returned
            
           Usage
            
            Palrotate shifts the colors between FirstColor and LastColor
            by a given number of locations.  The number of locations the
            colors are moved is specified by Shift which is between 1
            and 256.
            
           See Also
            
            PALGET, PALSET
            
           Example
            
            REM ROTATE A FEW PALETTE ENTRIES AROUND
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            COLR = 0
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
                COLR = COLR + 1
                IF COLR > 255 THEN COLR = 0
            NEXT I
            
            FOR I = 0 TO 100
                PALROTATE PAL, 0, 127, 1
                PALGET PAL, 0, 255
            NEXT I
            
            WHILE INKEY$ = ""
          




  
            WEND
            VIDEOMODESET VMODE
            
            END
          




            
          PALSET
            
           Syntax
            
            PALSEP Pal$, FirstColor, LastColor
            
           Input
            
            Pal$ = string * 768 containing the palette to set
            FirstColor = index into palette where set will begin
            LastColor = index into palette where set will end
            
           Output
            
            no value returned
            
           Usage
            
            Palset sets the specified range of colors in the current
            palette with the corresponding range in the palette Pal$.
            
           See Also
            
            PALGET, PALROTATE
            
           Example
            
            REM SET A NEW PALETTE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            DIM PAL AS STRING * 768
            DIM NEWPAL AS STRING * 768
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            PALGET PAL, 0, 255
            FOR I = 1 TO 768
                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
            NEXT I
            COLR = 0
            FOR I = 0 TO 639
                DRWLINE 1, COLR, I, 0, I, 479
                COLR = COLR + 1
                IF COLR > 255 THEN COLR = 0
            NEXT I
            
            PALSET NEWPAL, 0, 255
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
          




  
            
            END
          




            
          RES320
            
           Syntax
            
            RES320
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Res320 sets video mode 0x13 which is the industry standard
            320x200 graphics mode with 256 colors.  This function can be
            called without calling whichvga first as this function
            requires only that a VGA card is present, not a Super VGA
            card.
            
           See Also
            
            RES640, RES800, RES1024, WHICHVGA
            
           Example
            
            REM SET THE VIDEO MODE TO 320x200X256
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            
            RES320
            DRWSTRING 1, 7, 0, "THIS IS THE 320x200x256 VIDEO MODE...",
            0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          RES640
            
           Syntax
            
            RES640
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Res640 sets the video mode to 640x480 graphics mode with 256
            colors.  This function requires that a Super VGA card with
            at least 512K of video memory be present.  Also, whichvga
            must be called first or the function will fail without
            changing the video mode.  If video card does not have
            sufficient memory, res640 will return without changing the
            video mode.
            
           See Also
            
            RES320, RES800, RES1024, WHICHVGA
            
           Example
            
            REM SET THE VIDEO MODE TO 640x480X256
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES620
            DRWSTRING 1, 7, 0, "THIS IS THE 620x480x256 VIDEO MODE...",
            0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          RES800
            
           Syntax
            
            RES800
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Res800 sets the video mode to 800x600 graphics mode with 256
            colors.  This function requires that a Super VGA card with
            at least 512K of video memory be present.  Also, whichvga
            must be called first or the function will fail without
            changing the video mode.  If video card does not have
            sufficient memory, res800 will return without changing the
            video mode.
            
           See Also
            
            RES320, RES640, RES1024, WHICHVGA
            
           Example
            
            REM SET THE VIDEO MODE TO 800x600X256
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES800
            DRWSTRING 1, 7, 0, "THIS IS THE 800x600x256 VIDEO MODE...",
            0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          RES1024
            
           Syntax
            
            RES1024
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Res1024 sets the video mode to 1024x768 graphics mode with
            256 colors.  This function requires that a Super VGA card
            with at least 1 Megabyte of video memory be present.  Also,
            whichvga must be called first or the function will fail
            without changing the video mode.  If video card does not
            have sufficient memory, res1024 will return without changing
            the video mode.
            
           See Also
            
            RES320, RES800, RES1024, WHICHVGA
            
           Example
            
            REM SET THE VIDEO MODE TO 1024x768X256
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 1024 THEN STOP
            
            RES620
            DRWSTRING 1, 7, 0, "THIS IS THE 1024x768x256 VIDEO MODE...",
            0, 0
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          RESTEXT
            
           Syntax
            
            RESTEXT
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Restext sets video mode three which is the industry standard
            80x25 text mode.  Note, however, that since some users set
            their normal text mode to 43 or 50 lines, it is not
            recommended to use restext to restore a program to text mode
            upon completion.
            
           See Also
            
            VIDEOMODEGET, VIDEOMODESET
            
           Example
            
            REM SET THE VIDEO MODE TO STANDARD DOS TEXT MODE 3
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            
            RES620
            PRINT "THIS IS THE TEXT VIDEO MODE (DOS VIDEO MODE 3)...
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          SCROLLDN
            
           Syntax
            
            SCROLLDN X1, Y1, X2, Y2, Num, Color
            
           Input
            
            X1, Y1 - top left corner of block
            X2, Y2 - bottom right corner of block
            Num - number of pixels to shift
            Color - index to color in current palette
            
           Output
            
            no value returned
            
           Usage
            
            Scrolldn shifts the contents of the box described by (X1,
            Y1) - (X2, Y2) down by the number of pixels specified by
            Num.  The empty pixels created at the top of the box are
            filled with Color.  The pixels that are shifted out of the
            box are lost.  Scrolldn enforces X2X1 and Y2Y1.  When placed
            within a loop, scrolldn will create a scrolling effect.
            
           See Also
            
            SCROLLLT, SCROLLRT, SCROLLUP
            
           Example
            
            REM SCROLL SOME TEXT DOWN
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES640
            DRWBOX 1, 10, 0, 0, 100, 100
            DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
            
            FOR I = 0 TO 40
                SCROLLDN 1, 1, 99, 99, 1, 0
                SDELAY 2
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




  
          




              
          SCROLLLT
            
           Syntax
            
            SCROLLLT X1, Y1, X2, Y2, Num, Color
            
           Input
            
            X1, Y1 - top left corner of block
            X2, Y2 - bottom right corner of block
            Num - number of pixels to shift
            Color - index to color in current palette
            
           Output
            
            no value returned
            
           Usage
            
            Scrolllt shifts the contents of the box described by (X1,
            Y1) - (X2, Y2) down by the number of pixels specified by
            Num.  The empty pixels created at the right of the box are
            filled with Color.  The pixels that are shifted out of the
            box are lost.  Scrolllt enforces X2X1 and Y2Y1.  When placed
            within a loop, scrollrt will create a scrolling effect.
            
           See Also
            
            SCROLLDN, SCROLLRT, SCROLLUP
            
           Example
            
            REM SCROLL SOME TEXT LEFT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES640
            DRWBOX 1, 10, 0, 0, 100, 100
            DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
            
            FOR I = 0 TO 40
                SCROLLLT 1, 1, 99, 99, 1, 0
                SDELAY 2
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




  
          




              
          SCROLLRT
            
           Syntax
            
            SCROLLRT X1, Y1, X2, Y2, Num, Color
            
           Input
            
            X1, Y1 - top left corner of block
            X2, Y2 - bottom right corner of block
            Num - number of pixels to shift
            Color - index to color in current palette
            
           Output
            
            no value returned
            
           Usage
            
            Scrollrt shifts the contents of the box described by (X1,
            Y1) - (X2, Y2) down by the number of pixels specified by
            Num.  The empty pixels created at the left of the box are
            filled with Color.  The pixels that are shifted out of the
            box are lost.  Scrollrt enforces X2X1 and Y2Y1.  When placed
            within a loop, scrollrt will create a scrolling effect.
            
           See Also
            
            SCROLLDN, SCROLLLT, SCROLLUP
            
           Example
            
            REM SCROLL SOME TEXT RIGHT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES640
            DRWBOX 1, 10, 0, 0, 100, 100
            DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
            
            FOR I = 0 TO 40
                SCROLLRT 1, 1, 99, 99, 1, 0
                SDELAY 2
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




  
          




              
          SCROLLUP
            
           Syntax
            
            SCROLLUP X1, Y1, X2, Y2, Num, Color
            
           Input
            
            X1, Y1 - top left corner of block
            X2, Y2 - bottom right corner of block
            Num - number of pixels to shift
            Color - index to color in current palette
            
           Output
            
            no value returned
            
           Usage
            
            Scrollup shifts the contents of the box described by (X1,
            Y1) - (X2, Y2) down by the number of pixels specified by
            Num.  The empty pixels created at the bottom of the box are
            filled with Color.  The pixels that are shifted out of the
            box are lost.  Scrollup enforces X2X1 and Y2Y1.  When placed
            within a loop, scrollup will create a scrolling effect.
            
           See Also
            
            SCROLLDN, SCROLLLT, SCROLLRT
            
           Example
            
            REM SCROLL SOME TEXT UP
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            
            RES640
            DRWBOX 1, 10, 0, 0, 100, 100
            DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
            
            FOR I = 0 TO 40
                SCROLLUP 1, 1, 99, 99, 1, 0
                SDELAY 2
            NEXT I
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




  
          




              
          SDELAY
            
           Syntax
            
            SDELAY Count
            
           Input
            
            Count - number of vertical syncs to wait
            
           Output
            
            no value returned
            
           Usage
            
            Sdelay pauses execution of the program for a period of time
            specified by Count.  This delay remains approximately
            constant on all machines by using the vertical sync timer of
            the VGA graphics card which is about 60 - 70 Hz.
            
           Example
            
            REM MAKE A DELAY ABOUT 3 SECONDS LONG
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            PRINT "OK...STARTING DELAY NOW..."
            PRINT "SHOULD BE ABOUT 3 SECONDS..."
            PRINT
            TIM! = TIMER
            
            SDELAY 195
            
            TOT! = TIMER - TIM!
            
            PRINT "ACTUAL TIME WAS:"; TOT!
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          SETCARD
            
           Syntax
            
            SETCARD Chip, Mem
            
           Input
            
            Chip - code for certain SVGA chip type
            Mem - amount of video memory installed
            
           Output
            
            no value returned
            
           Usage
            
            WARNING:  USING SETCARD IMPROPERLY MAY CAUSE A SYSTEM
            FAILURE OR DAMAGE.
            Setcard sets the card type and installed video memory.  It
            can be used instead of the whichvga function.  However,
            specifying an incorrect chip type or installed video memory
            may cause unpredictable results not excluding damage to the
            SVGA card and/or monitor.  Extreme caution is advised when
            using this function.  It is recommended that this function
            only be used when it is suspected that the identification
            process in whichvga failed.  Be absolutely certain that the
            chip type specified is the actual chip type installed in the
            computer.  Mem should be a value of 256, 512 or 1024
            representing the kilobytes of video memory installed.  Use
            the following table for chip types:
            
           See Also
            
            WHICHVGA
            
           Example
            
            REM
            !WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WAR
            NING!
            
            REM USE THIS FUNCTION CAREFULLY. IT WORKS AROUND THE
            "WHICHVGA FUNCTION"
            REM IMPROPER USE (IE SETTING THE CARD ID AND MEMORY TO
            SOMTHING THAT
            REM THAT IS NOT VAILD) MIGHT DAMAGE YOUR VIDEO CARD/VIDEO
            MONITOR OR CAUSE
            REM UNPRECITABLE RESULTS. IT IS PROVIDED AS A METHOD TO FIND
            FAULTS IN THE
            REM VIDEO CARD/CHIP ID PROCESS.
            
            REM
            !WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WAR
          




  
            NING!
            
            END
          




              
          SETVIEW
            
           Syntax
            
            SETVIEW X1, Y1, X2, Y2
            
           Input
            
            X1, Y1 - top, left corner of view port
            X2, Y2 - bottom, right corner of view port
            
           Output
            
            no value returned
            
           Usage
            
            Setview defines a view port for clipping output on the
            screen.  Nothing can be drawn outside of the currently
            defined view port.  The res### functions set the view port
            to the full screen.
            
           See Also
            
            RES320, RES640, RES800, RES1024
            
           Example
            
            REM DRAW SOME LINES CLIPED TO A VIEWPORT
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            DRWBOX 1, 15, 100, 100, 539, 379
            SETVIEW 101, 101, 538, 378
            FOR I = 0 TO 300
                X1 = RND * 640
                Y1 = RND * 480
                X2 = RND * 640
                Y2 = RND * 480
                DRWLINE 1, 10, X1, Y1, X2, Y2
            NEXT I
            
            
            WHILE INKEY$ = ""
            WEND
            VIDEOMODESET VMODE
            
            END
          




              
          SPRITEGAP
            
           Syntax
            
            SPRITEGAP TransColor, X, Y, GfxBlk, BkGndGfxBlk
            
           Input
            
            TransColor - index to color in current palette
            X, Y - top, left corner of block
            GfxBlk - predefined integer array containing the sprite
            BkGndGfxBlk - empty integer array to hold sprite background
            
           Output
            
            no value returned
            
           Usage
            
            Spritegap is used in sprite graphics or animation to
            retrieve a sprite's background and then display the sprite.
            GfxBlk, a short integer array, contains the sprite which
            should have been previously defined by blkget or similar
            function such as getlaststring.  TransColor is the
            transparent color assumed in GfxBlk.  BkGndBlk, an empty
            short integer array of the same size as GfxBlk, will receive
            the sprite's background.  The top, left corner of the
            sprite's location is specified by X, Y.
            
           See Also
            
            BLKGET, BLKPUT, GETLASTSTRING, SPRITEPUT
            
           Example
              
            REM MOV A SPRITE ON A COMPLEX BACKGROUND
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
             
            DIM SPRITEDATA(0 TO 1040) AS INTEGER
            DIM SPRITEBKGND(0 TO 130) AS INTEGER
          
            IF WHICHCPU < 386 THEN
                PRINT "SORRY...386 REQUIRED"
                END
            END IF
            IF WHICHVGA = 0 THEN
                PRINT "SORRY...UNABLE TO ID VIDEO CARD"
                END
            END IF
            ORIGMODE = VIDEOMODEGET
            IF WHICHMEM < 512 THEN
                MAXX = 320
                MAXY = 200
          




  
                RES320
            ELSE
                MAXX = 640
                MAXY = 480
                RES640
            END IF
            
            FOR I = 0 TO 7
                FOR J = 0 TO 129
                    READ SPRITEDATA(I * 130 + J)
                NEXT J
            NEXT I
           
            MYPI! = ATN(1) * 4
            
            Colr = 16
            X1 = 0
            X2 = MAXX
            Y1 = 0
            Y2 = MAXY
            I = 0
            WHILE Y1 + I <= Y2 - I
                DRWBOX 1, Colr, X1 + I, Y1 + I, X2 - I, Y2 - I
                Colr = Colr + 1
                IF Colr > 255 THEN
                    Colr = 16
                END IF
                I = I + 1
            WEND
           
            CNTX = (MAXX \ 2) - 8
            CNTY = ((MAXY - 9) \ 2) - 8
            J = 0
           
            FOR DEG = 0 TO 360 STEP 2
                RAD! = (DEG * MYPI! / 180)
                X = CNTX + SIN(RAD!) * MAXY \ 4
                Y = CNTY + COS(RAD!) * MAXY \ 4
                SPRITEGAP 0, X, Y, SPRITEDATA(J), SPRITEBKGND(0)
                SDELAY 3
                SPRITEPUT 0, X, Y, SPRITEBKGND(0)
                J = J + 130
                IF J > 910 THEN
                    J = 0
                END IF
            NEXT DEG
            
            WHILE INKEY$ = ""
            WEND
          
            VIDEOMODESET ORGMODE
            END
          
          
            REM *SPRITE DATA
          




  
            DATA  15, 15, 0, 0, 0, 2304, 0, 0, 0, 0
            DATA  0, 0, 0, 265, 9, 0, 0, 0, 0, 0
            DATA  2304, 2305, 2305, 0, 0, 0, 0, 0, 0, 2304
            DATA  0, 0, 0, 0, 0, 0, 0, 2304, 0, 0
            DATA  0, 0, 0, 0, 0, 2570, 10, 0, 0, 0
            DATA  0, 0, 2560, 3588, 2564, 0, 0, 0, 0, 0
            DATA  2560, 1038, 2574, 0, 0, 0, 0, 0, 2560, 3588
            DATA  2564, 0, 0, 0, 0, 0, 1280, 2570, 1290, 0
            DATA  0, 0, 0, 0, 5, 2304, 0, 5, 0, 0
            DATA  0, 0, 5, 2304, 0, 5, 0, 0, 0, 1280
            DATA  0, 265, 9, 1280, 0, 0, 0, 1280, 2304, 2049
            DATA  2305, 1280, 0, 0, 0, 5, 2304, 2049, 2305, 0
            DATA  5, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 2313, 2313, 0, 0, 0
            DATA  0, 0, 0, 256, 2305, 0, 0, 0, 0, 0
            DATA  0, 2304, 2305, 0, 0, 0, 0, 0, 0, 9
            DATA  2304, 0, 0, 0, 0, 2570, 2314, 0, 0, 0
            DATA  0, 0, 2560, 1038, 2574, 0, 0, 0, 0, 1280
            DATA  2565, 1028, 2564, 0, 0, 0, 1280, 5, 2560, 1038
            DATA  2574, 0, 0, 0, 5, 0, 2304, 2570, 10, 0
            DATA  0, 0, 0, 2313, 9, 1280, 0, 0, 0, 0
            DATA  2304, 257, 9, 1280, 0, 0, 0, 0, 265, 264
            DATA  9, 5, 0, 0, 0, 0, 2048, 2305, 0, 5
            DATA  0, 0, 0, 0, 0, 9, 1280, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 5, 0
            DATA  0, 0, 0, 0, 0, 0, 1280, 5, 0, 0
            DATA  0, 0, 0, 0, 0, 1280, 5, 0, 0, 0
            DATA  0, 0, 2313, 0, 1280, 2570, 10, 0, 9, 0
            DATA  257, 9, 2560, 3588, 2564, 0, 2305, 0, 2056, 2305
            DATA  2569, 1038, 2574, 2313, 265, 9, 257, 9, 2560, 3588
            DATA  2564, 0, 2305, 0, 2313, 0, 1280, 2570, 10, 0
            DATA  9, 0, 0, 1280, 5, 0, 0, 0, 0, 0
            DATA  1280, 5, 0, 0, 0, 0, 0, 0, 5, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 9, 1280, 0, 0, 0, 0, 0
            DATA  2048, 2305, 0, 5, 0, 0, 0, 0, 265, 264
            DATA  9, 5, 0, 0, 0, 0, 2304, 257, 9, 1280
            DATA  0, 0, 0, 0, 0, 2313, 9, 1280, 0, 0
            DATA  0, 0, 5, 0, 2304, 2570, 10, 0, 0, 0
            DATA  1280, 5, 2560, 1038, 2574, 0, 0, 0, 0, 1280
            DATA  2565, 1028, 2564, 0, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 0, 0, 0, 0, 0, 2570, 2314, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 9, 2304, 0
            DATA  0, 0, 0, 0, 0, 2304, 2305, 0, 0, 0
            DATA  0, 0, 0, 256, 2305, 0, 0, 0, 0, 0
            DATA  0, 2313, 2313, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          




  
          
            DATA  15, 15, 0, 5, 2304, 2049, 2305, 0, 5, 0
            DATA  0, 1280, 2304, 2049, 2305, 1280, 0, 0, 0, 1280
            DATA  0, 265, 9, 1280, 0, 0, 0, 0, 5, 2304
            DATA  0, 5, 0, 0, 0, 0, 5, 2304, 0, 5
            DATA  0, 0, 0, 0, 1280, 2570, 1290, 0, 0, 0
            DATA  0, 0, 2560, 3588, 2564, 0, 0, 0, 0, 0
            DATA  2560, 1038, 2574, 0, 0, 0, 0, 0, 2560, 3588
            DATA  2564, 0, 0, 0, 0, 0, 0, 2570, 10, 0
            DATA  0, 0, 0, 0, 0, 2304, 0, 0, 0, 0
            DATA  0, 0, 0, 2304, 0, 0, 0, 0, 0, 0
            DATA  2304, 2305, 2305, 0, 0, 0, 0, 0, 0, 265
            DATA  9, 0, 0, 0, 0, 0, 0, 2304, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 1280, 0, 9, 0
            DATA  0, 0, 0, 0, 5, 2304, 2049, 0, 0, 0
            DATA  0, 0, 5, 265, 264, 9, 0, 0, 0, 1280
            DATA  0, 265, 2305, 0, 0, 0, 0, 1280, 0, 2313
            DATA  9, 0, 0, 0, 0, 2570, 2314, 0, 0, 5
            DATA  0, 0, 2560, 1038, 2574, 0, 1285, 0, 0, 0
            DATA  2560, 1028, 2564, 1285, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 0, 0, 0, 0, 2304, 2570, 10, 0
            DATA  0, 0, 2304, 0, 9, 0, 0, 0, 0, 0
            DATA  2304, 2305, 0, 0, 0, 0, 0, 0, 2304, 257
            DATA  0, 0, 0, 0, 0, 0, 2304, 2313, 9, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 5, 0, 0, 0, 0
            DATA  0, 0, 1285, 0, 0, 0, 0, 0, 0, 1285
            DATA  0, 0, 0, 9, 0, 2570, 1290, 0, 2304, 9
            DATA  2304, 1, 2560, 3588, 2564, 0, 265, 1, 265, 2313
            DATA  2569, 1038, 2574, 2313, 2049, 8, 2304, 1, 2560, 3588
            DATA  2564, 0, 265, 1, 0, 9, 0, 2570, 1290, 0
            DATA  2304, 9, 0, 0, 0, 0, 0, 1285, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 1285, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 5, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  2304, 2313, 9, 0, 0, 0, 0, 0, 2304, 257
            DATA  0, 0, 0, 0, 0, 0, 2304, 2305, 0, 0
            DATA  0, 0, 0, 0, 2304, 0, 9, 0, 0, 0
            DATA  0, 0, 0, 0, 2304, 2570, 10, 0, 0, 0
            DATA  0, 0, 2560, 1038, 2574, 0, 0, 0, 0, 0
            DATA  2560, 1028, 2564, 1285, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 1285, 0, 0, 0, 0, 2570, 2314, 0
            DATA  0, 5, 0, 0, 0, 1280, 0, 2313, 9, 0
            DATA  0, 0, 0, 1280, 0, 265, 2305, 0, 0, 0
            DATA  0, 0, 5, 265, 264, 9, 0, 0, 0, 0
            DATA  5, 2304, 2049, 0, 0, 0, 0, 0, 1280, 0
          




  
            DATA  9, 0, 0, 0, 0, 0, 0, 0, 0, 0
          




              
          SPRITEPUT
            
           Syntax
            
            SPRITEPUT TransColor, X, Y, GfxBlk
            
           Input
            
            TransColor - index to color in current palette
            X, Y - top, left corner of block
            GfxBlk - predefined integer array containing the sprite
            
           Output
            
            no value returned
            
           Usage
            
            Spriteput is used in sprite graphics or animation to display
            a sprite or, more commonly, its background.  GfxBlk, a short
            integer array, contains the sprite which should have been
            previously defined by blkget or spritegap.  TransColor is
            the transparent color assumed in GfxBlk.  The top, left
            corner of the sprite's location is specified by X, Y.
            
           See Also
            
            BLKGET, BLKPUT, GETLASTSTRING, SPRITEGAP
            
           Example
              
            REM MOV A SPRITE ON A COMPLEX BACKGROUND
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
             
            DIM SPRITEDATA(0 TO 1040) AS INTEGER
            DIM SPRITEBKGND(0 TO 130) AS INTEGER
          
            IF WHICHCPU < 386 THEN
                PRINT "SORRY...386 REQUIRED"
                END
            END IF
            IF WHICHVGA = 0 THEN
                PRINT "SORRY...UNABLE TO ID VIDEO CARD"
                END
            END IF
            ORIGMODE = VIDEOMODEGET
            IF WHICHMEM < 512 THEN
                MAXX = 320
                MAXY = 200
                RES320
            ELSE
                MAXX = 640
                MAXY = 480
          




  
                RES640
            END IF
            
            FOR I = 0 TO 7
                FOR J = 0 TO 129
                    READ SPRITEDATA(I * 130 + J)
                NEXT J
            NEXT I
           
            MYPI! = ATN(1) * 4
            
            Colr = 16
            X1 = 0
            X2 = MAXX
            Y1 = 0
            Y2 = MAXY
            I = 0
            WHILE Y1 + I <= Y2 - I
                DRWBOX 1, Colr, X1 + I, Y1 + I, X2 - I, Y2 - I
                Colr = Colr + 1
                IF Colr > 255 THEN
                    Colr = 16
                END IF
                I = I + 1
            WEND
           
            CNTX = (MAXX \ 2) - 8
            CNTY = ((MAXY - 9) \ 2) - 8
            J = 0
           
            FOR DEG = 0 TO 360 STEP 2
                RAD! = (DEG * MYPI! / 180)
                X = CNTX + SIN(RAD!) * MAXY \ 4
                Y = CNTY + COS(RAD!) * MAXY \ 4
                SPRITEGAP 0, X, Y, SPRITEDATA(J), SPRITEBKGND(0)
                SDELAY 3
                SPRITEPUT 0, X, Y, SPRITEBKGND(0)
                J = J + 130
                IF J > 910 THEN
                    J = 0
                END IF
            NEXT DEG
            
            WHILE INKEY$ = ""
            WEND
          
            VIDEOMODESET ORGMODE
            END
          
          
            REM *SPRITE DATA
            DATA  15, 15, 0, 0, 0, 2304, 0, 0, 0, 0
            DATA  0, 0, 0, 265, 9, 0, 0, 0, 0, 0
            DATA  2304, 2305, 2305, 0, 0, 0, 0, 0, 0, 2304
            DATA  0, 0, 0, 0, 0, 0, 0, 2304, 0, 0
          




  
            DATA  0, 0, 0, 0, 0, 2570, 10, 0, 0, 0
            DATA  0, 0, 2560, 3588, 2564, 0, 0, 0, 0, 0
            DATA  2560, 1038, 2574, 0, 0, 0, 0, 0, 2560, 3588
            DATA  2564, 0, 0, 0, 0, 0, 1280, 2570, 1290, 0
            DATA  0, 0, 0, 0, 5, 2304, 0, 5, 0, 0
            DATA  0, 0, 5, 2304, 0, 5, 0, 0, 0, 1280
            DATA  0, 265, 9, 1280, 0, 0, 0, 1280, 2304, 2049
            DATA  2305, 1280, 0, 0, 0, 5, 2304, 2049, 2305, 0
            DATA  5, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 2313, 2313, 0, 0, 0
            DATA  0, 0, 0, 256, 2305, 0, 0, 0, 0, 0
            DATA  0, 2304, 2305, 0, 0, 0, 0, 0, 0, 9
            DATA  2304, 0, 0, 0, 0, 2570, 2314, 0, 0, 0
            DATA  0, 0, 2560, 1038, 2574, 0, 0, 0, 0, 1280
            DATA  2565, 1028, 2564, 0, 0, 0, 1280, 5, 2560, 1038
            DATA  2574, 0, 0, 0, 5, 0, 2304, 2570, 10, 0
            DATA  0, 0, 0, 2313, 9, 1280, 0, 0, 0, 0
            DATA  2304, 257, 9, 1280, 0, 0, 0, 0, 265, 264
            DATA  9, 5, 0, 0, 0, 0, 2048, 2305, 0, 5
            DATA  0, 0, 0, 0, 0, 9, 1280, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 5, 0
            DATA  0, 0, 0, 0, 0, 0, 1280, 5, 0, 0
            DATA  0, 0, 0, 0, 0, 1280, 5, 0, 0, 0
            DATA  0, 0, 2313, 0, 1280, 2570, 10, 0, 9, 0
            DATA  257, 9, 2560, 3588, 2564, 0, 2305, 0, 2056, 2305
            DATA  2569, 1038, 2574, 2313, 265, 9, 257, 9, 2560, 3588
            DATA  2564, 0, 2305, 0, 2313, 0, 1280, 2570, 10, 0
            DATA  9, 0, 0, 1280, 5, 0, 0, 0, 0, 0
            DATA  1280, 5, 0, 0, 0, 0, 0, 0, 5, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 9, 1280, 0, 0, 0, 0, 0
            DATA  2048, 2305, 0, 5, 0, 0, 0, 0, 265, 264
            DATA  9, 5, 0, 0, 0, 0, 2304, 257, 9, 1280
            DATA  0, 0, 0, 0, 0, 2313, 9, 1280, 0, 0
            DATA  0, 0, 5, 0, 2304, 2570, 10, 0, 0, 0
            DATA  1280, 5, 2560, 1038, 2574, 0, 0, 0, 0, 1280
            DATA  2565, 1028, 2564, 0, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 0, 0, 0, 0, 0, 2570, 2314, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 9, 2304, 0
            DATA  0, 0, 0, 0, 0, 2304, 2305, 0, 0, 0
            DATA  0, 0, 0, 256, 2305, 0, 0, 0, 0, 0
            DATA  0, 2313, 2313, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 5, 2304, 2049, 2305, 0, 5, 0
            DATA  0, 1280, 2304, 2049, 2305, 1280, 0, 0, 0, 1280
            DATA  0, 265, 9, 1280, 0, 0, 0, 0, 5, 2304
          




  
            DATA  0, 5, 0, 0, 0, 0, 5, 2304, 0, 5
            DATA  0, 0, 0, 0, 1280, 2570, 1290, 0, 0, 0
            DATA  0, 0, 2560, 3588, 2564, 0, 0, 0, 0, 0
            DATA  2560, 1038, 2574, 0, 0, 0, 0, 0, 2560, 3588
            DATA  2564, 0, 0, 0, 0, 0, 0, 2570, 10, 0
            DATA  0, 0, 0, 0, 0, 2304, 0, 0, 0, 0
            DATA  0, 0, 0, 2304, 0, 0, 0, 0, 0, 0
            DATA  2304, 2305, 2305, 0, 0, 0, 0, 0, 0, 265
            DATA  9, 0, 0, 0, 0, 0, 0, 2304, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 1280, 0, 9, 0
            DATA  0, 0, 0, 0, 5, 2304, 2049, 0, 0, 0
            DATA  0, 0, 5, 265, 264, 9, 0, 0, 0, 1280
            DATA  0, 265, 2305, 0, 0, 0, 0, 1280, 0, 2313
            DATA  9, 0, 0, 0, 0, 2570, 2314, 0, 0, 5
            DATA  0, 0, 2560, 1038, 2574, 0, 1285, 0, 0, 0
            DATA  2560, 1028, 2564, 1285, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 0, 0, 0, 0, 2304, 2570, 10, 0
            DATA  0, 0, 2304, 0, 9, 0, 0, 0, 0, 0
            DATA  2304, 2305, 0, 0, 0, 0, 0, 0, 2304, 257
            DATA  0, 0, 0, 0, 0, 0, 2304, 2313, 9, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 5, 0, 0, 0, 0
            DATA  0, 0, 1285, 0, 0, 0, 0, 0, 0, 1285
            DATA  0, 0, 0, 9, 0, 2570, 1290, 0, 2304, 9
            DATA  2304, 1, 2560, 3588, 2564, 0, 265, 1, 265, 2313
            DATA  2569, 1038, 2574, 2313, 2049, 8, 2304, 1, 2560, 3588
            DATA  2564, 0, 265, 1, 0, 9, 0, 2570, 1290, 0
            DATA  2304, 9, 0, 0, 0, 0, 0, 1285, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 1285, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 5, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  0, 0, 0, 0, 0, 0, 0, 0, 0, 0
          
            DATA  15, 15, 0, 0, 0, 0, 0, 0, 0, 0
            DATA  2304, 2313, 9, 0, 0, 0, 0, 0, 2304, 257
            DATA  0, 0, 0, 0, 0, 0, 2304, 2305, 0, 0
            DATA  0, 0, 0, 0, 2304, 0, 9, 0, 0, 0
            DATA  0, 0, 0, 0, 2304, 2570, 10, 0, 0, 0
            DATA  0, 0, 2560, 1038, 2574, 0, 0, 0, 0, 0
            DATA  2560, 1028, 2564, 1285, 0, 0, 0, 0, 2560, 1038
            DATA  2574, 0, 1285, 0, 0, 0, 0, 2570, 2314, 0
            DATA  0, 5, 0, 0, 0, 1280, 0, 2313, 9, 0
            DATA  0, 0, 0, 1280, 0, 265, 2305, 0, 0, 0
            DATA  0, 0, 5, 265, 264, 9, 0, 0, 0, 0
            DATA  5, 2304, 2049, 0, 0, 0, 0, 0, 1280, 0
            DATA  9, 0, 0, 0, 0, 0, 0, 0, 0, 0
          




              
          VIDEOMODEGET
            
           Syntax
            
            mode = VIDEOMODEGET
            
           Input
            
            no input parameters
            
           Output
            
            mode = the current video mode
            
           Usage
            
            Videomodeget returns the current video mode.  This function
            is best used to retrieve the video mode being used when a
            program begins.  When the program ends, this video mode can
            then be restored using videomodeset.
            
           See Also
            
            RES320, RES640, RES800, RES1024, RESTEXT, VIDEOMODESET
            
           Example
            
            REM SAVE THE VIDEO MODE,SWITCH TO 640X480X256, RESTORE THE
            ORIGINAL MODE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            DRWSTRING 1, 7, 0, "PRESS A KEY...", 0, 0
            WHILE I2NKEY$ = ""
            WEND
            
            VIDEOMODESET VMODE
            
            END
          




              
          VIDEOMODESET
            
           Syntax
            
            VIDEOMODESET Mode
            
           Input
            
            Mode = number of video mode
            
           Output
            
            no value returned
            
           Usage
            
            Videomodeset sets the video mode specified by Mode.  This
            function is best used at the end of a program to restore the
            video mode to the mode in use when the program began.  The
            program should retrieve the video mode at the beginning by
            using videomodeget.
            
           See Also
            
            RES320, RES640, RES800, RES1024, RESTEXT, VIDEOMODEGET
            
           Example
            
            REM SAVE THE VIDEO MODE,SWITCH TO 640X480X256, RESTORE THE
            ORIGINAL MODE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            VMODE = VIDEOMODEGET
            IF WHICHVGA = 0 THEN STOP
            IF WHICHMEM < 512 THEN STOP
            RES640
            
            DRWSTRING 1, 7, 0, "PRESS A KEY...", 0, 0
            WHILE I2NKEY$ = ""
            WEND
            
            VIDEOMODESET VMODE
            
            END
          




              
          VIDEOOFF
            
           Syntax
            
            VIDEOOFF
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Videooff turns the output display off.  Graphics may still
            be drawn to the screen.  However, the computer's monitor
            will display nothing and appear black.  This function can be
            used to hide graphics being drawn by initially using
            videooff and then later calling videoon.
            
           See Also
            
            VIDEOON
            
           Example
            
            REM DISABLE THE VIDEO FOR ABOUT 3 SEC
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            PRINT "PRESS A KEY TO DISABLE THE VIDEO DISPLAY FOR 3
            SECONDS"
            WHILE INKEY$ = ""
            WEND
            VIDEOOFF
            SDELAY 195
            VIDEOON
            PRINT "OK...WE ARE BACK!"
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          VIDEOON
            
           Syntax
            
            VIDEOON
            
           Input
            
            no input parameters
            
           Output
            
            no value returned
            
           Usage
            
            Videoon turns the display back on.  All graphics that were
            drawn while the display was off are now visible.  This
            function can be used to hide graphics being drawn by
            initially using videooff and then later calling videoon.
            
           See Also
            
            VIDEOOFF
            
           Example
            
            REM DISABLE THE VIDEO FOR ABOUT 3 SEC
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            PRINT "PRESS A KEY TO DISABLE THE VIDEO DISPLAY FOR 3
            SECONDS"
            WHILE INKEY$ = ""
            WEND
            VIDEOOFF
            SDELAY 195
            VIDEOON
            PRINT "OK...WE ARE BACK!"
            
            WHILE INKEY$ = ""
            WEND
            
            END
          




              
          WHICHCPU
            
           Syntax
            
            cpu = WHICHCPU
            
           Input
            
            no input parameters
            
           Output
            
            cpu = processor type
            
           Usage
            
            Whichcpu returns the computer's processor type as 86, 286,
            386 or 486.  This function should be called by any program
            using this library graphic's routines to insure that the
            computer is at least 386 compatible or better.
            
           See Also
            
            WHICHJOYSTICK, WHICHMOUSE, WHICHVGA
            
           Example
            
            REM FIND OUT WHAT KIND OF MICROPROCESSOR WE HAVE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            CPU = WHICHCPU
            CPU$ = STR$(CPU)
            L = LEN(CPU$)
            CPU$ = RIGHT$(CPU$, L - 1)
            PRINT "Microprocessor is identified as a 80"; CPU$; "."
            
            END
          




              
          WHICHJOYSTICK
            
           Syntax
            
            support = WHICHJOYSTICK
            
           Input
            
            no input parameters
            
           Output
            
            support = available joystick support
            
           Usage
            
            Whichjoystick returns the joystick support available on the
            computer.  This function should be called prior to use of
            the joysticks to verify that joysticks are available.  The
            joystick support is returned in the bits of support.  If the
            function returns a -1, there is no joystick port present or
            no BIOS support for a joystick.  Joystick A is bit 1 and B
            is bit 2.  Therefore, a value of 1 means joystick A is
            available, a value of 2 means B is available and a value of
            3 means both are available.  If no bits are set, there are
            no joysticks present.
            
           See Also
            
            WHICHCPU, WHICHMOUSE, WHICHVGA
            
           Example
            
            REM FIND OUT IF WE HAVE ANY JOYSTICKS AVAILABLE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            JOYSTICK = WHICHJOYSTICK
            SELECT CASE JOYSTICK
                CASE IS = -1
                    A$ = "No joystick port detected or no joystick BIOS
            support present."
                CASE IS = 0
                    A$ = "No joystick detected."
                CASE IS = 1
                    A$ = "Joystick A is present and available."
                CASE IS = 2
                    A$ = "Joystick B is present and available."
                CASE IS = 3
                A$ = "Both Joystick A and Joystick B are present and
            available."
            END SELECT
            PRINT A$
          




  
            
            END
          




              
          WHICHMEM
            
           Syntax
            
            mem = WHICHMEM
            
           Input
            
            no input parameters
            
           Output
            
            mem = installed video memory in kilobytes
            
           Usage
            
            Whichmem returns the amount of installed video memory as
            previously determined by whichvga.  Whichvga should be
            called prior to whichmem.  This function should be called
            prior to any of the res### functions to verify that there is
            enough memory to support the resolution.  If setcard was
            used to set the video card and memory, whichmem will return
            the amount of memory as defined by setcard.
            
           See Also
            
            RES320, RES640, RES800, RES1024, WHICHVGA
            
           Example
            
            REM FIND OUT HOW MUCH VIDEO MEMORY WE HAVE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            DUMMY = WHICHVGA
            PRINT "INSTALLED VIDEO MEMORY IS IDENTIFIED AS"; WHICHMEM;
            "k BYTES"
            
            END
          




              
          WHICHMOUSE
            
           Syntax
            
            mse = WHICHMOUSE
            
           Input
            
            no input parameters
            
           Output
            
            mse = number of buttons on mouse
            
           Usage
            
            Whichmouse returns a value indicating whether a Microsoft
            compatible mouse is available.  If mse is 0, no mouse is
            available.  A nonzero value indicates a mouse and Microsoft
            compatible driver is installed and gives the number of
            buttons available.
            
           See Also
            
            MOUSEINFO, WHICHCPU, WHICHJOYSTICK, WHICHVGA
            
           Example
            
            REM FIND OUT WHAT KIND OF MOUSE WE HAVE
            REM $INCLUDE: 'SVGAQB10.BI'
            DEFINT A-Z
            
            CLS
            MOUSE = WHICHMOUSE
            IF MOUSE > 0 THEN
                MOUSEINFO MJV, MNV, TP, I
                VER$ = STR$(MNV)
                L = LEN(VER$)
                VER$ = STR$(MJV) + "." + RIGHT$(VER$, L - 1)
                VER$ = "Software driver version is" + VER$
                VER$ = VER$ + " (Microsoft equalvalent version)."
                A$ = "Microsoft compatable mouse detected with"
                A$ = A$ + STR$(MOUSE) + " buttons on IRQ" + STR$(I) +
            "."
                PRINT A$
                PRINT VER$
            ELSE
                PRINT "No Microsoft compatable mouse detected."
            END IF
            
            END
          




              
          WHICHVGA
            
           Syntax
            
            chip = WHICHVGA
            
           Input
            
            no input parameters
            
           Output
            
            chip = code indentifying video card
            
           Usage
            
            Whichvga identifies the video card installed and the amount
            of video memory.  In addition this function sets up the
            default font and mouse cursor.  This function must be called
            before any other graphics function.  The code returned
            identifies the video card according to the following table:
            
            1 Acumos SuperVGA
            2 ATI Technologies SuperVGA
            3 Ahead V5000 ver A SuperVGA
            4 Ahead V5000 ver B SuperVGA
            5 Chips and Technologies SuperVGA
            6 Cirrus Logic CL-GD 500/600 SuperVGA
            7 Everex Micro Enhancer SuperVGA
            8 Genoa SuperVGA
            9 NCR 77C22E SuperVGA
            10 Oak Technologies OTI-067/037C SuperVGA
            11 Paridise/Western Digital SuperVGA
            12 (intentionally omitted)
            13 Trident 8800/8900 SuperVGA
            14 Tseng Labs 3000 SuperVGA
            15 Tseng Labs 4000 SuperVGA
            16 VESA compatable SuperVGA
            17 Video 7 SuperVGA
            
            Any value returned not found on this table represents an
            unidentified video card.  No graphics functions should be
            called unless the video card is properly identified.
            
           See Also
            
            SETCARD, WHICHCPU, WHICHJOYSTICK, WHICHMOUSE, WHICHMEM
            
           Example
            
            REM FIND OUT WHAT KIND OF VIDEO CARD WE HAVE
            DEFINT A-Z
            
            CLS
          




  
            VGA = WHICHVGA
            SELECT CASE VGA
                CASE IS = 1
                    VGA$ = "Acumos SuperVGA"
                CASE IS = 2
                    VGA$ = "ATI Technologies SuperVGA"
                CASE IS = 3
                    VGA$ = "Ahead V5000 ver A SuperVGA"
                CASE IS = 4
                    VGA$ = "Ahead V5000 ver B SuperVGA"
                CASE IS = 5
                    VGA$ = "Chips and Technologies SuperVGA"
                CASE IS = 6
                    VGA$ = "Cirrus Logic CL-GD 500/600 SuperVGA"
                CASE IS = 7
                    VGA$ = "Everex Micro Enhancer SuperVGA"
                CASE IS = 8
                    VGA$ = "Genoa SuperVGA"
                CASE IS = 9
                    VGA$ = "NCR 77C22E SuperVGA"
                CASE IS = 10
                    VGA$ = "Oak Technologies OTI-067/037C SuperVGA"
                CASE IS = 11
                    VGA$ = "Paridise/Western Digital SuperVGA"
                CASE IS = 13
                    VGA$ = "Trident 8800/8900 SuperVGA"
                CASE IS = 14
                    VGA$ = "Tseng Labs 3000 SuperVGA"
                CASE IS = 15
                    VGA$ = "Tseng Labs 4000 SuperVGA"
                CASE IS = 16
                    VGA$ = "VESA compatable SuperVGA"
                CASE IS = 17
                    VGA$ = "Video 7 SuperVGA"
                CASE ELSE
                    VGA$ = "Unidentified"
                    VGA = 0
            END SELECT
            PRINT "Video card/chip is identified as a "; VGA$; "."
            
            END
          




              
          APPENDIX  SVGAQB10.BI
          
          This is the header file containing function declarations and
          structure definitions for SVGAQB10.LIB.  This file should be
          included in every program that uses this library.  To properly
          include the header file, place the following line at the top
          of the every program module:
          
                            REM $INCLUDE: 'SVGAQB10.BI'
          
          Without these declarations and definitions, the QuickBasic
          compiler will be unable to compile any program using the
          commands found in this library.
          
          REM SVGAQB10 GRAPHICS LIBRARY INCLUDE FILE FOR MS QuickBasic
          REM COPYRIGHT 1993 BY STEPHEN L. BALKUM AND DANIEL A. SILL
          REM ZEPHYR SOFTWARE, P.O. BOX 7704, AUSTIN, TEXAS  78713-7704
          REM LAST UPDATE 5/11/93
          
          DECLARE SUB BLKGET (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%, SEG GFXBLK%)
          DECLARE SUB BLKPUT (BYVAL Mode%, BYVAL X%, BYVAL Y%, SEG
            GFXBLK%)
          DECLARE SUB D2ROTATE (BYVAL Points%, BYVAL XOrigin%, BYVAL
            YOrigin%, BYVAL ANG%, SEG InAry%, SEG OutAry%)
          DECLARE SUB D2SCALE (BYVAL Points%, BYVAL XSCALE%, BYVAL
            YSCALE%, SEG InAry%, SEG OutAry%)
          DECLARE SUB D2TRANSLATE (BYVAL Points%, BYVAL XTRANS%, BYVAL
            YTRANS%, SEG InAry%, SEG OutAry%)
          DECLARE FUNCTION D3PROJECT% (BYVAL Points%, SEG ProjParms%,
            SEG InAry%, SEG OutAry%)
          DECLARE SUB D3ROTATE (BYVAL Points%, BYVAL XOrigin%, BYVAL
            YOrigin%, BYVAL ZOrigin%, BYVAL ZRAng%, BYVAL YRAng%, BYVAL
            XRAng%, SEG InAry%, SEG OutAry%)
          DECLARE SUB D3SCALE (BYVAL Points%, BYVAL XSCALE%, BYVAL
            YSCALE%, BYVAL ZScale%, SEG InAry%, SEG OutAry%)
          DECLARE SUB D3TRANSLATE (BYVAL Points%, BYVAL XTRANS%, BYVAL
            YTRANS%, BYVAL ZTrans%, SEG InAry%, SEG OutAry%)
          DECLARE SUB DRWBOX (BYVAL Mode%, BYVAL Colr%, BYVAL X1%, BYVAL
            Y1%, BYVAL X2%, BYVAL Y2%)
          DECLARE SUB DRWCIRCLE (BYVAL Mode%, BYVAL Colr%, BYVAL
            CenterX%, BYVAL CenterY%, BYVAL Radius%)
          DECLARE SUB DRWELLIPSE (BYVAL Mode%, BYVAL Colr%, BYVAL
            CenterX%, BYVAL CenterY%, BYVAL Radiusx%, BYVAL Radiusy%)
          DECLARE SUB DRWLINE (BYVAL Mode%, BYVAL Colr%, BYVAL X1%,
            BYVAL Y1%, BYVAL X2%, BYVAL Y2%)
          DECLARE SUB DRWPOINT (BYVAL Mode%, BYVAL Colr%, BYVAL X%,
            BYVAL Y%)
          DECLARE SUB DRWSTRING (BYVAL Mode%, BYVAL FColr%, BYVAL
            BColr%, Strng$, BYVAL X%, BYVAL Y%)
          DECLARE SUB DRWSTRINGDN (BYVAL Mode%, BYVAL FColr%, BYVAL
            BColr%, Strng$, BYVAL X%, BYVAL Y%)
          DECLARE SUB DRWSTRINGLT (BYVAL Mode%, BYVAL FColr%, BYVAL
            BColr%, Strng$, BYVAL X%, BYVAL Y%)
          




  
          DECLARE SUB DRWSTRINGRT (BYVAL Mode%, BYVAL FColr%, BYVAL
            BColr%, Strng$, BYVAL X%, BYVAL Y%)
          DECLARE SUB FILLAREA (BYVAL Xseed%, BYVAL Yseed%, BYVAL
            BorderColr%, BYVAL FillColr%)
          DECLARE SUB FILLCOLOR (BYVAL Xseed%, BYVAL Yseed%, BYVAL
            OldColr%, BYVAL NewColr%)
          DECLARE SUB FILLSCREEN (BYVAL Colr%)
          DECLARE SUB FILLVIEW (BYVAL Colr%)
          DECLARE SUB FONTGETINFO (WDTH%, HGHT%)
          DECLARE SUB FONTSET (FONT$)
          DECLARE SUB FONTSYSTEM ()
          DECLARE SUB GETLASTSTRING (SEG StrngGfxBlk%)
          DECLARE FUNCTION GETPOINT% (BYVAL X%, BYVAL Y%)
          DECLARE FUNCTION GIFGETINFO% (Name$, GifXSize%, GifYSize%,
            NumColors%, PAL$)
          DECLARE FUNCTION GIFPUT% (BYVAL Mode%, BYVAL Xloc%, BYVAL
            Yloc%, Name$)
          DECLARE SUB JOYSTICKINFO (JAX%, JAY%, JAButs%, JBX%, JBY%,
            JBButs%)
          DECLARE SUB MOUSEBUTPRESS (ReqBut%, Xloc%, Yloc%, Num%,
            Mbuts%)
          DECLARE SUB MOUSEBUTRELEASE (ReqBut%, Xloc%, Yloc%, Num%,
            Mbuts%)
          DECLARE SUB MOUSECURSORDEFAULT ()
          DECLARE SUB MOUSECURSORSET (MouseCursor$)
          DECLARE SUB MOUSEENTER ()
          DECLARE SUB MOUSEEXIT ()
          DECLARE SUB MOUSEHIDE ()
          DECLARE SUB MOUSEINFO (DrvMajorVer%, DrvMinorVer%, MouseType%,
            IRQnumber%)
          DECLARE SUB MOUSELOCSET (BYVAL Xloc%, BYVAL Yloc%)
          DECLARE SUB MOUSERANGESET (BYVAL X1%, BYVAL Y1%, BYVAL X2%,
            BYVAL Y2%)
          DECLARE SUB MOUSERESTORESTATE (SEG MouseBuf%)
          DECLARE SUB MOUSESAVESTATE (SEG MouseBuf%)
          DECLARE SUB MOUSESENSSET (BYVAL Xsens%, BYVAL Ysens%)
          DECLARE SUB MOUSESHOW ()
          DECLARE SUB MOUSESTATUS (X%, Y%, MButs%)
          DECLARE FUNCTION MOUSESTORAGESIZE% ()
          DECLARE SUB OVERSCANSET (BYVAL Colr%)
          DECLARE SUB PALCHGAUTO (PalString$, NewPalString$, BYVAL
            FirstColr%, BYVAL LastColr%, BYVAL Speed%)
          DECLARE SUB PALCHGSTEP (PalString$, NewPalString$, BYVAL
            FirstColr%, BYVAL LastColr%, BYVAL Percent%)
          DECLARE SUB PALDIMSTEP (PalString$, BYVAL FirstColr%, BYVAL
            LastColr%, BYVAL Percent%)
          DECLARE SUB PALGET (PalString$, BYVAL FirstColr%, BYVAL
            LastColr%)
          DECLARE SUB PALIOAUTO (PalString$, BYVAL FirstColr%, BYVAL
            LastColr%, BYVAL Speed%)
          DECLARE SUB PALROTATE (PalString$, BYVAL FirstColr%, BYVAL
            LastColr%, BYVAL Shift%)
          DECLARE SUB PALSET (PalString$, BYVAL FirstColr%, BYVAL
            LastColr%)
          DECLARE SUB RES320 ()
          




  
          DECLARE SUB RES640 ()
          DECLARE SUB RES800 ()
          DECLARE SUB RES1024 ()
          DECLARE SUB RESTEXT ()
          DECLARE SUB SCROLLDN (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%, BYVAL NUM%, BYVAL Colr%)
          DECLARE SUB SCROLLLT (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%, BYVAL NUM%, BYVAL Colr%)
          DECLARE SUB SCROLLRT (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%, BYVAL NUM%, BYVAL Colr%)
          DECLARE SUB SCROLLUP (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%, BYVAL NUM%, BYVAL Colr%)
          DECLARE SUB SDELAY (BYVAL Count%)
          DECLARE SUB SETCARD (BYVAL CHIP%, BYVAL MEM%)
          DECLARE SUB SETVIEW (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
            Y2%)
          DECLARE SUB SPRITEGET (BYVAL TransColr%, BYVAL X%, BYVAL Y%,
            SEG SPRITEGFXBLK%, SEG BKGNDGFXBLK%)
          DECLARE SUB SPRITEPUT (BYVAL TransColr%, BYVAL X%, BYVAL Y%,
            SEG SPRITEGFXBLK%)
          DECLARE FUNCTION VIDEOMODEGET% ()
          DECLARE SUB VIDEOMODESET (BYVAL Mode%)
          DECLARE SUB VIDEOOFF ()
          DECLARE SUB VIDEOON ()
          DECLARE FUNCTION WHICHCPU% ()
          DECLARE FUNCTION WHICHJOYSTICK% ()
          DECLARE FUNCTION WHICHMEM% ()
          DECLARE FUNCTION WHICHMOUSE% ()
          DECLARE FUNCTION WHICHVGA% ()
          
          TYPE P2DType
            X AS INTEGER
            Y AS INTEGER
          END TYPE
          
          TYPE P3Dtype
            X AS INTEGER
            Y AS INTEGER
            Z AS INTEGER
          END TYPE
          
          TYPE PROJType
            EYEX AS INTEGER
            EYEY AS INTEGER
            EYEZ AS INTEGER
            SCRD AS INTEGER
            THETA AS INTEGER
            PHI AS INTEGER
          END TYPE
          
          
