home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / tpal4c10 / tpal.doc < prev    next >
Encoding:
Text File  |  1994-06-03  |  4.9 KB  |  176 lines

  1.  
  2.                TPAL4C v1.00  (C) Copyright 1994 Peak Computing
  3.                              All Rights Reserved
  4.                 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  5.                      Designed & Written by Brian Manning
  6.  
  7.  
  8. * What is TPAL4C?
  9.  
  10.   TPAL is a collection of video palette fading routines for VGA display
  11.   adapters.  These routines work in text video modes and directly
  12.   modify the video's internal palette registers for blazing speed!
  13.   The original version of TPAL was written for QuickBASIC, then I created
  14.   a Pascal version, and now I've have created a version for C/C++ users!
  15.   (These routines were written in Borland C v3.1)
  16.  
  17.  
  18. * What do I get when I register?
  19.  
  20.   You get the latest version of TPAL4C (with all of the memory models)
  21.   and all the tech support you need! ;-)  Plus free upgrades!
  22.  
  23.  
  24. * How do I use TPAL4C?
  25.  
  26.   These routines are very simple to use, just load the C Editor (IDE) and
  27.   create a project containing the proper library for the memory model your
  28.   using, then add TPAL to your "include" statements, here is an example:
  29.  
  30.           #include "tpal.h"
  31.  
  32.   (If you want to use fonts include "fonts.h" as well)
  33.  
  34.   After that your ready to begin calling the routines.  The first routine you
  35.   need to call is "InitTPALDriver" this routine intializes the video card and
  36.   gets the current default palette settings.  After doing this all the other
  37.   routines you just call whenever you want text fading or to create effects!
  38.  
  39.  
  40. * Routine Summary:
  41.  
  42.  
  43. Name: InitTPALDriver
  44. Dec.: void InitTPALDriver(void)
  45.  
  46.   Initializes the video card & routines.  This only needs to be called
  47.   once at the begining of your program.  Note:  This REALLY should be
  48.   one of the first routines called upon, as it reads the current font &
  49.   palette settings to be used in the routines.
  50.  
  51.     InitTPALDriver();
  52.  
  53.  
  54. Name: TPALDone
  55. Dec.: void TPALDone(void)
  56.  
  57.   Un-initializes the video card & routines.  You should call this routine
  58.   before your program exits, what this routine does is restore the palette
  59.   and font to the original settings.
  60.  
  61.     TPALDone();
  62.  
  63.  
  64. Name: TBlankPalette
  65. Dec.: void TBlankPalette(void)
  66.  
  67.   Blanks out the current palette, sets palette to black.
  68.  
  69.     TBlankPalette();
  70.  
  71.  
  72. Name: TSavePalette
  73. Dec.: int TSavePalette(char FileName[255])
  74.  
  75.   Saves the current palette to disk, if no extention is given the routine
  76.   will assume the extention .PAL  (See TLoadPalette)
  77.  
  78.     strcpy(FileName,"TEST");
  79.     ErrCode = TSavePalette(FileName);
  80.  
  81. FileName   - Filename to save palette. (may include path)
  82. --------
  83. ErrCode    - 0 if no error, otherwise disk error.
  84.  
  85.  
  86. Name: TLoadPalette
  87. Dec.: int TLoadPalette(char FileName[255])
  88.  
  89.   Loads a palette from disk, if no extention is given the routine
  90.   will assume the extention .PAL  (See TSavePalette)
  91.  
  92.     strcpy(FileName,"TEST");
  93.     ErrCode = TLoadPalette(FileName);
  94.     IF ErrCode = 256 then printf("\nNot a TPAL file!\n");
  95.  
  96. FileName   - Palette filename to load. (may include path)
  97. ---------
  98. ErrCode%   - 0 no error, 256 the file is not a "TPAL" saved file.
  99.  
  100.  
  101. Name: TFadeInPalette
  102. Dec.: void TFadeInPalette(int FadeSpeed)
  103.  
  104.   Fades a palette from black to its original settings.  (See TFadeOutPalette)
  105.  
  106.     FadeSpeed=10;
  107.     TFadeInPalette(FadeSpeed);
  108.  
  109. FadeSpeed  - Fading speed in milliseconds.
  110.  
  111.  
  112. Name: TFadeOutPalette
  113. Dec.: void TFadeOutPalette(int FadeSpeed)
  114.  
  115.   Fades a palette to black.  (See TFadeInPalette, TBlankPalette)
  116.  
  117.     FadeSpeed=10;
  118.     TFadeOutPalette(FadeSpeed);
  119.  
  120. FadeSpeed  - Fading speed in milliseconds.
  121.  
  122.  
  123. Name: TSetBright
  124. Dec.: void TSetBright(int Brightness)
  125.  
  126.   Sets the screens 'brightness' by changing the palette intensity levels.
  127.  
  128.     Brightness=31;
  129.     TSetBright(Brightness);
  130.  
  131. Brightness - Range 1-63, 1 being the darkest setting (black)
  132.  
  133.  
  134. Name: TResetPalette
  135. Dec.: void TResetPalette(void)
  136.  
  137.   Sets the video palette back to it's original settings that were established
  138.   when 'InitTPALDriver' was called.
  139.  
  140.     TResetPalette();
  141.  
  142.  
  143. Name: TSetFont
  144. Dec.: void TSetFont(char FontData[8193])
  145.  
  146.   Sets the current font.  You must include "FONTS.H" and make sure
  147.   you have FONTS_x.LIB included in your project.  Here is a list of fonts
  148.   availible in the TPAL4C library:  (32 total fonts, in alph. order)
  149.  
  150.      amb          antique      boxy         broad
  151.      cour1        cour2        deck         decor
  152.      fresno       future       ghost        hylas
  153.      italian      italics      king         lewis
  154.      medieval     modern       muchery      olden
  155.      petite       puter        roman        sanserif
  156.      scribble     script       startrek     system1
  157.      system2      tall         tektite      thix
  158.  
  159.     TSetFont(scribble);
  160.  
  161.  
  162. Name: TResetFont
  163. Dec.: void TResetFont(void)
  164.  
  165.   Sets the font back to it's original settings established when
  166.   'InitTPALDriver' was called.
  167.  
  168.     TResetFont();
  169.  
  170.  
  171. * Notes:
  172.  
  173.   No news is good news!
  174.  
  175.  
  176.