home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
fmgraph
/
g_paint.c
< prev
next >
Wrap
Text File
|
1990-06-14
|
903b
|
46 lines
#include <stdio.h>
#include <dos.h>
struct PAINT {
unsigned type,type2;
int px,py;
unsigned bordrno;
unsigned bdrcolor[10];
};
extern unsigned char gds_fshift;
extern unsigned gds_wrkoff;
extern unsigned gds_wrkseg;
int g_paint(int x,int y,unsigned number,unsigned *color)
{
union REGS reg;
struct SREGS seg;
struct {
unsigned len;
struct PAINT paintrec;
} gdata;
int i;
if((number==0)||(number>10))
return -1;
segread(&seg);
reg.h.ah=gds_fshift+0x0f;
reg.x.di=(unsigned)&gdata;
seg.ds=seg.ss;
gdata.len=10+number*2;
gdata.paintrec.type=0x4148+number*2;
gdata.paintrec.type2=5;
gdata.paintrec.px=x;
gdata.paintrec.py=y;
gdata.paintrec.bordrno=number;
for(i=0; i<number; i++){
gdata.paintrec.bdrcolor[i]=*color;
color++;
}
reg.x.bx=gds_wrkoff;
seg.es=gds_wrkseg;
int86x(0x92,®,®,&seg);
return (int)reg.h.ah;
}