[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.h,1.24,1.25 mpu401.cpp,1.15,1.16 mpu401.h,1.12,1.13

Jamieson Christian jamieson630 at users.sourceforge.net
Fri Aug 8 04:55:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv8821/sound

Modified Files:
	mididrv.h mpu401.cpp mpu401.h 
Log Message:
Added generic send() option to MidiChannel.
This circumvents problems doing generic send()
calls to MidiDrivers that support more than
16 MIDI channels (i.e. Adlib). Because of the
way it interacts with MidiDriver, Simon could
have run into a problem if it tried to
allocate more than 15 Adlib music channels
(though this would only happen in very, VERY
rare circumstances).

Also fixed a problem with the channel
numbering scheme used by MidiDriver_Adlib,
in particular the percussion channel number.

Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- mididrv.h	5 Aug 2003 23:58:23 -0000	1.24
+++ mididrv.h	8 Aug 2003 11:54:24 -0000	1.25
@@ -91,6 +91,8 @@
 	virtual byte getNumber() = 0;
 	virtual void release() = 0;
 
+	virtual void send (uint32 b) = 0; // 4-bit channel portion is ignored
+
 	// Regular messages
 	virtual void noteOff (byte note) = 0;
 	virtual void noteOn (byte note, byte velocity) = 0;

Index: mpu401.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mpu401.cpp	8 Aug 2003 07:23:11 -0000	1.15
+++ mpu401.cpp	8 Aug 2003 11:54:24 -0000	1.16
@@ -34,6 +34,10 @@
 	return _owner;
 }
 
+void MidiChannel_MPU401::send (uint32 b) {
+	_owner->send (b & 0xFFFFFFF0 | (_channel & 0xF));
+}
+
 void MidiChannel_MPU401::noteOff (byte note) {
 	_owner->send(note << 8 | 0x80 | _channel);
 }

Index: mpu401.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- mpu401.h	5 Jul 2003 15:19:11 -0000	1.12
+++ mpu401.h	8 Aug 2003 11:54:24 -0000	1.13
@@ -49,6 +49,8 @@
 	byte getNumber() { return _channel; }
 	void release() { _allocated = false; }
 
+	void send (uint32 b);
+
 	// Regular messages
 	void noteOff (byte note);
 	void noteOn (byte note, byte velocity);





More information about the Scummvm-git-logs mailing list