[Scummvm-cvs-logs] SF.net SVN: scummvm:[52662] scummvm/trunk/engines/sci

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Thu Sep 9 20:26:16 CEST 2010


Revision: 52662
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52662&view=rev
Author:   waltervn
Date:     2010-09-09 18:26:16 +0000 (Thu, 09 Sep 2010)

Log Message:
-----------
SCI: Fix last MIDI channel number for adlib driver

Modified Paths:
--------------
    scummvm/trunk/engines/sci/resource.h
    scummvm/trunk/engines/sci/resource_audio.cpp
    scummvm/trunk/engines/sci/sound/drivers/adlib.cpp
    scummvm/trunk/engines/sci/sound/music.cpp
    scummvm/trunk/engines/sci/sound/music.h

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2010-09-09 17:27:02 UTC (rev 52661)
+++ scummvm/trunk/engines/sci/resource.h	2010-09-09 18:26:16 UTC (rev 52662)
@@ -512,6 +512,7 @@
 public:
 	struct Channel {
 		byte number;
+		bool isRhythm;
 		byte poly;
 		uint16 prio;
 		uint16 size;

Modified: scummvm/trunk/engines/sci/resource_audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource_audio.cpp	2010-09-09 17:27:02 UTC (rev 52661)
+++ scummvm/trunk/engines/sci/resource_audio.cpp	2010-09-09 18:26:16 UTC (rev 52662)
@@ -664,7 +664,8 @@
 						channel->data = resource->data + dataOffset;
 						channel->size = READ_LE_UINT16(data + 4);
 						channel->curPos = 0;
-						channel->number = *channel->data;
+						channel->number = *channel->data & 0xf;
+						channel->isRhythm = *channel->data & 0x20;
 						channel->poly = *(channel->data + 1);
 						channel->time = channel->prev = 0;
 						channel->data += 2; // skip over header

Modified: scummvm/trunk/engines/sci/sound/drivers/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/adlib.cpp	2010-09-09 17:27:02 UTC (rev 52661)
+++ scummvm/trunk/engines/sci/sound/drivers/adlib.cpp	2010-09-09 18:26:16 UTC (rev 52662)
@@ -73,6 +73,8 @@
 	bool loadResource(const byte *data, uint size);
 	virtual uint32 property(int prop, uint32 param);
 
+	bool useRhythmChannel() { return _rhythmKeyMap != NULL; }
+
 private:
 	enum ChannelID {
 		kLeftChannel = 1,
@@ -177,6 +179,8 @@
 	void setVolume(byte volume) { static_cast<MidiDriver_AdLib *>(_driver)->setVolume(volume); }
 	void playSwitch(bool play) { static_cast<MidiDriver_AdLib *>(_driver)->playSwitch(play); }
 	void loadInstrument(int idx, byte *data);
+
+	int getLastChannel() { return (static_cast<MidiDriver_AdLib *>(_driver)->useRhythmChannel() ? 8 : 15); }
 };
 
 static const byte registerOffset[MidiDriver_AdLib::kVoices] = {

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-09-09 17:27:02 UTC (rev 52661)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-09-09 18:26:16 UTC (rev 52662)
@@ -102,6 +102,7 @@
 	// Find out what the first possible channel is (used, when doing channel
 	// remapping).
 	_driverFirstChannel = _pMidiDrv->getFirstChannel();
+	_driverLastChannel = _pMidiDrv->getLastChannel();
 }
 
 void SciMusic::miditimerCallback(void *p) {

Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h	2010-09-09 17:27:02 UTC (rev 52661)
+++ scummvm/trunk/engines/sci/sound/music.h	2010-09-09 18:26:16 UTC (rev 52662)
@@ -223,6 +223,7 @@
 	MusicType _musicType;
 
 	int _driverFirstChannel;
+	int _driverLastChannel;
 };
 
 } // End of namespace Sci


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