home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / msdos / sndbords / proaudio / mvdoc / pcm.doc < prev    next >
Text File  |  1993-03-09  |  24KB  |  743 lines

  1. PCM - TSR Providing PCM Access - version 3.9
  2.  
  3.  
  4. Syntax
  5.  
  6.     pcm            # display command syntax and TSR status
  7.     pcm -h            # to display more information
  8.     pcm -s            # to display status on the ISR/TSR
  9.     pcm -i            # to install PCM routines as a TSR 
  10.     pcm -u            # to unload the TSR
  11.     pcm -l [command]    # to load the ISR, run command, then unload
  12.     pcm -bXXX        # XXX= board address 
  13.  
  14.  
  15. Options
  16.  
  17.     q -    toggle quiet mode (-l sets quiet)
  18.     h -    display additional information 
  19.     s -    display install status
  20.  
  21.     i -     install as TSR
  22.     u -     uninstall TSR
  23.  
  24.     l program.exe
  25.         -     load ISR, run "program.exe", unload and exit
  26.         -    returns as "errorlevel" the result of "program.exe"
  27.  
  28.     bXXX    -    XXX= port address of board (default: find it)
  29.  
  30.  
  31. What is PCM.COM?
  32.  
  33. pcm.com is a program that can operate as either a TSR (Terminate, Stay
  34. Resident), or as a set of installable ISR's (Interrupt Service Routines).
  35.  
  36. As a TSR, it provides interrupt service routines for other programs in
  37. order to access PCM (sound) routines for the Media Vision Spectrum/CDPC
  38. interface boards.  
  39.  
  40. The program includes code to access both the PAS and the on-board SB.
  41. The program checks the environment at load-time for a "BLASTER=..."
  42. statement, and configures itself accordingly.
  43.  
  44. As an ISR, it provides these same services, but instead of terminating
  45. and staying resident, it loads and runs another program that expects 
  46. these services to be available, and then uninstalls these routines
  47. before terminating.
  48.  
  49.     Programs that expect pcm.com services include "tpcm.exe",
  50.     "srs16.exe", "play.exe", and other sound programs from 
  51.     Media Vision.
  52.  
  53.     These programs, and others, do not include the PCM access
  54.     routines in their own body of code.  This makes each of the 
  55.     programs smaller, and allows changes/improvements to the
  56.     PCM code more easily implemented among the various programs.
  57.  
  58. In short, pcm.com is a flexible program that provides PCM services 
  59. via interrupt 94h to other programs requiring such, either as a TSR
  60. or as a front-end loader, and can also add extra sound-playing 
  61. capabilities to your computer by using extended memory, the timer, 
  62. and your keyboard.
  63.  
  64.  
  65. Operation
  66.  
  67. Use the "pcm.com" program in order to provide access to PCM functions 
  68. via interrupt 94h.  
  69.  
  70. There are two ways to utilize these functions: resident at all times,
  71. or loaded before program execution.
  72.  
  73.     When run as:
  74.  
  75.     C:> pcm -i
  76.  
  77.         The program will install into interrupts not already
  78.         hooked, and go resident if installation took place.
  79.  
  80.         Some versions of the pcm.com program provide "background"
  81.         play capability when loaded using the "loadpcm.exe"
  82.         program;  this requires that pcm.com be installed as
  83.         as a TSR.
  84.  
  85.         Other programs, such as "tpcm.exe", will load pcm.com
  86.         if it is not already loaded, and so do not required 
  87.         that be installed as a TSR.
  88.  
  89.         To unload the program, use:
  90.  
  91.         C:> pcm -u
  92.  
  93.     When run as:
  94.  
  95.     C:> pcm -l "program -options arguments"
  96.  
  97.         The program will install into all its interrupts, 
  98.         regardless of previous installation, run "program"
  99.         with its options and arguments, then remove itself
  100.         from the interrupts and exit.
  101.  
  102.         Note: the quotation marks are not required.  
  103.  
  104.         C:> pcm -l "command.com"
  105.  
  106.         This will install the routines and run the command 
  107.         shell, thus making the routines available, but 
  108.         after typing "exit" to the command shell, pcm.com
  109.         unloads the ISR's and exits.
  110.  
  111.         Programs must be in the current directory in order
  112.         to be found and loaded, or their location must be
  113.         explicitly specified:
  114.  
  115.             pcm -l c:\usr\bin\tp.exe -v *.wav
  116.  
  117.             pcm -l ..\test\test.exe *.wav
  118.  
  119.     If you find that you are using frequently programs that 
  120.     require pcm.com, you can load it as a TSR.  If you find
  121.     that you only need it for one program, you can use it as
  122.     a front-end loader, manually or in a .bat file.
  123.  
  124. Errorlevel Return Values
  125.  
  126. The program returns to DOS an errorlevel using the following logic:
  127.  
  128.     if the "-l" option was used to run another program, the
  129.         errorlevel is that returned by the other program
  130.  
  131.     if the "-i" option is specified, the returned values are:
  132.  
  133.         0    successfully installed
  134.         1    not installed, detected pcm.com resident code
  135.  
  136.     if the "-u" option is specified, the returned values are:
  137.  
  138.         0    successfully uninstalled
  139.         #-1    not uninstalled, number of routines found
  140.         #    not uninstalled, no routines found resident
  141.  
  142.         Here, "#" is the number of routines normally installed.
  143.  
  144.             For the "fun" version, this # is 5.
  145.             For the standard "pcm.com", this # is 1.  
  146.  
  147.             Note: the standard "pcm.com" returns either
  148.  
  149.                 0 (successfully uninstalled) or 
  150.                 1 (already resident)
  151.         
  152.     if the "-s" option is specified, the returned values are:
  153.  
  154.         0    not installed
  155.         1    number of installed vectors
  156.  
  157. These returned errorlevels can be used in .bat files:
  158.  
  159.     pcm -s
  160.     if errorlevel 1    echo PCM.COM is installed
  161.  
  162.     pcm -i
  163.     if errorlevel 1 echo PCM.COM failed installation
  164.  
  165.     pcm -u
  166.     if errorlevel 1 echo PCM.COM could not unload
  167.  
  168.  
  169. Auxiliary Programs
  170.  
  171. Use "loadpcm.exe" to load sounds into extended memory for background play.
  172.  
  173.     Some versions of pcm.com may intercept other interrupts in 
  174.     order to provide additional services, such as background play.  
  175.  
  176.     Most likely to be hooked are the keyboard, timer, console i/o;  
  177.     with these versions, the TSR can be programmed to provide timed, 
  178.     random, or initiated asynchronous sound output when loaded 
  179.     with an extended-memory service provider, such as "himem.sys",
  180.     using the int 2F interface.
  181.  
  182.     With this version of the program, you can use "loadpcm.exe"
  183.     to load sound files into extended memory, and the TSR will
  184.     then play these files using the keyboard, the timer, or
  185.     intercept CONTROL-G, at any time.
  186.  
  187.     You will know if your version does by the following:
  188.  
  189.     If after installing pcm.com using "pcm -i" you see only:
  190.     
  191.         94h- Digital Audio   Installed.
  192.  
  193.     then the version provides only PCM access routines.
  194.  
  195.     If after installing pcm.com using "pcm -i" you see:
  196.  
  197.         94h- Digital Audio   Installed.
  198.         09h- Keyboard        Installed.
  199.         10h- Video Services  Installed.
  200.         29h- Fast Putchar()  Installed.
  201.         08h- Hardware Timer  Installed.
  202.  
  203.     then the version provides these extra "fun" features.
  204.  
  205.     See "pcmfun.doc".
  206.  
  207. Use "setdma.exe" to fix an area of memory for DMA transfers.  
  208.  
  209.     This program searches the Memory Arena for the end, then
  210.     subtracts 16K from the top and allocates it as system 
  211.     memory, thereby ensuring that the DMA buffer does not
  212.     cross a 64K segment boundary.  
  213.  
  214.     This program could search the UMB's, effectively providing a
  215.     DMA buffer that is completely out of conventional memory.
  216.  
  217.     The program adds the string "DMABUF=SEGADDR PARASIZE" to the
  218.     master environment, which can be used in a .bat file by the
  219.     "loadpcm.exe" program:
  220.  
  221.         loadpcm %dmabuf% 64
  222.  
  223.     This causes loadpcm to inform the pcm.com TSR to use memory 
  224.     at SEGADDR:0000 with a size in bytes of PARASIZE * 16 split
  225.     into 64 divisions.
  226.  
  227.     Use the "freedma.exe" program to release this memory.  
  228.  
  229.     Note: the program uses "undocumented" DOS information to
  230.     perform this memory allocation.
  231.  
  232.     See "sfdma.doc" for more information on these programs.
  233.  
  234. "proas.exe" will locate and initialize Media Vision hardware.
  235.  
  236.     This program will allow you to use your sound board without
  237.     the need for "mvsound.sys" being resident.
  238.  
  239.     pcm.com can read the DMA/IRQ channels from the hardware,
  240.     allowing programs using the int94 interface to function 
  241.     without mvsound.sys (requires MV101 Rev D).
  242.  
  243.         
  244. Programming using PCM.COM
  245.  
  246. Although programming by linking to the static libraries provided in
  247. the Media Vision SDK is easy enough, using this TSR provides 
  248. additional functionality:
  249.  
  250.     during load, the Hardware State Table is initialized.
  251.  
  252.     provide access to global DMA buffer for any program
  253.  
  254.     perform all initialization automatically (Function 8004)
  255.  
  256.     perform custom initialization automatically (Function 8011)
  257.  
  258.     internal User Functions to track your DMA buffer counters
  259.  
  260.     background sound play/record using extended memory 
  261.  
  262.     improvements to PCM routines incorporated through PCM.COM
  263.  
  264.     automatic 16- to 8-bit conversion on low-end hardware
  265.  
  266.  
  267. Some changes in these PCM routines over their ancestors in the SDK:
  268.  
  269.     Access to SB
  270.  
  271.         Use a "set blaster=..." statement before loading
  272.         "pcm.com" to have it configure itself to access
  273.         the on-board SB.
  274.  
  275.             C:> set blaster=a220 d1 i5 t3
  276.  
  277.                 aXXX    XXX= base port for SB (220h)
  278.                 dX    X= dma channel
  279.                 iX    X= irq channel
  280.                 tX    X= CT product number (not used)
  281.  
  282.         The program "tpcm.exe", written for the PAS, was
  283.         able to access the SB with only one program change:
  284.         "or" in the "sb request" bit into the function call.
  285.  
  286.         Access to the PAS and SB can be simultaneous and
  287.         is independent.
  288.  
  289.     DMA Buffer Divisions
  290.  
  291.         No longer must the number of divisions be a 
  292.         a multiple of two, and instead can be any number.
  293.  
  294.     DMA Buffer Size
  295.  
  296.         No longer must it be a multiple of 1024 bytes.
  297.         If the dma buffer size as passed in DMABuffer()
  298.         (function #3) is >= 100h, then it is assumed to
  299.         be the actual size and not the size in Kbytes.
  300.  
  301.         It is the responsibility of the calling program
  302.         to ensure that the Buffer Size is an integral
  303.         multiple of the Number of Divisions;  failure
  304.         can be as minor as "bumps" in the sound output
  305.         to destroying the memory control block arena.
  306.  
  307.     IRQ/DMA Channel Changes
  308.  
  309.         With the latest Media Vision hardware, it is
  310.         possible to program the board to use specific
  311.         DMA/IRQ channels.
  312.  
  313.         The pcm.com program retrieves this information
  314.         from mvsound.sys, but also uses the information
  315.         from the board, and, in case of conflict, uses
  316.         those values programmed into the hardware.
  317.  
  318.  
  319.     Running without, or in conflict with, MVSOUND.SYS
  320.  
  321.         pcm.com can read the hardware at load time, which
  322.         allows programs to function without mvsound.sys 
  323.         being loaded ("pasinit.exe" will wake up and 
  324.         initialize the board, and "mixinit.exe" will 
  325.         program the mixer).
  326.  
  327.         Also, "proas.exe" can change the DMA/IRQ 
  328.         channels on the board, and pcm.com will detect
  329.         a conflict with mvsound.sys and use the values
  330.         programmed into the hardware.
  331.  
  332.         Note: changing channels should not be done with
  333.         pcm.com loaded;  the detection is made at "pcm -i"
  334.         time.  If you do change the hardware, then, use
  335.         function 0 - InitMVSound - to cause the DMA/IRQ
  336.         channel info to be updated.
  337.  
  338.         Note: with the PAS Original, the DMA/IRQ info
  339.         is not available from the hardware, so this 
  340.         capability is not available.
  341.  
  342.     Hardware Configuration Information
  343.  
  344.         pcm.com provides a function to retrieve a bitfield
  345.         describing the known hardware configuration.
  346.  
  347.     Playing 16-bit data on 8-bit Hardware
  348.  
  349.         pcm.com will convert the 16-bit data to 8-bit
  350.         if it detects that the hardware does not have
  351.         a 16-bit DAC onboard.
  352.  
  353.         It accomplishes this when the following logic
  354.         is used in the int 94h interface:
  355.  
  356.         call PCMInfo()    - notify 16-bit coming up
  357.         call DMABuffer()- calculate stuff
  358.         call PausePCM()    - set state to Paused
  359.         call PlayPCM()    - prepare to Play, but still paused
  360.  
  361.         load the DMA Buffer from the app
  362.  
  363.         call ResumePCM()- converts 1st division data
  364.  
  365.         thereafter, every IRQ the next division is
  366.             converted
  367.             
  368.     Pause/Play/Record/Resume Operation
  369.  
  370.         Previously, calling PausePCM() then PCMPlay()
  371.         resulted in sound output.  So, in order to
  372.         "setup" and then use "pause" and "resume", 
  373.         you had to "Play" then "Pause", but then a
  374.         little bit of data played.  
  375.  
  376.         Now, the operation of the "PausePCM()" function
  377.         is like that of the "pause" button on a tape deck.
  378.  
  379.             Press Pause.
  380.             Press Play (or Record)
  381.  
  382.                 nothing happens
  383.  
  384.             Press Resume 
  385.  
  386.                 begin play/record
  387.  
  388.         This was desired, but required when run-time 
  389.         16- to 8-bit conversion was required.
  390.  
  391. ========================================================================
  392.  
  393. NOTE: There are two programs, pcmfun.com and pcmmin.com, that share
  394.     the same code.  Occasionally, one or the other is distributed
  395.     as "pcm.com".
  396.  
  397.     The intention is to maintain both "serious" and "fun"
  398.     sides to this set of routines, but leaving you the user
  399.     the option of deciding whether or not you want, or can,
  400.     use the "fun" stuff.
  401.  
  402.     If you prefer to not use the fun stuff, and thus not
  403.     allocate the memory, but you do like the programs that
  404.     depend on the int 94h services, then rename "pcmmin.com"
  405.     to "pcm.com", and leave it in the same directory as the
  406.     other programs (tpcm.exe, srs.exe).  These programs will
  407.     load "pcm.com" if it is not already installed. 
  408.  
  409.     Of course, I would prefer if the TSR were to dynamically
  410.     install those functions desired by the user via a command-
  411.     line option, but, alas, there has been too little time!
  412.     Know, though, that I know that this is a worthy goal.
  413.  
  414.     I apologize in advance for any confusion that may arise.
  415.  
  416. ========================================================================
  417.  
  418. Programming for Interrupt 94h
  419.  
  420. Use of the interrupt 94h interface is similar to that for "fm.com",
  421. which was based on the "sound.com" program.
  422.  
  423.     This could be considered unfortunate, as the "si"
  424.     register is used to pass the function number, and
  425.     this register must be preserved across function calls,
  426.     when programming in C.
  427.     
  428.  
  429.     The functions 0 - B are duplicate the similarly named
  430.     functions from the SDK.  Function C is new.  Functions
  431.     8000 - 8011 are functions that might simplify some 
  432.     programming for sound output.  Functions 8012 - 8016 are
  433.     included only in versions of pcm.com that provide the
  434.     background play ability (the "fun" stuff).
  435.  
  436. Additionally, the SI register also holds the requested "board address",
  437. as well as a "card" bit:
  438.  
  439.     SI Register Definition
  440.     ;; STPP PPPP PPff ffff
  441.     ;; S=             Special Function if set
  442.     ;;  T=             0= PAS, 1= ThunderBoard (Sound Blaster)
  443.     ;;   PP PPPP PPcc=     port address (388, 38C, 384: low 2 bits clear)
  444.     ;;             ff ffff= function number
  445.  
  446. Interrupt 94h Functions
  447.  
  448.     Entry
  449.     si    = special/card/port/function 
  450.     es:bx    = points to data buffer specific to function
  451.  
  452.     Exit
  453.     ax    = return integer or boolean value
  454.     dx:ax    = return long value or far address 
  455.     si    = 0 if recognized function
  456.  
  457.  
  458.     Description of Function
  459.    SI    ES:BX points to Buffer Containing...
  460.     Returned in AX (int) or DX:AX (void far *)
  461.     
  462.  
  463.     0    InitMVSound() - initialize the Hardware State Table
  464.         N/A
  465.     char far *    NULL if failed, else Hardware State Table address
  466.         
  467.        
  468.     1    InitPCM() - initialize PCM State Tables
  469.         N/A
  470.     int         0 if failed, else Library Version Number
  471.        
  472.     2    PCMInfo() - set samplerate and mono/stereo
  473.         struct pcminfo {long samplerate;  int stereoflag}; 
  474.     int        0 if okay, -1 if Samplerate Out of Range
  475.        
  476.     3    DMABuffer() - set DMA buffer address, size and partitions
  477.         struct dmabuf {char far * dmabuf, int bufkbsize, partitions;};
  478.     char far *    NULL if failed, else succeeded
  479.        
  480.     4    UserFunc() - set up callback routine for DMA interrupts
  481.         void far (*userfunction)();
  482.     void far *    NULL if failed, else succeeded
  483.        
  484.     5    PCMPlay() - play 
  485.         N/A
  486.     int        0 if successful, else failed
  487.        
  488.     6    PCMRecord() - record
  489.         N/A
  490.     int        0 if successful, else failed
  491.  
  492.     7    PausePCM() - pause playback or record
  493.         N/A
  494.     N/A
  495.  
  496.     8    ResumePCM() - resume paused playback or record
  497.         N/A
  498.     N/A
  499.  
  500.     9    StopPCM() - stop playback or record
  501.         N/A
  502.     N/A
  503.  
  504.     A    RemovePCM() - remove PCM hook to IRQ, clear internal DMA vars
  505.         N/A
  506.     N/A
  507.  
  508.     B    FindDMABuffer() - find area from memory within 64K block
  509.         struct fdmabuf {char huge *dmabuf; int bufkbsize};
  510.     char far *dmabuf    NULL if failed, else Valid DMA address
  511.  
  512.     C   GetHWVersionBits() - return a bitfield describing configuration
  513.     N/A
  514.     int        bitfield (see HWVersionBits below)
  515.  
  516.  8000     Retrieve Current DMA Address
  517.     N/A
  518.     char far *dmabuf    NULL if none, else Current DMA address
  519.  
  520.  8001     Retrieve Current DMA Size and Divisions
  521.     N/A
  522.     AX= Current DMA Size, DX= Current DMA Divisions
  523.  
  524.  8002 - 8003    NOT IMPLEMENTED
  525.  
  526.  8004     Make Ready For Play Mono at 11025Hz using B000:0 as 32K/2 DMA Buffer
  527.     N/A
  528.     N/A
  529.  
  530.  8005 - 8010     NOT IMPLEMENTED
  531.  
  532.  8011    Make Ready For Play using User Specified Parameters
  533.     struct pcmstate *{};    All Parms for PCMInfo, DMABuffer, UserFunc
  534.     struct pcmstate *{};    See Below for structure definition
  535.  
  536.  ----    The following functions are included only with the extra "fun"
  537.  ----    background play stuff.
  538.  
  539.  8012    Load Sound for Background Play
  540.     struct extstate *{};     All Parms for sound and access to XMS 
  541.     N/A
  542.  
  543.  8013    Return Bitfield Describing Background Sound Slot Usage
  544.     N/A
  545.     ax= bitfield of sounds used, dx= max sound slots (8)
  546.  
  547.  8014    Fill Structure for Specified Sound Slot
  548.     struct extstate *{};     desired sound number in field member
  549.     struct extstate *{};    structure filled with internal info
  550.  
  551.  8015    Set/Get/Unset Internal DMA Buffer
  552.     struct dmabuf *{};    if dmaoff != -1, set internal to contents
  553.     struct dmabuf *{};    if dmaoff == -1, set contents to internal
  554.  
  555.  8016    Simulate LeftShift-RightShift-# Keystroke
  556.     ax= 1 through 8        desired slot #
  557.     N/A
  558.  
  559.  8017    Control Background Processing Logic
  560.     al= 1    Control-G Intercept
  561.     ah= 0 Off, 1 On
  562.  
  563.     al= 2    Double-Shift Key Intercept
  564.     ah= 0 Off, 1 On
  565.  
  566.     al= 4    Random Sound 
  567.     ah= 0 Off, 1 On
  568.     cx= minimum delay in ticks (if turning on)
  569.     dx= maximum delay in ticks
  570.  
  571.     al= 8    No Activity
  572.     ah= 0 Off, 1 On
  573.     cx= delay in ticks (if turning on)
  574.  
  575.     al= F    Timer Control
  576.     ah= timer # (0-3)
  577.     dx:cx= delay in ticks, b15=0 reload, b15= 1 oneshot
  578.     
  579.  
  580.  
  581. Parameter Definitions
  582.  
  583. The "pcminfo" structure holds the Sample Rate and Mono/Stereo Flag.  
  584. The Sample Rate can vary from 100 to 88200 Hz Mono output, or 200 to 
  585. 44100 Hz for Stereo.
  586.  
  587. struct pcminfo            /* Passed to PCMInfo() */
  588. {
  589.     long samplerate;    /* 100 - 88200 (100 - 44100 for stereo) */
  590.     int stereoflag;        /* 0 = mono, 1 = stereo */
  591. };
  592.  
  593. The "dmabuf" structure contains the address of memory to be used as
  594. the DMA Load/Unload Buffer, the Size of this Buffer in KB, and the 
  595. Number of Partitions it is to be split into.  This buffer must not wrap
  596. around a 64KB block (the address should never get to ????:FFFF+ 1).
  597.  
  598. struct dmabuf            /* Passed to DMABuffer() */
  599. {
  600.     char far *dmabuf;    /* address of DMA buffer */
  601.     int bufkbsize;        /* size of DMA buffer in KB */
  602.     int partitions;        /* number of partitions */
  603. };
  604.  
  605. The "fdmabuf" structure contains a "huge" pointer to an area of memory
  606. that is at least twice as large as the associated "kbsize" parameter, 
  607. which specifies the desired size of memory in KB.
  608.  
  609. struct fdmabuf            /* Passed to FindDMABuffer() */
  610. {
  611.     char huge *dmabuf;    /* address of memory allocated */
  612.     int bufkbsize;        /* size of memory in KB */
  613. };
  614.  
  615. The "userfunc" parameter is the address of a routine that is to be
  616. called every time the PCM hardware has completed the output/input 
  617. of a partition of the DMA buffer.  Typically this routine decrements 
  618. a "flag" (see pcmstate.stat, below) which is monitored in the main
  619. program, allowing it to read/write data during PCM playback/record.
  620.  
  621. void (far *userfunc)();        /* address of callback routine 
  622.  
  623. The "pcmstate" structure is used to completely initialize the DMA and PCM
  624. state with user-supplied parameters, and includes space for the return
  625. values as well as a default DMA interrupt function that decrements the
  626. int pointed to by pcmstate.stat, and one that reads/writes files in the 
  627. background using the pcmstate.fh file handle.  Set pcmdir to 0 for play,
  628. set to 1 for record;  the internal user function decrements the stat flag
  629. during play, and increments during record.
  630.  
  631. struct pcmstate
  632. {
  633.    char far *f00r;     /* hardware state table returned from InitMVSound */
  634.    int f01r;         /* library code version returned from InitPCM */
  635.    long f02c1;         /* samplerate passed to PCMInfo */
  636.    int f02c2;         /* mono/stero flag passed to PCMInfo */
  637.    int f02r;         /* -1 returned by PCMInfo if error, else (?) */
  638.    void (far *f04c)();    /* address of interrupt function or index to internals */
  639.    void far *f04r;         /* 0 returned by UserFunc if error, else (?) */
  640.    char huge *f11c1;    /* not used at present FindDMABuffer */
  641.    int f11c2;         /* not used at present FindDMABuffer */
  642.    void far *f11r;         /* not used at present FindDMABuffer */
  643.    char far *f03c1;    /* DMA buffer passed to DMABuffer */
  644.    int f03c2;         /* size of DMA buffer in kilobytes passed to DMABuffer */
  645.    int f03c3;         /* number of partitions of DMA buffer passed to DMABuffer */
  646.    char far *f03r;     /* 0 returned by DMABuffer if error, else (?) */
  647.    int f10r;         /* returned by RemovePCM */
  648.    int f05r;         /* returned by PCMPlay */
  649.    int f07r;         /* returned by PausePCM */
  650.    int far *stat;     /* "volatile int" address decremented each DMA pass */
  651.    int fh    ;     /* file handle for input/output file (not implemented) */
  652.    int sbsize;         /* calculated size of each partition in bytes */
  653.    int f02c3;        /* compression flag */
  654.    int f02c4;         /* data size (8 or 16, specifying bit-size of sample)
  655.    int pcmdir;        /* 0= play, 1= record */
  656.    int unknown[16];    /* for expansion */
  657. };
  658.  
  659. struct extstate
  660. {
  661.    uint snum;    /* sound slot number */
  662.    uint xmsh;    /* XMS handle */
  663.    ulong xmso;    /* XMS offset for data */
  664.    ulong xmss;    /* XMS memory size */
  665.    ulong rate;     /* samplerate of sound */
  666.    uint chan;    /* number of sound channels */
  667.    uint comp;    /* code for compression */
  668.    uint dsiz;    /* bitsize of sample data */
  669.    char name;     /* name of sound file */
  670. };   
  671.  
  672. HWVersionBits Definition
  673.  
  674.     bMVA508     = 0000000000000001b ; MVA508(1) or National(0) mixer
  675.     bMVPS2        = 0000000000000010b ; PS2 bus stuff
  676.     bMVSLAVE    = 0000000000000100b ; CDPC Slave device is present
  677.     bMVSCSI     = 0000000000001000b ; SCSI interface
  678.     bMVENHSCSI    = 0000000000010000b ; Enhanced SCSI interface
  679.     bMVSONY     = 0000000000100000b ; Sony 535 interface
  680.     bMVDAC16    = 0000000001000000b ; 16 bit DAC
  681.     bMVSBEMUL    = 0000000010000000b ; SB h/w emulation
  682.     bMVMPUEMUL    = 0000000100000000b ; MPU h/w emulation
  683.     bMVOPL3         = 0000001000000000b ; OPL3(1) or 3812(0)
  684.     bMV101        = 0000010000000000b ; MV101 ASIC
  685.     bMV101_REV    = 0111100000000000b ; MV101 Revision
  686.  
  687. Note: this document and its associated programs are subject to change
  688. at any time and is being distributed for informational purposes only.
  689.  
  690. Copyright (c) 1992.  Media Vision, Inc.  All Rights Reserved. 
  691. Programmer: Bart Crane
  692.  
  693. ************************************************************************
  694.  
  695. pcm.com         - main TSR/ISR
  696.  
  697. ctrlgon.com    - turn on  CTRL-G intercept (plays sound #1)
  698. ctrlgoff.com     - turn off CTRL-G interception
  699.  
  700. keyx.com        - play a key # (syntax: keyx 14)
  701.  
  702. noacton.com    - turn on  no-activity detection (plays sounds 25-32)
  703. noactoff.com     - turn off no-activity detection
  704.  
  705. rndon.com       - turn on  random sounds (plays sounds 33-64)
  706. rndoff.com      - turn off random sounds
  707.  
  708. sskeyoff.com    - turn off left-right-shift key detection
  709. sskeyon.com     - turn on  left-right-shift key detection
  710.  
  711. tmr1set.com    - set timer 1 time
  712. tmr1on.com      - turn on timer 1
  713. tmr1off.com     - turn off timer 1
  714.  
  715. tmr2set.com    - set timer 1 time
  716. tmr2on.com      - turn on timer 1
  717. tmr2off.com     - turn off timer 1
  718.  
  719. tmr3set.com    - set timer 1 time
  720. tmr3on.com      - turn on timer 1
  721. tmr3off.com     - turn off timer 1
  722.  
  723. tmr4set.com    - set timer 1 time
  724. tmr4on.com      - turn on timer 1
  725. tmr4off.com     - turn off timer 1
  726.  
  727. tmr5set.com    - set timer 1 time
  728. tmr5on.com      - turn on timer 1
  729. tmr5off.com     - turn off timer 1
  730.  
  731. tmr6set.com    - set timer 1 time
  732. tmr6on.com      - turn on timer 1
  733. tmr6off.com     - turn off timer 1
  734.  
  735. tmr7set.com    - set timer 1 time
  736. tmr7on.com      - turn on timer 1
  737. tmr7off.com     - turn off timer 1
  738.  
  739. tmr8set.com    - set timer 1 time
  740. tmr8on.com      - turn on timer 1
  741. tmr8off.com     - turn off timer 1
  742.  
  743.