/* gxLib.H */ /* Copyright (c) Genus Microprogramming, Inc. 1988-92 All Rights Reserved. */ /**************************************************************************** Function declarations for GX Kernel v2.00, for C. Microsoft C version 6.x Programmer: Chris Howard 01/21/90 Daniel Sie 05/15/91 Luhit Young 03/01/92 *****************************************************************************/ /* GX ID's */ #define gxID 0xCA /* Genus manufacturer ID */ #define gxVHID 0xCA00 /* GX virtual header ID value */ #define gxLHID 0xCA01 /* GX Library header ID value */ /* GX Display modes */ #define gxDETECT -1 /* Detect mode */ #define gxTEXT 0 /* Text mode */ #define gxGRAPHICS 1 /* Graphics mode */ /* GX Display types */ #define gxMINDISP 0 #define gxCGA_4 0 /* CGA Mode 4H ( 320x200x4 ) */ #define gxCGA_6 1 /* CGA Mode 6H ( 640x200x2 ) */ #define gxEGA_D 2 /* EGA Mode DH ( 320x200x16 ) */ #define gxEGA_E 3 /* EGA Mode EH ( 640x200x16 ) */ #define gxEGA_F 4 /* EGA Mode FH ( 640x350x2 ) */ #define gxEGA_10 5 /* EGA Mode 10H ( 640x350x16 ) */ #define gxVGA_11 6 /* VGA Mode 11H ( 640x480x2 ) */ #define gxVGA_12 7 /* VGA Mode 12H ( 640x480x16 ) */ #define gxVGA_13 8 /* VGA Mode 13H ( 320x200x256) */ #define gxHERC 9 /* Hercules ( 720x348x2 ) */ #define gxTS_29 10 /* Tseng 29H ( 800x600x16 ) */ #define gxTS_2D 11 /* Tseng 2DH ( 640x350x256) */ #define gxTS_2E 12 /* Tseng 2EH ( 640x480x256) */ #define gxTS_30 13 /* Tseng 30H ( 800x600x256) */ #define gxTS_38 26 /* Tseng 38H (1024x768x256) */ #define gxPAR_58 14 /* Paradise 58H ( 800x600x16 ) */ #define gxPAR_59 15 /* Paradise 59H ( 800x600x2 ) */ #define gxPAR_5E 16 /* Paradise 5EH ( 640x400x256) */ #define gxPAR_5F 17 /* Paradise 5FH ( 640x480x256) */ #define gxPAR_5C 27 /* Paradise 5CH ( 800x600x256) */ #define gxPAR_60 28 /* Paradise 60H (1024x768x256) */ #define gxV7_62 18 /* Video 7 62H ( 800x600x16 ) */ #define gxV7_66 19 /* Video 7 66H ( 640x400x256) */ #define gxV7_67 20 /* Video 7 67H ( 640x480x256) */ #define gxV7_69 21 /* Video 7 69H ( 800x600x256) */ #define gxV7_6A 29 /* Video 7 6AH (1024x768x256) */ #define gxATI_54 22 /* ATI 54H ( 800x600x16 ) */ #define gxATI_61 23 /* ATI 61H ( 640x400x256) */ #define gxATI_62 24 /* ATI 62H ( 640x480x256) */ #define gxATI_63 25 /* ATI 63H ( 800x600x256) */ #define gxATI_64 30 /* ATI 64H (1024x768x256) */ #define gxTRI_5B 31 /* Trident 5BH ( 800x600x16 ) */ #define gxTRI_5C 32 /* Trident 5CH ( 640x400x256) */ #define gxTRI_5D 33 /* Trident 5DH ( 640x480x256) */ #define gxTRI_5E 34 /* Trident 5EH ( 800x600x256) */ #define gxTRI_62 35 /* Trident 62H (1024x768x256) */ #define gxVESA_100 36 /* VESA 100H ( 640x400x256) */ #define gxVESA_101 37 /* VESA 101H ( 640x480x256) */ #define gxVESA_102 38 /* VESA 102H ( 800x600x16 ) */ #define gxVESA_103 39 /* VESA 103H ( 800x600x256) */ #define gxVESA_105 40 /* VESA 105H (1024x768x256) */ #define gxMAXDISP 40 /* Searches */ #define gxFIRST 0 /* Find first matching entry */ #define gxNEXT 1 /* Find next matching entry */ /* Logical Operations */ #define gxSET 0 /* SET pixel value directly */ #define gxAND 1 /* AND pixel value with data */ #define gxOR 2 /* OR pixel value with data */ #define gxXOR 3 /* XOR pixel value with data */ /* Virtual memory type */ #define gxCMM 0 /* Conventional Memory virtual */ #define gxEMM 1 /* Expanded Memory virtual */ #define gxDMM 2 /* Disk paging virtual memory */ #define gxXMM 3 /* Extended Memory virtual */ /* Library type */ #define gxDIR 0 /* DOS directory */ #define gxGXL 1 /* GXL file */ #define gxEXE 2 /* GXL imbedded in EXE */ /* Dither matrix type */ #define gxMAGICSQ 0 /* Magic square */ #define gxDISPERSED 1 /* Dispersed-dot */ #define gxCLUSTERED 2 /* Clustered-dot */ /* Timer resolution */ #define gxLOWRES 0 /* Low res (54.92 msec/cycle) */ #define gxHIGHRES 1 /* High res (1 msec/cycle) */ /* Miscellaneous */ #define gxTRUE 1 /* True value */ #define gxFALSE 0 /* False value */ /* Video Info Constants */ #define viNONE 0 /* No adapter/display */ #define viMDA 1 /* Monochrome Display Adapter */ #define viCGA 2 /* Color Graphics Adapter */ #define viEGA 3 /* Enhanced Graphics Adapter */ #define viMCGA 4 /* MCGA */ #define viVGA 5 /* Video Graphics Array */ #define viHGC 0x80 /* Hercules Monochrome */ #define viHGCPlus 0x81 /* Hercules Plus */ #define viHGCColor 0x82 /* Hercules InColor */ #define viMDAdisp 1 /* Monochrome Display */ #define viCGAdisp 2 /* CGA Display */ #define viEGAdisp 3 /* EGA Display */ #define viVGAmono 4 /* VGA Monochrome Display */ #define viVGAcolor 5 /* VGA Color Display */ /* Chip sets */ #define chipUNKNOWN 0 /* Unknown chipset */ #define chipTSENG 1 /* Tseng ET3000 */ #define chipPARA 2 /* Paradise */ #define chipV7 3 /* Video 7 */ #define chipATI 4 /* ATI VGA Wonder */ #define chipTSENG4 5 /* Tseng ET4000 */ #define chipTRIDENT 6 /* Trident */ #define chipVESA 7 /* VESA compatible */ /* Hercules Configuration */ #define gxHERCdiag 0 /* Hercules Diagnostic */ #define gxHERChalf 1 /* Hercules Half */ #define gxHERCfull 3 /* Hercules Full */ /* Default Palette Colors */ #define gxBLACK 0 /* Black = 00H */ #define gxBLUE 1 /* Blue = 01H */ #define gxGREEN 2 /* Green = 02H */ #define gxCYAN 3 /* Cyan = 03H */ #define gxRED 4 /* Red = 04H */ #define gxMAGENTA 5 /* Magenta = 05H */ #define gxBROWN 6 /* Brown = 06H */ #define gxGRAY 7 /* Light Gray = 07H */ #define gxDARKGRAY 8 /* Dark Gray = 038H */ #define gxLIGHTBLUE 9 /* Light Blue = 039H */ #define gxLIGHTGREEN 10 /* Light Green = 03AH */ #define gxLIGHTCYAN 11 /* Light Cyan = 03BH */ #define gxLIGHTRED 12 /* Light Red = 03CH */ #define gxLIGHTMAGENTA 13 /* Light Magenta = 03DH */ #define gxYELLOW 14 /* Yellow = 03EH */ #define gxWHITE 15 /* White = 03FH */ /* Palette types */ #define gxPAL0 0 /* No palette (B/W) */ #define gxPAL1 1 /* CGA 4 color */ #define gxPAL2 2 /* CGA 2 color */ #define gxPAL3 3 /* EGA 16 color */ #define gxPAL4 4 /* VGA 16 color */ #define gxPAL5 5 /* VGA 256 color */ /* Error Codes */ #define gxSUCCESS 0 /* Successful */ #define gxERR_OPEN -1 /* Error opening file */ #define gxERR_BUFSMALL -2 /* Buffer is too small */ #define gxERR_READ -3 /* Error in reading from file */ #define gxERR_WRITE -4 /* Error in writing to file */ #define gxERR_BADDISP -6 /* Display not defined or invalid */ #define gxERR_BADMODE -7 /* Bad display mode */ #define gxERR_BADPAGE -8 /* Bad page */ #define gxERR_BADPAL -9 /* Bad palette */ #define gxERR_NOPAL -10 /* No palette available */ #define gxERR_NOPALGRAB -11 /* Palette is not grabbed */ #define gxERR_NOTGXLIB -12 /* Not a GX library */ #define gxERR_NOTFOUND -14 /* Image not found in library */ #define gxERR_CLIPPARM -15 /* Bad Clipper parameter */ #define gxERR_ESCAPE -20 /* Escape key was pressed */ #define gxERR_NOEMM -21 /* No EMM driver was found */ #define gxERR_EMMFAIL -22 /* General EMM driver failure */ #define gxERR_EMMNOMEM -23 /* No EMM memory available */ #define gxERR_BADMEMTYPE -24 /* Bad virtual memory type */ #define gxERR_CMMFAIL -25 /* General CMM alloc/free error*/ #define gxERR_CMMNOMEM -26 /* No CMM memory available */ #define gxERR_BADCOORD -27 /* Bad coordinate location */ #define gxERR_NOTGX -28 /* Not a valid GX buffer/file */ #define gxERR_NODMM -29 /* No DMM driver was found */ #define gxERR_DMMFAIL -30 /* General DMM driver failure */ #define gxERR_DMMNOMEM -31 /* No DMM memory available */ #define gxERR_DMMFILE -32 /* Error with DMM file */ #define gxERR_CLOSE -33 /* Error closing a file */ #define gxERR_BADCHIP -34 /* Invalid chipset */ #define gxERR_EOF -35 /* End of file found */ #define gxERR_NOXMM -36 /* No XMS driver was found */ #define gxERR_XMMFAIL -37 /* General XMS driver failure */ #define gxERR_XMMNOMEM -38 /* No XMM memory available */ #define gxERR_NOVESA -39 /* No VESA driver was found */ #define gxERR_VESAFAIL -40 /* General VESA driver failure */ #define gxERR_BADDMTYPE -41 /* Invalid dither matrix type */ #define gxERR_NOTIMPL -900 /* Not implemented yet */ #define gxERR_GENERAL -999 /* General error */ /* GX Header */ typedef struct gxheader { unsigned id; /* Virtual header id (=0CA00H) */ unsigned version; /* Version number */ int dtype; /* Display type */ unsigned x1; /* Picture dimensions (incl) */ unsigned y1; unsigned x2; unsigned y2; unsigned hres; /* Display horiz resolution */ unsigned vres; /* Display vert resolution */ char nplanes; /* Number of planes */ char bitpx; /* Bits per pixel */ unsigned bplin; /* Bytes per line */ unsigned vtype; /* Virtual buffer type */ char far * vptr; /* Virtual buffer pointer */ unsigned ptype; /* Palette type */ char far * pptr; /* Palette buffer pointer */ char reserved[94]; /* Reserved for GX kernel */ } GXHEADER; typedef GXHEADER far * GXHEADERPTR; /* Library Header */ typedef struct gxlibheader { unsigned id; /* Library header id (=0CA01H) */ char copyright[50]; /* Copyright notice */ unsigned version; /* gxLib version */ char label[40]; /* Library volume label */ unsigned entries; /* Total image entries */ char reserved[32]; /* Reserved for GX kernel */ } GXLIBHEADER; typedef GXLIBHEADER far * GXLIBHEADERPTR; /* Library File Information */ typedef struct gxfinfo { char pack; /* Packing type */ char filename[13]; /* Image file name */ long filepos; /* File position (data) */ long filesize; /* File size */ unsigned filedate; /* File date */ unsigned filetime; /* File time */ } GXFINFO; typedef GXFINFO far * GXFINFOPTR; /* Library Structure */ typedef struct gxlib { char ltype; /* Lib type (gxDIR,gxGXL,gxEXE)*/ char path[65]; /* Directory path (gxDIR) */ unsigned handle; /* File handle (gxEXE,gxLIB) */ unsigned entries; /* Total index entries */ long lpos; /* Library position */ unsigned bbegent; /* Bucket entry (beginning) */ unsigned bcurent; /* Bucket entry (current) */ unsigned bmaxent; /* Bucket entries (maximum) */ long bptr; /* Bucket pointer */ char reserved[172]; /* Reserved for GX kernel */ } GXLIB; typedef GXLIB far * GXLIBPTR; /* Display Type Information */ typedef struct gxdinfo { char dtype; /* Display type */ char descrip[20]; /* String description */ char ctype; /* Color type */ char mode; /* Actual BIOS mode */ char bitpx; /* Number of bits per pixel */ unsigned hres; /* Horizontal resolution */ unsigned vres; /* Vertical resolution */ unsigned bplin; /* Number of bytes per row */ char planes; /* Number of display planes */ char pages; /* Number of display pages */ unsigned begseg; /* Beginning display segment */ unsigned pagesize; /* Size of display page */ unsigned paltype; /* Palette format type */ } GXDINFO; typedef GXDINFO *GXDINFOPTR; /* Video Info Structure */ typedef struct gxvinfo { unsigned char adapter; /* Video Adapter */ unsigned char display; /* Video Display */ } GXVINFO; typedef GXVINFO *GXVINFOPTR; /* Chipset Info structure */ typedef struct gxcinfo { int chipset; /* Chipset */ int memory; /* Memory installed in Kbyte */ int maxdisp; /* Maximum display type */ } GXCINFO; typedef GXCINFO *GXCINFOPTR; /* VESA SVGA information block */ typedef struct gxvesainfo { char signature[4]; /* VESA signature string */ unsigned version; /* Version number */ char far *OEMstrptr; /* Pointer to OEM string */ char capabilities[4]; /* Capabilities of video */ void far *modeptr; /* Ptr to supported SVGA modes */ unsigned memblocks; /* Number of 64K memory blocks */ char reserved[236]; /* Reserved for VESA */ } GXVESAINFO; typedef GXVESAINFO *GXVESAINFOPTR; /* New types */ #ifndef BYTE typedef unsigned char BYTE; /* A single byte */ #endif #ifndef WORD typedef unsigned int WORD; /* Unsigned integer */ #endif /* Functions */ #ifdef __cplusplus extern "C" { #endif /* gxBT.asm */ extern int far pascal gxBeginTimer (int); extern long far pascal gxGetTime (void); extern long far pascal gxElapsedTime (long); extern int far pascal gxDelay (long); extern int far pascal gxKeyCheck (int); /* gxCV.asm */ extern int far pascal gxSetVirtualHeader (int,GXHEADER far *,long,int,int,int); extern int far pascal gxCreateVirtual (int,GXHEADER far *,int,int,int); extern int far pascal gxDestroyVirtual (GXHEADER far *); /* gxDD.asm */ extern int far pascal gxDisplayDisplay (int,int,int,int,int,int,int,int); /* gxDM.asm */ extern int far pascal gxDMMInstalled (void); extern int far pascal gxInstallDMM (char far *,unsigned); extern int far pascal gxRemoveDMM (void); /* gxDP.asm */ extern int far pascal gxGetPaletteType (int); extern int far pascal gxSetDisplayPalette (char far *); extern int far pascal gxGetDisplayPalette (char far *); extern int far pascal gxSetPaletteColor (int,int); extern int far pascal gxGetPaletteColor (int); extern int far pascal gxSetPaletteRGB (int,int,int,int); extern int far pascal gxGetPaletteRGB (int,int far *,int far *,int far *); /* gxDT.asm */ extern int far pascal gxVerifyDisplayType (int); extern int far pascal gxMapDisplayType (int,int); /* gxDV.asm */ extern int far pascal gxDisplayVirtual (int,int,int,int,int,GXHEADER far *,int,int); /* gxEM.asm */ extern int far pascal gxEMSInstalled (void); /* gxFM.asm */ #ifdef __TURBOC__ extern int far pascal gxSetUserMalloc (void far * (far pascal *)(unsigned long),int (far pascal *)(void far *),unsigned long (far pascal *)(void)); #endif /* gxGI.asm */ extern int far pascal gxGetImage (GXHEADER far *,int,int,int,int,int); /* gxLB.asm */ extern long far pascal gxLibBuffer (GXLIB far *,char far *,long,unsigned,char far *); /* gxOL.asm */ extern int far pascal gxOpenLib (int,char far *,GXLIB far *,char far *,int); extern int far pascal gxCloseLib (GXLIB far *); extern int far pascal gxFindFile (GXLIB far *,char far *,GXFINFO far *,int); /* gxPG.asm */ extern int far pascal gxBeginPaletteGrab (char far *); extern int far pascal gxEndPaletteGrab (void); /* gxPI.asm */ extern int far pascal gxPutImage (GXHEADER far *,int,int,int,int); /* gxQC.asm */ extern int far pascal gxVESAInstalled (GXVESAINFO far *); extern int far pascal gxQueryChipset (void); extern int far pascal gxSetChipset (int); extern int far pascal gxGetChipset (void); extern int far pascal gxChipsetInfo (GXCINFO far *); /* gxRD.asm */ extern int far pascal gxClearDisplay (int,int); /* gxRV.asm */ extern int far pascal gxClearVirtual (GXHEADER far *,int); /* gxSB.asm */ extern int far pascal gxSetBuffer (char far *,int); /* gxSD.asm */ extern int far pascal gxGetVersion (int far *,int far *); extern int far pascal gxSetDisplay (int); extern int far pascal gxGetDisplay (void); extern int far pascal gxGetDisplayInfo (int,GXDINFO far *); extern int far pascal gxSetMode (int); extern int far pascal gxGetMode (void); extern int far pascal gxSetHerc (int); extern int far pascal gxModeCheck (int); extern int far pascal gxRetraceCheck (int); /* gxSL.asm */ extern int far pascal gxGetVirtualScanline (GXHEADER far *,int,char far *); extern int far pascal gxSetVirtualScanline (GXHEADER far *,int,char far *); /* gxSP.asm */ extern int far pascal gxSetPage (int); extern int far pascal gxGetPage (void); /* gxSR.asm */ extern int far pascal gxSetRandom (int); extern int far pascal gxGetRandom (int); /* gxTB.asm */ extern int far pascal gxTextBuffer (char far *); extern int far pascal gxBufferText (char far *); /* gxVC.asm */ extern int far pascal gxFindClosestColor (int); extern int far pascal gxFindClosestRGB (int,int,int,int); extern int far pascal gxGetDitherMatrix (void); extern int far pascal gxSetDitherMatrix (int); extern int far pascal gxGetConvertPalette (int,char far *); extern int far pascal gxSetConvertPalette (int,char far *); extern int far pascal gxVirtualConvert (GXHEADER far *,char far *,GXHEADER far *); /* gxVD.asm */ extern int far pascal gxVirtualDisplay (GXHEADER far *,int,int,int,int,int,int,int); /* gxVI.asm */ extern int far pascal gxVideoInfo (GXVINFO far *); /* gxVL.asm */ extern int far pascal gxVirtualScale (GXHEADER far *,GXHEADER far *); /* gxVR.asm */ extern long far pascal gxVirtualSize (int,int,int); extern long far pascal gxVirtualFree (int); /* gxVS.asm */ extern int far pascal gxVirtualScroll (GXHEADER far *,int,int,int,int,int,int,int); /* gxVV.asm */ extern int far pascal gxVirtualVirtual (GXHEADER far *,int,int,int,int,GXHEADER far *,int,int,int); /* gxXM.asm */ extern int far pascal gxXMSInstalled (void); extern int far pascal gxXMMInstalled (void); extern int far pascal gxInstallXMM (unsigned); extern int far pascal gxRemoveXMM (void); #ifdef __cplusplus } #endif