home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / graf / plotfrac.zip / GRAFIX.H < prev    next >
Text File  |  1987-10-23  |  3KB  |  98 lines

  1. /*
  2.         G R A F I X . H
  3.  
  4.  
  5.     To use this package, make sure that your main() has the following
  6.     include definitions:
  7.  
  8.     #include <dos.h>
  9.     #include <stdio.h>
  10.     #include <stdlib.h>
  11.     #include <math.h>
  12.  
  13.     These are needed by the routines which call the BIOS ROM in the
  14.     IBM-PC and compatables.  These routines will only work on the IBM-PC
  15.     or compatables; and are recommended for use only with Microsoft 'C'
  16.     Version 4.00 or later running under MS-DOS 3.10 or later.
  17. */
  18.  
  19. /*
  20.         H E X   C O N S T A N T S
  21. */
  22.  
  23. #define ROM_BIOS       0x10     /* INT 10H calls the IBM-PC ROM
  24.                                    BIOS video driver services       */
  25.  
  26. #define DOS_INT        0x21     /* MS-DOS Int. 21h service call */
  27.  
  28. #define PRN_OUTPUT     0x05     /* Function 05h sends output to PRN: */
  29.  
  30. #define SET_VI_MODE    0x00     /* Function 00h sets the video mode
  31.                                    calls.                           */
  32.  
  33. #define SET_PALETTE    0x0B     /* Function 0Bh sets the color
  34.                                    palette for 320 X 200 medium-res */
  35.  
  36. #define WRITE_PIXEL    0x0C     /* Function 0Ch writes a pixel at
  37.                                    location specified by CX & DX    */
  38.  
  39. #define READ_PIXEL     0x0D     /* Function 0Dh reads the value of
  40.                                    a graphics pixel at location
  41.                                    specified by CX & DX             */
  42.  
  43. #define GET_DIS_MODE   0x0F     /* Function 0Fh gets the current
  44.                                    display mode and saves all the
  45.                                    relevant information.            */
  46.  
  47. #define SELECT_PAGE    0x05     /* Function 05h selects the current
  48.                                    active display page              */
  49.  
  50. /*
  51.         F U N C T I O N   D E C L A R A T I O N S
  52. */
  53.  
  54. extern void get_mode (void);
  55. extern void set_mode (int);
  56. extern void set_palette (int);
  57. extern void set_background (int);
  58. extern void plot_point (int, int, int);
  59. extern void set_page (int);
  60. extern void save_pic (char *, double *, int *);
  61. extern void load_pic (char *);
  62. extern int  read_point (int, int);
  63. extern void print_pic (void);
  64. extern void prn_out (int);
  65.  
  66. /*
  67.         V A R I A B L E   D E C L A R A T I O N S
  68. */
  69.  
  70. union REGS inregs, outregs;
  71. struct SREGS segregs;
  72.  
  73. extern char P_BUFFER[350];
  74.  
  75. extern int bits[8];
  76.  
  77. extern int  CURRENT_PAGE,              /* Returned by get_mode() */
  78.         CURRENT_MODE,              /* Returned by get_mode() */
  79.         PALETTE,                   /* Set by set_palette(Palette) */
  80.         BACKGROUND,                /* Set by set_background(Background) */
  81.         USE_MODE;                  /* Set by set_mode(Mode) */
  82.  
  83. /* Palette = 1 or 0 when used with CGA modes 4 and 5 */
  84. /* Background = 1 - 16 when used with CGA modes 4 or 5 */
  85. /* Mode = 0 - 16 for various text and graphics displays.
  86.           Only Modes 0-6, 14 and 16 are supported currently.
  87.  
  88.     0 = 40 x 25 B/W text, Color Adapter
  89.     1 = 40 x 25 Color Text
  90.     2 = 80 x 25 B/W Text
  91.     3 = 80 x 25 Color Text
  92.     4 = 320 x 200 4-Color Graphics
  93.     5 = 320 x 200 4-Color Graphics (One color only)
  94.     6 = 640 x 200 2-Color Graphics
  95.    14 = 640 X 200 16-Color Graphics (EGA with CGA or EGA monitor)
  96.    16 = 640 X 350 16-Color Graphics (EGA with EGA or Multi-sync monitor)
  97. */
  98.