diff options
author | Walter van Niftrik | 2010-01-16 19:11:37 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-01-16 19:11:37 +0000 |
commit | 6caf8e3f89337e56d24ee7a7b412f4f5727e3723 (patch) | |
tree | 02f61d8a5ef84c871af3ba2e81d95466ac097ee4 /engines | |
parent | d1733bcf1526060e19411cbc6ddca8e1f772cfc6 (diff) | |
download | scummvm-rg350-6caf8e3f89337e56d24ee7a7b412f4f5727e3723.tar.gz scummvm-rg350-6caf8e3f89337e56d24ee7a7b412f4f5727e3723.tar.bz2 scummvm-rg350-6caf8e3f89337e56d24ee7a7b412f4f5727e3723.zip |
SCI: Fix rhythm channel handling in SCI0
svn-id: r47326
Diffstat (limited to 'engines')
-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 |