home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / ms_dos / fmgraph / g_viwprt.c < prev    next >
Text File  |  1990-06-14  |  727b  |  39 lines

  1. #include    <stdio.h>
  2. #include    <dos.h>
  3.  
  4. struct VIEWPORT {
  5.     unsigned    type,escno,escln;
  6.     int    startx,starty,endx,endy;
  7. };
  8.  
  9. extern    unsigned    char    gds_fshift;
  10. extern    unsigned    gds_wrkoff;
  11. extern    unsigned    gds_wrkseg;
  12.  
  13. int    g_viewport(int x1,int y1,int x2,int y2)
  14. {
  15.     union REGS    reg;
  16.     struct SREGS    seg;
  17.     struct {
  18.         unsigned    len;
  19.         struct VIEWPORT    vw;
  20.     }    gdata;
  21.  
  22.     segread(&seg);
  23.     reg.h.ah=gds_fshift+0x0f;
  24.     reg.x.di=(unsigned)&gdata;
  25.     seg.ds=seg.ss;
  26.     gdata.len=14;
  27.     gdata.vw.type=0x602c;
  28.     gdata.vw.escno=1;
  29.     gdata.vw.escln=8;
  30.     gdata.vw.startx=x1;
  31.     gdata.vw.starty=y1;
  32.     gdata.vw.endx=x2;
  33.     gdata.vw.endy=y2;
  34.     reg.x.bx=gds_wrkoff;
  35.     seg.es=gds_wrkseg;
  36.     int86x(0x92,®,®,&seg);
  37.     return (int)reg.h.ah;
  38. }
  39.