[Scummvm-cvs-logs] CVS: scummvm/scumm midiparser_eup.cpp,1.9,1.10

Jamieson Christian jamieson630 at users.sourceforge.net
Tue Oct 7 08:16:14 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv17249/scummvm/scumm

Modified Files:
	midiparser_eup.cpp 
Log Message:
More Euphony/YM2612 instrument layering and polyphony
fixes. Aside from variations in the instrument timbre,
the output from ScummVM now seems to match up with the
output from UNZ (MAME YM2612 emulator).

Index: midiparser_eup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/midiparser_eup.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- midiparser_eup.cpp	5 Oct 2003 21:39:04 -0000	1.9
+++ midiparser_eup.cpp	7 Oct 2003 15:15:26 -0000	1.10
@@ -33,7 +33,7 @@
 class MidiParser_EUP : public MidiParser {
 protected:
 	byte _instruments[6][50]; // Two extra bytes for SysEx ID and channel #
-	byte _channel_instr[16];
+	byte *_instr_to_channel;
 	struct {
 		byte *enable;
 		int8 *channel;
@@ -71,20 +71,21 @@
 	// program changes to get a reasonable "one-size-
 	// fits-all" sound until we actually support the
 	// FM synthesis capabilities of FM Towns.
-	for (; _presend < 32; ++_presend) {
-		if (_channel_instr[_presend >> 1] == 0xFF) continue;
+	for (; _presend < 12; ++_presend) {
+		if (_instr_to_channel[_presend>>1] >= 16)
+			continue;
 		info.start = pos;
 		info.delta = 0;
 		if (_presend & 1) {
-			info.event = 0xB0;
-			info.basic.param1 = 7;
-			info.basic.param2 = 127;
-		} else {
-			byte *data = &_instruments[_channel_instr[_presend >> 1]][0];
-			data[1] = _presend >> 1;
+			byte *data = &_instruments[_presend>>1][0];
+			data[1] = _instr_to_channel[_presend>>1];
 			info.event = 0xF0;
 			info.ext.data = data;
 			info.length = 48;
+		} else {
+			info.event = 0xB0 | (_presend >> 1);
+			info.basic.param1 = 121;
+			info.basic.param2 = 0;
 		}
 		++_presend;
 		return;
@@ -186,11 +187,8 @@
 	pos += 32;
 
 	pos += 8; // Unknown bytes
-	for (i = 0; i < 16; ++i)
-		_channel_instr[i] = 0xFF;
-	for (i = 0; i < 6; ++i)
-		_channel_instr[pos[i]] = i;
-	pos += 6; // Instrument-to-channel mapping (not supported yet)
+	_instr_to_channel = pos; // Instrument-to-channel mapping
+	pos += 6;
 	pos += 4; // Skip the music size for now.
 	pos++;    // Unknown byte
 	byte tempo = *pos++;





More information about the Scummvm-git-logs mailing list