[Scummvm-git-logs] scummvm master -> c7743b3422d6b95cb9252d01f69b75c76278faaf
sluicebox
noreply at scummvm.org
Mon Mar 20 17:58:26 UTC 2023
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:
19d4f63af4 SCI: Fix crash in script debugger
c7743b3422 SCI: Fix LSL5 Hollywood sign
Commit: 19d4f63af4d4b379937762324267eeb33338a708
https://github.com/scummvm/scummvm/commit/19d4f63af4d4b379937762324267eeb33338a708
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-03-20T10:58:11-07:00
Commit Message:
SCI: Fix crash in script debugger
Stepping through an instruction that accesses an invalid property caused
an error. This code is only used by the disassembler when debugging, and
the disassembler already displays when a property is invalid.
Changed paths:
engines/sci/engine/object.cpp
engines/sci/engine/scriptdebug.cpp
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index 2fdbb9118f0..9dac479ba95 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -222,8 +222,7 @@ int Object::propertyOffsetToId(SegManager *segMan, int propertyOffset) const {
int selectors = getVarCount();
if (propertyOffset < 0 || (propertyOffset >> 1) >= selectors) {
- error("Applied propertyOffsetToId to invalid property offset %x (property #%d not in [0..%d])",
- propertyOffset, propertyOffset >> 1, selectors - 1);
+ // Scripts contain instructions with invalid properties
return -1;
}
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 16d1edb7cc7..e4ec0a88c23 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -316,8 +316,12 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
} else {
if (getSciVersion() == SCI_VERSION_3)
debugN("\t(%s)", g_sci->getKernel()->getSelectorName(param_value).c_str());
- else
- debugN("\t(%s)", g_sci->getKernel()->getSelectorName(obj->propertyOffsetToId(s->_segMan, param_value)).c_str());
+ else {
+ int propertySelector = obj->propertyOffsetToId(s->_segMan, param_value);
+ if (propertySelector != -1) {
+ debugN("\t(%s)", g_sci->getKernel()->getSelectorName(propertySelector).c_str());
+ }
+ }
}
}
}
Commit: c7743b3422d6b95cb9252d01f69b75c76278faaf
https://github.com/scummvm/scummvm/commit/c7743b3422d6b95cb9252d01f69b75c76278faaf
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-03-20T10:58:11-07:00
Commit Message:
SCI: Fix LSL5 Hollywood sign
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 df0472d964a..5f70e1870fb 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8832,9 +8832,39 @@ static const uint16 larry5PatchGermanEndingPattiTalker[] = {
PATCH_END
};
+// The Hollywood sign in room 190 doesn't respond to clicks or display its
+// messages. This is a script typo. The author attempted to initialize the
+// `HollywoodSign` object, but typed the word `sign` instead. The compiler
+// accepted this because `sign` is the name of a procedure in script 999.
+// The `init` selector was interpreted as a non-existent property.
+//
+// We fix this by calling HollywoodSign:init instead of sign.
+//
+// Applies to: All versions
+// Responsible method: rm190:init
+static const uint16 larry5SignatureHollywoodSign[] = {
+ 0x78, // push1
+ 0x66, SIG_ADDTOOFFSET(+2), // pTos ????
+ SIG_MAGICDWORD,
+ 0x46, SIG_UINT16(0x03e7), // calle proc999_0 [ sign(????) ]
+ SIG_UINT16(0x0000), 0x02,
+ SIG_ADDTOOFFSET(+3),
+ 0x72, // lofsa tree [ 0x40 bytes before HollywoodSign ]
+ SIG_END
+};
+
+static const uint16 larry5PatchHollywoodSign[] = {
+ 0x38, PATCH_SELECTOR16(init), // pushi init
+ 0x39, 0x00, // pushi 00
+ 0x72, PATCH_GETORIGINALUINT16ADJUST(+14, +0x40), // lofsa HollywoodSign
+ 0x4a, 0x04, // send 04 [ HollywoodSign init: ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry larry5Signatures[] = {
{ true, 0, "update stopGroop client", 1, larry5SignatureUpdateStopGroopClient, larry5PatchUpdateStopGroopClient },
+ { true, 190, "hollywood sign", 1, larry5SignatureHollywoodSign, larry5PatchHollywoodSign },
{ true, 280, "English-only: fix green card limo bug", 1, larry5SignatureGreenCardLimoBug, larry5PatchGreenCardLimoBug },
{ true, 380, "German-only: Enlarge Patti Textbox", 1, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker },
SCI_SIGNATUREENTRY_TERMINATOR
More information about the Scummvm-git-logs
mailing list