home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
fmgraph
/
g_tilpt2.c
< prev
next >
Wrap
Text File
|
1990-06-14
|
900b
|
45 lines
#include <stdio.h>
#include <dos.h>
struct TILEPT2 {
unsigned type,dlen;
char tileid,reserve;
unsigned wdh,hgt;
unsigned ptn[128];
};
extern unsigned char gds_fshift;
extern unsigned gds_wrkoff;
extern unsigned gds_wrkseg;
int g_tilepattern2(char id,unsigned height,unsigned *pattern)
{
union REGS reg;
struct SREGS seg;
struct {
unsigned len;
struct TILEPT2 tile;
} gdata;
int i;
if((height==0)||(height>16))
return -1;
segread(&seg);
reg.h.ah=gds_fshift+0x0f;
reg.x.di=(unsigned)&gdata;
seg.ds=seg.ss;
gdata.len=10+height*16;
gdata.tile.type=0x53ff;
gdata.tile.dlen=6+height*16;
gdata.tile.tileid=id;
gdata.tile.reserve=0;
gdata.tile.wdh=8;
gdata.tile.hgt=height;
for(i=0;i<(height*8);i++)
gdata.tile.ptn[i]=*pattern++;
reg.x.bx=gds_wrkoff;
seg.es=gds_wrkseg;
int86x(0x92,®,®,&seg);
return (int)reg.h.ah;
}