home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / pcbsrcs2 / graphics.c < prev    next >
C/C++ Source or Header  |  1991-02-07  |  1KB  |  47 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4.  
  5. /* graphics support routines */
  6.  
  7. void Dot( int, int, int );
  8. int GetMode( void );
  9. void SetMode( int );
  10.  
  11. void Dot ( color, row, col ) /* draw a dot on the screen */
  12.     int color, row, col;
  13.     {
  14.     union REGS regs;
  15.  
  16. /*printf("Dot(color=%d,row=%d,col=%d)\n",color,row,col);*/
  17. /*return;*/
  18.     regs.h.ah = 0xC; /* write pixel */
  19.     regs.h.al = (char)color;
  20.     regs.x.bx = 0;
  21.     regs.x.cx = col;
  22.     regs.x.dx = row;
  23.     int86( 0x10, ®s, ®s );
  24.     }
  25.  
  26. int GetMode () { /* get the graphics screen mode */
  27.     union REGS regs;
  28.  
  29.     regs.h.ah = 0xF; /* get graphics mode */
  30.     int86( 0x10, ®s, ®s );
  31.     regs.h.ah = 0;
  32. /*printf("GetMode() returns %d\n",regs.x.ax);*/
  33.     return( regs.x.ax );
  34.     }
  35.  
  36. void SetMode ( mode ) /* set the graphics screen mode */
  37.     int mode;
  38.     {
  39.     union REGS regs;
  40.  
  41. /*printf("SetMode(mode=%d)\n",mode);*/
  42. /*return;*/
  43.     regs.h.ah = 0; /* set graphics mode */
  44.     regs.h.al = (char)mode;
  45.     int86( 0x10, ®s, ®s );
  46.     }
  47.