SCI: Fix rhythm channel handling in SCI0

svn-id: r47326
This commit is contained in:
Walter van Niftrik 2010-01-16 19:11:37 +00:00
parent d1733bcf15
commit 6caf8e3f89
3 changed files with 8 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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