[Scummvm-git-logs] scummvm master -> 7cee0a548002785071d9e36707b36d7426fc7326

sluicebox noreply at scummvm.org
Thu Jul 13 23:35:17 UTC 2023


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:
7cee0a5480 SCI: Update speed test overflow fix for more versions


Commit: 7cee0a548002785071d9e36707b36d7426fc7326
    https://github.com/scummvm/scummvm/commit/7cee0a548002785071d9e36707b36d7426fc7326
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-07-13T16:34:37-07:00

Commit Message:
SCI: Update speed test overflow fix for more versions

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 9b9de7d54e7..d26546c9af6 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -639,18 +639,19 @@ static const uint16 sci11SpeedTestPatch[] = {
 
 // The speed test originally used a signed comparison, causing the test to take
 //  nine minutes if kGetTime rolled over during it. This could happen when
-//  restarting the game. This bug conflicts with our speed test patch in KQ4,
-//  because after its very long introduction it runs the test again.
-//  We fix this with an unsigned comparison, as Sierra did.
+//  restarting the game. We fix this bug with an unsigned comparison, as Sierra
+//  did, otherwise our patch will cause the test to hang when kGetTime is large.
 static const uint16 sci0SpeedTestOverflowSignature[] = {
 	SIG_MAGICDWORD,
-	0x43, 0x46, 0x00,                   // callk GetTime
+	0x8b, 0x00,                         // lsl 00
+	0x76,                               // push0
+	0x43, SIG_ADDTOOFFSET(+1), 0x00,    // callk GetTime 00
 	0x22,                               // lt?
 	SIG_END
 };
 
 static const uint16 sci0SpeedTestOverflowPatch[] = {
-	PATCH_ADDTOOFFSET(+3),
+	PATCH_ADDTOOFFSET(+6),
 	0x2a,                               // ult?
 	PATCH_END
 };




More information about the Scummvm-git-logs mailing list