void SD_StopDigitized(void) { DigiPlaying = false; DigiPriority = 0; SoundPositioned = false; if ((DigiMode == sds_PC) && (SoundMode == sdm_PC)) SDL_SoundFinished(); Mix_HaltChannel(-1); }
/////////////////////////////////////////////////////////////////////////// // // SDL_PCService() - Handles playing the next sample in a PC sound // /////////////////////////////////////////////////////////////////////////// static void SDL_PCService(void) { byte s; word t; if (pcSound) { s = *pcSound++; if (s != pcLastSample) { asm pushf asm cli pcLastSample = s; if (s) // We have a frequency! { t = pcSoundLookup[s]; asm mov bx,[t] asm mov al,0xb6 // Write to channel 2 (speaker) timer asm out 43h,al asm mov al,bl asm out 42h,al // Low byte asm mov al,bh asm out 42h,al // High byte asm in al,0x61 // Turn the speaker & gate on asm or al,3 asm out 0x61,al } else // Time for some silence { asm in al,0x61 // Turn the speaker & gate off asm and al,0xfc // ~3 asm out 0x61,al } asm popf } if (!(--pcLengthLeft)) { SDL_PCStopSound(); SDL_SoundFinished(); } }
/////////////////////////////////////////////////////////////////////////// // // SD_StopSound() - if a sound is playing, stops it // /////////////////////////////////////////////////////////////////////////// void SD_StopSound(void) { if (DigiPlaying) SD_StopDigitized(); switch (SoundMode) { default: break; case sdm_PC: SDL_PCStopSound(); break; case sdm_AdLib: SDL_ALStopSound(); break; } SoundPositioned = false; SDL_SoundFinished(); }