[Scummvm-cvs-logs] scummvm master -> 882b1c218fedf5ea45d81524f405df1178080e7a

m-kiewitz m_kiewitz at users.sourceforge.net
Fri Apr 17 23:40:54 CEST 2015


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:
882b1c218f SCI: patch qfg2 import bug for 1.102 and below


Commit: 882b1c218fedf5ea45d81524f405df1178080e7a
    https://github.com/scummvm/scummvm/commit/882b1c218fedf5ea45d81524f405df1178080e7a
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-04-17T23:40:12+02:00

Commit Message:
SCI: patch qfg2 import bug for 1.102 and below

this patches the known character type import bug
(which made all imported characters a fighter)

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 48b1292..44ceb15 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -2245,9 +2245,57 @@ static const uint16 qfg2PatchImportDialog[] = {
 	PATCH_END
 };
 
-//          script, description,                                      signature                  patch
+// Quest For Glory 2 character import doesn't properly set the character type
+//  in versions 1.102 and below, which makes all importerted characters a fighter.
+//
+// Sierra released an official patch. However the fix is really easy to
+//  implement on our side, so we also patch the flaw in here in case we find it.
+//
+// The version released on GOG is 1.102 without this patch applied, so us
+//  patching it is quite useful.
+//
+// Applies to at least: English Floppy
+// Responsible method: importHero::changeState
+// Fixes bug: inside versions 1.102 and below
+static const uint16 qfg2SignatureImportCharType[] = {
+	0x35, 0x04,                         // ldi 04
+	0x90, SIG_UINT16(0x023b),           // lagi global[23Bh]
+	0x02,                               // add
+	0x36,                               // push
+	0x35, 0x04,                         // ldi 04
+	0x08,                               // div
+	0x36,                               // push
+	0x35, 0x0d,                         // ldi 0D
+	0xb0, SIG_UINT16(0x023b),           // sagi global[023Bh]
+	0x8b, 0x1f,                         // lsl local[1Fh]
+	0x35, 0x05,                         // ldi 05
+	SIG_MAGICDWORD,
+	0xb0, SIG_UINT16(0x0150),           // sagi global[0150h]
+	0x8b, 0x02,                         // lsl local[02h]
+	SIG_END
+};
+
+static const uint16 qfg2PatchImportCharType[] = {
+	0x80, PATCH_UINT16(0x023f),         // lag global[23Fh] <-- patched to save 2 bytes
+	0x02,                               // add
+	0x36,                               // push
+	0x35, 0x04,                         // ldi 04
+	0x08,                               // div
+	0x36,                               // push
+	0xa8, SIG_UINT16(0x0248),           // ssg global[0248h] <-- patched to save 2 bytes
+	0x8b, 0x1f,                         // lsl local[1Fh]
+	0xa8, SIG_UINT16(0x0155),           // ssg global[0155h] <-- patched to save 2 bytes
+	// new code, directly from the official sierra patch file
+	0x83, 0x01,                         // lal local[01h]
+	0xa1, 0xbb,                         // sag global[BBh]
+	0xa1, 0x73,                         // sag global[73h]
+	PATCH_END
+};
+
+//          script, description,                                      signature                    patch
 static const SciScriptPatcherEntry qfg2Signatures[] = {
-	{  true,   944, "import dialog continuous calls",              1, qfg2SignatureImportDialog, qfg2PatchImportDialog },
+	{  true,   805, "import character type fix",                   1, qfg2SignatureImportCharType, qfg2PatchImportCharType },
+	{  true,   944, "import dialog continuous calls",              1, qfg2SignatureImportDialog,   qfg2PatchImportDialog },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 






More information about the Scummvm-git-logs mailing list