home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / gds / source / gds101.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  554 b   |  28 lines

  1.  
  2. /*
  3.  *
  4.  *    GDS101 : 初期化
  5.  *
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <dos.h>
  10.  
  11. unsigned char *GDS_init(unsigned int size) {
  12.    union  REGS  inregs, outregs;
  13.    struct SREGS segregs;
  14.    unsigned char *wp;
  15.  
  16.    if((wp=(unsigned char *)malloc(size))==NULL)
  17.       return NULL;
  18.    segread(&segregs);
  19.    inregs.x.ax=0x8000;
  20.    int86x(0x92,&inregs,&outregs,&segregs);
  21.    inregs.x.ax=0xF901;
  22.    int86x(0x92,&inregs,&outregs,&segregs);
  23.    inregs.x.ax=0xFA00;
  24.    int86x(0x92,&inregs,&outregs,&segregs);
  25.    *(unsigned int *)wp=0;
  26.    return wp;
  27. }
  28.