home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / hgraphx.zip / HGRAPHX.DOC
Text File  |  1989-03-20  |  5KB  |  125 lines

  1. ----------------------------------------------------------------------------
  2. Bob Sawyer's graphics library
  3.  
  4. Name:      HGRAPHX
  5.  
  6.            -- A library of graphics functions for the Hercules Monochrome 
  7.               Graphics Card, including both C source and compiled code for
  8.               graphics primitives and for some basic utilities (see below).  
  9.  
  10. Class:     Public domain, no rights reserved, no responsibility assumed!
  11.            Users are asked to contribute to the public domain.
  12.  
  13. Author:    Bob Sawyer, 3620 Spencer St. 30, Torrance, CA 90503.
  14.  
  15. Date:      Jun84
  16.  
  17. REQUIREMENTS:
  18.  
  19.     Hardware --  Hercules Monochrome Graphics Card & compatible monitor.
  20.                  (I don't know about the Hercules Color Card)
  21.  
  22.     Software --  Hercules INT10.EXE program, supplied with the Hercules Card.
  23.                  This program MUST be run ONCE after booting in order for
  24.                  these graphics functions to work.
  25.  
  26.              --  These programs have been compiled with the C Ware (DeSmet)
  27.                  C compiler, v2.4, on an IBM-PC running DOS 2.1.  I use an
  28.                  IBM green monitor and an Amdek 310A amber monitor.
  29.  
  30.  
  31. Files:
  32.  
  33.     Demonstration files:
  34.  
  35.     demo.bat --------------batch file to illustrate all the functions
  36.     demo.dat --------------short data file to be plotted by gplot
  37.     iterxy.c & .exe -------a demonstration program
  38.  
  39.     Utilities:
  40.  
  41.     gplot.c & .exe --------prg to plot numer. data from a two-col. text file
  42.     gprint.c & .exe -------prg to copy either graphics page (0/1) to printer
  43.     gsave.c & .exe --------prg to copy  "      "        "     "   to file
  44.     gload.c & .exe --------prg to copy gsave'd file to either graphics page
  45.     gshow.c & .exe --------prg to view either graphics page
  46.     gcls.c & .exe ---------prg to clear either graphics page
  47.     peekpoke.a ------------assem. lang. code for peek() & poke() functions
  48.   
  49.                            The .exe programs were created by first
  50.                            compiling the .c file, then binding with
  51.                            graphx.s, e.g.:
  52.                                c88 gplot
  53.                                bind gplot graphx.s
  54.  
  55.                            The peekpoke.a assembly language file is included
  56.                            in case your compiler doesn't include the peek()
  57.                            and poke() functions -- earlier DeSmet versions
  58.                            didn't.  If you're using a different compiler, 
  59.                            you'll have to translate the .a files into .asm
  60.                            format appropriate to your assembler.
  61.  
  62.     Graphics primitives:
  63.  
  64.     graphx.c --------------c code for the primary graphics functions
  65.     sys_int.a -------------assem. lang. code for function to call interrupts
  66.     graphx.s --------------library of compiled graphx functions, created by:
  67.                               c88 graphx
  68.                               asm88 sys_int
  69.                               lib88 graphx sys_int -ographx
  70.  
  71.  
  72. Synopses of graphics functions in graphx.c and graphx.s:
  73.  
  74. gmode()                      /*enter graphics mode*/
  75.  
  76. tmode()                      /*enter normal text (non-graphics) mode*/
  77.  
  78. clrscr()                     /*clear active write page*/ 
  79.  
  80. gpage(page)                  /*set active write page (0 or 1; default=0)*/
  81. int page;
  82.  
  83. level(intens)                /*set intensity level to 0(black), 1(white),*/
  84. int intens;                  /*or 2(xor); default=1*/
  85.  
  86. disp(page)                   /*set active display page (0 or 1; default=0*/
  87. int page;
  88.  
  89. plot(col, row)               /*write pixel at specified row and column*/
  90. int col, row;                /*0<=row<=347,  0<=col<=719*/
  91.  
  92. getpt(col, row, pintens)     /*report intensity level (0 or 1) of pixel*/
  93. int col, row;
  94. int *pintens;
  95.  
  96. move(col, row)               /*set current position to specified pixel*/
  97. int col, row;
  98.  
  99. dline(col, row)              /*draw line from current position to specified*/
  100. int col, row;                /*pixel*/
  101.  
  102. blkfil(col, row, width, height)   /*fill rectangle with lower left corner*/
  103. int col, row, width, height;      /*at (row,col) and of specified size*/
  104.  
  105. text(col, row, chr)          /*write a single character with lower left*/
  106. int col, row;                /*corner at (row,col); level() determines*/
  107. char chr;                    /*char attribute (0=reverse,1=normal,2=xor)*/
  108.  
  109. arc(col, row, radius, quad)  /*draw a quarter circular arc with specified*/
  110. int col, row, radius, quad;  /*center, radius, and quadrant (1=upper-right,*/
  111.                              /*2=upper-left,3=lower-left,4=lower-right)*/
  112.  
  113. circ(col, row, radius)       /*draw circle with specified center & radius*/
  114. int col, row, radius;        /*radius = number of columns from center*/ 
  115.  
  116. fill(col, row)               /*change intens. of interior of convex polygon*/
  117. int col, row;
  118.  
  119.  
  120. ------------end-of-text-----------------------------------------------------
  121.  interior of convex polygon*/
  122. int col, row;
  123.  
  124.  
  125. ------------end-of-text----------