TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: ALL
from: ROBERT KOHL
date: 1998-05-13 21:37:00
subject: CodeFAQ Part 10 of 11

---------------------------- CodeFAQ Part 10 of 11 --------------
    IF b = 3 THEN PUT (a, 100), Guy3%
    IF b = 4 THEN PUT (a, 100), Guy4%
   NEXT                                   'Loop!
[end]
11) CAN I USE VESA SCREEN MODES IN QB?
   Most definitely.  The problem is not in getting INTO these
   screen modes; it's what you can actually DO when you're there.
   Once you have overstepped QB's regular screen modes, you can't
   use the built in graphics functions, so you have to write your
   own.  And that's where the fun part comes in.  Sticking a pixel
   on the screen is the main problem, as using INTERRUPTs seems to
   be the only standard way to do it so far, and INTERRUPT pixel-
   plotting is ridiculously slow.  But since that seems to be the
   only universally-working method, here's code for it.  Code by
   Dave Shea.
[begin]
   ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   ' SVGA.BAS  by  Dave Shea
   ' Released to Public Domain on January 18th, 1997
   '
   ' Compile: MicroSoft QuickBasic 4.5, PDS 7.1
   '
   ' Desc: Beginnings of a QB SVGA library. Allows you to change
   '       screen mode to 640x400x256, 640x480x256, 800x600x256,
   '       1024x768x256 etc. Pixel routine is incredibly slow,
   '       unfortunatly.
   '
   ' (Use at your own risk)
   ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   DECLARE SUB Pixel (x%, y%, Col%)
   DECLARE SUB ScreenMode (SM%)
   ' $INCLUDE: 'qb.bi'                            'Required to use
   DIM SHARED InReg AS RegType, OutReg AS RegType 'CALL INTERRUPT
   DEFINT A-Z                   'Defines all variables as Integers
   ScreenMode &H101             'Call sub ScreenMode
   FOR a = 1 TO 640             'Begins "a" FOR-NEXT Loop
    Col = Col + 1               'Increases variable Col
    IF Col = 256 THEN Col = 1   'If Col is bigger than 256,
                                'then set it to 1
    FOR b = 1 TO 480            'Begins "b" FOR-NEXT Loop
     Pixel a, b, Col            'Call sub Pixel
    NEXT                        'Ends "b" FOR-NEXT Loop
   NEXT                         'Ends "a" FOR-NEXT Loop
   SLEEP 1                      'Waits for 1 second or user input
   ScreenMode 3                 'Return to text mode
   END                          'La fin!
   SUB Pixel (x, y, Col)
    InReg.Ax = &HC00 + Col             'Sticks your color into AX
    InReg.Cx = x                       'Sticks x value in CX
    InReg.Dx = y                       'Sticks y value in DX
    CALL INTERRUPT(&H10, InReg, OutReg)'Calls Int 10h, which places
                                       'a pixel at (x, y) with an
                                       'attribute of Col
   END SUB
   SUB ScreenMode (SM)
    'SM (ScreenMode) may be any one of the following:
    '3 = Text Mode
    '&H100 = 640x400x256
    '&H101 = 640x480x256
    '&H102 = 800x600x16
    '&H103 = 800x600x256
    '&H104 = 1024x768x16
    '&H105 = 1024x768x256
    InReg.Ax = &H4F02                      'Sticks 4F02h in AX
    InReg.Bx = SM                          'Sticks ScreenMode in BX
    CALL INTERRUPT(&H10, InReg, OutReg)    'Using InRegisters,
                                           'calls Int 10h and
                                           'sticks output (none in
                                           'this case) into
                                           'OutRegisters
   END SUB
[end]
-------------- CodeFAQ ends Part 10 of 11 -----------------------
Robert (Bob) Kohl  Rio Rancho, New Mexico
Home Page:  http://www.geocities.com/SiliconValley/Way/7854
            http://members.tripod.com/~Bob_Kohl/index.html
Internet: bobakohl@abq.com  bobakohl1@juno.com  barbarianh@aol.com
--- Blue Wave/DOS v2.30
(1:301/45)
---------------
* Origin: * Binary illusions BBS * Albuquerque, NM * 505.897.8282 *

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.