home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / screen / fastvid2 / fastvid.doc < prev    next >
Encoding:
Text File  |  1987-06-03  |  8.6 KB  |  187 lines

  1.  
  2.                            FASTVID.C  version 1.0
  3.  
  4.  
  5.                         by Scott Friedman - May 1987
  6.  
  7.     I would really like to hear from you if you have a chance to try
  8. these routines out.  At the present time I am releasing these routines into
  9. the PUBLIC DOMAIN.  However, I eventually plan to release an entire set of
  10. functions that will be ShareWare and ask a small registration fee, like ten
  11. dollars or so, for future updates and a manual with examples and so on.
  12. Anyway, that's later, for now I would like to hear any comments you might have
  13. so please send them to me either on Compuserve or through the US Mail.
  14.  
  15.         Compusreve :  Scott Friedman   [74017,1331]
  16.  
  17.         or
  18.  
  19.         Scott Friedman
  20.         3700 Greenleaf St.
  21.         Skokie, IL.  60076-2357
  22.  
  23.  
  24.  
  25.     FASTVID is a set of no nonsense text display routines for use with
  26. Borlands Turbo C compiler.  For version 1.0 I have included about 30 of my
  27. text routines ( there are around 100+ total ) to start with.  In later
  28. versions I will include the others.  These functions, however, are the
  29. building blocks for all of the others; so these get released first.  Basically,
  30. these are simple, small, and FAST.  I think the best two features are that
  31. they do not require a lot of understanding to use and that they don't take up
  32. a lot of room when you include them.  The object module that would be used to
  33. link the FASTVID 1.0 routines is under 3k.
  34.  
  35.     Below are descriptions of all of the routines included in the FASTVID
  36. "library".  After which is a short explaination of how to include the routines
  37. into your own programs.
  38.  
  39.  
  40. void InitText ( void )  -  InitText is the function you need to call first
  41.     whenever you use FASTVID.  This routines sets-up the internal data
  42.     structure that most of the routines use.  It also sets the video
  43.         mode to 3 ( 25x80 color ) for CGA/EGA and 7 ( mono ) for Monochrome
  44.         monitors.  Lastly it clears the screen to black.
  45.  
  46. void UsesBios ( byte YN )  -  UsesBios is used to tell FASTVID that you want
  47.     it to use the ROM BIOS routines to display text.  Why you would do
  48.     this I'm not sure, but it's included for completeness.  You're prob-
  49.     ably asking "what's a BYTE?".  If you're not, look in the parameter
  50.     list for UseBios.  the BYTE data type is functionally equivalent to
  51.     an unsigned char.  You can use BYTE, which is declared in FASTVID.H,
  52.     or unsigned char interchangably.  the YN parameter is for either
  53.     YES or NO which are also defined in FASTVID.H.  The default is NO.
  54.  
  55.     example:    UseBios ( YES ); ---->  Yes, use the Bios routines.
  56.             UseBios ( NO ); ----->  No, write directly to the screen.
  57.  
  58. void HaveSnow ( byte YN )  -  HaveSnow is potentially a bit more useful than
  59.     UseBios.  HaveSnow is used to tell FASTVID that it's creating snow
  60.     on your screen when it writes to the display.  When you send this
  61.     function a YES the FASTVID display routines will wait for the display
  62.     to do a verticle retrace before it writes to your display.  The
  63.     default is not to wait for the display to retrace.
  64.  
  65. int EgaInstalled ( void )  -  EgaInstalled returns either YES or NO depending
  66.     on whether or not you have one in your machine.
  67.  
  68. void SetCursor ( byte Start, byte End )  -  SetCursor is NOT used to move the
  69.     cursor around the screen.  It is used to change the way the cursor
  70.     appears on the screen.  This is accomplished by setting the starting
  71.     and ending scan lines for the cursor.  Generally, this is not a very
  72.     useful routine, the only place I have ever seen it used effectivly
  73.     is for marking the difference between INSERT and OVERWRITE modes in
  74.     word processors and editors.
  75.  
  76. void HideCursor ( void )  -  Does exactly what it says.  This is a better way
  77.     to hide the cursor than giving SetCursor weird values or positioning
  78.     the cursor off the screen, both of which can be unpredictable.
  79.  
  80. void ShowCursor ( void )  -  Opposite of HideCursor.
  81.  
  82. int GetVideoMode ( void )  -  Returns the current video mode.  Refer to your
  83.     DOS references for the different modes and what they represent.
  84.  
  85. void SetVideoMode ( byte Mode )  -  Allows you to change the current video
  86.     mode.  For those of you new to "Video Modes" remember that all the
  87.     modes listed cannot be used by all display cards.
  88.  
  89. void Gotoxy ( int Col, int Row )  -  This routine will move the cursor for the
  90.     direct screen display mode ( UseBios ( NO ) ).
  91.  
  92. void GotoxyB ( int Col, int Row )  -  This is the BIOS move cursor.  The
  93.     difference is thay Gotoxy does not actually "move" the cursor, it
  94.     just updates the FASTVID col and row.  GotoxyB changes FASTVID's col
  95.     and row as well as moving the BIOS cursor ( the one you see ).
  96.  
  97. void Getxy ( int *Col, int *Row )  -  Returns the current location of the
  98.     FASTVID cursor.
  99.  
  100. void GetxyB ( int *Col, int *Row )  -  Returns the current location of the
  101.     BIOS cursor.
  102.  
  103. byte Attr ( byte Foreground, byte Background )  -  This routine will combine
  104.     a foreground and background color defined in FASTVID.H into a single
  105.     attribute byte you can use with other functions that require just
  106.     an attribute byte instead of a seperate foreground and background.
  107.  
  108.     example:     Cls ( Attr ( WHITE, BLUE ) ); ---> Clears screen to Blue.
  109.  
  110. void SetAttribute ( byte Attribute )  -  Sets the defualt FASTVID attribute
  111.         to be use with normal display routines.  This a function that you
  112.         might use Attr with.
  113.  
  114. byte GetAttribute ( byte Attribute )  -  Returns the current FASTVID attribute.
  115.  
  116. void FlipAttribute ( byte Attribute, int Number )  -  Changes the display
  117.     to the specified attribute starting at the current cursor position
  118.     and extending for Number positions.
  119.  
  120. void AtFlipAttribute ( int Col, int Row, byte Attribute, int Number )
  121.     Same as above except that you can specify the starting location.
  122.  
  123. void SetPage ( byte Page )  -  Allows you to select which video page your
  124.     display adapter puts on your monitor.
  125.  
  126. byte GetPage ( void )  -  Returns the current display page.
  127.  
  128. void SetBorder ( byte Color )  -  Lets you change the border color on your
  129.     display.
  130.  
  131. void Scroll ( byte Direction, byte NumOfLines, byte Attribute,
  132.           int x1, int y1, int x2, int y2 )  -  Allows you to scroll port-
  133.     ions of your display up or down by specifying a direction ( UP, DOWN )
  134.     the number of lines you want to scroll, an attribute for the blank
  135.     lines created by scrolling, and the coordinates describing the area
  136.     to scroll; x1,y1 being the upper left corner and x2,y2 the lower right.
  137.  
  138. void Cls ( byte Attribute )  -  Clear the screen using the specifyed attribute.
  139.  
  140. void Box ( int Left, int Top, int Right, int Bottom, byte Style )  -  Simple
  141.     way of creating boxes out of the extended IBM charater set.  All you
  142.     need to do is fill in the coordinates of the sides and the style of
  143.     box you want displayed.  There are 4 styles: single line, double line,
  144.     and two single and double combinations.  The styles go from 0 to 3.
  145.     Take a look at the _F structure in FASTVID.H to see how its set up.
  146.     You can declare an extern variable Frame in your program to have
  147.     to this predefined array.  I have found it much easier to draw with
  148.     these characters by using this array structure.
  149.  
  150.     example to include Frame in you code:
  151.  
  152.         extern _F Frame;   ---->  That's it!
  153.  
  154. void Say ( char *Text )  -  This is the heart of FASTVID.C, it will display
  155.     the specified NULL terminated string of characters at the current
  156.     cursor position.  To have formatted text al la printf use the sprintf
  157.     function and pass the result to Say.
  158.  
  159. void AtSay ( int Col, int Row, char *Text )  -  Same as Say except you can
  160.     specify a Column and Row as well.
  161.  
  162. void AtSayA ( int Col, int Row, char *Text, byte Attribute )  -  Again, same
  163.     as above except you can also specify an attribute for the text to be
  164.     be displayed.  Note, this attribute does not affect the FASTVID
  165.     default attribute set by SetAttribute.
  166.  
  167. void SayC ( char Character )  -  Writes the specified character to the display
  168.     at the current cursor position.
  169.  
  170. void AtSayC ( int Col, int Row, char Character )  -  Same as SayC, but allows
  171.     you to move the cursor as well.
  172.  
  173. void SayCN ( char Character, int Number )  -  Displays the specified character
  174.     at the current cursor position and repeats that charater for Number
  175.     more screen positions.
  176.  
  177. void AtSayCN ( int Col, int Row, char Character, int Number )  -  Same as SayCN
  178.     but, again, you can specify a Column and Row to start at.
  179.  
  180. void AtSayCNV ( int Col, int Row, char Character, int Number )  -  Don't con-
  181.     fuse this with AtSayCN, this routine allows you to replicate a charater
  182.     verically instead of horizontally.  Col and Row specify a starting loc-
  183.     ation and Character is repeated Number of times DOWNWARD.
  184.  
  185.  
  186. End of document.
  187.