[Scummvm-cvs-logs] scummvm master -> ade33c4c0bfc2c92475af3b9fa202ab06dc58a01

bluegr bluegr at gmail.com
Mon Oct 13 11:25:04 CEST 2014


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

Summary:
c25f190ee6 SCI: Re-enable the entry for LSL1 remake
d3710bae7b SCI: Add another version of LockerGnome Quest Redux
43cb57ba00 SCI: Add comments for the MT-32/GM patch contents
ae2be20a20 SCI: Fix bug #6725 - "SCI: LSL5 Mac doesn't launch with MT-32 music"
ade33c4c0b SCI: Set the NS rect for all cases in GK1 (bug #6729)


Commit: c25f190ee6adfc5383eb67c9cadecac7c5b6eb2f
    https://github.com/scummvm/scummvm/commit/c25f190ee6adfc5383eb67c9cadecac7c5b6eb2f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-13T12:21:38+03:00

Commit Message:
SCI: Re-enable the entry for LSL1 remake

The entry is valid, verified by waltervn

Changed paths:
    engines/sci/detection_tables.h



diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 91b3c45..da6cdc7 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1832,15 +1832,12 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)	},
 
-#if 0
-	// The resource.002 file, contained in disk 3, is broken in this version
-	// (it contains a large chunk of zeroes and several broken resources,
-	// e.g. pic 250 and views 250 and 251).
-	// Thus this detection entry isn't accurate.
-
-	// Larry 1 Remake - English Amiga (from www.back2roots.org)
+	// Larry 1 Remake - English Amiga
 	// Executable scanning reports "1.004.024"
 	// SCI interpreter version 1.000.784
