/*********************************** Sandstorm SOUND.C ************************************/ /**** INCLUDES ****/ #include #include "main.h" #include "graphics.h" #include "pad.h" #include "control.h" #include "debug.h" #include "sprite.h" #include "collide.h" #include "fire.h" #include "ai.h" #include "cdread.h" #include "sound.h" /**** GLOBALS ****/ short vab, seq; /**** INITSOUND ****/ void InitSound( void ) { // recognise and transmit sound source data to buffer vab = SsVabTransfer( (u_char *)VH_ADDR, (u_char *)VB_ADDR, -1, 1 ); // check if failed if ( vab < 0 ) { printf("ERROR: SsVabTransfer failed (%d)\n" , vab ); return; } // open SEQ data seq = SsSeqOpen( (u_long *)SEQ_ONE_ADDR, vab ); // check if failed if ( seq < 0 ) printf("ERROR: SsSeqOpen failed (%)\n", seq ); } //end INITSOUND /**** PLAYSOUND ****/ void PlaySound( void ) { //short reverb; // main volume value setting, Left and Right channels //SsSetMVol( MVOL, MVOL ); // SEQ volume seting, Left and Right channels //SsSeqSetVol( seq, SVOL, SVOL ); // SEQ data reading (musical performance) SsSeqPlay( seq, SSPLAY_PLAY, SSPLAY_INFINITY ); // Setup the tempo //SsSetTempo( seq,0,107 ); // Setup the reverberation type to HALL //reverb = SsUtSetReverbType( SS_REV_TYPE_OFF ); // check if failed //if ( reverb < 0 ) // printf("ERROR: SsUtSetReverbType failed (%)\n", reverb); // Turn the reverb on //SsUtReverbOn(); // Setup the reverberation depth //SsUtSetReverbDepth( 64,64 ); }// end PlaySound() /**** STOPSOUND ****/ void StopSound( void ) { // stop SEQ data reading SsSeqStop( seq ); /* // turn the reverb off SsUtReverbOff(); // wait for vertical synchronisation VSync(0); VSync(0); // close SEQ data SsSeqClose( seq ); // close VAB data SsVabClose( vab ); */ }// end StopSound()