aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorsluicebox2019-07-07 19:18:04 -0700
committerFilippos Karapetis2019-07-09 09:51:10 +0300
commitca66a776b0444a4af5cde844a924b8f25baffb77 (patch)
tree6c4773fbeaefd85be715982ce5af7d707f2a0973 /engines/sci/engine
parent14fe8ac3a0243fe356a604127e60c6104dd66cc4 (diff)
downloadscummvm-rg350-ca66a776b0444a4af5cde844a924b8f25baffb77.tar.gz
scummvm-rg350-ca66a776b0444a4af5cde844a924b8f25baffb77.tar.bz2
scummvm-rg350-ca66a776b0444a4af5cde844a924b8f25baffb77.zip
SCI: Implement early GetLongest() behavior, bug #10000
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/features.cpp50
-rw-r--r--engines/sci/engine/features.h2
2 files changed, 52 insertions, 0 deletions
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 5d01aea32f..980e417d7e 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -774,4 +774,54 @@ PseudoMouseAbilityType GameFeatures::detectPseudoMouseAbility() {
return _pseudoMouseAbility;
}
+// GetLongest(), which calculates the number of characters in a string that can fit
+// within a width, had two subtle changes which started to appear in interpreters
+// in late 1990. An off-by-one bug was fixed where the character that exceeds the
+// width would be applied to the result if a space character hadn't been reached.
+// The pixel width test was also changed from a greater than or equals to greater
+// than, but again only if a space character hadn't been reached.
+//
+// The notebook in LB1 (bug #10000) is currently the only known script that depended
+// on the original behavior. This appears to be an isolated fix to an interpreter
+// edge case, a corresponding script change to allow autodetection hasn't been found.
+//
+// The Japanese interpreters have their own versions of GetLongest() to support
+// double byte characters which seems to be how QFG1 Japanese reintroduced it
+// even though its interpreter is later than SQ3/LSL3 multilingual versions.
+bool GameFeatures::useEarlyGetLongestTextCalculations() const {
+ switch (getSciVersion()) {
+
+ // All SCI0, confirmed:
+ // - LSL2 English PC 1.000.011
+ // - LB1 PC 1.000.046
+ // - ICEMAN PC 1.033
+ // - SQ3 English PC 1.018
+ // - PQ2 Japanese 1.000.052
+ case SCI_VERSION_0_EARLY:
+ case SCI_VERSION_0_LATE:
+ return true;
+
+ // SCI01: confirmed KQ1 and QFG1 Japanese,
+ // fixed in SQ3 and LSL3 multilingual PC
+ case SCI_VERSION_01:
+ return (g_sci->getGameId() == GID_KQ1 || g_sci->getGameId() == GID_QFG1);
+
+ // QFG2, confirmed 1.000 and 1.105 (first and last versions)
+ case SCI_VERSION_1_EGA_ONLY:
+ return true;
+
+ // SCI1 Early: just KQ5 English PC versions,
+ // confirmed fixed in:
+ // - LSL1 Demo
+ // - XMAS1990 EGA
+ // - SQ4 1.052
+ case SCI_VERSION_1_EARLY:
+ return (g_sci->getGameId() == GID_KQ5);
+
+ // Fixed in all other versions
+ default:
+ return false;
+ }
+}
+
} // End of namespace Sci
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 42d710f9a6..01535ce3dc 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -245,6 +245,8 @@ public:
*/
PseudoMouseAbilityType detectPseudoMouseAbility();
+ bool useEarlyGetLongestTextCalculations() const;
+
private:
reg_t getDetectionAddr(const Common::String &objName, Selector slc, int methodNum = -1);