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 >
Pascal/Delphi Source File  |  1994-10-09  |  5KB  |  135 lines

  1. (***************************************************************************
  2.  
  3.     DemoScr2.Pas        P-Screen Demo -- Copyright 1994, Rob W. Smetana
  4.  
  5.     Note:               Turn screen-swapping on if appropriate.
  6.  
  7.                         Always declare our ASM procedures FAR (see below)!
  8.  
  9.                         In shareware versions, the "re-color" demo(s)
  10.                         do nothing.  But please review them to see
  11.                         how easily you can re-color screens on-the-fly.
  12.  
  13.     Purpose:            This **extremely simply** demo shows how easily
  14.                         you can:
  15.  
  16.                         1.  Call P-Screen's ASM/OBJ screens (e.g., FROG () ;).
  17.  
  18.                         2.  Display bright background screens -- IF you
  19.                             have a CGA, EGA, VGA or compatible monitor !!!
  20.  
  21.                         3.  Re-color "callable" screens -- if you detect
  22.                             your users have mono/Hercules screens on
  23.                             which bright background colors would blink.
  24.  
  25.                             NOTE:  Because re-color alters memory, you
  26.                             MUST be careful using this function!
  27.  
  28.     Requires:           Demo.Obj        Contains 3 "callable"
  29.                                         ASM/OBJ screens
  30.  
  31.                         Brite.Obj       A "bright background" callable screen
  32.  
  33.                         PScreen.Obj with functions:
  34.  
  35.                           PSBrightBG      ASM function to toggle bright
  36.                                           backgrounds on/off.
  37.  
  38.                           PSRECOLOR       To re-color screens on-the-fly.
  39.  
  40. ***************************************************************************)
  41. uses Crt, PScreen;                           { Crt needed only for delay }
  42.                               { Unit P-Screen.Pas declares our functions }
  43.  
  44. {$F+}    { ALWAYS declare our ASM procedures FAR !!! }
  45.                                     { "callable" ASM/OBJ screens          }
  46. procedure Falcon; external;         { a falcon                            }
  47. procedure Frog;   external;         { a frog                              }
  48. procedure Frog2;  external;         { some frog parts                     }
  49. {$L Demo.OBJ}
  50.  
  51. procedure Brite;  external;         { a bright background screen          }
  52. function BriteSEGADDR: Pointer; external;  { memory-locate functions to   }
  53. function BriteNUMELS: Integer;  external;  { let us re-color screens!     }
  54. {$L Brite.OBJ}
  55.  
  56. {$F-}
  57.  
  58. Var
  59.   N : Integer;
  60.   segaddr : Pointer;
  61.   numintegers : Integer;
  62.  
  63. Begin
  64.  
  65.    TextAttr := 23; ClrScr;
  66.  
  67.    Falcon;  delay (1500);
  68.  
  69.    for n := 1 to 3 do
  70.        Begin
  71.         Frog;  delay (1200);
  72.         Frog2; delay (200);
  73.        end;
  74.  
  75.    Frog; delay (1000);
  76.  
  77.    Brite;                   { this screen will blink -- since we have NOT }
  78.                             { turned bright bg ON yet; but we will...     }
  79.    delay (4000);
  80.  
  81.    psBrightBG (-1);         { turn blinking into bright bg -- IF you have }
  82.                             { a CGA, EGA, VGA or compatible monitor       }
  83.    delay (2000);
  84.  
  85.    {
  86.       Now RE-COLOR bright background/blinking colors -- as you might in your
  87.       programs if you detect your users have mono or Hercules monitors.
  88.  
  89.       In shareware versions, the "re-color" demo(s) do nothing.  But
  90.       review this to see how easily you can re-color screens on-the-fly.
  91.  
  92.       * Each call to psRecolor below changes one color to another.  Our
  93.         bright-background screen has several bright colors we need to change.
  94.  
  95.       * The 1st number (e.g., 200) is the # of the color we want to change.
  96.         The 2nd number (e.g., 79) is the # of the color we want now.
  97.         Use Ruler.Exe or P-Screen to determine these numbers.
  98.    }
  99.  
  100.  
  101.    { 1st # = color to change;  2nd # = color we want #1 changed to }
  102.  
  103.    { Locate our bright background screen in memory, and get its size.}
  104.    segaddr := BriteSEGADDR; numintegers := BriteNUMELS;
  105.  
  106.    psRecolor (segaddr, numintegers, 200 , 79);
  107.    psRecolor (segaddr, numintegers, 134 , 64);
  108.    psRecolor (segaddr, numintegers, 131 , 14);
  109.    psRecolor (segaddr, numintegers, 192 , 49);
  110.    psRecolor (segaddr, numintegers, 211 , 80);
  111.    psRecolor (segaddr, numintegers, 224 , 30);
  112.  
  113.    Brite;           { display it again, this time with colors re-mapped! }
  114.    delay (2000);
  115.  
  116.    {
  117.      RESTORE our bright background colors -- reversing what we did above.
  118.      In shareware versions, the "re-color" demo(s) do nothing.  But
  119.      review this to see how easily you can re-color screens on-the-fly.
  120.    }
  121.  
  122.    psRecolor (segaddr, numintegers, 79, 200 );
  123.    psRecolor (segaddr, numintegers, 64, 134 );
  124.    psRecolor (segaddr, numintegers, 14, 131 );
  125.    psRecolor (segaddr, numintegers, 49, 192 );
  126.    psRecolor (segaddr, numintegers, 80, 211 );
  127.    psRecolor (segaddr, numintegers, 30, 224 );
  128.  
  129.    Brite;                   { display it to show re-color took }
  130.    delay (2000);
  131.  
  132.    psBrightBG (0);          { return to normal }
  133.    delay (4000);
  134.    ClrScr;
  135. end.