[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.h,1.26,1.27 mpu401.cpp,1.17,1.18 mpu401.h,1.13,1.14
Jamieson Christian
jamieson630 at users.sourceforge.net
Thu Sep 25 15:33:02 CEST 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv11551/sound
Modified Files:
mididrv.h mpu401.cpp mpu401.h
Log Message:
Fix for Bug [810564] ALL: missing instruments with native MT-32
As defined in Patch [811623] MT-32 patch for Bug 810564
Added a channel mask to MPU-401 devices so that --native-mt32
may force the device to use only the subset of MIDI channels
actually supported by the MT-32. Also added a best-guess
interpretation of iMuse Part priority in the SysEx 0x00 msg,
since part priorities become more of an issue when the
channel count is cramped.
Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- mididrv.h 13 Aug 2003 14:08:21 -0000 1.26
+++ mididrv.h 25 Sep 2003 22:32:05 -0000 1.27
@@ -44,7 +44,8 @@
enum {
// PROP_TIMEDIV = 1,
- PROP_OLD_ADLIB = 2
+ PROP_OLD_ADLIB = 2,
+ PROP_CHANNEL_MASK = 3
};
// Open the midi driver.
Index: mpu401.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mpu401.cpp 18 Sep 2003 02:07:18 -0000 1.17
+++ mpu401.cpp 25 Sep 2003 22:32:05 -0000 1.18
@@ -85,7 +85,8 @@
_started_thread (false),
_mutex (0),
_timer_proc (0),
- _timer_param (0)
+ _timer_param (0),
+ _channel_mask (0xFFFF) // Permit all 16 channels by default
{
uint i;
@@ -106,12 +107,22 @@
send (0x7B << 8 | 0xB0 | i);
}
+uint32 MidiDriver_MPU401::property (int prop, uint32 param) {
+ switch (prop) {
+ case PROP_CHANNEL_MASK:
+ _channel_mask = param & 0xFFFF;
+ return 1;
+ }
+
+ return 0;
+}
+
MidiChannel *MidiDriver_MPU401::allocateChannel() {
MidiChannel_MPU401 *chan;
uint i;
for (i = 0; i < ARRAYSIZE(_midi_channels); ++i) {
- if (i == 9)
+ if (i == 9 || !(_channel_mask & (1 << i)))
continue;
chan = &_midi_channels[i];
if (!chan->_allocated) {
Index: mpu401.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- mpu401.h 8 Aug 2003 11:54:24 -0000 1.13
+++ mpu401.h 25 Sep 2003 22:32:05 -0000 1.14
@@ -85,6 +85,7 @@
OSystem::MutexRef _mutex; // Concurrent shutdown barrier
volatile TimerCallback _timer_proc;
void *_timer_param;
+ uint16 _channel_mask;
static int midi_driver_thread (void *param);
@@ -94,6 +95,7 @@
virtual void close();
void setTimerCallback(void *timer_param, TimerCallback timer_proc);
uint32 getBaseTempo(void) { return 10000; }
+ uint32 property(int prop, uint32 param);
MidiChannel *allocateChannel();
MidiChannel *getPercussionChannel() { return &_midi_channels [9]; }
More information about the Scummvm-git-logs
mailing list