[Scummvm-git-logs] scummvm branch-3-0 -> a854b543dd1ef4be53eb3466d7f05898bcae98d7
sluicebox
noreply at scummvm.org
Thu Dec 11 22:21:37 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
501f6b0c32 AGI: Add game detection entry for SQ2 Hebrew localization
a854b543dd AGI: Detect WORDS.TOK.EXTENDED, Remove GF_EXTCHAR
Commit: 501f6b0c32e7ef196a40546e98d9e69faed3d7a2
https://github.com/scummvm/scummvm/commit/501f6b0c32e7ef196a40546e98d9e69faed3d7a2
Author: Sam Davidoff (sam at mfbtech.com)
Date: 2025-12-11T14:20:49-08:00
Commit Message:
AGI: Add game detection entry for SQ2 Hebrew localization
Changed paths:
engines/agi/detection_tables.h
diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h
index 1bfab3d89b2..7451dea9960 100644
--- a/engines/agi/detection_tables.h
+++ b/engines/agi/detection_tables.h
@@ -855,6 +855,10 @@ static const AGIGameDescription gameDescriptions[] = {
// Unofficial port by Guillaume Major
GAME_PS("sq2", "updated", "d24f19b047e65e1763eff4b46f3d50df", 768, 0x2440, GID_SQ2, Common::kPlatformCoCo3),
+ // Space Quest 2 (Hebrew) 2.0F
+ // Based on English version from GOG
+ GAME_LVFPN("sq2", "", "logdir", "5f73ab13808a260d777d0002c70b967c", 423, Common::HE_ISR, 0x2917, GF_EXTCHAR, GID_SQ2, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+
// Troll's Tale (PC Booter)
GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformDOS),
Commit: a854b543dd1ef4be53eb3466d7f05898bcae98d7
https://github.com/scummvm/scummvm/commit/a854b543dd1ef4be53eb3466d7f05898bcae98d7
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-12-11T14:21:13-08:00
Commit Message:
AGI: Detect WORDS.TOK.EXTENDED, Remove GF_EXTCHAR
The game flag GF_EXTCHAR caused the engine to look for a third party
extended dictionary file (WORDS.TOK.EXTENDED) instead of WORDS.TOK.
This made developing new translations with ScummVM difficult, as it
required an existing detection entry with GF_EXTCHAR.
Now GF_EXTCHAR has been removed, and the engine simply checks for
the existence of WORDS.TOK.EXTENDED and uses it if it exists.
Changed paths:
engines/agi/agi.h
engines/agi/detection_tables.h
engines/agi/loader_v2.cpp
engines/agi/words.cpp
engines/agi/words.h
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 7a8e7ddb151..b3ced461ee8 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -112,8 +112,7 @@ enum AgiGameFeatures {
GF_AGDS = (1 << 1), // marks games created with AGDS - all using AGI version 2.440
GF_AGI256 = (1 << 2), // marks fanmade AGI-256 games
GF_FANMADE = (1 << 3), // marks fanmade games
- GF_2GSOLDSOUND = (1 << 5),
- GF_EXTCHAR = (1 << 6) // use WORDS.TOK.EXTENDED
+ GF_2GSOLDSOUND = (1 << 5)
};
enum AgiGameID {
diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h
index 7451dea9960..df43280bf00 100644
--- a/engines/agi/detection_tables.h
+++ b/engines/agi/detection_tables.h
@@ -386,7 +386,7 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 1 (Hebrew) [DOS 2.0F 1987]
// Fan made translation by SegMash, based on the English GoG version
- GAME_LVFPN("kq1", "", "logdir", "28954efaa2dd118cb3a6b672e03d806b", 315, Common::HE_ISR, 0x2917, GF_EXTCHAR, GID_KQ1, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LPS("kq1", "", "28954efaa2dd118cb3a6b672e03d806b", 315, Common::HE_ISR, 0x2917, GID_KQ1, Common::kPlatformDOS),
// King's Quest 2 (Apple II) 1.0G [AGI 1.08]
A2("kq2", "1.0G", "8e8d562e50233c939112c89bba55d249", 0x1120, GID_KQ2),
@@ -444,7 +444,7 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 2 (Hebrew) [2.1 1987-04-10/DOS]
// Fan made translation by SegMash, based on the English GoG version
- GAME_LVFPN("kq2", "", "logdir", "34e9abb9f1ce54db4e1abcc37b53b198", 543, Common::HE_ISR, 0x2917, GF_EXTCHAR, GID_KQ2, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LPS("kq2", "", "34e9abb9f1ce54db4e1abcc37b53b198", 543, Common::HE_ISR, 0x2917, GID_KQ2, Common::kPlatformDOS),
// King's Quest 3 (Amiga) 1.01 11/8/86
GAME_PO("kq3", "1.01 1986-11-08", "8ab343306df0e2d98f136be4e8cfd0ef", 0x2440, GID_KQ3, Common::kPlatformAmiga, GAMEOPTIONS_AMIGA),
@@ -713,7 +713,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("pq1", "2.0G 1987-12-03", "d194e5d88363095f55d5096b8e32fbbb", 0x2917, GID_PQ1),
// Police Quest 1 (PC) 2.0G 12/3/87; with Hebrew translation
- GAME_LVFPN("pq1", "2.0G 1987-12-03", "PQ1.WAG", "59e1b2fb6d025968b8ed7388f107c7b5", AD_NO_SIZE, Common::HE_ISR, 0x2917, GF_EXTCHAR, GID_PQ1, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LVFPN("pq1", "2.0G 1987-12-03", "PQ1.WAG", "59e1b2fb6d025968b8ed7388f107c7b5", AD_NO_SIZE, Common::HE_ISR, 0x2917, 0, GID_PQ1, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
// Police Quest 1 (PC) 2.0G 12/3/87; with Spanish translation (TRAC #14369)
GAME_LPS("pq1", "2.0G 1987-12-03", "5d151f2f4c4e0675534d49b13529da3f", 360, Common::ES_ESP, 0x2917, GID_PQ1, Common::kPlatformDOS),
@@ -762,7 +762,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("sq1", "2.2 1987-05-07 5.25\"/3.5\"", "5d67630aba008ec5f7f9a6d0a00582f4", 0x2440, GID_SQ1),
// Space Quest 1 (PC 5.25"/3.5") 2.2 [AGI 2.917]; French Translation
- GAME_LVFPN("sq1", "2.2 1987-05-07 5.25\"/3.5\"", "words.tok.extended", "3f1730f3c9d4622a986f735af0f8734a", 12665, Common::FR_FRA, 0x2917, GF_EXTCHAR, GID_SQ1, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LVFPN("sq1", "2.2 1987-05-07 5.25\"/3.5\"", "words.tok.extended", "3f1730f3c9d4622a986f735af0f8734a", 12665, Common::FR_FRA, 0x2917, 0, GID_SQ1, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
// Space Quest 1 (CoCo3 360k) [AGI 2.072]
// Unofficial port by Guillaume Major
@@ -845,7 +845,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME_LPS("sq2", "", "ba21c8934caf28e3ba45ce7d1cd6b041", 423, Common::RU_RUS, 0x2917, GID_SQ2, Common::kPlatformDOS),
// Space Quest 2 (PC 3.5" / 5.25") 2.0F [AGI 2.936]; French Translation
- GAME_LVFPN("sq2", "2.0F", "words.tok.extended", "b2efb603df643d8d93db0c6d51a54b5a", 19142, Common::FR_FRA, 0x2936, GF_EXTCHAR, GID_SQ2, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LVFPN("sq2", "2.0F", "words.tok.extended", "b2efb603df643d8d93db0c6d51a54b5a", 19142, Common::FR_FRA, 0x2936, 0, GID_SQ2, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
// Space Quest 2 (CoCo3 360k) [AGI 2.023]
// Unofficial port by Guillaume Major
@@ -857,7 +857,7 @@ static const AGIGameDescription gameDescriptions[] = {
// Space Quest 2 (Hebrew) 2.0F
// Based on English version from GOG
- GAME_LVFPN("sq2", "", "logdir", "5f73ab13808a260d777d0002c70b967c", 423, Common::HE_ISR, 0x2917, GF_EXTCHAR, GID_SQ2, Common::kPlatformDOS, GType_V2, GAMEOPTIONS_DEFAULT),
+ GAME_LPS("sq2", "", "5f73ab13808a260d777d0002c70b967c", 423, Common::HE_ISR, 0x2917, GID_SQ2, Common::kPlatformDOS),
// Troll's Tale (PC Booter)
GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformDOS),
diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp
index 4cb46567ba3..d62d70ea66b 100644
--- a/engines/agi/loader_v2.cpp
+++ b/engines/agi/loader_v2.cpp
@@ -187,8 +187,9 @@ int AgiLoader_v2::loadObjects() {
}
int AgiLoader_v2::loadWords() {
- if (_vm->getFeatures() & GF_EXTCHAR) {
- return _vm->_words->loadExtendedDictionary(WORDS);
+ // Use a fan-made extended dictionary file for translations if present.
+ if (Common::File::exists(EXTENDED_DICTIONARY_FILENAME)) {
+ return _vm->_words->loadExtendedDictionary(EXTENDED_DICTIONARY_FILENAME);
} else {
return _vm->_words->loadDictionary(WORDS);
}
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index ddb18a8c5fe..4d2d326d65e 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -26,8 +26,9 @@
namespace Agi {
-Words::Words(AgiEngine *vm) {
- _vm = vm;
+Words::Words(AgiEngine *vm) :
+ _vm(vm),
+ _hasExtendedCharacters(false) {
clearEgoWords();
}
@@ -139,10 +140,7 @@ int Words::loadDictionary(Common::SeekableReadStream &stream) {
return errOK;
}
-int Words::loadExtendedDictionary(const char *sierraFname) {
- Common::String fnameStr = Common::String(sierraFname) + ".extended";
- const char *fname = fnameStr.c_str();
-
+int Words::loadExtendedDictionary(const char *fname) {
Common::File fp;
if (!fp.open(fname)) {
warning("loadWords: can't open %s", fname);
@@ -163,6 +161,7 @@ int Words::loadExtendedDictionary(const char *sierraFname) {
}
}
+ _hasExtendedCharacters = true;
return errOK;
}
@@ -253,7 +252,7 @@ int16 Words::findWordInDictionary(const Common::String &userInputLowercase, uint
foundWordLen = 0;
- const byte lastCharInAbc = _vm->getFeatures() & GF_EXTCHAR ? 0xff : 'z';
+ const byte lastCharInAbc = _hasExtendedCharacters ? 0xff : 'z';
// Words normally have to start with a letter.
// ENHANCEMENT: Fan games and translations include words that start with a
diff --git a/engines/agi/words.h b/engines/agi/words.h
index a372ca1fe00..6222f81cacb 100644
--- a/engines/agi/words.h
+++ b/engines/agi/words.h
@@ -27,6 +27,8 @@ namespace Agi {
#define DICTIONARY_RESULT_UNKNOWN -1
#define DICTIONARY_RESULT_IGNORE 0
+#define EXTENDED_DICTIONARY_FILENAME "words.tok.extended"
+
struct WordEntry {
uint16 id;
Common::String word;
@@ -48,6 +50,7 @@ private:
WordEntry _egoWords[MAX_WORDS];
uint16 _egoWordCount;
+ bool _hasExtendedCharacters; // true on WORDS.TOK.EXTENDED
public:
uint16 getEgoWordCount() const;
const char *getEgoWord(int16 wordNr) const;
More information about the Scummvm-git-logs
mailing list