[Scummvm-git-logs] scummvm master -> ef8916d445f33d3a6be5d30776a80afac8787366

sluicebox 22204938+sluicebox at users.noreply.github.com
Fri Aug 14 05:56:20 UTC 2020


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:
d94789e162 SCI: Add KQ4 1.000.106 detection entry
ef8916d445 SCI: Fix KQ4 crash when falling down stairs


Commit: d94789e162e0a724ff400974ca6c758faff2b64d
    https://github.com/scummvm/scummvm/commit/d94789e162e0a724ff400974ca6c758faff2b64d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-08-13T22:55:10-07:00

Commit Message:
SCI: Add KQ4 1.000.106 detection entry

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 6f96efcec2..29e0acdb71 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1466,6 +1466,19 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER	},
 
+	// King's Quest 4 - English DOS (original boxed release, 3 1/2" disks)
+	// Executable scanning reports "0.000.253"
+	// K4091988.QA file reports "SCI Version 0.000.247 (2nd rev)"
+	// Game version "1.000.106" according to K4091988.QA and scripts
+	{"kq4sci", "SCI", {
+		{"resource.map", 0, "1f253c0d649fb1da1eb8784b2df34284", 7416},
+		{"resource.001", 0, "0c8566848a76eea19a6d6220914030a7", 495006},
+		{"resource.002", 0, "0c8566848a76eea19a6d6220914030a7", 681749},
+		{"resource.003", 0, "0c8566848a76eea19a6d6220914030a7", 686821},
+		{"resource.004", 0, "0c8566848a76eea19a6d6220914030a7", 652398},
+		AD_LISTEND},
+		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER	},
+
 	// King's Quest 4 - English DOS (from the King's Quest Collection)
 	// Executable scanning reports "0.000.502"
 	// SCI interpreter version 0.000.502


Commit: ef8916d445f33d3a6be5d30776a80afac8787366
    https://github.com/scummvm/scummvm/commit/ef8916d445f33d3a6be5d30776a80afac8787366
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-08-13T22:55:10-07:00

Commit Message:
SCI: Fix KQ4 crash when falling down stairs

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


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 05aec7e6b7..2e46498420 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4300,6 +4300,45 @@ static const SciScriptPatcherEntry islandBrainSignatures[] = {
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
+// ===========================================================================
+// In KQ4 1.000.111, falling down the lower stairs in room 90 sends a message to
+//  a non-object, which also crashes the original. It appears that the fragment
+//  of code which instantiated the Sound object was accidentally deleted from
+//  the script. This line was intact in the previous version and in later
+//  versions it was rewritten to use a new local Sound object. We fix this by
+//  jumping from the broken code into the sound code in fallingToDeath, which
+//  correctly plays the same sound.
+//
+// Applies to: PC 1.000.111
+// Responsible method: fallingDown:changeState(0)
+static const uint16 kq4SignatureFallDownStairs[] = {
+	SIG_MAGICDWORD,
+	0x83, 0x01,                      // lal 01  [ not set, zero ]
+	0x4a, 0x10,                      // send 10 [ local1 number: 51 loop: 1 play: ]
+	SIG_ADDTOOFFSET(+0x0108),
+	0x38, SIG_SELECTOR16(new),       // pushi new
+	0x76,                            // push0
+	0x51, 0x31,                      // push Sound
+	0x4a, 0x04,                      // send 04  [ Sound new: ]
+	0x4a, 0x10,                      // send 10  [ sound number: 51 loop: 1 play: ]
+	0x32, SIG_UINT16(0x0040),        // jmp 0040 [ end of method ]
+	SIG_END
+};
+
+static const uint16 kq4PatchFallDownStairs[] = {
+	0x32, PATCH_UINT16(0x0109),      // jmp 0109
+	PATCH_ADDTOOFFSET(+0x0111),
+	0xa2, PATCH_UINT16(0x0001),      // sal 0001 [ local1 = the new sound ]
+	0x4a, 0x10,                      // send 10  [ local1 number: 51 loop: 1 play: ]
+	PATCH_END
+};
+
+//          script, description,                                      signature                                 patch
+static const SciScriptPatcherEntry kq4Signatures[] = {
+	{  true,    90, "fall down stairs",                            1, kq4SignatureFallDownStairs,               kq4PatchFallDownStairs },
+	SCI_SIGNATUREENTRY_TERMINATOR
+};
+
 // ===========================================================================
 // At least during the harpy scene, export 29 of script 0 is called and has an
 //  issue where temp[3] won't get inititialized, but is later used to set
@@ -19866,6 +19905,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
 	case GID_ISLANDBRAIN:
 		signatureTable = islandBrainSignatures;
 		break;
+	case GID_KQ4:
+		signatureTable = kq4Signatures;
+		break;
 	case GID_KQ5:
 		signatureTable = kq5Signatures;
 		break;




More information about the Scummvm-git-logs mailing list