home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
fmgraph
/
g_oarc.c
< prev
next >
Wrap
Text File
|
1990-06-14
|
1KB
|
68 lines
#include <stdio.h>
#include <math.h>
#include <dos.h>
struct FIXED {
unsigned major,minor;
};
struct OVALARC {
unsigned type;
int cx,cy,dx,nul1,nul2,dy;
struct FIXED strd,edrd;
};
extern unsigned char gds_fshift;
extern unsigned gds_wrkoff;
extern unsigned gds_wrkseg;
int g_oval_arc(int x,int y,int rx,int ry,double start,double end)
{
union REGS reg;
struct SREGS seg;
double iwork,fwork;
struct {
unsigned len;
struct OVALARC arc;
} gdata;
segread(&seg);
reg.h.ah=gds_fshift+0x0f;
reg.x.di=(unsigned)&gdata;
seg.ds=seg.ss;
gdata.len=22;
gdata.arc.type=0x4254;
gdata.arc.cx=x;
gdata.arc.cy=y;
gdata.arc.dx=rx;
gdata.arc.nul1=0;
gdata.arc.nul2=0;
gdata.arc.dy=ry;
if(start>=0){
fwork=modf(start,&iwork);
gdata.arc.strd.major=0;
}
else{
fwork=fabs(start);
fwork=modf(fwork,&iwork);
gdata.arc.strd.major=0x8000;
}
gdata.arc.strd.major+=(unsigned)iwork;
gdata.arc.strd.minor=(unsigned)(fwork*65536.0);
if(end>=0){
fwork=modf(end,&iwork);
gdata.arc.edrd.major=0;
}
else{
fwork=fabs(end);
fwork=modf(fwork,&iwork);
gdata.arc.edrd.major=0x8000;
}
gdata.arc.edrd.major+=(unsigned)iwork;
gdata.arc.edrd.minor=(unsigned)(fwork*65536.0);
reg.x.bx=gds_wrkoff;
seg.es=gds_wrkseg;
int86x(0x92,®,®,&seg);
return (int)reg.h.ah;
}