aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-17 22:11:35 +0000
committerMartin Kiewitz2010-07-17 22:11:35 +0000
commitbbcf020457a19bf7fdbc758d5f878554058dbd08 (patch)
tree6dfecf551920a4149d76e00aa51b25889b6509f2 /engines/sci
parent88dfa3142f46f1f346614dd9ca298be98023750c (diff)
downloadscummvm-rg350-bbcf020457a19bf7fdbc758d5f878554058dbd08.tar.gz
scummvm-rg350-bbcf020457a19bf7fdbc758d5f878554058dbd08.tar.bz2
scummvm-rg350-bbcf020457a19bf7fdbc758d5f878554058dbd08.zip
SCI: adding detection for SCI01 vocab inside a SCI0 game that's using the SCI0 vocab resource number, fixes pq2 japanese crashing on startup
svn-id: r50970
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/parser/vocabulary.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 7b115a815d..ad006b0ca8 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -85,6 +85,24 @@ bool Vocabulary::loadParserWords() {
return false; // NOT critical: SCI1 games and some demos don't have one!
}
+ if (_vocabVersion == kVocabularySCI0) {
+ if (resource->size < 26 * 2) {
+ warning("Invalid main vocabulary encountered: Much too small");
+ return false;
+ }
+ // Check the alphabet-offset table for any content
+ int alphabetNr;
+ for (alphabetNr = 0; alphabetNr < 26; alphabetNr++) {
+ if (READ_LE_UINT16(resource->data + alphabetNr * 2))
+ break;
+ }
+ // If all of them were empty, we are definitely seeing SCI01 vocab in disguise (e.g. pq2 japanese)
+ if (alphabetNr == 26) {
+ warning("SCI0: Found SCI01 vocabulary in disguise");
+ _vocabVersion = kVocabularySCI1;
+ }
+ }
+
unsigned int seeker;
if (_vocabVersion == kVocabularySCI1)
seeker = 255 * 2; // vocab.900 starts with 255 16-bit pointers which we don't use