aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Fioramonti2017-09-15 18:17:43 -0700
committerColin Snover2017-09-15 23:44:13 -0500
commit817c9e77aa6f2c40571e807888bace46b08d0142 (patch)
tree5d7fff5b9f24f47e79137a29534af6871dac77b9
parent45cadfd9fbb25d28a7ff96a719f259f20499a93e (diff)
downloadscummvm-rg350-817c9e77aa6f2c40571e807888bace46b08d0142.tar.gz
scummvm-rg350-817c9e77aa6f2c40571e807888bace46b08d0142.tar.bz2
scummvm-rg350-817c9e77aa6f2c40571e807888bace46b08d0142.zip
SCI32: Fix bad play call in Shivers room 23090
This fixes a bad play call by replacing it with a fade call. The newRoom function In script rm23v090 (room 23090) was calling a play function with 5 arguments, but the play function only takes 4 arguments. Since it looks like a fade call it has been replaced with that. Fixes Trac#10200. snover helped.
-rw-r--r--engines/sci/engine/script_patches.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 22006575c6..018b4089aa 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -115,6 +115,8 @@ static const char *const selectorNameTable[] = {
"posn", // SCI2 benchmarking script
"detailLevel", // GK2 benchmarking
"view", // RAMA benchmarking
+ "fade", // Shivers sound fix
+ "play", // Shivers sound fix
"test", // Torin
"get", // Torin
"set", // Torin
@@ -166,6 +168,8 @@ enum ScriptPatcherSelectors {
SELECTOR_posn,
SELECTOR_detailLevel,
SELECTOR_view,
+ SELECTOR_fade,
+ SELECTOR_play,
SELECTOR_test,
SELECTOR_get,
SELECTOR_set,
@@ -6193,11 +6197,34 @@ static const uint16 shiversPatchSuperCall[] = {
PATCH_END
};
+// When the Ixupi is present in the Gods and Items intro room, the game tries to
+// play a sound using the play selector, but its arguments are only appropriate
+// for the fade selector.
+// If the badly constructed sound object from this call ends up receiving a
+// signal at any time in the future, the game will try to send to a number and
+// crash (because the third argument to play is supposed to be a client object,
+// but here it is a number instead). Other rooms make this same call with the
+// correct fade selector, so fix the selector here to match.
+// Applies to at least: English CD
+static const uint16 shiversGodsItemsIxupiPlaySoundSignature[] = {
+ SIG_MAGICDWORD,
+ 0x39, SIG_SELECTOR8(play), // pushi 33
+ 0x38, SIG_UINT16(0x06), // pushi 0006
+ SIG_END
+};
+
+static const uint16 shiversGodsItemsIxupiPlaySoundPatch[] = {
+ 0x38, PATCH_SELECTOR16(fade), // pushi 00f3
+ 0x39, 0x06, // pushi 06
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry shiversSignatures[] = {
{ true, 35170, "fix CCTV joystick interaction", 1, shiversSignatureSuperCall, shiversPatchSuperCall },
{ true, 990, "fix volume & brightness sliders", 2, shiversSignatureSuperCall, shiversPatchSuperCall },
{ true, 64908, "disable video benchmarking", 1, sci2BenchmarkSignature, sci2BenchmarkPatch },
+ { true, 23090, "fix play call in room 23090", 1, shiversGodsItemsIxupiPlaySoundSignature, shiversGodsItemsIxupiPlaySoundPatch },
SCI_SIGNATUREENTRY_TERMINATOR
};