[Scummvm-cvs-logs] scummvm master -> 318c51a2027b554a5c0bc8b045103026657b7073

bluegr md5 at scummvm.org
Sat Feb 26 04:23:24 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
67aee1ebd8 SCI: Slight cleanup in the animate code
318c51a202 SCI: Added support for reading data off the MT32.DRV driver found in LSL2 early (bug #3192627)


Commit: 67aee1ebd85963b3034103a8681efabb33ea7b85
    https://github.com/scummvm/scummvm/commit/67aee1ebd85963b3034103a8681efabb33ea7b85
Author: md5 (md5 at scummvm.org)
Date: 2011-02-25T19:19:11-08:00

Commit Message:
SCI: Slight cleanup in the animate code

Changed paths:
    engines/sci/graphics/animate.cpp



diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 5f9c5b8..0eb7b95 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -371,7 +371,7 @@ void GfxAnimate::update() {
 			it->showBitsFlag = true;
 
 			it->signal &= ~(kSignalStopUpdate | kSignalViewUpdated | kSignalNoUpdate | kSignalForceUpdate);
-			if ((it->signal & kSignalIgnoreActor) == 0) {
+			if (!(it->signal & kSignalIgnoreActor)) {
 				rect = it->celRect;
 				rect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(it->priority) - 1, rect.top, rect.bottom - 1);
 				_paint16->fillRect(rect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15);
@@ -563,7 +563,7 @@ void GfxAnimate::addToPicDrawCels() {
 
 		// draw corresponding cel
 		_paint16->drawCel(view, it->loopNo, it->celNo, it->celRect, it->priority, it->paletteNo, it->scaleX, it->scaleY);
-		if ((it->signal & kSignalIgnoreActor) == 0) {
+		if (!(it->signal & kSignalIgnoreActor)) {
 			it->celRect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(it->priority) - 1, it->celRect.top, it->celRect.bottom - 1);
 			_paint16->fillRect(it->celRect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15);
 		}


Commit: 318c51a2027b554a5c0bc8b045103026657b7073
    https://github.com/scummvm/scummvm/commit/318c51a2027b554a5c0bc8b045103026657b7073
Author: md5 (md5 at scummvm.org)
Date: 2011-02-25T19:22:10-08:00

Commit Message:
SCI: Added support for reading data off the MT32.DRV driver found in LSL2 early (bug #3192627)

Changed paths:
    engines/sci/sound/drivers/midi.cpp



diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index 08e93d3..73420ef 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -604,10 +604,13 @@ void MidiPlayer_Midi::readMt32DrvData() {
 	if (f.open("MT32.DRV")) {
 		int size = f.size();
 
-		assert(size >= 166);
-
-		// Send before-SysEx text
-		f.seek(0x59);
+		// Skip before-SysEx text
+		if (size == 1773 || size == 1759)	// XMAS88 / KQ4 early
+			f.seek(0x59);
+		else if (size == 2771)				// LSL2 early
+			f.seek(0x29);
+		else
+			error("Unknown MT32.DRV size (%d)", size);
 
 		// Skip 2 extra 0 bytes in some drivers
 		if (f.readUint16LE() != 0)
@@ -620,25 +623,58 @@ void MidiPlayer_Midi::readMt32DrvData() {
 
 		// Save goodbye message
 		f.read(_goodbyeMsg, 20);
+		_goodbyeMsg[19] = 0;	// make sure that the message is nul-terminated
 
 		// Set volume
 		byte volume = CLIP<uint16>(f.readUint16LE(), 0, 100);
 		setMt32Volume(volume);
 
-		byte reverbSysEx[13];
-		// This old driver should have a full reverb SysEx
-		if ((f.read(reverbSysEx, 13) != 13) || (reverbSysEx[0] != 0xf0) || (reverbSysEx[12] != 0xf7))
-			error("Error reading MT32.DRV");
+		if (size == 2771) {
+			// MT32.DRV in LSL2 early contains more data, like a normal patch
+			byte reverb = f.readByte();
+
+			_hasReverb = true;
+
+			// Skip reverb SysEx message
+			f.skip(11);
+
+			// Read reverb data (stored vertically - patch #3117434)
+			for (int j = 0; j < 3; ++j) {
+				for (int i = 0; i < kReverbConfigNr; i++) {
+					_reverbConfig[i][j] = f.readByte();
+				}
+			}
+
+			f.skip(2235);	// skip driver code
+
+			// Patches 1-48
+			sendMt32SysEx(0x50000, static_cast<Common::SeekableReadStream *>(&f), 256);
+			sendMt32SysEx(0x50200, static_cast<Common::SeekableReadStream *>(&f), 128);
 
-		// Send reverb SysEx
-		sysEx(reverbSysEx + 1, 11);
-		_hasReverb = false;
+			setReverb(reverb);
 
-		f.seek(0x29);
+			// Send after-SysEx text
+			f.seek(0);
+			sendMt32SysEx(0x200000, static_cast<Common::SeekableReadStream *>(&f), 20);
+
+			// Send the mystery SysEx
+			sendMt32SysEx(0x52000a, (const byte *)"\x16\x16\x16\x16\x16\x16", 6);
+		} else {
+			byte reverbSysEx[13];
+			// This old driver should have a full reverb SysEx
+			if ((f.read(reverbSysEx, 13) != 13) || (reverbSysEx[0] != 0xf0) || (reverbSysEx[12] != 0xf7))
+				error("Error reading MT32.DRV");
 
-		// Read AdLib->MT-32 patch map
-		for (int i = 0; i < 48; i++) {
-			_patchMap[i] = f.readByte();
+			// Send reverb SysEx
+			sysEx(reverbSysEx + 1, 11);
+			_hasReverb = false;
+
+			f.seek(0x29);
+
+			// Read AdLib->MT-32 patch map
+			for (int i = 0; i < 48; i++) {
+				_patchMap[i] = f.readByte();
+			}
 		}
 
 		f.close();






More information about the Scummvm-git-logs mailing list