home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / MIDI_PAT / MTOOLS.ZIP / PLAYRDEV.EXE / PLAYRINT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-11-07  |  2.3 KB  |  62 lines

  1.          unit playrint;
  2.  
  3.          interface
  4.  
  5.          function checkres: integer;
  6.          procedure callplayr;
  7.  
  8.          var
  9.            param: array [0..63] of byte;        {Play/R parameter data}
  10.  
  11.          implementation
  12.  
  13.          uses dos;
  14.  
  15.          const
  16.            playrid: array [0..7] of char = 'Play/R  ';  {PlayR id string}
  17.  
  18.            tessmpx =  $5453; {hex}              {TesSeRact multiplex id}
  19.  
  20.          var
  21.            reg: registers;                      {CPU register set}
  22.            idnum: integer;                      {Play/R id number}
  23.  
  24.          function checkres: integer;
  25.  
  26.           { Check Play/R is loaded - returns id number if found, else -1 }
  27.  
  28.            begin
  29.              reg.ax := tessmpx;                 {ax = Tess int 2fh
  30.                                                   muliplex id}
  31.              reg.ds := seg(playrid);            {ds = id string segment}
  32.              reg.si := ofs(playrid);            {si = id string offset}
  33.              reg.cx := 0;                       {cx = Tess id counter -    
  34.                                                   must be 0}
  35.              reg.bx := 0;                       {bx = Tess check resident
  36.                                                   function}
  37.              intr($2f, reg);                    {Call int 2fh}
  38.              if reg.ax = $ffff then
  39.                idnum := reg.cx                  {Found - return tsr id}
  40.              else
  41.                idnum := -1;                     {Not loaded}
  42.              checkres := idnum;
  43.            end;
  44.  
  45.          procedure callplayr;
  46.  
  47.            { Call Play/R using the contents of the byte array "param".
  48.              Byte 0 is the function code, and the rest is any required
  49.              data. }
  50.  
  51.            begin
  52.              reg.ax := tessmpx;                 {ax = Tess multiplex id}
  53.              reg.es := seg(param);              {es = parameter segment}
  54.              reg.di := ofs(param);              {di = parameter offset}
  55.              reg.cx := idnum;                   {cx = PlayR id number}
  56.              reg.bx := $20;                     {bx = Tess call user
  57.                                                   function}
  58.              intr($2f, reg);                    {Call int 2fh}
  59.            end;
  60.  
  61.          end.
  62.