[Scummvm-cvs-logs] SF.net SVN: scummvm:[43119] scummvm/trunk/engines/tinsel/music.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Aug 8 13:42:29 CEST 2009


Revision: 43119
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43119&view=rev
Author:   lordhoto
Date:     2009-08-08 11:42:29 +0000 (Sat, 08 Aug 2009)

Log Message:
-----------
Add workaround for bug #2820054 "DW1: No intro music at first start on Wii", which actually happened on all systems, when using the multilanguage version.

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/music.cpp

Modified: scummvm/trunk/engines/tinsel/music.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/music.cpp	2009-08-08 11:31:27 UTC (rev 43118)
+++ scummvm/trunk/engines/tinsel/music.cpp	2009-08-08 11:42:29 UTC (rev 43119)
@@ -256,6 +256,22 @@
 
 		midiStream.close();
 
+		// WORKAROUND for bug #2820054 "DW1: No intro music at first start on Wii",
+		// which actually affects all ports, since it's specific to the multi language
+		// version.
+		//
+		// The multilanguage version does not seem to set the channel volume at all for
+		// the intro track, thus we need to do that here. We only initialize the
+		// channels used in that sequence. And we are using 127 as default channel volume.
+		if (_vm->getGameID() == GID_DW1 && dwFileOffset == 38888 &&
+			(_vm->getFeatures() & (GF_USE_3FLAGS | GF_USE_4FLAGS | GF_USE_5FLAGS))) {
+			_vm->_midiMusic->send(0x7F07B0 |  3);
+			_vm->_midiMusic->send(0x7F07B0 |  5);
+			_vm->_midiMusic->send(0x7F07B0 |  8);
+			_vm->_midiMusic->send(0x7F07B0 | 10);
+			_vm->_midiMusic->send(0x7F07B0 | 13);
+		}
+
 		_vm->_midiMusic->playXMIDI(midiBuffer.pDat, dwSeqLen, bLoop);
 
 		// Store the length
@@ -320,10 +336,10 @@
 		_vm->_midiMusic->setVolume(vol);
 	} else if (vol != 0 && priorVolMusic == 0) {
 		// Perhaps restart last midi sequence
-		if (currentLoop) {
+		if (currentLoop)
 			PlayMidiSequence(currentMidi, true);
+
 			_vm->_midiMusic->setVolume(vol);
-		}
 	} else if (vol != 0 && priorVolMusic != 0) {
 		// Alter current volume
 		_vm->_midiMusic->setVolume(vol);
@@ -377,6 +393,7 @@
 
 MidiMusicPlayer::MidiMusicPlayer(MidiDriver *driver) : _parser(0), _driver(driver), _looping(false), _isPlaying(false) {
 	memset(_channel, 0, sizeof(_channel));
+	memset(_channelVolume, 0, sizeof(_channelVolume));
 	_masterVolume = 0;
 	this->open();
 	_xmidiParser = MidiParser::createParser_XMIDI();


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