+	// NOTE: The resource.002 file, contained in disk 3, is broken in the
+	// www.back2roots.org version (it contains a large chunk of zeroes and
+	// several broken resources, e.g. pic 250 and views 250 and 251).
 	{"lsl1sci", "SCI", {
 		{"resource.map", 0, "7d115a9e27dc8ac71e8d5ef33d589bd5", 3366},
 		{"resource.000", 0, "e67fd129d5810fc7ad8ea509d891cc00", 363073},
@@ -1849,7 +1846,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.003", 0, "4a34c3367c2fe7eb380d741374da1989", 572251},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)	},
-#endif
 
 	// Larry 1 VGA Remake - English DOS (from spookypeanut)
 	// Executable scanning reports "1.000.577", VERSION file reports "2.1"


Commit: d3710bae7bf06522ad38f73484eedfde4c0756ad
    https://github.com/scummvm/scummvm/commit/d3710bae7bf06522ad38f73484eedfde4c0756ad
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-13T12:21:39+03:00

Commit Message:
SCI: Add another version of LockerGnome Quest Redux

Changed paths:
    engines/sci/detection_tables.h



diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index da6cdc7..0fddaa5 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -4115,6 +4115,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 	FANMADE("Knight's Quest Demo 1.0", "5e816edf993956752ed06fccfeeae6d9", 1260, "959321f88a22905fa1f8c6d897874744", 703836),
 	FANMADE("LockerGnome Quest", "3eeff9130206cad0c4e1551e2b9dd2c5", 420, "ae05ca90806fd90cc43f147c82d3547c", 158906),
 	FANMADE("LockerGnome Quest Redux", "55b0081dbdd77a07807c76cec3606970", 492, "75c9c5e8a475a7b5f1a6cb18edad67f2", 168069),
+	FANMADE("LockerGnome Quest Redux", "6299578d8ab709cc181baea6b984a0a7", 492, "c0ff4bfcc62fb111337343967e4001fd", 167383),
 	FANMADE("New Year's Mystery", "e4dcab1b1d3cb4a2c070a07a9c9589e0", 708, "e00ca5e44fd4e98d8174b467b31b0f21", 295425),
 	FANMADE("New Year's Mystery (Updated)", "efd1beb5120293725065c95959144f81", 714, "b3bd3c2372ed6efa28adb12403c4c31a", 305027),
 	FANMADE("Ocean Battle", "c2304a0568e0eb84f8e9a0915f01170a", 408, "46c520c1ac9b63528854d0f58c7e1b74", 142234),


Commit: 43cb57ba00d3d19fe46c16c12a43fcc902bbb1c2
    https://github.com/scummvm/scummvm/commit/43cb57ba00d3d19fe46c16c12a43fcc902bbb1c2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-13T12:21:39+03:00

Commit Message:
SCI: Add comments for the MT-32/GM patch contents

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 80a72b9..5065500 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -399,24 +399,37 @@ void MidiPlayer_Midi::playSwitch(bool play) {
 }
 
 bool MidiPlayer_Midi::isMt32GmPatch(const byte *data, int size) {
-	if (size < 1155)
+	// Need at least 1153 + 2 bytes for a GM patch. Check readMt32GmPatch()
+	// below for more info.
+	if (size < 1153 + 2)
 		return false;
+	// The maximum number of bytes for an MT-32 patch is 16889. The maximum
+	// number of timbres is 64, which leads us to:
+	// 491 + 1 + 64 * 246 + 653 = 16889
 	if (size > 16889)
 		return true;
 
 	bool isMt32 = false;
 	bool isMt32Gm = false;
 
+	// First, check for a GM patch. The presence of MIDI data after the
+	// initial 1153 + 2 bytes indicates a GM patch
 	if (READ_LE_UINT16(data + 1153) + 1155 == size)
 		isMt32Gm = true;
 
-	int pos = 492 + 246 * data[491];
+	// Now check for a regular MT-32 patch. Check readMt32Patch() below for
+	// more info.
+	// 491 = 20 + 20 + 20 + 2 + 1 + 11 + 3 * 11 + 256 + 128
+	byte timbresNr = data[491];
+	int pos = 492 + 246 * timbresNr;
 
+	// Patches 49-96
 	if ((size >= (pos + 386)) && (READ_BE_UINT16(data + pos) == 0xabcd))
-		pos += 386;
+		pos += 386;	// 256 + 128 + 2
 
+	// Rhythm key map + partial reserve
 	if ((size >= (pos + 267)) && (READ_BE_UINT16(data + pos) == 0xdcba))
-		pos += 267;
+		pos += 267;	// 256 + 9 + 2
 
 	if (size == pos)
 		isMt32 = true;
@@ -460,10 +473,28 @@ void MidiPlayer_Midi::sendMt32SysEx(const uint32 addr, const byte *buf, int len,
 }
 
 void MidiPlayer_Midi::readMt32Patch(const byte *data, int size) {
+	// MT-32 patch contents:
+	// - 20 bytes unkown
+	// - 20 bytes before-SysEx message
+	// - 20 bytes goodbye SysEx message
+	// - 2 bytes volume
+	// - 1 byte reverb
+	// - 11 bytes reverb Sysex message
+	// - 3 * 11 reverb data
+	// - 256 + 128 bytes patches 1-48
+	// --> total: 491 bytes
+	// - 1 byte number of timbres (64 max)
+	// - 246 * timbres timbre data
+	// - 2 bytes flag (0xabcd)
+	// - 256 + 128 bytes patches 49-96
+	// - 2 bytes flag (0xdcba)
+	// - 256 bytes rhythm key map
+	// - 9 bytes partial reserve
+
 	Common::MemoryReadStream *str = new Common::MemoryReadStream(data, size);
 
 	// Send before-SysEx text
-	str->seek(0x14);
+	str->seek(20);
 	sendMt32SysEx(0x200000, str, 20);
 
 	// Save goodbye message
@@ -527,15 +558,25 @@ void MidiPlayer_Midi::readMt32Patch(const byte *data, int size) {
 }
 
 void MidiPlayer_Midi::readMt32GmPatch(const byte *data, int size) {
-	memcpy(_patchMap, data, 0x80);
-	memcpy(_keyShift, data + 0x80, 0x80);
-	memcpy(_volAdjust, data + 0x100, 0x80);
-	memcpy(_percussionMap, data + 0x180, 0x80);
-	_channels[MIDI_RHYTHM_CHANNEL].volAdjust = data[0x200];
-	memcpy(_velocityMapIdx, data + 0x201, 0x80);
-	memcpy(_velocityMap, data + 0x281, 0x200);
-
-	uint16 midiSize = READ_LE_UINT16(data + 0x481);
+	// GM patch contents:
+	// - 128 bytes patch map
+	// - 128 bytes key shift
+	// - 128 bytes volume adjustment
+	// - 128 bytes percussion map
+	// - 1 byte volume adjust for the rhythm channel
+	// - 128 bytes velocity map IDs
+	// - 512 bytes velocity map
+	// --> total: 1153 bytes
+
+	memcpy(_patchMap, data, 128);
+	memcpy(_keyShift, data + 128, 128);
+	memcpy(_volAdjust, data + 256, 128);
+	memcpy(_percussionMap, data + 384, 128);
+	_channels[MIDI_RHYTHM_CHANNEL].volAdjust = data[512];
+	memcpy(_velocityMapIdx, data + 513, 128);
+	memcpy(_velocityMap, data + 641, 512);
+
+	uint16 midiSize = READ_LE_UINT16(data + 1153);
 
 	if (midiSize > 0) {
 		if (size < midiSize + 1155)


Commit: ae2be20a20b4a88dee2aec8b47e01f899df38ff4
    https://github.com/scummvm/scummvm/commit/ae2be20a20b4a88dee2aec8b47e01f899df38ff4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-13T12:21:39+03:00

Commit Message:
SCI: Fix bug #6725 - "SCI: LSL5 Mac doesn't launch with MT-32 music"

Thanks to waltervn for his help

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 5065500..baf85de 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -399,6 +399,11 @@ void MidiPlayer_Midi::playSwitch(bool play) {
 }
 
 bool MidiPlayer_Midi::isMt32GmPatch(const byte *data, int size) {
+	// WORKAROUND: Some Mac games (e.g. LSL5) may have an extra byte at the
+	// end, so compensate for that here - bug #6725.
+	if (size == 16890)
+		size--;
+
 	// Need at least 1153 + 2 bytes for a GM patch. Check readMt32GmPatch()
 	// below for more info.
 	if (size < 1153 + 2)


Commit: ade33c4c0bfc2c92475af3b9fa202ab06dc58a01
    https://github.com/scummvm/scummvm/commit/ade33c4c0bfc2c92475af3b9fa202ab06dc58a01
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-13T12:21:40+03:00

Commit Message:
SCI: Set the NS rect for all cases in GK1 (bug #6729)

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



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 91b5b25..a015362 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -784,13 +784,10 @@ void GfxFrameout::kernelFrameout() {
 					// swapped in the GK1 inventory screen, investigate why.
 					// This is also needed for GK1 rooms 710 and 720 (catacombs, inner and
 					// outer circle), for handling the tiles and talking to Wolfgang.
-					// HACK: Fix the coordinates by explicitly setting them here.
-					Common::Rect objNSRect = g_sci->_gfxCompare->getNSRect(itemEntry->object);
-					uint16 roomNumber = g_sci->getEngineState()->currentRoomNumber();
-					if (objNSRect.top == nsRect.left && objNSRect.left == nsRect.top && nsRect.top != 0 && nsRect.left != 0 ||
-						(g_sci->getGameId() == GID_GK1 && (roomNumber == 710 || roomNumber == 720))) {
+					// HACK: Fix the coordinates by explicitly setting them here for GK1.
+					// Also check bug #6729, for another case where this needed.
+					if (g_sci->getGameId() == GID_GK1)
 						g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
-					}
 				}
 
 				// Don't attempt to draw sprites that are outside the visible






More information about the Scummvm-git-logs mailing list