; ----------------------------------------------
; DSP_Init
;
; Inputs: None
;
; Outputs: Carry set if install failed
;
; Input/Output: Nothing.
;
; Purpose: This routine calls the soundlib init and setcallback functions
; to prepare the audio card for the playing of WAV's
;
; Written by: Nathan Hamstra
; -----------------------------------------------
; ----------------------------------------------
; DSP_Play
;
; Inputs: AX -- The index of the WAV file in the table of filenames to play
;
; Outputs: Plays the wave file from the speakers
;
; Input/Output: Nothing.
;
; Purpose: This will open and laod a WAV file and set up the DMA for the
; SBLib291 call.
;
; Written by: Nathan Hamstra
; -----------------------------------------------
; ----------------------------------------------
; DSP_Clean
;
; Inputs:None
;
; Outputs:None
;
; Input/Output: None
;
; Purpose: Just uses a SBLib291 call to restore the the soundcard
; to it's previous settings
;
; Written by: Nathan Hamstra
; -----------------------------------------------
; ----------------------------------------------
; PlayMidi
;
; Inputs: ax == sequence in midi to play (default to 0)
;
; Outputs:ax == 1 for successful play, 0 for failure
;
; Input/Output: sound from the FM synthesis
;
; Purpose: uses the installed midpak drivers on user interrupt 66h
; to play a midi sequence
;
; Written by: Nathan Hamstra
; -----------------------------------------------
; ----------------------------------------------
; StopMidi
;
; Inputs: None
;
; Outputs: None
;
; Input/Output: Nothing
;
; Purpose: uses another midipak interrupt call to stop the music
;
; Written by: Nathan Hamstra
; -----------------------------------------------
; ----------------------------------------------
; RegisterMidi
;
; Inputs: ax == index in wavtable array of file to register
;
; Outputs: None
;
; Input/Output: Nothing
;
; Purpose: Reads the midifile into memory, then registers it with
; midpak
;
; Written by: Nathan Hamstra
; -----------------------------------------------
Below all the data structures that are used in the sound routines are going to be described.
|
WaveHdr STRUC ; Format of wave file header format db 'RIFF' filelen dd ? wavefmt db 'WAVEfmt_' fmt_len dd ? fmt_tag dw ? channel dw ? samples dd ? bytesps dd ? bkalign dw ? bitsps dw ? data db 'data' datalen dd ? WaveHdr Ends |
Below all the variables that will be used in the sound routines will be described.
Below the segments that the will be used in the sound routines will be described.
| SoundSeg SEGMENT PUBLIC | |
| sndbuf DB 2048 DUP (10, 20, 50, 80, 90, 80, 50, 20) | |
| SoundSeg ENDS |
| MidiSeg | |
| midibuf db 32*32*32*2 dup(?) | |
| MidiSeg ENDS |