[Scummvm-cvs-logs] SF.net SVN: scummvm:[50970] scummvm/trunk/engines/sci/parser/vocabulary.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Jul 18 00:11:36 CEST 2010
Revision: 50970
http://scummvm.svn.sourceforge.net/scummvm/?rev=50970&view=rev
Author: m_kiewitz
Date: 2010-07-17 22:11:35 +0000 (Sat, 17 Jul 2010)
Log Message:
-----------
SCI: adding detection for SCI01 vocab inside a SCI0 game that's using the SCI0 vocab resource number, fixes pq2 japanese crashing on startup
Modified Paths:
--------------
scummvm/trunk/engines/sci/parser/vocabulary.cpp
Modified: scummvm/trunk/engines/sci/parser/vocabulary.cpp
===================================================================
--- scummvm/trunk/engines/sci/parser/vocabulary.cpp 2010-07-17 21:13:37 UTC (rev 50969)
+++ scummvm/trunk/engines/sci/parser/vocabulary.cpp 2010-07-17 22:11:35 UTC (rev 50970)
@@ -85,6 +85,24 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list