[Scummvm-cvs-logs] scummvm master -> 0b8c57be8482f58d6c5a9ff54102c440cf399dc4

bluegr md5 at scummvm.org
Fri Mar 11 23:58:51 CET 2011


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

Summary:
0b8c57be84 SCI: Moved a heap patch from kScriptID() into script_patches.cpp


Commit: 0b8c57be8482f58d6c5a9ff54102c440cf399dc4
    https://github.com/scummvm/scummvm/commit/0b8c57be8482f58d6c5a9ff54102c440cf399dc4
Author: md5 (md5 at scummvm.org)
Date: 2011-03-11T14:57:45-08:00

Commit Message:
SCI: Moved a heap patch from kScriptID() into script_patches.cpp

Changed paths:
    engines/sci/engine/kscripts.cpp
    engines/sci/engine/script_patches.cpp



diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 30c8b6a..b9baa35 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -249,33 +249,9 @@ reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {
 	// is used for timing during the intro, and in the problematic version it's
 	// initialized to 0, whereas it's 6 in other versions. Thus, we assign it
 	// to 6 here, fixing the speed of the introduction. Refer to bug #3102071.
-	if (g_sci->getGameId() == GID_PQ2 && script == 200) {
-		if (s->variables[VAR_GLOBAL][3].isNull()) {
-			warning("Fixing speed in the intro of PQ2, version 1.002.011");
-			s->variables[VAR_GLOBAL][3] = make_reg(0, 6);
-		}
-	}
-
-	// HACK: Prevent the murderer from getting stuck behind the door in
-	// Colonel's Bequest, room 215. A temporary fix for bug #3122075.
-	// TODO/FIXME: Add a proper fix for this. There is a regression in this
-	// scene with the new kInitBresen and kDoBresen functions (r52467). Using
-	// just the "old" kInitBresen works. This hack is added for now because the
-	// two functions are quite complex. The "old" versions were created based
-	// on observations, and not on the interpreter itself, thus they have a lot
-	// of differences in the way they behave and set variables to the mover object.
-	// Since this is just a death scene where Laura is supposed to die anyway,
-	// figuring out the exact cause of this is just not worth the effort.
-	// Differences between the new and the old kInitBresen to the MoveTo object:
-	// dy: 1 (new) - 2 (old)
-	// b-i1: 20 (new) - 12 (old)
-	// b-di: 65526 (new) - 65516 (old)
-	// Performing the changes above to MoveTo (0017:033a) allows the killer to
-	// move. Note that the actual issue might not be with kInitBresen/kDoBresen,
-	// and there might be another underlying problem here.
-	if (g_sci->getGameId() == GID_LAURABOW && script == 215) {
-		warning("Moving actor position for the shower scene of Colonel's Bequest");
-		writeSelectorValue(s->_segMan, s->_segMan->findObjectByName("killer"), SELECTOR(x), 6);
+	if (g_sci->getGameId() == GID_PQ2 && script == 200 &&
+		s->variables[VAR_GLOBAL][3].isNull()) {
+		s->variables[VAR_GLOBAL][3] = make_reg(0, 6);
 	}
 
 	return make_reg(scriptSeg, address);
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 120544c..f69b6a7 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -622,6 +622,50 @@ const SciScriptSignature larry6Signatures[] = {
 };
 
 // ===========================================================================
+// This is a heap patch, and it modifies the properties of an object, instead
+// of patching script code.
+// Prevent the murderer from getting stuck behind the door in Colonel's
+// Bequest, room 215. Fixes bug #3122075.
+// TODO/FIXME: Add a proper fix for this. There is a regression in this
+// scene with the new kInitBresen and kDoBresen functions (r52467). Using
+// just the "old" kInitBresen works. This hack is added for now because the
+// two functions are quite complex. The "old" versions were created based
+// on observations, and not on the interpreter itself, thus they have a lot
+// of differences in the way they behave and set variables to the mover object.
+// Since this is just a death scene where Laura is supposed to die anyway,
+// figuring out the exact cause of this is just not worth the effort.
+// Differences between the new and the old kInitBresen to the MoveTo object:
+// dy: 1 (new) - 2 (old)
+// b-i1: 20 (new) - 12 (old)
+// b-di: 65526 (new) - 65516 (old)
+// Performing the changes above to MoveTo (0017:033a) allows the killer to
+// move. Note that the actual issue might not be with kInitBresen/kDoBresen,
+// and there might be another underlying problem here.
+
+const byte laurabow1SignatureKillerPosition[] = {
+	12,
+	0x5f, 0x00,	// y
+	0x00, 0x00,	// x
+	0x00, 0x00,	// z
+	0x00, 0x00,	// heading
+	0x02, 0x00,	// yStep
+	0x0f, 0x01,	// view
+	0
+};
+
+const uint16 laurabow1PatchKillerPosition[] = {
+	0x5f, 0x00,	// y (same)
+	0x06, 0x00,	// x (changed to 6)
+	PATCH_END
+};
+
+//    script, description,                                      magic DWORD,                                  adjust
+const SciScriptSignature laurabow1Signatures[] = {
+	{    215, "actor position for shower scene",             1, PATCH_MAGICDWORD(0x02, 0x00, 0x0f, 0x01),    -8, laurabow1SignatureKillerPosition, laurabow1PatchKillerPosition },
+	SCI_SIGNATUREENTRY_TERMINATOR
+};
+
+// ===========================================================================
 // rm560::doit was supposed to close the painting, when Heimlich enters the
 //  room. The code is buggy, so it actually closes the painting, when heimlich
 //  is not in the room. We fix that.
@@ -1061,6 +1105,9 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin
 	case GID_KQ6:
 		signatureTable = kq6Signatures;
 		break;
+	case GID_LAURABOW:
+		signatureTable = laurabow1Signatures;
+		break;
 	case GID_LAURABOW2:
 		signatureTable = laurabow2Signatures;
 		break;






More information about the Scummvm-git-logs mailing list