[Scummvm-git-logs] scummvm master -> cc95809bb5d37691b5bef94375094305a4b74453
sluicebox
22204938+sluicebox at users.noreply.github.com
Tue Apr 6 06:51:44 UTC 2021
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:
cc95809bb5 SCI: Fix compatibility with PQ1VGA & PQ3 GOG versions
Commit: cc95809bb5d37691b5bef94375094305a4b74453
https://github.com/scummvm/scummvm/commit/cc95809bb5d37691b5bef94375094305a4b74453
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-04-05T23:47:45-07:00
Commit Message:
SCI: Fix compatibility with PQ1VGA & PQ3 GOG versions
GOG includes NRS scripts in PQ1VGA and PQ3 which trigger our
warning about fan patches. The patches introduce several forms of
speed throttling but we already throttle at the engine level.
This changes timing throughout the games and may cause conflicts.
This commit:
- Disables the speed throttling that the patches introduce
- Removes the warning for these versions
GOG versions now play the same as original unpatched ones.
Changed paths:
engines/sci/engine/script_patches.cpp
engines/sci/sci.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index bc6724ffac..9cf8cb059c 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -10904,6 +10904,45 @@ static const uint16 pq1vgaPatchFloatOutsideCarols2[] = {
PATCH_END
};
+// The GOG release includes New Rising Sun's script patches which throttle speed
+// in core classes. Since we do our own speed throttling, we patch the scripts
+// back to the original code for compatibility.
+//
+// Applies to: English floppy with NRS patches 994.HEP/SCR and 999.HEP/SCR
+// Responsible methods: Game:doit, Script:doit
+static const uint16 pq1vgaSignatureNrsSpeedThrottle1[] = {
+ 0x78, // push1
+ 0x78, // push1
+ SIG_MAGICDWORD,
+ 0x43, 0x41, 0x02, // callk Wait 02 [ Wait 1 ]
+ 0x30, SIG_UINT16(0x0000), // bnt 0000
+ SIG_ADDTOOFFSET(+10),
+ 0x63, 0x12, // pToa script
+ SIG_END
+};
+
+static const uint16 pq1vgaPatchNrsSpeedThrottle1[] = {
+ 0x81, 0x25, // lag 37
+ 0x31, 0x0e, // bnt 0e
+ 0x35, 0x00, // ldi 00
+ 0xa1, 0x25, // sag 37
+ PATCH_END
+};
+
+static const uint16 pq1vgaSignatureNrsSpeedThrottle2[] = {
+ SIG_MAGICDWORD,
+ 0x67, 0x1c, // pTos seconds
+ 0x35, 0x00, // ldi 00
+ 0x1a, // eq?
+ 0x30, SIG_UINT16(0x0012), // bnt 0012
+ SIG_END
+};
+
+static const uint16 pq1vgaPatchNrsSpeedThrottle2[] = {
+ 0x33, 0x18, // jmp 18 [ skip Script throttling ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry pq1vgaSignatures[] = {
{ true, 30, "float outside carol's (1/2)", 7, pq1vgaSignatureFloatOutsideCarols1, pq1vgaPatchFloatOutsideCarols1 },
@@ -10912,6 +10951,8 @@ static const SciScriptPatcherEntry pq1vgaSignatures[] = {
{ true, 341, "put gun in locker bug", 1, pq1vgaSignaturePutGunInLockerBug, pq1vgaPatchPutGunInLockerBug },
{ true, 500, "map save/restore bug", 2, pq1vgaSignatureMapSaveRestoreBug, pq1vgaPatchMapSaveRestoreBug },
{ true, 928, "Narrator lockup fix", 1, sciNarratorLockupSignature, sciNarratorLockupPatch },
+ { true, 994, "NRS: remove speed throttle (1/2)", 1, pq1vgaSignatureNrsSpeedThrottle1, pq1vgaPatchNrsSpeedThrottle1 },
+ { true, 999, "NRS: remove speed throttle (2/2)", 1, pq1vgaSignatureNrsSpeedThrottle2, pq1vgaPatchNrsSpeedThrottle2 },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -11132,12 +11173,39 @@ static const uint16 pq3PatchRoadSignUpdates[] = {
PATCH_END
};
+// The GOG release includes New Rising Sun's script patches which throttle speed
+// in core classes. Since we do our own speed throttling, we patch the scripts
+// back to the original code for compatibility.
+//
+// Applies to: PC floppy with NRS patches 994.HEP/SCR
+// Responsible method: Game:doit
+static const uint16 pq3SignatureNrsSpeedThrottle[] = {
+ 0x78, // push1
+ 0x7a, // push2
+ 0x43, 0x41, 0x02, // callk Wait 02 [ Wait 2 ]
+ SIG_MAGICDWORD,
+ 0x30, SIG_UINT16(0x0001), // bnt 0001
+ 0x00, // bnot
+ SIG_ADDTOOFFSET(+10),
+ 0x63, 0x08, // pToa script
+ SIG_END
+};
+
+static const uint16 pq3PatchNrsSpeedThrottle[] = {
+ 0x81, 0x25, // lag 37
+ 0x30, PATCH_UINT16(0x000e), // bnt 000e
+ 0x35, 0x00, // ldi 00
+ 0xa1, 0x25, // sag 37
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry pq3Signatures[] = {
- { true, 25, "fix road sign updates", 1, pq3SignatureRoadSignUpdates, pq3PatchRoadSignUpdates },
- { true, 33, "prevent house fire repeating", 1, pq3SignatureHouseFireRepeats, pq3PatchHouseFireRepeats },
- { true, 36, "give locket missing points", 1, pq3SignatureGiveLocketPoints, pq3PatchGiveLocketPoints },
- { true, 36, "doctor mouth speed", 1, pq3SignatureDoctorMouthSpeed, pq3PatchDoctorMouthSpeed },
+ { true, 25, "fix road sign updates", 1, pq3SignatureRoadSignUpdates, pq3PatchRoadSignUpdates },
+ { true, 33, "prevent house fire repeating", 1, pq3SignatureHouseFireRepeats, pq3PatchHouseFireRepeats },
+ { true, 36, "give locket missing points", 1, pq3SignatureGiveLocketPoints, pq3PatchGiveLocketPoints },
+ { true, 36, "doctor mouth speed", 1, pq3SignatureDoctorMouthSpeed, pq3PatchDoctorMouthSpeed },
+ { true, 994, "NRS: remove speed throttle", 1, pq3SignatureNrsSpeedThrottle, pq3PatchNrsSpeedThrottle },
SCI_SIGNATUREENTRY_TERMINATOR
};
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index ea6ebfa632..5a8e4b6f7a 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -468,13 +468,15 @@ bool SciEngine::gameHasFanMadePatch() {
{ GID_LSL3, 380, 6148, 195, 0x35 },
{ GID_LSL5, 994, 4810, 1342, 0x78 }, // English
{ GID_LSL5, 994, 4942, 1392, 0x76 }, // German
- { GID_PQ1, 994, 4332, 1473, 0x78 },
+ // GOG includes PQ1 patches. Incompatibilities are resolved by our script patches
+ //{ GID_PQ1, 994, 4332, 1473, 0x78 },
{ GID_PQ2, 200, 10614, 0, 0x00 },
- { GID_PQ3, 994, 4686, 1291, 0x78 }, // English
- { GID_PQ3, 994, 4734, 1283, 0x78 }, // German
+ // GOG includes PQ3 patches. Incompatibilities are resolved by our script patches
+ //{ GID_PQ3, 994, 4686, 1291, 0x78 }, // English
+ //{ GID_PQ3, 994, 4734, 1283, 0x78 }, // German
{ GID_QFG1VGA, 994, 4388, 0, 0x00 },
{ GID_QFG3, 994, 4714, 2, 0x48 },
- // TODO: Disabled, as it fixes a whole lot of bugs which can't be tested till SCI2.1 support is finished
+ // GOG includes QFG4 patches. Incompatibilities are resolved by our script patches
//{ GID_QFG4, 710, 11477, 0, 0x00 },
{ GID_SQ1, 994, 4740, 0, 0x00 },
{ GID_SQ5, 994, 4142, 1496, 0x78 }, // English/German/French
More information about the Scummvm-git-logs
mailing list