home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dos.h>
-
- struct CHARWIDTH {
- unsigned type,count,step;
- };
-
- extern unsigned char gds_fshift;
- extern unsigned gds_wrkoff;
- extern unsigned gds_wrkseg;
-
- int g_charwidth(unsigned count,unsigned step)
- {
- union REGS reg;
- struct SREGS seg;
- struct {
- unsigned len;
- struct CHARWIDTH wdh;
- } gdata;
-
- segread(&seg);
- reg.h.ah=gds_fshift+0x0f;
- reg.x.di=(unsigned)&gdata;
- seg.ds=seg.ss;
- gdata.len=6;
- gdata.wdh.type=0x5184;
- gdata.wdh.count=count;
- gdata.wdh.step=step;
- reg.x.bx=gds_wrkoff;
- seg.es=gds_wrkseg;
- int86x(0x92,®,®,&seg);
- return (int)reg.h.ah;
- }