aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authormd52011-05-13 00:10:44 +0300
committermd52011-05-13 00:10:44 +0300
commita3c6439a1a464471b62b091d52065cf53a8dabdf (patch)
treed4a6f8bc5217d23750eda7b4b4b08cd07441c15b /engines/sci
parent4f5ecc4861f170c4a7881140533846db1095fa5b (diff)
downloadscummvm-rg350-a3c6439a1a464471b62b091d52065cf53a8dabdf.tar.gz
scummvm-rg350-a3c6439a1a464471b62b091d52065cf53a8dabdf.tar.bz2
scummvm-rg350-a3c6439a1a464471b62b091d52065cf53a8dabdf.zip
SCI: Added workarounds for bug #3292251, instead of patching the script
This fixes bug #3295853
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/script_patches.cpp41
-rw-r--r--engines/sci/engine/workarounds.cpp4
2 files changed, 3 insertions, 42 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 0791267e94..2d3d8f6155 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 96e9c89aa7..aba2e66eff 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
};