[Scummvm-cvs-logs] SF.net SVN: scummvm:[47326] scummvm/trunk/engines/sci
waltervn at users.sourceforge.net
waltervn at users.sourceforge.net
Sat Jan 16 20:11:37 CET 2010
Revision: 47326
http://scummvm.svn.sourceforge.net/scummvm/?rev=47326&view=rev
Author: waltervn
Date: 2010-01-16 19:11:37 +0000 (Sat, 16 Jan 2010)
Log Message:
-----------
SCI: Fix rhythm channel handling in SCI0
Modified Paths:
--------------
scummvm/trunk/engines/sci/resource.cpp
scummvm/trunk/engines/sci/resource.h
scummvm/trunk/engines/sci/sound/music.cpp
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2010-01-16 17:30:17 UTC (rev 47325)
+++ scummvm/trunk/engines/sci/resource.cpp 2010-01-16 19:11:37 UTC (rev 47326)
@@ -2077,7 +2077,7 @@
}
// 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 @@
}
// Play channel 15 at all times (control channel)
channelMask |= 0x8000;
+
+ channelMask &= ~(1 << 9);
+ if (wantsRhythm)
+ channelMask |= (1 << 9);
+
break;
default:
break;
Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h 2010-01-16 17:30:17 UTC (rev 47325)
+++ scummvm/trunk/engines/sci/resource.h 2010-01-16 19:11:37 UTC (rev 47326)
@@ -473,7 +473,7 @@
#endif
Track *getTrackByType(byte type);
Track *getDigitalTrack();
- int getChannelFilterMask(int hardwareMask);
+ int getChannelFilterMask(int hardwareMask, bool wantsRhythm);
private:
SciVersion _soundVersion;
Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp 2010-01-16 17:30:17 UTC (rev 47325)
+++ scummvm/trunk/engines/sci/sound/music.cpp 2010-01-16 19:11:37 UTC (rev 47326)
@@ -316,14 +316,7 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list