'>>> Page 8 of CODE0498.FAQ begins here.
Exist% = ORegsX.ax = 0 'if ax contains a value,
'remove the null byte
FileName$ = LEFT$(FileName$, LEN(FileName$) - 1)
END FUNCTION
[end]
8) HOW DO I PERFORM A COLD/WARM BOOT THROUGH QB?
Cold boot:
OUT &H64, &HFE
Warm boot:
DEF SEG = &HFFFF
CALL ABSOLUTE(0)
9) HOW CAN I PRINT TEXT IN A GRAPHICS MODE WITHOUT DESTROYING
THE BACKGROUND?
The problem with PRINTing text on top of graphics is that
QB blacks out the entire character box for each character
you print. That means that the graphics underneath your
new text are just erased from the screen. Not good, in some
cases. The following routine by Douglas Lusher is a very good
substitute for the PRINT command, as it offers styles for two
different graphics modes. Just "comment-out" the statements
for the mode you don't want to use, and "un-comment" those that
you do want to use. Note: if you use the style for VGA
modes, you must load QB with the /L switch.
[begin]
SUB GPrint (X%, Y%, Text$, Culler%)
'this routine allows printing text at any pixel location
' in the graphics modes without disturbing the background
'by Douglas H. Lusher, 06-08-1996
' 8 x 8 char box, CGA
CharSegment% = &HFFA6: CharOffset% = &HE
CharWid% = 8: CharHgt% = 8
' 8 x 16 char box, VGA
'DIM Register AS RegTypeX
'Register.AX = &H1130
'Register.BX = &H600
'CALL InterruptX(&H10, Register, Register)
'CharSegment% = Register.ES: CharOffset% = Register.BP
'CharWid% = 8: CharHgt% = 16
DEF SEG = CharSegment%
XX% = X%
FOR Char% = 1 TO LEN(Text$)
Ptr% = CharHgt% * ASC(MID$(Text$, Char%, 1)) + CharOffset%
FOR Ln% = 0 TO CharHgt% - 1
BitPattern& = PEEK(Ptr% + Ln%) * 256&
LineFormat% = (BitPattern& - 32768) XOR -32768
LINE (XX%, Y% + Ln%)-STEP(CharWid% - 1, 0), Culler%_
, , LineFormat%
NEXT
XX% = XX% + CharWid%
NEXT
DEF SEG
END SUB
[end]
10) HOW CAN I ANIMATE SPRITES IN QB?
First thing, what's a sprite? Basically, it's a rectangle box
that has a picture in it. In something like cartoon animation,
they would be referred to as frames. So when you're animating
in QB, you're essentially doing the same thing that you would do
if you were to create a cartoon, just on a smaller scale.
So how do you create sprites? QB has a variety of graphics
functions (DRAW, LINE, CIRCLE, PSET, etc.) at your disposal.
They are quite cumbersome to use, so you might find it difficult
to get started. You may want to keep your eyes open for a QB
graphics editor; there are probably a lot of them.
Coincidentally (?), Dave Shea has written a graphics program
for QB:
'>>> Page 8 of CODE0498.FAQ ends here. Continued on next page.
___
* SLMR 2.0 * "640K ought to be enough..." -- Bill Gates, 1984
--- Maximus/2 3.01
---------------
* Origin: The I.O. Board - 4GB -XX- V34+ (1:2255/10)
|