home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
games
/
hgraphx.zip
/
HGRAPHX.DOC
Wrap
Text File
|
1989-03-20
|
5KB
|
125 lines
----------------------------------------------------------------------------
Bob Sawyer's graphics library
Name: HGRAPHX
-- A library of graphics functions for the Hercules Monochrome
Graphics Card, including both C source and compiled code for
graphics primitives and for some basic utilities (see below).
Class: Public domain, no rights reserved, no responsibility assumed!
Users are asked to contribute to the public domain.
Author: Bob Sawyer, 3620 Spencer St. 30, Torrance, CA 90503.
Date: Jun84
REQUIREMENTS:
Hardware -- Hercules Monochrome Graphics Card & compatible monitor.
(I don't know about the Hercules Color Card)
Software -- Hercules INT10.EXE program, supplied with the Hercules Card.
This program MUST be run ONCE after booting in order for
these graphics functions to work.
-- These programs have been compiled with the C Ware (DeSmet)
C compiler, v2.4, on an IBM-PC running DOS 2.1. I use an
IBM green monitor and an Amdek 310A amber monitor.
Files:
Demonstration files:
demo.bat --------------batch file to illustrate all the functions
demo.dat --------------short data file to be plotted by gplot
iterxy.c & .exe -------a demonstration program
Utilities:
gplot.c & .exe --------prg to plot numer. data from a two-col. text file
gprint.c & .exe -------prg to copy either graphics page (0/1) to printer
gsave.c & .exe --------prg to copy " " " " to file
gload.c & .exe --------prg to copy gsave'd file to either graphics page
gshow.c & .exe --------prg to view either graphics page
gcls.c & .exe ---------prg to clear either graphics page
peekpoke.a ------------assem. lang. code for peek() & poke() functions
The .exe programs were created by first
compiling the .c file, then binding with
graphx.s, e.g.:
c88 gplot
bind gplot graphx.s
The peekpoke.a assembly language file is included
in case your compiler doesn't include the peek()
and poke() functions -- earlier DeSmet versions
didn't. If you're using a different compiler,
you'll have to translate the .a files into .asm
format appropriate to your assembler.
Graphics primitives:
graphx.c --------------c code for the primary graphics functions
sys_int.a -------------assem. lang. code for function to call interrupts
graphx.s --------------library of compiled graphx functions, created by:
c88 graphx
asm88 sys_int
lib88 graphx sys_int -ographx
Synopses of graphics functions in graphx.c and graphx.s:
gmode() /*enter graphics mode*/
tmode() /*enter normal text (non-graphics) mode*/
clrscr() /*clear active write page*/
gpage(page) /*set active write page (0 or 1; default=0)*/
int page;
level(intens) /*set intensity level to 0(black), 1(white),*/
int intens; /*or 2(xor); default=1*/
disp(page) /*set active display page (0 or 1; default=0*/
int page;
plot(col, row) /*write pixel at specified row and column*/
int col, row; /*0<=row<=347, 0<=col<=719*/
getpt(col, row, pintens) /*report intensity level (0 or 1) of pixel*/
int col, row;
int *pintens;
move(col, row) /*set current position to specified pixel*/
int col, row;
dline(col, row) /*draw line from current position to specified*/
int col, row; /*pixel*/
blkfil(col, row, width, height) /*fill rectangle with lower left corner*/
int col, row, width, height; /*at (row,col) and of specified size*/
text(col, row, chr) /*write a single character with lower left*/
int col, row; /*corner at (row,col); level() determines*/
char chr; /*char attribute (0=reverse,1=normal,2=xor)*/
arc(col, row, radius, quad) /*draw a quarter circular arc with specified*/
int col, row, radius, quad; /*center, radius, and quadrant (1=upper-right,*/
/*2=upper-left,3=lower-left,4=lower-right)*/
circ(col, row, radius) /*draw circle with specified center & radius*/
int col, row, radius; /*radius = number of columns from center*/
fill(col, row) /*change intens. of interior of convex polygon*/
int col, row;
------------end-of-text-----------------------------------------------------
interior of convex polygon*/
int col, row;
------------end-of-text----------