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

  1. #include    <stdio.h>
  2. #include    <dos.h>
  3.  
  4. struct TILEPT2 {
  5.     unsigned    type,dlen;
  6.     char    tileid,reserve;
  7.     unsigned    wdh,hgt;
  8.     unsigned    ptn[128];
  9. };
  10.  
  11. extern unsigned char    gds_fshift;
  12. extern unsigned     gds_wrkoff;
  13. extern unsigned     gds_wrkseg;
  14.  
  15. int    g_tilepattern2(char id,unsigned height,unsigned *pattern)
  16. {
  17.     union REGS    reg;
  18.     struct SREGS    seg;
  19.     struct {
  20.         unsigned    len;
  21.         struct TILEPT2    tile;
  22.     }    gdata;
  23.     int    i;
  24.  
  25.     if((height==0)||(height>16))
  26.         return -1;
  27.     segread(&seg);
  28.     reg.h.ah=gds_fshift+0x0f;
  29.     reg.x.di=(unsigned)&gdata;
  30.     seg.ds=seg.ss;
  31.     gdata.len=10+height*16;
  32.     gdata.tile.type=0x53ff;
  33.     gdata.tile.dlen=6+height*16;
  34.     gdata.tile.tileid=id;
  35.     gdata.tile.reserve=0;
  36.     gdata.tile.wdh=8;
  37.     gdata.tile.hgt=height;
  38.     for(i=0;i<(height*8);i++)
  39.         gdata.tile.ptn[i]=*pattern++;
  40.     reg.x.bx=gds_wrkoff;
  41.     seg.es=gds_wrkseg;
  42.     int86x(0x92,®,®,&seg);
  43.     return (int)reg.h.ah;
  44. }
  45.