[Scummvm-git-logs] scummvm master -> bc2ab792614825f3a03290f2894f017f585e0e6d

bluegr bluegr at gmail.com
Tue Apr 9 19:50:32 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bc2ab79261 SCI: Add parser support for LSL3, SQ3 German Amiga


Commit: bc2ab792614825f3a03290f2894f017f585e0e6d
    https://github.com/scummvm/scummvm/commit/bc2ab792614825f3a03290f2894f017f585e0e6d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-04-09T20:50:28+03:00

Commit Message:
SCI: Add parser support for LSL3, SQ3 German Amiga

Add parser support for multilingual Amiga versions that were released
in 1991 and are SCI_VERSION_1_MIDDLE

Changed paths:
    engines/sci/engine/kparse.cpp
    engines/sci/parser/vocabulary.cpp
    engines/sci/sci.cpp
    engines/sci/sci.h


diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp
index d3bf2d7..08992ca 100644
--- a/engines/sci/engine/kparse.cpp
+++ b/engines/sci/engine/kparse.cpp
@@ -169,7 +169,7 @@ reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv) {
 	Vocabulary *voc = g_sci->getVocabulary();
 
 	// Only SCI0-SCI1 EGA games had a parser. In newer versions, this is a stub
-	if (getSciVersion() > SCI_VERSION_1_EGA_ONLY)
+	if (!g_sci->hasParser())
 		return s->r_acc;
 
 	voc->clearSynonyms();
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 2642b6b..483fae2 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -60,7 +60,7 @@ Vocabulary::Vocabulary(ResourceManager *resMan, bool foreign) : _resMan(resMan),
 		_resourceIdBranches += 10;
 	}
 
-	if (getSciVersion() <= SCI_VERSION_1_EGA_ONLY && loadParserWords()) {
+	if (g_sci->hasParser() && loadParserWords()) {
 		loadSuffixes();
 		if (loadBranches())
 			// Now build a GNF grammar out of this
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index ebe157e..717d678 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -311,11 +311,7 @@ Common::Error SciEngine::run() {
 	_kernel->init();
 
 	_features = new GameFeatures(segMan, _kernel);
-	// Only SCI0, SCI01 and SCI1 EGA games used a parser
-	_vocabulary = (getSciVersion() <= SCI_VERSION_1_EGA_ONLY) ? new Vocabulary(_resMan, false) : NULL;
-	// Also, XMAS1990 apparently had a parser too. Refer to https://forums.scummvm.org/viewtopic.php?t=9135
-	if (getGameId() == GID_CHRISTMAS1990)
-		_vocabulary = new Vocabulary(_resMan, false);
+	_vocabulary = hasParser() ? new Vocabulary(_resMan, false) : NULL;
 
 	_gamestate = new EngineState(segMan);
 	_guestAdditions = new GuestAdditions(_gamestate, _features, _kernel);
@@ -779,6 +775,13 @@ bool SciEngine::isBE() const{
 	}
 }
 
+bool SciEngine::hasParser() const {
+	// Only SCI0, SCI01 and SCI1 EGA games used a parser, along with
+	//  multilingual LSL3 and SQ3 Amiga which are SCI_VERSION_1_MIDDLE
+	return getSciVersion() <= SCI_VERSION_1_EGA_ONLY ||
+			getGameId() == GID_LSL3 || getGameId() == GID_SQ3;
+}
+
 bool SciEngine::hasMacIconBar() const {
 	return _resMan->isSci11Mac() && getSciVersion() == SCI_VERSION_1_1 &&
 			(getGameId() == GID_KQ6 || getGameId() == GID_FREDDYPHARKAS);
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 2113ec2..fc218ee 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -228,7 +228,7 @@ enum SciVersion {
 	SCI_VERSION_01, // KQ1 and multilingual games (S.old.*)
 	SCI_VERSION_1_EGA_ONLY, // SCI 1 EGA with parser (i.e. QFG2 only)
 	SCI_VERSION_1_EARLY, // KQ5 floppy, SQ4 floppy, XMAS card 1990, Fairy tales, Jones floppy
-	SCI_VERSION_1_MIDDLE, // LSL1, Jones CD
+	SCI_VERSION_1_MIDDLE, // LSL1, Jones CD, LSL3 & SQ3 multilingual Amiga
 	SCI_VERSION_1_LATE, // Dr. Brain 1, EcoQuest 1, Longbow, PQ3, SQ1, LSL5, KQ5 CD
 	SCI_VERSION_1_1, // Dr. Brain 2, EcoQuest 1 CD, EcoQuest 2, KQ6, QFG3, SQ4CD, XMAS 1992 and many more
 	SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
@@ -283,6 +283,7 @@ public:
 	/** Returns true if the game's original platform is big-endian. */
 	bool isBE() const;
 
+	bool hasParser() const;
 	bool hasMacIconBar() const;
 
 	inline ResourceManager *getResMan() const { return _resMan; }





More information about the Scummvm-git-logs mailing list