home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dos.h>
-
- struct CLIP {
- unsigned type;
- int cx1,cy1,cx2,cy2;
- };
-
- extern unsigned char gds_fshift;
- extern unsigned gds_wrkoff;
- extern unsigned gds_wrkseg;
-
- int g_clip(int x1,int y1,int x2,int y2)
- {
- union REGS reg;
- struct SREGS seg;
- struct {
- unsigned len;
- struct CLIP vdc;
- } gdata;
-
- segread(&seg);
- reg.h.ah=gds_fshift+0x0f;
- reg.x.di=(unsigned)&gdata;
- seg.ds=seg.ss;
- gdata.len=10;
- gdata.vdc.type=0x3088;
- gdata.vdc.cx1=x1;
- gdata.vdc.cy1=y1;
- gdata.vdc.cx2=x2;
- gdata.vdc.cy2=y2;
- reg.x.bx=gds_wrkoff;
- seg.es=gds_wrkseg;
- int86x(0x92,®,®,&seg);
- return (int)reg.h.ah;
- }