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

  1. #include    <stdio.h>
  2. #include    <dos.h>
  3.  
  4. struct GCURSOR {
  5.     unsigned char    wdh,hgt;
  6.     unsigned    colorid;
  7.     unsigned char    ptn[256];
  8. };
  9.  
  10. extern    unsigned    char    gds_fshift;
  11.  
  12. int    g_gcurform(char xcenter,char ycenter,unsigned width,unsigned height,
  13.         unsigned color,unsigned char *andptn,unsigned char *xorptn)
  14. {
  15.     union REGS    reg;
  16.     struct SREGS    seg;
  17.     struct GCURSOR    gcs;
  18.     unsigned char    *ptr;
  19.     int    i;
  20.  
  21.     if((height==0)||(height>32)||(width==0)||((width%8)!=0))
  22.         return -1;
  23.     segread(&seg);
  24.     reg.h.ah=gds_fshift+0x14;
  25.     reg.h.dh=(unsigned char)xcenter;
  26.     reg.h.dl=(unsigned char)ycenter;
  27.     reg.x.di=(unsigned)&gcs;
  28.     seg.ds=seg.ss;
  29.     gcs.wdh=width;
  30.     gcs.hgt=height;
  31.     gcs.colorid=color;
  32.     ptr=&gcs.ptn[0];
  33.     for(i=0;i<((width/8)*height);i++)
  34.         *ptr++ = *andptn++;
  35.     for(i=0;i<((width/8)*height);i++)
  36.         *ptr++ = *xorptn++;
  37.     int86x(0x92,®,®,&seg);
  38.     return (int)reg.h.ah;
  39. }
  40.