diff options
| -rw-r--r-- | engines/sci/resource.cpp | 7 | ||||
| -rw-r--r-- | engines/sci/resource.h | 2 | ||||
| -rw-r--r-- | engines/sci/sound/music.cpp | 9 | 
3 files changed, 8 insertions, 10 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index c3730a757d..9afcba13e4 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -2077,7 +2077,7 @@ SoundResource::Track *SoundResource::getDigitalTrack() {  }  // Gets the filter mask for SCI0 sound resources -int SoundResource::getChannelFilterMask(int hardwareMask) { +int SoundResource::getChannelFilterMask(int hardwareMask, bool wantsRhythm) {  	byte *data = _innerResource->data;  	int channelMask = 0;  	int reverseHardwareMask = 0; @@ -2130,6 +2130,11 @@ int SoundResource::getChannelFilterMask(int hardwareMask) {  		}  		// Play channel 15 at all times (control channel)  		channelMask |= 0x8000; + +		channelMask &= ~(1 << 9); +		if (wantsRhythm) +			channelMask |= (1 << 9); +  		break;  	default:  		break; diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 3422c44837..b20279ff3e 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -473,7 +473,7 @@ public:  #endif  	Track *getTrackByType(byte type);  	Track *getDigitalTrack(); -	int getChannelFilterMask(int hardwareMask); +	int getChannelFilterMask(int hardwareMask, bool wantsRhythm);  private:  	SciVersion _soundVersion; diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index cfff541d0a..bc2d286a5b 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -316,14 +316,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {  			pSnd->pauseCounter = 0;  			// Find out what channels to filter for SCI0 -			channelFilterMask = pSnd->soundRes->getChannelFilterMask(_pMidiDrv->getPlayId(_soundVersion)); - -			// Enable rhythm channel when requested -			// FIXME: this causes crashes and/or oddities for newer games (SCI1+) -			/*channelFilterMask &= ~(1 << MIDI_RHYTHM_CHANNEL); -			if (_pMidiDrv->hasRhythmChannel()) -				channelFilterMask |= (1 << MIDI_RHYTHM_CHANNEL);*/ - +			channelFilterMask = pSnd->soundRes->getChannelFilterMask(_pMidiDrv->getPlayId(_soundVersion), _pMidiDrv->hasRhythmChannel());  			pSnd->pMidiParser->loadMusic(track, pSnd, channelFilterMask, _soundVersion);  			// Fast forward to the last position and perform associated events when loading  | 
