1512GFX    640x200x16 graphics on the PC1512    John Elliott, 30 December 1997
==============================================================================

  1512GFX is a simple library of C routines based on the PC1512 programming
information given in Cliff Lawson's web page. It provides functions for access
to the 640x200x16 CGA graphics mode (used, for example, by GEM).

  The programs supplied with 1512GFX are intended simply as samples of how to
use the library.

  1512GFX is released under the GNU library GPL, version 2 (see the file 
COPYING.LIB in this archive) or optionally a later version of the library GPL.

  Files provided are:

1512GFX.H:  Header file. Include this in your programs.
1512GFX.C:  Implementation file. This is simply a rendering into C of the
            information on the web page.

1512BMP.C:   A program which uses the library to display BMP files. Note that
            because of the CGA aspect ratio, the BMP will look stretched in
            the vertical.
             The resulting images can be saved as .4PL files; these are just
            a dump of the four colour planes in memory. .4PL files can be
            loaded (by LOAD4PL) much faster than .BMP files.
1512BMP.EXE: Compiled version of 1512BMP.C above. 

LOAD4PL.C:    Load a .4PL file.
LOAD4PL.EXE:  Compiled version of LOAD4PL.C above.

Functions
=========

int  gfx_init(void);	

       Initialise the library. Returns 1 if on a PC1512, else 0.
     The library will still function on non-PC1512 hardware, but all graphics
     will be in standard CGA 640x200x2 mode.

void gfx_mode(void);

       Select the graphics mode. 640x200x16 on a PC1512; else 640x200x2.

void gfx_off(void);

       Restore the previous screen mode - normally 80-column text.

void gfx_wplane(unsigned char plane);

       The PC1512 graphics mode works by having four planes in the CGA video
     memory (B800:0000). This sets which planes will be written when a byte
     is written to this area of memory. The value passed is a bitmap:

              Bit 3 set: Intensity
              Bit 2 set: Red
              Bit 1 set: Green
              Bit 0 set: Blue

     On non-PC1512 computers, there is only one plane and this call has no
     effect.

void gfx_rplane(unsigned char plane);

       This sets which plane will be read when a byte is read from the CGA
     video memory. The value passed is _not_ a bitmap, but a number:

              3 => Intensity
              2 => Red
              1 => Green
              0 => Blue

       On non-PC1512 computers, there is only one plane so this call has
     no effect.

int gfx_flyback(int wait);

       If "wait" is nonzero, then wait for frame flyback and return 0.
       If "wait" is zero,    then return 8 if flyback is taking place, else 0.
										     waits for flyback, returns 0 */
void gfx_border(int bdr);

     Set the border colour to bdr.

void gfx_getplane(unsigned char *plane);

     Read the current plane (0x3F3F bytes).

void gfx_putplane(unsigned char *plane);

     Write 0x3F3F bytes from "plane" to the currently selected plane or
   planes.

