aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-01-25 15:06:42 +0000
committerTorbjörn Andersson2006-01-25 15:06:42 +0000
commitca705b9167e9462b259614a0874ac2db1a3cee44 (patch)
tree1d500c6b6e988cdee13e005e4a31a8d652c286c9
parenta9e164e757fde583858f82abfdbdfe8ba729dac5 (diff)
downloadscummvm-rg350-ca705b9167e9462b259614a0874ac2db1a3cee44.tar.gz
scummvm-rg350-ca705b9167e9462b259614a0874ac2db1a3cee44.tar.bz2
scummvm-rg350-ca705b9167e9462b259614a0874ac2db1a3cee44.zip
Extend the workaround for bug #1407789 in an attempt to deal with the
different versions of Full Throttle. This is partly guesswork, and may be incorrect. svn-id: r20161
-rw-r--r--scumm/script.cpp10
-rw-r--r--scumm/scumm.cpp26
-rw-r--r--scumm/scumm.h3
3 files changed, 34 insertions, 5 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 62cd689980..5750f2d500 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -1082,12 +1082,12 @@ void ScummEngine::checkAndRunSentenceScript() {
localParamList[1] = _sentence[_sentenceNum].objectA;
localParamList[2] = _sentence[_sentenceNum].objectB;
- // WORKAROUND for bug #1407789. The script clearly assumes that
- // one of the two objects is an actor. If that's not the case,
- // fall back on what appears to be the usual sentence script.
+ // WORKAROUND for bug #1407789. The buggy script clearly
+ // assumes that one of the two objects is an actor. If that's
+ // not the case, fall back on the default sentence script.
- if (_gameId == GID_FT && sentenceScript == 103 && !isValidActor(localParamList[1]) && !isValidActor(localParamList[2])) {
- sentenceScript = 28;
+ if (_gameId == GID_FT && sentenceScript == _buggyFTSentenceScript && !isValidActor(localParamList[1]) && !isValidActor(localParamList[2])) {
+ sentenceScript = _defaultFTSentenceScript;
}
}
_currentScript = 0xFF;
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 704266e45f..6783f4062b 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -962,6 +962,32 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
if (!elem)
printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
+ if (_gameId == GID_FT) {
+ // WORKAROUND for bug #1407789. See checkAndRunSentenceScript()
+ // for the actual workaround.
+
+ // FIXME: We do not yet have all necessary information, but the
+ // following is known:
+ //
+ // * The US PC version uses scripts 28 and 103.
+ // * The French PC version uses scripts 29 and 104.
+ // * The German, Italian, Portuguese and Spanish PC versions
+ // use script 29. The other script is not currently known.
+ // * The US Mac demo uses script 28.
+ //
+ // For now, assume that the PC and Mac versions are the same,
+ // that all localized versions use scripts 29 and 104, and that
+ // any completely unknown version is localized.
+
+ if (elem && elem->language == Common::EN_USA) {
+ _defaultFTSentenceScript = 28;
+ _buggyFTSentenceScript = 103;
+ } else {
+ _defaultFTSentenceScript = 29;
+ _buggyFTSentenceScript = 104;
+ }
+ }
+
// Add default file directories.
if (((_platform == Common::kPlatformAmiga) || (_platform == Common::kPlatformAtariST)) && (_version <= 4)) {
// This is for the Amiga version of Indy3/Loom/Maniac/Zak
diff --git a/scumm/scumm.h b/scumm/scumm.h
index d8fec6cfdf..157068628a 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -618,6 +618,9 @@ protected:
int _vmStack[150];
int _keyScriptKey, _keyScriptNo;
+ // See the ScummEngine constructor and checkAndRunSentenceScript()
+ int _defaultFTSentenceScript, _buggyFTSentenceScript;
+
virtual void setupOpcodes() = 0;
virtual void executeOpcode(byte i) = 0;
virtual const char *getOpcodeDesc(byte i) = 0;