'>>> Page 10 of CODE0398.FAQ begins here.
' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' RUN.BAS by Dave Shea
' Released to Public Domain on January 18th, 1997.
'
' Compile: MicroSoft QuickBasic 4.5, PDS 7.1
'
' Desc: A simple animation. Demonstrates some techniques behind
' animating in QB.
'
' (Use at your own risk)
' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CLS : SCREEN 13 'Set Screen 13, of course!
PSET (25, 71), 31: DRAW "rdld2l2ngr3fnehld3rfrdngulhlg2lh"
PSET (45, 71), 31: DRAW "rdld2lgnder2dnr2ld2rfdnguhld2lg"
PSET (65, 71), 31: DRAW "rdld2ldrnednrddrfndhldlg"
PSET (85, 71), 31: DRAW "rdld2lgnderdnr2d2rfdnguhlgdl2"
'The above will draw four
'different frames of a Stick man
'running.
DIM Guy1%(134), Guy2%(134), Guy3%(134), Guy4%(134)
'Set aside the memory required for
'each frame.
GET (16, 69)-(34, 82), Guy1% 'Stick each frame into memory
GET (36, 69)-(54, 82), Guy2% '(X and Y values calculated by
GET (56, 69)-(74, 82), Guy3% ' pure trial and error. =u)
GET (76, 69)-(94, 82), Guy4%
CLS 'Guess what THIS does!
FOR a = 1 TO 300 STEP 2 'Begin Loop
b = b + 1: IF b = 5 THEN b = 1 'Increase b until it
'reaches a value of 5,
'reset it to 1
IF b = 1 THEN PUT (a, 100), Guy1% 'Determine which frame to
IF b = 2 THEN PUT (a, 100), Guy2% 'PUT, then PUT it.
IF b = 3 THEN PUT (a, 100), Guy3%
IF b = 4 THEN PUT (a, 100), Guy4%
WAIT 986, 8 'Wait for Vertical
'Retrace
Start = TIMER 'Small delay loop to slow
WHILE TIMER < Start + .1: WEND 'it down a bit.
IF b = 1 THEN PUT (a, 100), Guy1% 'Erase current frame by
IF b = 2 THEN PUT (a, 100), Guy2% 'PUTting it again.
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,
'>>> Page 10 of CODE0398.FAQ ends here. Continued on next page.
___
* SLMR 2.0 * hAS ANYONE SEEN MY CAPS LOCK KEY?
--- Maximus/2 3.01
---------------
* Origin: The I.O. Board - 4GB -XX- V34+ (1:2255/10)
|