home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 18
/
CD_ASCQ_18_111294_W.iso
/
dos
/
prg
/
pas
/
pscrn55
/
pascal.exe
/
DEMOSCR2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-10-09
|
5KB
|
135 lines
(***************************************************************************
DemoScr2.Pas P-Screen Demo -- Copyright 1994, Rob W. Smetana
Note: Turn screen-swapping on if appropriate.
Always declare our ASM procedures FAR (see below)!
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.
NOTE: Because re-color alters memory, you
MUST be careful using this function!
Requires: Demo.Obj Contains 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.
***************************************************************************)
uses Crt, PScreen; { Crt needed only for delay }
{ Unit P-Screen.Pas declares our functions }
{$F+} { ALWAYS declare our ASM procedures FAR !!! }
{ "callable" ASM/OBJ screens }
procedure Falcon; external; { a falcon }
procedure Frog; external; { a frog }
procedure Frog2; external; { some frog parts }
{$L Demo.OBJ}
procedure Brite; external; { a bright background screen }
function BriteSEGADDR: Pointer; external; { memory-locate functions to }
function BriteNUMELS: Integer; external; { let us re-color screens! }
{$L Brite.OBJ}
{$F-}
Var
N : Integer;
segaddr : Pointer;
numintegers : Integer;
Begin
TextAttr := 23; ClrScr;
Falcon; delay (1500);
for n := 1 to 3 do
Begin
Frog; delay (1200);
Frog2; delay (200);
end;
Frog; delay (1000);
Brite; { this screen will blink -- since we have NOT }
{ turned bright bg ON yet; but we will... }
delay (4000);
psBrightBG (-1); { turn blinking into bright bg -- IF you have }
{ a CGA, EGA, VGA or compatible monitor }
delay (2000);
{
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) 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.
Use Ruler.Exe or P-Screen to 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;
psRecolor (segaddr, numintegers, 200 , 79);
psRecolor (segaddr, numintegers, 134 , 64);
psRecolor (segaddr, numintegers, 131 , 14);
psRecolor (segaddr, numintegers, 192 , 49);
psRecolor (segaddr, numintegers, 211 , 80);
psRecolor (segaddr, numintegers, 224 , 30);
Brite; { display it again, this time with colors re-mapped! }
delay (2000);
{
RESTORE our bright background colors -- reversing what we did above.
In shareware versions, the "re-color" demo(s) do nothing. But
review this to see how easily you can re-color screens on-the-fly.
}
psRecolor (segaddr, numintegers, 79, 200 );
psRecolor (segaddr, numintegers, 64, 134 );
psRecolor (segaddr, numintegers, 14, 131 );
psRecolor (segaddr, numintegers, 49, 192 );
psRecolor (segaddr, numintegers, 80, 211 );
psRecolor (segaddr, numintegers, 30, 224 );
Brite; { display it to show re-color took }
delay (2000);
psBrightBG (0); { return to normal }
delay (4000);
ClrScr;
end.