[Scummvm-cvs-logs] scummvm master -> c9cef5e9711a33c5e8a0a442b336175df5ebb3c2

bluegr md5 at scummvm.org
Thu May 12 23:17:39 CEST 2011


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:
a3c6439a1a SCI: Added workarounds for bug #3292251, instead of patching the script
c9cef5e971 SCI: Marked the sanity check inside processWorkList() as a workaround


Commit: a3c6439a1a464471b62b091d52065cf53a8dabdf
    https://github.com/scummvm/scummvm/commit/a3c6439a1a464471b62b091d52065cf53a8dabdf
Author: md5 (md5 at scummvm.org)
Date: 2011-05-12T14:10:44-07:00

Commit Message:
SCI: Added workarounds for bug #3292251, instead of patching the script

This fixes bug #3295853

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 0791267..2d3d8f6 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -872,50 +872,9 @@ const uint16 qfg3PatchDialogCrash[] = {
 	PATCH_END
 };
 
-// Part of script 47 that handles the barter icon checks for the wrong local.
-// The local is supposed to contain the value returned by a previous kDisplay
-// call, but since the wrong one is checked, it contains junk instead. We
-// remove that check here (this doesn't affect the game at all). This occurs
-// when attempting to purchase something from a vendor and the barter button is
-// available (e.g. when buying the robe or meat from the associated vendors).
-// Fixes bug #3292251.
-const byte qfg3BarterCrash[] = {
-	22,
-	0x83, 0x10,        // lal 10   ---> BUG! Wrong local
-	0x30, 0x11, 0x00,  // bnt 0011 ---> the accumulator will now contain garbage, so this check fails
-	0x35, 0x00,        // ldi 00
-	0xa5, 0x00,        // sat 00
-	0x39, 0x03,        // pushi 03
-	0x5b, 0x04, 0x00,  // lea 04 00
-	0x36,              // push
-	0x39, 0x6c,        // pushi 6c
-	0x8b, 0x10,        // lsl 10   ---> local 10 contains garbage, so the call below will fail
-	0x43, 0x1b, 0x06   // callk Display[1b] 06
-};
-
-// Same as above, but for local 0x11
-const byte qfg3BarterCrash2[] = {
-	18,
-	0x83, 0x11,        // lal 11   ---> BUG! Wrong local
-	0x30, 0x0d, 0x00,  // bnt 000d ---> the accumulator will now contain garbage, so this check fails
-	0x39, 0x03,        // pushi 03
-	0x5b, 0x04, 0x00,  // lea 04 00
-	0x36,              // push
-	0x39, 0x6c,        // pushi 6c
-	0x8b, 0x11,        // lsl 11   ---> local 11 contains garbage, so the call below will fail
-	0x43, 0x1b, 0x06   // callk Display[1b] 06
-};
-
-const uint16 qfg3PatchBarterCrash[] = {
-	0x35, 0x00,       // ldi 00    ---> the accumulator will always be zero, so the problematic code won't run
-	PATCH_END
-};
-
 //    script, description,                                      magic DWORD,                                  adjust
 const SciScriptSignature qfg3Signatures[] = {
 	{     23, "dialog crash",                                   1, PATCH_MAGICDWORD(0xe7, 0x03, 0x22, 0x33),  -1,           qfg3DialogCrash,          qfg3PatchDialogCrash },
-	{     47, "barter crash",                                   1, PATCH_MAGICDWORD(0x83, 0x10, 0x30, 0x11),   0,           qfg3BarterCrash,          qfg3PatchBarterCrash },
-	{     47, "barter crash 2",                                 1, PATCH_MAGICDWORD(0x83, 0x11, 0x30, 0x0d),   0,          qfg3BarterCrash2,          qfg3PatchBarterCrash },
 	{    944, "import dialog continuous calls",                 1, PATCH_MAGICDWORD(0x2a, 0x31, 0x0b, 0x7a),  -1, qfg3SignatureImportDialog,         qfg3PatchImportDialog },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 96e9c89a..aba2e66 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -210,6 +210,8 @@ const SciWorkaroundEntry kDisplay_workarounds[] = {
 	{ GID_PQ2,            23,    23,  0,         "rm23Script", "elements",    0x4ae,    0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of pate's file - 0x75 as id
 	{ GID_PQ2,            23,    23,  0,         "rm23Script", "elements",    0x4c1,    0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #3043904)
 	{ GID_QFG1,           11,    11,  0,             "battle", "<noname90>",     -1,    0, { WORKAROUND_IGNORE,    0 } }, // DEMO: When entering battle, 0x75 as id
+	{ GID_QFG3,           -1,    47,  0,          "barterWin", "open",       0x1426,    0, { WORKAROUND_IGNORE,    0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251
+	{ GID_QFG3,           -1,    47,  0,         "barterIcon", "show",       0x135c,    0, { WORKAROUND_IGNORE,    0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251
 	{ GID_SQ1,            -1,   700,  0,       "arcadaRegion", "doit",           -1,    0, { WORKAROUND_IGNORE,    0 } }, // restoring in some rooms of the arcada (right at the start)
 	{ GID_SQ4,           397,     0,  0,                   "", "export 12",      -1,    0, { WORKAROUND_IGNORE,    0 } }, // FLOPPY: when going into the computer store (bug #3044044)
 	{ GID_SQ4,           391,   391,  0,          "doCatalog", "mode",         0x84,    0, { WORKAROUND_IGNORE,    0 } }, // CD: clicking on catalog in roboter sale - a parameter is an object
@@ -227,7 +229,7 @@ const SciWorkaroundEntry kDirLoop_workarounds[] = {
 const SciWorkaroundEntry kDisposeScript_workarounds[] = {
 	{ GID_LAURABOW,      777,   777,  0,             "myStab", "changeState",    -1,    0, { WORKAROUND_IGNORE,    0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #3034907
 	{ GID_QFG1,           -1,    64,  0,               "rm64", "dispose",        -1,    0, { WORKAROUND_IGNORE,    0 } }, // when leaving graveyard, parameter 0 is an object
-	{ GID_SQ4,           150,   151,  0,        "fightScript", "dispose",        -1,    0, { WORKAROUND_IGNORE,    0 } }, // during fight with vohaul, parameter 0 is an object
+	{ GID_SQ4,           150,   151,  0,        "fightScript", "dispose",        -1,    0, { WORKAROUND_IGNORE,    0 } }, // during fight with Vohaul, parameter 0 is an object
 	{ GID_SQ4,           150,   152,  0,       "driveCloseUp", "dispose",        -1,    0, { WORKAROUND_IGNORE,    0 } }, // when choosing "beam download", parameter 0 is an object
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };


Commit: c9cef5e9711a33c5e8a0a442b336175df5ebb3c2
    https://github.com/scummvm/scummvm/commit/c9cef5e9711a33c5e8a0a442b336175df5ebb3c2
Author: md5 (md5 at scummvm.org)
Date: 2011-05-12T14:15:41-07:00

Commit Message:
SCI: Marked the sanity check inside processWorkList() as a workaround

The sanity check added in rev #35086fe17c fixes the crashes with that
code when an invalid reference is about to be processed, but these
references shouldn't be in the stack at all in the first place, so the
root cause seems to be somewhere else.

Changed paths:
    engines/sci/engine/gc.cpp



diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp
index 9c580dd..b40677d 100644
--- a/engines/sci/engine/gc.cpp
+++ b/engines/sci/engine/gc.cpp
@@ -87,7 +87,13 @@ static void processWorkList(SegManager *segMan, WorklistManager &wm, const Commo
 		wm._worklist.pop_back();
 		if (reg.segment != stackSegment) { // No need to repeat this one
 			debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg));
-			// We only check for valid offsets here. Fixes bugs #3299458 and #3295849.
+			// WORKAROUND: We only check for valid offsets here. Fixes bugs
+			// #3299458 and #3295849.
+			// FIXME: Where are these invalid offsets coming from? The check
+			// below avoids a crash when examining invalid references, but the
+			// root of the problem lies elsewhere. These shouldn't be in the
+			// stack at all (unless these really are script bugs, in which case
+			// we should just keep the sanity check).
 			if (reg.segment < heap.size() && heap[reg.segment] && heap[reg.segment]->isValidOffset(reg.offset)) {
 				// Valid heap object? Find its outgoing references!
 				wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg));






More information about the Scummvm-git-logs mailing list