home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------
- -----------------------------------------------------------------------
- DOCUMENT:
- SOUND MASTER II BOARD DETECTION PROGRAM
-
- Version 1.1
- February 28, 1991
-
- Programming and Documentation by Ryan Hanlon
- Copyright (c) 1991, Covox, Inc. All Rights Reserved
- ----------------------------------------------------------------------
-
- PROGRAM NAME : sm2detec.exe
-
- ----------------------------------------------------------------------
-
- PROGRAM DESCRIPTION
- This program determines if a Sound Master II is present in the computer
- by doing an auto-detect for each of the three devices on the SM II
- (i.e., MIDI, VMDMA and YM3812).
-
- The primary auto-detect functions within the program are :
-
- 1. MidiPortDetect - Midi interface
-
- 2. YM3812PortDetect - Yamaha 3812 control (Adlib compatible section).
-
- 3. VMDMAPortDetect - Voice Master section.
-
- SM2DETEC.C was designed to test the above listed auto-detect functions
- and not as a stand alone application. Therefore main() can be removed
- from the code without consequence.
-
- All constants referred to in this document can be found in sm2detec.h
-
- ----------------------------------------------------------------------
-
- COMPILATION REQUIREMENTS
-
- This program was designed to be complied with Microsoft C version 6.0
- or Turbo C version 2.0.
-
- To compile with MICROSOFT C issue the following command at the DOS prompt.
-
- C:\> cl /Ism2detec.h sm2detec.c;
-
- To compile with TURBO C issue the following commands.
-
- C:\> tcc -c -B sm2detec.c
- .
- .
- .
-
- C:> tlink -x -Ism2detec.h \tc\lib\c0s + sm2detec,sm2detec
- ,,\tc\lib\cs.lib
-
- ----------------------------------------------------------------------
-
- AUTO-DETECT FUNCTION PROTOTYPES
-
-
- 1. MidiPortDetect
-
- PROTOTYPE : unsigned MidiPortDetect(char * Midi_Interrupt_Vector);
-
- RETURNS port address : Value returned is the port address of the MIDI
- on the Sound Master II board. Valid port
- addresses are 0x330 and 0x338.
-
- 0 : Device not present or jumpers are not installed
- properly.
-
- PARAMETERS : Midi_Interrupt_Vector : This parameter is the IRQ vector
- address the MIDI is using. It is
- set if the function is successful
- in detecting a port address.
-
-
- DESCRIPTION : This function will return the port value that the Midi
- section of the Sound Master II is currently using. If the
- Sound Master II is not found or there is a problem with the
- board then a zero is returned. The problems with the board
- that may exist are improper installation (e.g., jumper
- setting conflicts), or hardware failure.
- The parameter Midi_Interrupt_Vector is set and must be
- referred to by address.
-
- EXAMPLE :
-
- /* Call function to perform auto-detect on MIDI on the
- // Sound Master II.
- */
- Midi_Port_Value = MidiPortDetect( &Midi_Interrupt_Vector );
-
-
- if( Midi_Port_Value )
- {
- /* Print message indicating detected Port and IRQ values.
- */
- printf("MIDI using port --> %x\n", Midi_Port_Value );
- printf("MIDI using IRQ vector --> %x\n", Midi_Interrupt_Vector );
- }
- else
- {
- /* Print message indicating that the MIDI auto-detect failed.
- */
- printf( "MIDI detection failed.\n" );
- }
-
-
-
- ----------------------------------------------------------------------
-
- 2. YM3812PortDetect
-
- PROTOTYPE : unsigned YM3812PortDetect ( void );
-
- RETURNS port address : Value returned is the port address of the Yamaha
- 3812 Music Synthisizer (Adlib compatible section),
- on the Sound Master II board. Valid port
- addresses are 0x380 and 0x388.
- 0 : Device not present or jumpers are not installed
- properly.
-
- PARAMETERS : None.
-
-
- DESCRIPTION : This function will return the port value that the YM3812
- section of the Sound Master II is currently using. If the
- Sound Master II is not found or there is a problem with the
- board then a zero is returned. The problems with the board
- that may exist are improper installation (e.g., jumper
- setting conflicts), or hardware failure.
-
- EXAMPLE :
-
- /* Call function to perform auto-detect on YM3812 on the
- // Sound Master II.
- */
- YM3812_Port_Value = YM3812PortDetect();
-
-
- if( YM3812_Port_Value )
- {
- /* Print message indicating detected YM3812 Port on SM II.
- */
- printf("YM3812 using port --> %x\n", YM3812_Port_Value );
- }
- else
- {
- /* Print message indicating that the YM3812 auto-detect
- // failed.
- */
- printf( "YM3812 detection failed.\n" );
- }
-
-
- ----------------------------------------------------------------------
-
- 3. VMDMAPortDetect
-
- PROTOTYPE : VMDMAPortDetect(char * VMDMA_Interrupt_Vector,
- char * VMDMA_Channel );
-
-
- RETURNS port address : Value returned is the port address of the VMDMA
- on the Sound Master II board. Valid port
- addresses are 0x220, 0x240, 0x280 and 0x2C0.
-
- 0 : Device not present or jumpers are not installed
- properly.
-
- PARAMETERS : VMDMA_Interrupt_Vector : This parameter is the IRQ vector
- address the VMDMA is using and is
- set if the function is successful
- in detecting a port address.
-
- VMDMA_Channel : This parameter is the DMA channel
- the VMDMA is using and is set if
- the function is successful in
- detecting a port address.
-
-
- DESCRIPTION : This function will return the port value that the VMDMA
- section of the Sound Master II is currently using. If the
- Sound Master II is not found or there is a problem with the
- board then a zero is returned. The problems with the board
- that may exist are improper installation (e.g., jumper
- setting conflicts), or hardware failure.
- The parameter VMDMA_Interrupt_Vector is set and must be
- referred to by address.
- The parameter VMDMA_Channel is set and must be referred to
- by address.
-
- EXAMPLE :
-
- /* ------ VOICE MASTER PORT DETECT
- */
- VMDMA_Port_Value = VMDMAPortDetect(&VMDMA_Interrupt_Vector, &VMDMA_Channel);
-
-
- if( VMDMA_Port_Value )
- {
-
- /* Print message indicating detected Port, Channel, and IRQ.
- */
- printf("VMDMA using port --> %x\n", VMDMA_Port_Value );
- printf("VMDMA using IRQ --> %x\n", (VMDMA_Interrupt_Vector-8) );
- printf("VMDMA using Channel --> %x\n", VMDMA_Channel );
-
- }
- else
- {
- /* Print message indicating that the VMDMA auto-detect
- */ failed to find a Voice Master or Sound Master II board.
- */
- printf( "VMDMA detection failed.\n" );
- }