home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / MIDI_PAT / MTOOLS.ZIP / PLAYRDEV.EXE / PLAYRINT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-07  |  1.7 KB  |  44 lines

  1. #include <dos.h>
  2. #define LOCAL
  3. #include "playrint.h"
  4.  
  5. char playrid[8] = "Play/R  ";           /* PlayR id string */
  6. int tessmpx = 0x5453;                   /* TesSeRact multiplex id */
  7. int idnum;                              /* Play/R id number */
  8. char param [64];                        /* Parameter block */
  9. union REGS reg;                         /* Machine registers */
  10. struct SREGS sreg;
  11.  
  12. int checkres ()
  13.  
  14.   /* Check Play/R is loaded - returns id number if found, else -1 */
  15.  
  16.   {
  17.     reg.x.ax = tessmpx;                /* ax = Tess int 2fh muliplex id */
  18.     sreg.ds = FP_SEG(playrid);         /* ds = id string segment */
  19.     reg.x.si = FP_OFF(playrid);        /* si = id string offset */
  20.     reg.x.cx = 0;                      /* cx = Tess id counter - must be 0 */
  21.     reg.x.bx = 0;                      /* bx = Tess check resident function */
  22.     int86x(0x2f, ®, ®, &sreg);   /* Call int 2fh */
  23.     if (reg.x.ax == 0xffff)
  24.       idnum = reg.x.cx;                /* Found - return tsr id */
  25.     else
  26.       idnum = -1;                      /* Not loaded */
  27.     return idnum;
  28.   }
  29.  
  30. void callplayr ()
  31.  
  32.   /* Call Play/R using the contents of the byte array "param".
  33.      Byte 0 is the function code, and the rest is any required
  34.      data. */
  35.  
  36.   {
  37.     reg.x.ax = tessmpx;                /* ax = Tess multiplex id */
  38.     sreg.es = FP_SEG(param);           /* es = parameter segment */
  39.     reg.x.di = FP_OFF(param);          /* di = parameter offset */
  40.     reg.x.cx = idnum;                  /* cx = PlayR id number */
  41.     reg.x.bx = 0x20;                   /* bx = Tess call user function */
  42.     int86x(0x2f, ®, ®, &sreg);   /* Call int 2fh */
  43.   }
  44.