Index: scumm/sound.cpp =================================================================== RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v retrieving revision 1.355 diff -u -r1.355 sound.cpp --- scumm/sound.cpp 19 Jul 2004 10:50:52 -0000 1.355 +++ scumm/sound.cpp 21 Jul 2004 07:38:08 -0000 @@ -69,6 +69,7 @@ _endOfMouthSync(false), _curSoundPos(0), _overrideFreq(0), + _curSndMode(0), _currentCDSound(0), _currentMusic(0), _soundsPaused(false), @@ -628,10 +629,14 @@ // HACK: Checking for script 99 in Sam & Max is to keep Conroy's song // from being interrupted. - if (mode == 1 && (_vm->_gameId == GID_TENTACLE - || (_vm->_gameId == GID_SAMNMAX && !_vm->isScriptRunning(99)))) { - id = 777777; - _vm->_mixer->stopID(id); + if (mode == 1 && (_vm->_gameId == GID_TENTACLE || (_vm->_gameId == GID_SAMNMAX))) { + if (_curSndMode == 1) { + _vm->_mixer->stopHandle(_sfx1ChannelHandle); + handle = (&_sfx1ChannelHandle); + } else { + _vm->_mixer->stopHandle(_sfx0ChannelHandle); + handle = (&_sfx0ChannelHandle); + } } if (b > 8) { @@ -874,7 +879,7 @@ } } -void Sound::talkSound(uint32 a, uint32 b, int mode, int frame) { +void Sound::talkSound(uint32 a, uint32 b, int mode, int frame, int sndMode) { if (mode == 1) { _talk_sound_a1 = a; _talk_sound_b1 = b; @@ -883,6 +888,7 @@ _talk_sound_b2 = b; } + _curSndMode = sndMode; _talk_sound_frame = frame; _talk_sound_mode |= mode; } Index: scumm/sound.h =================================================================== RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v retrieving revision 1.68 diff -u -r1.68 sound.h --- scumm/sound.h 14 Jul 2004 07:29:09 -0000 1.68 +++ scumm/sound.h 21 Jul 2004 07:38:08 -0000 @@ -71,12 +71,15 @@ uint _curSoundPos; int _overrideFreq; + int _curSndMode; int _currentCDSound; int _currentMusic; public: PlayingSoundHandle _talkChannelHandle; // Handle of mixer channel actor is talking on PlayingSoundHandle _musicChannelHandle; // Handle of mixer channel music is on + PlayingSoundHandle _sfx0ChannelHandle; // Handle of first sfx channel + PlayingSoundHandle _sfx1ChannelHandle; // Handle of second sfx channel bool _soundsPaused; byte _sfxMode; @@ -97,7 +100,7 @@ void stopSound(int a); void stopAllSounds(); void soundKludge(int *list, int num); - void talkSound(uint32 a, uint32 b, int mode, int frame); + void talkSound(uint32 a, uint32 b, int mode, int frame, int sndMode = 1); void setupSound(); void pauseSounds(bool pause); Index: scumm/string.cpp =================================================================== RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v retrieving revision 1.226 diff -u -r1.226 string.cpp --- scumm/string.cpp 18 Jul 2004 22:29:21 -0000 1.226 +++ scumm/string.cpp 21 Jul 2004 07:38:09 -0000 @@ -54,8 +54,10 @@ // and setting VAR_V6_SOUNDMODE beforehand. See patch 609791. // FIXME: There are other VAR_V6_SOUNDMODE states, as // mentioned in the patch. FIXME after iMUSE is done. - if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2)) - _sound->talkSound(a, b, 1, -1); + if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2)) { + int sndMode = VAR(VAR_V6_SOUNDMODE); + _sound->talkSound(a, b, 1, -1, sndMode); + } } }