home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / APOG / DMADOC.ZIP / SM2DETEC.DOC < prev    next >
Encoding:
Text File  |  1991-03-19  |  8.1 KB  |  219 lines

  1.    -----------------------------------------------------------------------
  2.    -----------------------------------------------------------------------
  3.    DOCUMENT:
  4.                   SOUND MASTER II BOARD DETECTION PROGRAM 
  5.  
  6.                                Version 1.1
  7.                             February 28, 1991
  8.  
  9.                Programming and Documentation by Ryan Hanlon
  10.            Copyright (c) 1991,  Covox, Inc.  All Rights Reserved
  11.    ----------------------------------------------------------------------
  12.    
  13.    PROGRAM NAME : sm2detec.exe
  14.    
  15.    ----------------------------------------------------------------------
  16.  
  17.    PROGRAM DESCRIPTION 
  18.    This program determines if a Sound Master II is  present in the computer
  19.    by doing an auto-detect for each of the three  devices on the SM II
  20.    (i.e., MIDI, VMDMA and YM3812).
  21.  
  22.    The primary auto-detect functions within the program are :
  23.  
  24.      1. MidiPortDetect    - Midi interface
  25.  
  26.      2. YM3812PortDetect  - Yamaha 3812 control (Adlib compatible section).
  27.  
  28.      3. VMDMAPortDetect   - Voice Master section.
  29.  
  30.    SM2DETEC.C was designed to test the above listed auto-detect functions
  31.    and not as a stand alone application. Therefore main() can be removed
  32.    from the code without consequence.
  33.  
  34.    All constants referred to in this document can be found in sm2detec.h
  35.  
  36.    ----------------------------------------------------------------------
  37.  
  38.    COMPILATION REQUIREMENTS
  39.  
  40.    This program was designed to be complied with Microsoft C version 6.0
  41.    or Turbo C version 2.0.
  42.  
  43.    To compile with MICROSOFT C issue the following command at the DOS prompt.
  44.  
  45.        C:\> cl /Ism2detec.h sm2detec.c;
  46.  
  47.    To compile with TURBO C issue the following commands.
  48.  
  49.        C:\> tcc -c -B sm2detec.c
  50.                .
  51.                .
  52.                .
  53.  
  54.        C:> tlink -x -Ism2detec.h \tc\lib\c0s + sm2detec,sm2detec
  55.                                  ,,\tc\lib\cs.lib 
  56.  
  57.    ----------------------------------------------------------------------
  58.  
  59.    AUTO-DETECT FUNCTION PROTOTYPES
  60.  
  61.  
  62.    1. MidiPortDetect 
  63.  
  64.    PROTOTYPE   : unsigned MidiPortDetect(char * Midi_Interrupt_Vector);  
  65.  
  66.    RETURNS  port address : Value returned is the port address of the MIDI
  67.                            on the Sound Master II board.  Valid port 
  68.                            addresses are 0x330 and 0x338.
  69.  
  70.                       0  : Device not present or jumpers are not installed
  71.                            properly.
  72.  
  73.    PARAMETERS  : Midi_Interrupt_Vector : This parameter is the IRQ vector 
  74.                                          address the MIDI is using.  It is
  75.                                          set if the function is successful
  76.                                          in detecting a port address.
  77.  
  78.    
  79.    DESCRIPTION : This function will return the port value that the Midi
  80.                  section of the Sound Master II is currently using.  If the
  81.                  Sound Master II is not found or there is a problem with the
  82.                  board then a zero is returned. The problems with the board
  83.                  that may exist are improper installation (e.g., jumper
  84.                  setting conflicts), or hardware failure.
  85.                  The parameter Midi_Interrupt_Vector is set and must be
  86.                  referred to by address.
  87.  
  88.    EXAMPLE     : 
  89.  
  90.        /* Call function to perform auto-detect on MIDI on the 
  91.        // Sound Master II.
  92.        */
  93.        Midi_Port_Value = MidiPortDetect( &Midi_Interrupt_Vector );  
  94.  
  95.  
  96.        if( Midi_Port_Value )
  97.        {
  98.           /* Print message indicating detected Port and IRQ values. 
  99.           */
  100.           printf("MIDI using port       -->  %x\n", Midi_Port_Value );
  101.           printf("MIDI using IRQ vector -->  %x\n", Midi_Interrupt_Vector );
  102.        }
  103.        else
  104.        {
  105.           /* Print message indicating that the MIDI auto-detect failed.
  106.           */
  107.           printf( "MIDI detection failed.\n" );
  108.        }
  109.  
  110.  
  111.  
  112.    ----------------------------------------------------------------------
  113.  
  114.    2. YM3812PortDetect
  115.  
  116.    PROTOTYPE   : unsigned YM3812PortDetect ( void );
  117.  
  118.    RETURNS  port address : Value returned is the port address of the Yamaha
  119.                            3812 Music Synthisizer (Adlib compatible section),
  120.                            on the Sound Master II board.  Valid port 
  121.                            addresses are 0x380 and 0x388.
  122.                        0 : Device not present or jumpers are not installed
  123.                            properly.
  124.  
  125.    PARAMETERS  : None.
  126.  
  127.    
  128.    DESCRIPTION : This function will return the port value that the YM3812
  129.                  section of the Sound Master II is currently using.  If the
  130.                  Sound Master II is not found or there is a problem with the
  131.                  board then a zero is returned.  The problems with the board
  132.                  that may exist are improper installation (e.g., jumper
  133.                  setting conflicts), or hardware failure.
  134.  
  135.    EXAMPLE     : 
  136.  
  137.        /* Call function to perform auto-detect on YM3812 on the 
  138.        // Sound Master II.
  139.        */
  140.        YM3812_Port_Value = YM3812PortDetect();  
  141.  
  142.  
  143.        if( YM3812_Port_Value )
  144.        {
  145.           /* Print message indicating detected YM3812 Port on SM II. 
  146.           */
  147.           printf("YM3812 using port  -->  %x\n", YM3812_Port_Value );
  148.        }
  149.        else
  150.        {
  151.           /* Print message indicating that the YM3812 auto-detect
  152.           // failed.
  153.           */
  154.           printf( "YM3812 detection failed.\n" );
  155.        }
  156.  
  157.  
  158.    ----------------------------------------------------------------------
  159.  
  160.    3. VMDMAPortDetect
  161.  
  162.    PROTOTYPE   : VMDMAPortDetect(char * VMDMA_Interrupt_Vector, 
  163.                                  char * VMDMA_Channel );  
  164.  
  165.  
  166.    RETURNS  port address : Value returned is the port address of the VMDMA
  167.                            on the Sound Master II board.  Valid port
  168.                            addresses are 0x220, 0x240, 0x280 and 0x2C0.
  169.  
  170.                       0  : Device not present or jumpers are not installed
  171.                            properly.
  172.  
  173.    PARAMETERS  : VMDMA_Interrupt_Vector : This parameter is the IRQ vector 
  174.                                           address the VMDMA is using and is
  175.                                           set if the function is successful
  176.                                           in detecting a port address.
  177.                            
  178.                  VMDMA_Channel          : This parameter is the DMA channel 
  179.                                           the VMDMA is using and is set if
  180.                                           the function is successful in
  181.                                           detecting a port address.
  182.  
  183.    
  184.    DESCRIPTION : This function will return the port value that the VMDMA
  185.                  section of the Sound Master II is currently using.  If the
  186.                  Sound Master II is not found or there is a problem with the
  187.                  board then a zero is returned. The problems with the board
  188.                  that may exist are improper installation (e.g., jumper
  189.                  setting conflicts), or hardware failure.
  190.                  The parameter VMDMA_Interrupt_Vector is set and must be
  191.                  referred to by address.
  192.                  The parameter VMDMA_Channel is set and must be referred to
  193.                  by address.
  194.  
  195.    EXAMPLE     :
  196.  
  197.       /* ------ VOICE MASTER PORT DETECT
  198.       */
  199.       VMDMA_Port_Value = VMDMAPortDetect(&VMDMA_Interrupt_Vector, &VMDMA_Channel); 
  200.  
  201.              
  202.       if( VMDMA_Port_Value )
  203.       {
  204.              
  205.          /* Print message indicating detected Port, Channel, and IRQ.
  206.          */
  207.          printf("VMDMA using port    -->  %x\n", VMDMA_Port_Value );
  208.          printf("VMDMA using IRQ     -->  %x\n", (VMDMA_Interrupt_Vector-8) );
  209.          printf("VMDMA using Channel -->  %x\n", VMDMA_Channel );
  210.              
  211.       }
  212.       else
  213.       {
  214.          /* Print message indicating that the VMDMA auto-detect
  215.          */ failed to find a Voice Master or Sound Master II board.
  216.          */
  217.          printf( "VMDMA detection failed.\n" );
  218.       }
  219.