home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
-
- /* graphics support routines */
-
- void Dot( int, int, int );
- int GetMode( void );
- void SetMode( int );
-
- void Dot ( color, row, col ) /* draw a dot on the screen */
- int color, row, col;
- {
- union REGS regs;
-
- /*printf("Dot(color=%d,row=%d,col=%d)\n",color,row,col);*/
- /*return;*/
- regs.h.ah = 0xC; /* write pixel */
- regs.h.al = (char)color;
- regs.x.bx = 0;
- regs.x.cx = col;
- regs.x.dx = row;
- int86( 0x10, ®s, ®s );
- }
-
- int GetMode () { /* get the graphics screen mode */
- union REGS regs;
-
- regs.h.ah = 0xF; /* get graphics mode */
- int86( 0x10, ®s, ®s );
- regs.h.ah = 0;
- /*printf("GetMode() returns %d\n",regs.x.ax);*/
- return( regs.x.ax );
- }
-
- void SetMode ( mode ) /* set the graphics screen mode */
- int mode;
- {
- union REGS regs;
-
- /*printf("SetMode(mode=%d)\n",mode);*/
- /*return;*/
- regs.h.ah = 0; /* set graphics mode */
- regs.h.al = (char)mode;
- int86( 0x10, ®s, ®s );
- }
-