[Scummvm-git-logs] scummvm master -> 811033288ec6e3fa33c29f85bd32734bf6065aeb
sluicebox
noreply at scummvm.org
Wed May 24 20:50:52 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:
811033288e SCI32: Add compatibility with GK1 CD Italian fan translation
Commit: 811033288ec6e3fa33c29f85bd32734bf6065aeb
https://github.com/scummvm/scummvm/commit/811033288ec6e3fa33c29f85bd32734bf6065aeb
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-05-24T13:49:50-07:00
Commit Message:
SCI32: Add compatibility with GK1 CD Italian fan translation
Fixes errors when displaying text and using the Walkman.
Changed paths:
engines/sci/engine/script_patches.cpp
engines/sci/engine/workarounds.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 571f6a8be35..66bc1700385 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4061,6 +4061,34 @@ static const uint16 gk1EndGameFontPatch[] = {
PATCH_END
};
+// The Italian fan translation by Enrico Rolfi replaced GK1CD's SCI2 interpreter
+// with an SCI2.1 version from a different game. This changed the kernel table.
+// The GK1 scripts were altered to match. ScummVM provides GK1 with the SCI2
+// table it expects, so these scripts are incompatible. Fortunately, only one
+// kernel function is affected. kDisposeTextBitmap only appears in SCI2, so its
+// calls were replaced with the equivalent kBitmap(Destroy) for SCI2.1.
+//
+// We fix this incompatibility by patching all ten kBitmap(Destroy) calls back
+// to kDisposeTextBitmap. By patching just the callk instructions, the Destroy
+// subop (1) on the stack becomes the new parameter count. The old parameter
+// count (2) remains on the stack until the next ret instruction. This allows
+// one patch to work on all calls.
+//
+// Applies to: Italian fan translation, PC CD version
+// Responsible methods: DEdit:hilite, DText:dispose, DText:draw, DSelector:dispose,
+// SRDialog:update, BookButton:hilite, TapeButton:doit
+// TellerButton:hilite, TopicButton:hilite
+static const uint16 gk1ItalianTranslationSignature[] = {
+ SIG_MAGICDWORD,
+ 0x43, 0x91, SIG_UINT16(0x0004), // callk 91 0004 [ SCI2: invalid, SCI2.1: kBitmap ]
+ SIG_END
+};
+
+static const uint16 gk1ItalianTranslationPatch[] = {
+ 0x43, 0x2e, PATCH_UINT16(0x0002), // callk 2e 0002 [ kDisposeTextBitmap ]
+ PATCH_END
+};
+
// Narrator lockup fix for GK1 CD / Mac, see sciNarratorLockupSignature.
// The custom code in these versions overlaps with the generic patch signature
// so we enable the correct one based on game version and platform.
@@ -4145,6 +4173,13 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
{ true, 710, "fix day 9 mummy animation (floppy)", 1, gk1MummyAnimateFloppySignature, gk1MummyAnimateFloppyPatch },
{ true, 710, "fix day 9 mummy animation (cd)", 1, gk1MummyAnimateCDSignature, gk1MummyAnimateCDPatch },
{ true, 800, "fix day 10 honfour unlock door lockup", 1, gk1HonfourUnlockDoorSignature, gk1HonfourUnlockDoorPatch },
+ { true, 91, "italian translation compatibility", 3, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 815, "italian translation compatibility", 1, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 920, "italian translation compatibility", 1, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 64913, "italian translation compatibility", 1, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 64914, "italian translation compatibility", 1, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 64915, "italian translation compatibility", 2, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
+ { true, 64990, "italian translation compatibility", 1, gk1ItalianTranslationSignature, gk1ItalianTranslationPatch },
{ false, 64928, "floppy: Narrator lockup fix", 1, sciNarratorLockupSignature, sciNarratorLockupPatch },
{ false, 64928, "cd/mac: Narrator lockup fix", 1, gk1NarratorLockupSignature, gk1NarratorLockupPatch },
{ true, 64990, "increase number of save games (1/2)", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 2918e2f4dc7..d4260f4f1d1 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -80,6 +80,7 @@ const SciWorkaroundEntry arithmeticWorkarounds[] = {
{ GID_FANMADE, 516, 983, 0, "Wander", "setTarget", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #5124
{ GID_FANMADE, -1, 935, 0, "Scaler", "init", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // op_mul: Zork: The Great Underground Empire (fan made): called with object as second parameter when changing rooms
{ GID_GK1, 800,64992, 0, "Fwd", "doit", nullptr, 0, 0, { WORKAROUND_FAKE, 1 } }, // op_gt: when Mosely finds Gabriel and Grace near the end of the game, compares the Grooper object with 7
+ { GID_GK1, -1, 91, 0, "Walkman", "showTapes", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // op_bnot: Italian fan translation when exiting Walkman. bnot is just an extra 00 byte from the fan patch; the result isn't used.
{ GID_HOYLE4, 700, -1, 1, "Code", "doit", nullptr, 0, 0, { WORKAROUND_FAKE, 1 } }, // op_add: while bidding in Bridge, an object ("Bid") is added to an object in another segment ("hand3")
{ GID_ICEMAN, 199, 977, 0, "Grooper", "doit", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // op_add: While dancing with the girl
{ GID_MOTHERGOOSE256, -1, 999, 0, "Event", "new", nullptr, 0, 0, { WORKAROUND_FAKE, 0 } }, // op_and: constantly during the game (SCI1 version)
More information about the Scummvm-git-logs
mailing list