home *** CD-ROM | disk | FTP | other *** search
/ World of Graphics / WOGRAPH.BIN / 337.VSA256.TXT < prev    next >
Text File  |  1992-08-29  |  31KB  |  1,081 lines

  1.  
  2.                 VSA256
  3.                Graphics Library
  4.  
  5.               For C Programmers
  6.  
  7.                  Version 1.1
  8.                August 29, 1992
  9.  
  10.  
  11.               Copyright Spyro Gumas, 1992.
  12.               All Rights Reserved
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                     
  56.                               
  57. VESA256 Graphics Library for C Programmers            August 29, 1992
  58. Version 1.1
  59.  
  60. 1.0 Introduction                                        3
  61. 2.0 The Programming Environment                         4
  62.     2.1 Setting Up The VESA Environment             4
  63.     2.2 Global Graphics Parameters                  4
  64. 3.0 Function Descriptions                               5
  65.     3.1 VESA Configuration Functions                5
  66.         3.1.1 vsa_set_svga_mode                 5
  67.         3.1.2 vsa_get_svga_mode                 6
  68.         3.1.3 vsa_init                          6
  69.     3.2 Miscellaneous Functions                     7
  70.         3.2.1 vsa_set_display_start             7
  71.         3.2.2 vsa_get_display_start             7
  72.     3.3 Attribute Functions                         8
  73.         3.3.1 vsa_set_color                     8
  74.         3.3.2 vsa_set_text_color                8
  75.     3.4 Color Look Up Table Functions               9
  76.         3.4.1 vsa_read_color_register           9
  77.         3.4.2 vsa_write_color_register          9
  78.         3.4.3 vsa_read_color_block              10
  79.         3.4.4 vsa_write_color_block             10
  80.     3.5 Text Functions                              11
  81.         3.5.1 vsa_set_text_cursor               11
  82.         3.5.2 vsa_set_text_cursor_mode          11
  83.         3.5.3 vsa_write_char                    11
  84.         3.5.4 vsa_write_string                  12
  85.         3.5.5 vsa_write_string_alt              12
  86.     3.6 Basic Drawing Functions                     12
  87.         3.6.1 vsa_move_to                       12
  88.         3.6.2 vsa_set_pixel                     13
  89.         3.6.3 vsa_line_to                       13
  90.         3.6.4 vsa_rect_fill                     13
  91.         3.6.5 vsa_rect                          13
  92.         3.6.6 vsa_h_line                        14
  93.         3.6.7 vsa_v_line                        14
  94.     3.7 Specialized Drawing Functions               14
  95.         3.7.1 vsa_raster_line                   14
  96. 4.0 Nitty Gritties                                      15
  97.     4.1 Registration Information                    15
  98.     4.2 Software License                            15
  99.     4.3 Disclaimer                                  15
  100.     4.4 Technical Support                           16
  101. 5.0 Coming Attractions                                  17
  102.     5.1 Graphics Library Extensions                 17
  103. 6.0 Appendix                                            18
  104.     6.1 VSA.H Include File                          18
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                 Page: 2
  112.                     
  113.  
  114. VESA256 Graphics Library for C Programmers            August 29, 1992
  115. Version 1.1
  116.  
  117. 1.0 Introduction
  118.  
  119.     The Video Electronics Standards Association (VESA) has 
  120. developed a set of BIOS extensions which standardize the Super VGA 
  121. (SVGA) graphics environment.  The VSA256 Graphics Library provides a C 
  122. programmer with the tools necessary to drive  a video adapter running 
  123. with the VESA version 2.0 BIOS extensions.  The name "VSA256" reflects 
  124. the fact that this library is primarily aimed at supporting the 256 
  125. color video modes 100h, 101h, 103h, 105h, and 107h defined within the 
  126. VESA standard (See table in section 3.1.1).
  127.     This is a revision to the original shareware version of VSA256 
  128. Graphics Library.  The major changes are listed below:
  129.  
  130.         - One library for all memory models
  131.         - Support for Borland C as well as Microsoft C
  132.         - New routine, vsa_set_text_cursor
  133.         - New routine, vsa_set_text_cursor_mode
  134.         - New routine, vsa_write_string_alt
  135.  
  136.     The distribution of the VSA256 Graphics Library consists of the 
  137. 7 files listed below plus the drivers listed in Section 2.1.  These 
  138. files are archived in the self extracting file VSA256.EXE.  To extract, 
  139. just type VSA256 in the directory that you want the files extracted to.  
  140. When distributing the VSA256 Graphics Library, distribute VSA256.EXE 
  141. instead of the individual files.
  142.  
  143. VSA_DEMO.C      Demonstration program (Source Code).
  144. VSA_DEMO.EXE    Demonstration program (Executable).
  145. VSA256MS.LIB    VSA256 Graphics Library (Microsoft C compatible).
  146. VSA256BC.LIB    VSA256 Graphics Library (Borland C Compatible).
  147. VSA.H           Include file required in your program.
  148. VSA256.TXT      This text document.
  149. ORDER.TXT       A text file order form for upgrades and registration.
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.                 Page: 3
  169.                     
  170.                     
  171. VESA256 Graphics Library for C Programmers            August 29, 1992
  172. Version 1.1
  173.  
  174. 2.0 The Programming Environment
  175.  
  176. 2.1 Setting Up The VESA Environment
  177.  
  178.     The VSA256 Graphics Library works with any (any?) IBM PC, XT, 
  179. AT or  compatible computer equipped with an SVGA video adapter card 
  180. capable of 256 colors.  A math coprocessor chip is not required, however 
  181. if it exists, this library will take advantage of it.
  182.     Before using the VSA256 Graphics Library, the VESA BIOS 
  183. Extensions must be loaded.  This is accomplished by executing the 
  184. appropriate driver or adding it to your AUTOEXEC.BAT file.  If your 
  185. video adapter card came with a VESA driver, use it.  Otherwise use one 
  186. of the drivers provided depending on the video adapter card installed in 
  187. the PC as follows:
  188.  
  189. APPIAN          \APPIAN\APVESA.EXE
  190. ATI             \ATI\VESA.COM
  191. C&T             \C&T\VESA451.COM (or VESA452.COM)
  192. CIRRUS          \CIRRUS\CRUSVESA.COM
  193. EVEREX          \EVEREX\EVRXVESA.COM
  194. GENOA           \GENOA\VESA.COM
  195. OAK             \OAK\37VESA.COM (or67VESA.COM)
  196. ORCHID          \ORCHID\ORCHDVSA.COM
  197. PARADISE        \PARADISE\VESA.EXE
  198. SIGMA           \SIGMA\SIGVESA.COM
  199. STB             \STB\STB-VESA.COM
  200. TECMAR          \TECMAR\VGAVESA.COM
  201. TRIDENT         \TRIDENT\VESA.EXE
  202. VIDEO7          \VIDEO7\V7VESA.COM
  203.  
  204. 2.2 Global Graphics Parameters
  205.  
  206.     The file VSA.H is used as an include file during program 
  207. development.  This file includes all of the function prototypes and it 
  208. defines the global graphics parameters that describe the specific video 
  209. adapter installed in the PC (See Section 6.1).  The global graphics 
  210. parameters are initialized by the vsa_init function and are described 
  211. below:
  212.  
  213. XResolution:    Unsigned, the number of screen pixels across (x 
  214.         dimension).
  215. YResolution:    Unsigned, the number of screen pixels high (y 
  216.         dimension).
  217. XCharResolution:Unsigned, the number of screen characters across (x 
  218.         dimension).
  219. YCharResolution:Unsigned, the number of screen characters high (y 
  220.         dimension).
  221. XCharSize:      Unsigned char, the character cell width.
  222. YCharSize:      Unsigned char, the character cell height.
  223. BitsPerPixel:   Unsigned char, the number of bits per pixel.
  224.  
  225.                 Page: 4
  226.                     
  227.                     
  228. VESA256 Graphics Library for C Programmers            August 29, 1992
  229. Version 1.1
  230.  
  231. 3.0 Function Descriptions
  232.  
  233.     This section describes the functions supported in the VSA256 
  234. Graphics Library.  To use these functions, link your program with the 
  235. appropriate library listed below depending on the compiler being used.
  236.  
  237.     Borland C++ or Turbo C  - VSA256BC.LIB
  238.     Microsoft C or Quick C  - VSA256MS.LIB
  239.  
  240.     In the following sections each function is listed along with a 
  241. definition of its inputs and return values.  A description is provided 
  242. followed by comments on the compatibility of the function with various 
  243. video modes.  Although many functions can drive non-VESA and non-256 
  244. color video modes, predictable operation requires that this software be 
  245. used with the 256 color VESA modes only.
  246.  
  247. 3.1 VESA Configuration Functions
  248.  
  249. 3.1.1 vsa_set_svga_mode(video_mode)
  250.  
  251. Inputs:         unsigned video_mode;
  252.  
  253. Returns:        unsigned fail_flag;
  254.  
  255. Description:    This routine sets the video mode.  The mode number may 
  256.     be any of the standard VESA SVGA mode numbers as defined in the 
  257.     tables below.  The mode is passed to this routine through the 
  258.     'video_mode' parameter.  This routine returns a 'fail_flag' = 0 
  259.     if the call was a success (a 1 for failure). It should be noted 
  260.     that this routine will also work with standard MDA, CGA, EGA, 
  261.     and VGA mode numbers, however the rest of the VSA256 functions 
  262.     will not necessarily work.
  263.  
  264. Comments:       Works in all VESA video modes.
  265.     Also works in MDA, CGA, EGA and VGA Modes.
  266.  
  267. WARNING: Use vsa_init Instead (Section 3.1.3)!  If you don't use 
  268. vsa_int, then the rest of the routines won't work because they depend on 
  269. the global parameters initialized by vsa_init;
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.                 Page: 5
  283.                     
  284.                     
  285. VESA256 Graphics Library for C Programmers            August 29, 1992
  286. Version 1.1
  287.  
  288. VESA SVGA VIDEO MODES
  289.  
  290. GRAPHICS                Mode            Resolution      Colors
  291.         100h            640x400         256
  292.         101h            640x480         256
  293.         102h            800x600         16
  294.         103h            800x600         256
  295.         104h            1024x768        16
  296.         105h            1024x768        256
  297.         106h            1280x1024       16
  298.         107h            1280x1024       256
  299.  
  300. TEXT            Mode            Columns         Rows
  301.         108h            80              60
  302.         109h            132             25
  303.         10Ah            132             43
  304.         10Bh            132             50
  305.         10Ch            132             60
  306.  
  307. 3.1.2 vsa_get_svga_mode(video_mode)
  308.  
  309. Inputs:         unsigned far *video_mode;
  310.  
  311. Returns:        unsigned fail_flag;
  312.  
  313. Description:    This routine gets the current video mode.  The mode is 
  314.     returned to the calling routine via the 'video_mode' pointer.  
  315.     The mode number may be any of the standard VESA SVGA mode 
  316.     numbers as defined in Section 3.1.1.  This routine returns a 
  317.     'fail_flag' = 0 if the call was a success (a 1 for failure).           
  318.  
  319. Comments:       Works in all VESA video modes.
  320.     Also works in MDA, CGA, EGA and VGA Modes.
  321.  
  322. 3.1.3 vsa_init(video_mode)
  323.  
  324. Inputs:         unsigned video_mode;
  325.  
  326. Returns:        unsigned fail_flag;
  327.  
  328. Description:    This routine sets the video mode and initializes the 
  329.     VESA graphics environment.  This routine must be called prior 
  330.     to the use of any of the routines in Sections 3.4 through 3.7.  
  331.     The mode number may be any of the standard VESA SVGA mode 
  332.     numbers as defined in Section 3.1.1.  If the mode number is not 
  333.     a VESA SVGA mode number, this routine will still set the 
  334.     desired video mode, however, the VESA graphics environment will 
  335.     not be initialized and subsequent calls to drawing routines 
  336.     will produce unpredictable results.  The mode is passed to this 
  337.  
  338.  
  339.                 Page: 6
  340.                     
  341.                     
  342. VESA256 Graphics Library for C Programmers            August 29, 1992
  343. Version 1.1
  344.  
  345.     routine through the 'video_mode' parameter.  This routine 
  346.     returns a 'fail_flag' = 0 if the call was a success (a 1 for 
  347.     failure).
  348.  
  349. Comments:       Works in all VESA video modes.
  350.     Also works in MDA, CGA, EGA and VGA Modes.
  351.  
  352. 3.2 Miscellaneous Functions
  353.  
  354. 3.2.1 vsa_set_display_start(x_strt,y_strt)
  355.  
  356. Inputs:         unsigned x_strt,y_strt;
  357.  
  358. Returns:        unsigned fail_flag;
  359.  
  360. Description:    This routine sets the current start pixel address which 
  361.     is mapped to the upper left corner of the display.  This 
  362.     routine returns a 'fail_flag' = 0 if the call was a success (a 
  363.     1 for failure).
  364.  
  365. Comments:       Works in all VESA video modes.
  366.     Also works in MDA, CGA, EGA and VGA Modes.
  367.  
  368. 3.2.2 vsa_get_display_start(x_strt,y_strt)
  369.  
  370. Inputs:         unsigned far *x_strt, far *y_strt;
  371.  
  372. Returns:        unsigned fail_flag;
  373.  
  374. Description:    This routine gets the current start pixel address which 
  375.     is mapped to the upper left corner of the display.  This 
  376.     routine returns a 'fail_flag' = 0 if the call was a success (a 
  377.     1 for failure).                         
  378.  
  379. Comments:       Works in all VESA video modes.
  380.     Also works in MDA, CGA, EGA and VGA Modes.
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.                 Page: 7
  397.                     
  398.                     
  399. VESA256 Graphics Library for C Programmers            August 29, 1992
  400. Version 1.1
  401.  
  402. 3.3 Attribute Functions
  403.  
  404. 3.3.1 vsa_set_color(color)
  405.  
  406. Inputs:         unsigned color;
  407.  
  408. Returns:        Nothing
  409.  
  410. Description:    This routine sets the current drawing color which is 
  411.     used in drawing pixels, lines, and rectangles.  The "color" is 
  412.     an 8 bit value from 0 to 255 which is used to index in to the 
  413.     Color Look Up Table (see Section 3.4).   
  414.  
  415. Comments:       Works only in 256 color VESA video modes.
  416.  
  417. 3.3.2 vsa_set_text_color(color)
  418.  
  419. Inputs:         unsigned color;
  420.  
  421. Returns:        Nothing
  422.  
  423. Description:    This routine sets the current text color which is used 
  424.     in drawing text.  The "color" is an 8 bit value from 0 to 255 
  425.     which is used to index in to the Color Look Up Table (see 
  426.     Section 3.4).  In 16 color SVGA modes, the 4 LSBs define text 
  427.     color.  In 256 color SVGA modes, the 8 bits define text color.
  428.  
  429. Comments:       Works in all VESA video modes.
  430.     Also works in EGA and VGA Modes.
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.                 Page: 8
  454.                     
  455.                     
  456. VESA256 Graphics Library for C Programmers            August 29, 1992
  457. Version 1.1
  458.  
  459. 3.4 Color Look Up Table Functions
  460.  
  461.     The Color Look Up Table consists of 256 registers and each 
  462. register stores an 18 bit value defining 6 bit levels for each of red, 
  463. green, and blue.  The drawing functions index into the Color Look Up 
  464. Table with an 8 bit value (usually set with vsa_set_color) to determine 
  465. the drawing color. With the following functions, the Color Look Up Table 
  466. can be read or modified one register at a time or all at once in a block 
  467. operation.
  468.  
  469. 3.4.1 vsa_read_color_register(index,redptr,grnptr,bluptr)
  470.  
  471. Inputs:         unsigned index;
  472.         unsigned char far *redptr, far *grnptr, far *bluptr;
  473.  
  474. Returns:        Nothing
  475.  
  476. Description:    This routine reads the value of one of the 256 color 
  477.     registers as defined by 'index'.  Pointers to the red, green, 
  478.     and blue components of the color are returned (6 bits each for 
  479.     red, green, and blue).
  480.  
  481. Comments:       Works in all VESA video modes.
  482.     Also works in EGA and VGA Modes.
  483.  
  484. 3.4.2 vsa_write_color_register(index,red,green,blue)
  485.  
  486. Inputs:         unsigned index;
  487.         unsigned char red,green,blue;
  488.  
  489. Returns:        Nothing
  490.  
  491. Description:    This routine writes the value of one of the 256 color 
  492.     registers as defined by 'index'.  The calling routine provides 
  493.     'red', 'green', and 'blue' components of the color (6 bits each 
  494.     for red, green, and blue).   
  495.  
  496. Comments:       Works in all VESA video modes.
  497.     Also works in EGA and VGA Modes.
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.                 Page: 9
  511.                     
  512.                     
  513. VESA256 Graphics Library for C Programmers            August 29, 1992
  514. Version 1.1
  515.  
  516. 3.4.3 vsa_read_color_block(start,count,array)
  517.  
  518. Inputs:         unsigned start,count;
  519.         unsigned char far array[];
  520.  
  521. Returns:        Nothing
  522.  
  523. Description:    This routine reads 'count' (Range: 1 to 256) 
  524.     consecutive color registers starting at 'start' (Range: 0 to 
  525.     255) within the Color Look Up Table.  The 'count' must be less 
  526.     than or equal to 256 - 'start'.  The values read from the color 
  527.     registers are returned from this routine in 'array[]'.  Each 
  528.     element of 'array[]' is a byte, and the size of 'array[]' is 
  529.     equal to three times 'count'.  Every three bytes in 'array[]' 
  530.     represents the red, green, and blue color values respectively 
  531.     for one color register.  Each color component (red,green, or 
  532.     blue) is a byte value but only ranges from 0 to 63.                                                            
  533.  
  534. Comments:       Works in all VESA video modes.
  535.     Also works in EGA and VGA Modes.
  536.  
  537. 3.4.4 vsa_write_color_block(start,count,array)
  538.  
  539. Inputs:         unsigned start,count;
  540.         unsigned char far array[];
  541.  
  542. Returns:        Nothing
  543.  
  544. Description:    This routine writes 'count' (Range: 1 to 256) 
  545.     consecutive color registers starting at 'start' (Range: 0 to 
  546.     255) within the Color Look Up Table.  The 'count' must be less 
  547.     than or equal to 256 - 'start'.  The values loaded into the 
  548.     color registers are passed to this routine in 'array[]'.  Each 
  549.     element of 'array[]' is a byte, and the size of 'array[]' is 
  550.     equal to three times 'count'.  Every three bytes in 'array[]' 
  551.     represents the red, green, and blue color values respectively 
  552.     for one color register.  Each color component (red,green, or 
  553.     blue) is a byte value but only ranges from 0 to 63.                                            
  554.  
  555. Comments:       Works in all VESA video modes.
  556.     Also works in EGA and VGA Modes.
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.                 Page: 10
  568.                     
  569.                     
  570. VESA256 Graphics Library for C Programmers            August 29, 1992
  571. Version 1.1
  572.  
  573. 3.5 Text Functions
  574.  
  575. 3.5.1 vsa_set_text_cursor(row,col)
  576.  
  577. Inputs:         unsigned row, col;
  578.  
  579. Returns:        Nothing
  580.  
  581. Description:    This routine sets the current text cursor position to 
  582.     'row, col' in character coordinates (not pixel coordinates).  
  583.     The current text cursor position is only used by 
  584.     vsa_write_string_alt.
  585.  
  586. Comments:       Works in all VESA video modes.
  587.     Also works in EGA and VGA Modes.
  588.  
  589. 3.5.2 vsa_set_text_cursor_mode(mode)
  590.  
  591. Inputs:         unsigned mode;
  592.  
  593. Returns:        Nothing
  594.  
  595. Description:    This routine determines the mode of the text cursor 
  596.     operation.  If 'mode' is '0' (the default after calling 
  597.     vsa_init), the text cursor is not updated after a new text 
  598.     string is written with vsa_write_string or 
  599.     vsa_write_string_alt.  If 'mode' is '1', then the text cursor 
  600.     is moved to the end of the text string after executing 
  601.     vsa_write_string or vsa_write_string_alt.
  602.  
  603. Comments:       Works in all VESA video modes.
  604.     Also works in EGA and VGA Modes.
  605.  
  606. 3.5.3 vsa_write_char(row,col,alpha)
  607.  
  608. Inputs:         unsigned row,col;
  609.         char alpha;
  610.  
  611. Returns:        Nothing
  612.  
  613. Description:    This routine writes a the single character 'alpha' at 
  614.     position (row,col).  The character is written with the current 
  615.     text color.  After execution, the current text cursor position 
  616.     remains set to (row, col).
  617.  
  618. Comments:       Works in all VESA video modes.
  619.     Also works in EGA and VGA Modes.
  620.  
  621.  
  622.  
  623.  
  624.                 Page: 11
  625.                     
  626.                     
  627. VESA256 Graphics Library for C Programmers            August 29, 1992
  628. Version 1.1
  629.  
  630. 3.5.4 vsa_write_string(row,col,color,string)
  631.  
  632. Inputs:         unsigned row,col,color;
  633.         char far string[];
  634.  
  635. Returns:        Nothing
  636.  
  637. Description:    This routine writes a null terminated text string 
  638.     'string' at position (row,col).  The text is written with the 
  639.     'color' passed to this routine.  After execution, if the text 
  640.     cursor mode is '0', the text cursor remains at 'row,col', 
  641.     otherwise it is set to the end of the text string just written.
  642.  
  643. Comments:       Works in all VESA video modes.
  644.     Also works in EGA and VGA Modes.
  645.  
  646. 3.5.5 vsa_write_string_alt(string)
  647.  
  648. Inputs:         char far string[];
  649.  
  650. Returns:        Nothing
  651.  
  652. Description:    This routine writes a null terminated text string 
  653.     'string' at the current text cursor position as determined by 
  654.     vsa_set_text_cursor.  The text is written with the current text 
  655.     color.  After execution, if the text cursor mode is '0', the 
  656.     current text cursor remains unchanged, otherwise it is set to 
  657.     the end of the text string just written.
  658.  
  659. Comments:       Works in all VESA video modes.
  660.     Also works in EGA and VGA Modes.
  661.  
  662. 3.6 Basic Drawing Functions
  663.  
  664. 3.6.1 vsa_move_to(x,y)
  665.  
  666. Inputs:         unsigned x,y;
  667.  
  668. Returns:        Nothing
  669.  
  670. Description:    This routine sets the current cursor position to 'x,y'.  
  671.     The current cursor position is used by the vsa_line_to, 
  672.     vsa_rect_fill, and vsa_rect functions.
  673.  
  674. Comments:       none
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.                 Page: 12
  682.                     
  683.                     
  684. VESA256 Graphics Library for C Programmers            August 29, 1992
  685. Version 1.1
  686.  
  687. 3.6.2 vsa_set_pixel(x,y)
  688.  
  689. Inputs:         unsigned x,y;
  690.  
  691. Returns:        Nothing
  692.  
  693. Description:    This routine draws a single pixel at 'x,y' with the 
  694.     current drawing color.
  695.  
  696. Comments:       Works in all VESA 256 color video modes.
  697.  
  698. 3.6.3 vsa_line_to(x,y)
  699.  
  700. Inputs:         unsigned x,y;
  701.  
  702. Returns:        Nothing
  703.  
  704. Description:    This routine draws a line from the current cursor 
  705.     position to 'x,y' with the current drawing color.  Then the 
  706.     current cursor position is moved to 'x,y'.                                            
  707.  
  708. Comments:       Works in all VESA 256 color video modes.
  709.  
  710. 3.6.4 vsa_rect_fill(x,y)
  711.  
  712. Inputs:         unsigned x,y;
  713.  
  714. Returns:        Nothing
  715.  
  716. Description:    This routine draws a filled rectangle from the current 
  717.     cursor position to the rectangles diagonal position 'x,y' with 
  718.     the current color.
  719.  
  720. Comments:       Works in all VESA 256 color video modes.
  721.  
  722. 3.6.5 vsa_rect(x,y)
  723.  
  724. Inputs:         unsigned x,y;
  725.  
  726. Returns:        Nothing
  727.  
  728. Description:    This routine draws a rectangle from the current cursor 
  729.     position to the rectangles diagonal position 'x,y' with the 
  730.     current color.
  731.  
  732. Comments:       Works in all VESA 256 color video modes.
  733.  
  734.  
  735.  
  736.  
  737.  
  738.                 Page: 13
  739.                     
  740.                     
  741. VESA256 Graphics Library for C Programmers            August 29, 1992
  742. Version 1.1
  743.  
  744. 3.6.6 vsa_h_line(y,x0,x1)
  745.  
  746. Inputs:         unsigned y,x0,x1;
  747.  
  748. Returns:        Nothing
  749.  
  750. Description:    This routine draws a horizontal line from 'x0,y' to 
  751.     'x1,y'.  The line is drawn with the current drawing color.  For 
  752.     horizontal lines this function is quicker than the vsa_line_to 
  753.     function.
  754.  
  755. Comments:       Works in all VESA 256 color video modes.
  756.  
  757. 3.6.7 vsa_v_line(x,y0,y1)
  758.  
  759. Inputs:         unsigned x,y0,y1;
  760.  
  761. Returns:        Nothing
  762.  
  763. Description:    This routine draws a vertical line from 'x,y0' to 
  764.     'x,y1'.  The line is drawn with the current drawing color.  For 
  765.     vertical lines this function is quicker than the vsa_line_to 
  766.     function.
  767.  
  768. Comments:       Works in all VESA 256 color video modes.
  769.  
  770. 3.7 Specialized Drawing Functions
  771.  
  772. 3.7.1 vsa_raster_line(x0,x1,y,array)
  773.  
  774. Inputs:         unsigned x0,x1,y;
  775.         unsigned char far array[];
  776.  
  777. Returns:        Nothing
  778.  
  779. Description:    This routine draws a horizontal raster line from 'x0,y' 
  780.     to 'x1,y'.  The 'array[]' values specify each pixel's color 
  781.     value.  If x0 <= x1, then 'array[0]' defines the color of the 
  782.     first pixel in the line at 'x0,y'.  If x1 < x0, then 'array[0]' 
  783.     defines the color of the first pixel in the line at 'x1,y'.                                                        
  784.  
  785. Comments:       Works in all VESA 256 color video modes.
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.                 Page: 14
  796.                     
  797.                     
  798. VESA256 Graphics Library for C Programmers            August 29, 1992
  799. Version 1.1
  800.  
  801. 4.0 Nitty Gritties
  802.  
  803. 4.1 Registration Information
  804.  
  805.     If you find the VSA256 Graphics Library useful, a registration 
  806. of $20 would be appreciated.  If you register, you will receive a 
  807. diskette and manual for the next upgrade of the software (see Section 
  808. 5.0 Coming Attractions).
  809.  
  810.       Please state the version number of the software you are 
  811. presently using.  Send check or money order to:
  812.  
  813.             Spyro Gumas
  814.             1668 Shady Brook Drive
  815.             Fullerton, Ca. 92631
  816.  
  817. 4.2 Software License
  818.  
  819. VSA256 Graphics Library, Version 1.0
  820. Copyright Spyro Gumas, 1992.  All Rights Reserved.
  821.  
  822. You are free to copy and distribute the VSA256 Graphics Library if:
  823.  
  824. 1)      It is used strictly for non-commercial purposes.
  825. 2)      No fee is charged for use, copying or distribution.
  826. 3)      It is not modified in any way.
  827.  
  828.     Clubs and user groups may charge a nominal fee not to exceed 
  829. ($10) for expenses and handling while distributing the VSA256 Graphics 
  830. Library.
  831.  
  832.     Site licenses and commercial licenses for the VSA256 Graphics 
  833. Library are available.  Consult the file ORDER.TXT for more information, 
  834. or contact me for more information.
  835.  
  836. 4.3 Disclaimer
  837.  
  838.     This software is provided "as is".  All warranties relating to 
  839. this software are disclaimed, whether expressed or implied, including 
  840. without limitation any implied warranties of merchantability or fitness 
  841. for a particular purpose.  Neither the author nor an agent of the author 
  842. will be liable for any special, incidental, consequential, indirect or 
  843. similar damages due to loss of data or any other reason, even if the 
  844. author or an agent of the author has been advised of the possibility of 
  845. such damages.  In no event shall the author's or an agent of the 
  846. author's liability for any damages ever exceed the price paid for the 
  847. license to use software, regardless of the form of the claim.  The 
  848. person using the software bears all risk as to the quality and 
  849. performance of the software.
  850.  
  851.  
  852.                 Page: 15
  853.                     
  854.                     
  855. VESA256 Graphics Library for C Programmers            August 29, 1992
  856. Version 1.1
  857.  
  858. 4.4 Technical Support
  859.  
  860.     If you have any questions or comments about the VSA256 Graphics 
  861. Library, please write me at:
  862.  
  863.             Spyro Gumas
  864.             1668 Shady Brook Drive
  865.             Fullerton, Ca. 92631
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.                 Page: 16
  910.                     
  911.                     
  912. VESA256 Graphics Library for C Programmers            August 29, 1992
  913. Version 1.1
  914.  
  915. 5.0 Coming Attractions
  916.  
  917.     Version 2.0 of the VSA256 Graphics Library incorporates new 
  918. functions and drawing speed improvements while preserving compatibility 
  919. with the previous version.  With the $20 registration fee, you will 
  920. automatically receive this upgrade.  Some of the Version 2.0 new 
  921. functions are:
  922.  
  923. - vsa_triangle_fill:            General purpose triangle fill for n-gon 
  924.                 drawing, finite element models, etc.
  925.  
  926. - vsa_triangle_shade:           3D triangle fill using Gouraud shading 
  927.                 for light modelling effects.
  928.  
  929. - vsa_antialias_line:           Smooth line generation which eliminates 
  930.                 "the jaggies".
  931.  
  932. - vsa_circle:                   Circle drawing.
  933.  
  934. - vsa_arc:                      General arc sections.
  935.  
  936. 5.1 Graphics Library Extensions
  937.  
  938.     The VSA256 Graphics Library (Version 1.1 and higher) is a base 
  939. library which is supported by library extensions for more specialized 
  940. tasks.  New extensions will be developed periodically.  The current 
  941. extensions are:
  942.  
  943. TIFF256 Graphics Library Extension 1.0 - This library extension provides 
  944. functions which operate with Tagged Image File Format (TIFF) images.  
  945. With these functions, you can traverse the image file, extract image 
  946. information, and display the images as part of your own program.  The 
  947. image types supported include Bilevel, Grayscale, Palette Color and RGB 
  948. True Color.  This is shareware software available from the same place 
  949. that you got the VSA256 Graphics Library.
  950.  
  951. TIFF256 Graphics Library Extension 2.0 - This is the registered version 
  952. of the TIFF256 Graphics Library Extension.  In addition to the 
  953. capabilities provided by the version 1.0, version 2.0 lets you modify 
  954. the TIFF images and write them back to TIFF files.  Furthermore, any 
  955. image that you generate with VSA256 can be saved as a TIFF file.  You 
  956. can get your legal fingers on this with a $20 registration fee, or get 
  957. both VSA256 Ver. 2.0 and TIFF256 Ver 2.0 for the highly discounted price 
  958. of $30.  See the ORDER.TXT for ordering information.
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.                 Page: 17
  967.                     
  968.                     
  969. VESA256 Graphics Library for C Programmers            August 29, 1992
  970. Version 1.1
  971.  
  972. 6.0 Appendix
  973.  
  974. 6.1 VSA.H Include File
  975.  
  976. /*.................................. VSA.H ................. 5-8-92 ........*/
  977. /* This file declares the VSA256 Graphics Library functions and global      */
  978. /* parameters used throughout the graphics routines.                        */
  979. /*                                                                          */
  980. /*            Copyright Spyro Gumas, 1992.  All Rights Reserved.            */
  981. /*..........................................................................*/
  982.  
  983. /*..........................................................................*/
  984. /*                          Function Prototypes                             */
  985. /*..........................................................................*/
  986. unsigned  _far _cdecl vsa_set_svga_mode( unsigned );
  987. unsigned  _far _cdecl vsa_get_svga_mode( unsigned _far * );
  988. unsigned  _far _cdecl vsa_set_display_start( unsigned, unsigned );
  989. unsigned  _far _cdecl vsa_get_display_start( unsigned _far *,
  990.                 unsigned _far * );
  991. unsigned  _far _cdecl vsa_init( unsigned );
  992. void _far _cdecl vsa_set_color( unsigned );
  993. void _far _cdecl vsa_set_text_color( unsigned );
  994. void _far _cdecl vsa_set_text_cursor_mode( unsigned );
  995. void _far _cdecl vsa_set_text_cursor( unsigned, unsigned );
  996. void _far _cdecl vsa_write_char( unsigned, unsigned, char );
  997. void _far _cdecl vsa_write_string( unsigned, unsigned, unsigned, char _far * );
  998. void _far _cdecl vsa_write_string_alt( char _far * );
  999. void _far _cdecl vsa_read_color_register( unsigned, unsigned char _far *,
  1000.              unsigned char _far *, unsigned char _far *);
  1001. void _far _cdecl vsa_write_color_register( unsigned, unsigned char,
  1002.              unsigned char, unsigned char );
  1003. void _far _cdecl vsa_read_color_block( unsigned, unsigned,
  1004.              unsigned char _far * );
  1005. void _far _cdecl vsa_write_color_block( unsigned, unsigned,
  1006.              unsigned char _far * );
  1007. void _far _cdecl vsa_move_to( unsigned, unsigned );
  1008. void _far _cdecl vsa_set_pixel( unsigned, unsigned );
  1009. void _far _cdecl vsa_line_to( unsigned, unsigned );
  1010. void _far _cdecl vsa_rect_fill( unsigned, unsigned );
  1011. void _far _cdecl vsa_rect( unsigned, unsigned );
  1012. void _far _cdecl vsa_h_line( unsigned, unsigned, unsigned );
  1013. void _far _cdecl vsa_v_line( unsigned, unsigned, unsigned );
  1014. void _far _cdecl vsa_raster_line( unsigned, unsigned,unsigned,
  1015.              unsigned char _far *);
  1016. void _far _cdecl vsa_about( void );
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.                 Page: 18
  1024.                     
  1025.                     
  1026. VESA256 Graphics Library for C Programmers            August 29, 1992
  1027. Version 1.1
  1028.  
  1029. /*..........................................................................*/
  1030. /*                          Function Prototypes                             */
  1031. /*   The following functions only work in VESA mode 105h (1024 x 768 x 8)   */
  1032. /*   and should run a little faster, but they should only be used           */
  1033. /*   experimentally cause they "aint really checked out".                   */
  1034. /*..........................................................................*/
  1035. void _far _cdecl vsa_line_to_x( unsigned, unsigned );
  1036. void _far _cdecl vsa_rect_fill_x( unsigned, unsigned );
  1037. void _far _cdecl vsa_h_line_x( unsigned, unsigned, unsigned );
  1038. void _far _cdecl vsa_v_line_x( unsigned, unsigned, unsigned );
  1039. void _far _cdecl vsa_raster_line_x( unsigned, unsigned,unsigned,
  1040.              unsigned char _far *);
  1041.  
  1042. /*..........................................................................*/
  1043. /*                    External Parameter Declarations                       */
  1044. /*..........................................................................*/
  1045. unsigned XResolution, YResolution, XCharResolution, YCharResolution;
  1046. unsigned char XCharSize, YCharSize;
  1047. unsigned char BitsPerPixel;
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.                 Page: 19
  1081.