home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 18
/
CD_ASCQ_18_111294_W.iso
/
dos
/
prg
/
pas
/
pscrn55
/
basic.exe
/
DEMOSCR2.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-10-09
|
6KB
|
146 lines
DEFINT A-Z
'$INCLUDE: 'PScreen.Inc' '... Declare functions in PScreen.Obj
' For Microsoft Basics only.
'===================================================
' POWERBASIC USERS: 'un-REM the next few lines
'===================================================
''$INCLUDE "PScreen.Inc" '...declare routines
''$Link "Demo.Obj" '...link 3 "callable" screens
''$Link "Brite.Obj" '...link a "bright background" callable screen
''$Link "PScreen.Obj" '...essential "screen restore" routines
'===================================================
' END: POWERBASIC USERS
'===================================================
'***************************************************************************
'
' DemoScr2.Bas P-Screen Demo -- Copyright 1994, Rob W. Smetana
'
' QB/PDS/VB-DOS Users: To run this you must first create a Quick Library
' containing: PScreen.Obj and Demo.Obj
'
' Note: In shareware versions, the "re-color" demo(s)
' do NOTHING. But please review them to see how
' easily you can re-color screens on-the-fly.
'
' Purpose: This **extremely simply** demo shows how easily
' you can:
'
' 1. Call P-Screen's ASM/OBJ screens (e.g., FROG () ;).
'
' 2. Display bright background screens -- IF you
' have a CGA, EGA, VGA or compatible monitor !!!
'
' 3. Re-color "callable" screens -- if you detect
' your users have mono/Hercules screens on
' which bright background colors would blink.
'
' Requires: Demo.Obj 3 "callable" ASM/OBJ screens
' Brite.Obj A "bright background" callable screen
'
' PScreen.Obj with functions:
'
' psBrightBG ASM function to toggle bright
' backgrounds on/off.
'
' psRecolor To re-color screens on-the-fly.
'
'***************************************************************************
DECLARE SUB Falcon () '... declare our "callable screens"
DECLARE SUB Frog ()
DECLARE SUB Frog2 ()
DECLARE SUB Brite ()
DECLARE FUNCTION BriteSegAddr& () '... memory-locate functions letting
DECLARE FUNCTION BriteNUMELS% () ' us re-color our BRIGHTBG screen!
DECLARE SUB Pause (ticks%) '... pause for # of timer ticks you specify
'***************************************************************************
COLOR 7,1:Cls
Call psInitialize:Cls '...for SHAREWARE versions ONLY
CALL Falcon: CALL Pause(30)
FOR n = 1 TO 3
CALL Frog: CALL Pause(20)
CALL Frog2: CALL Pause(5) '... slurp!
NEXT
CALL Frog: CALL Pause(10)
CALL Brite '... this screen will blink -- since we have NOT
'... turned bright bg ON yet; but we will...
CALL Pause(40)
CALL psBrightBG(-1) '... turn blinking into bright bg -- IF you have
'... a CGA, EGA, VGA or compatible monitor
CALL Pause(40)
'... Now RE-COLOR bright background/blinking colors -- as you might in your
' programs if you detect your users have mono or Hercules monitors.
' In shareware versions, the "re-color" demo(s) will DO NOTHING.
' But review this to see how easily you can re-color screens on-the-fly.
'
' * Each call to psRecolor below changes one color to another. Our
' bright-background screen has several bright colors we need to change.
'
' * The 1st number (e.g., 200) is the # of the color we want to change.
' The 2nd number (e.g., 79) is the # of the color we want now.
' Both Ruler.Exe and P-Screen can help you determine these numbers.
'
'... 1st # = color to change; 2nd # = color we want #1 changed to.
'... Locate our bright background screen in memory, and get its size.
SegAddr& = BriteSegAddr&: NumIntegers = BriteNUMELS%
CALL psRecolor(SegAddr&, NumIntegers%, 200, 79)
CALL psRecolor(SegAddr&, NumIntegers%, 134, 64)
CALL psRecolor(SegAddr&, NumIntegers%, 131, 14)
CALL psRecolor(SegAddr&, NumIntegers%, 192, 49)
CALL psRecolor(SegAddr&, NumIntegers%, 211, 80)
CALL psRecolor(SegAddr&, NumIntegers%, 224, 30)
CALL Brite '... display it again -- with colors re-mapped!
CALL Pause(20)
'... RESTORE our bright background colors -- reverse what we did above.
'... In shareware versions, "re-color" does NOTHING. But review
' this to see how easily you can re-color screens on-the-fly.
'... Locate our bright background screen in memory, and get its size.
SegAddr& = BriteSegAddr&: NumIntegers = BriteNUMELS%
CALL psRecolor(SegAddr&, NumIntegers%, 79, 200)
CALL psRecolor(SegAddr&, NumIntegers%, 64, 134)
CALL psRecolor(SegAddr&, NumIntegers%, 14, 131)
CALL psRecolor(SegAddr&, NumIntegers%, 49, 192)
CALL psRecolor(SegAddr&, NumIntegers%, 80, 211)
CALL psRecolor(SegAddr&, NumIntegers%, 30, 224)
CALL Brite '... display it again -- with colors re-mapped!
CALL Pause(40)
CALL psBrightBG(0) '... return to normal
CALL Pause(20)
'
SUB Pause (ticks%) '...pause for the # of timer ticks you specify
DEF SEG = 0
DO UNTIL TestTick% > ticks%
LastTick% = GetTick%: GetTick% = PEEK(&H46C)
IF LastTick% <> GetTick% THEN TestTick% = TestTick% + 1
LOOP
DEF SEG
END SUB