From 4d2f4a9f797e8beabad868164b203fbc3e5625e1 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 18 Apr 2006 12:39:02 +0000 Subject: - Closed the stub in Draw_v2::printText() - Added a language field in GameSettings, so that the texts in Gob2 work for other languages than EN_GRB as well svn-id: r22005 --- engines/gob/draw_v2.cpp | 11 ++----- engines/gob/gob.cpp | 85 ++++++++++++++++++++++++++++++------------------- engines/gob/gob.h | 3 +- 3 files changed, 58 insertions(+), 41 deletions(-) diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 34ee703572..f2468766b0 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -329,14 +329,9 @@ void Draw_v2::printText(void) { case 10: // loc_12C93 - warning("GOB2 Stub! Draw_v2::printText: cmd == 10"); -/* -WTF: - mov ax, word ptr [bp+ptr] - xor dx, dx - sub ax, word ptr _game_totTextData - sbb dx, 0 -*/ + str[0] = (char)255; + *((int16*)(str+1)) = ptr - (char *)_vm->_game->_totTextData; + str[3] = 0; ptr++; i = *ptr++; for (i = *ptr++; i > 0; i--) { diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index af6f4f5140..108368006e 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -58,62 +58,63 @@ struct GameSettings { const char *gameid; const char *description; uint32 features; + Common::Language lang; const char *md5sum; }; static const GameSettings gob_games[] = { // Supplied by Florian Zeitz on scummvm-devel - {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, "82aea70ef26f41fa963dfae270993e49"}, - {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, "1f499458837008058b8ba6ae07057214"}, - {"gob1", "Gobliiins (Windows)", GF_GOB1, "8a5e850c49d7cacdba5f5eb1fcc77b89"}, + {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, Common::UNK_LANG, "82aea70ef26f41fa963dfae270993e49"}, + {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, Common::UNK_LANG, "1f499458837008058b8ba6ae07057214"}, + {"gob1", "Gobliiins (Windows)", GF_GOB1, Common::UNK_LANG, "8a5e850c49d7cacdba5f5eb1fcc77b89"}, // Supplied by Theruler76 in bug report #1201233 - {"gob1", "Gobliiins (DOS VGA)", GF_GOB1, "a5e232fcd02733c7dffff107d22d36eb"}, + {"gob1", "Gobliiins (DOS VGA)", GF_GOB1, Common::UNK_LANG, "a5e232fcd02733c7dffff107d22d36eb"}, // CD 1.000 version. Multilingual - {"gob1", "Gobliiins (CD)", GF_GOB1 | GF_CD, "037db48ebce94bdfe42e2c9510da9211"}, + {"gob1", "Gobliiins (CD)", GF_GOB1 | GF_CD, Common::UNK_LANG, "037db48ebce94bdfe42e2c9510da9211"}, // CD 1.02 version. Multilingual - {"gob1", "Gobliiins (CD)", GF_GOB1 | GF_CD, "45f9c1162dd7040fd05fd013ccc176e2"}, + {"gob1", "Gobliiins (CD)", GF_GOB1 | GF_CD, Common::UNK_LANG, "45f9c1162dd7040fd05fd013ccc176e2"}, - {"gob1", "Gobliiins (Amiga)", GF_GOB1, "d9f8736b7dc0ea891cd06592a72e8a72"}, - {"gob1", "Gobliiins (Amiga)", GF_GOB1, "69f9ae85252271e7dfa62883e581e5e9"}, - {"gob1", "Gobliiins (Amiga)", GF_GOB1, "26de406cb09228d902274446a6a2eceb"}, - {"gob1", "Gobliiins (Amiga)", GF_GOB1, "baf88a95928edb3f51067983f2dffa93"}, + {"gob1", "Gobliiins (Amiga)", GF_GOB1, Common::UNK_LANG, "d9f8736b7dc0ea891cd06592a72e8a72"}, + {"gob1", "Gobliiins (Amiga)", GF_GOB1, Common::UNK_LANG, "69f9ae85252271e7dfa62883e581e5e9"}, + {"gob1", "Gobliiins (Amiga)", GF_GOB1, Common::UNK_LANG, "26de406cb09228d902274446a6a2eceb"}, + {"gob1", "Gobliiins (Amiga)", GF_GOB1, Common::UNK_LANG, "baf88a95928edb3f51067983f2dffa93"}, - {"gob1", "Gobliiins (Interactive Demo)", GF_GOB1, "4f5bf4b9e4c39ebb93579747fc678e97"}, + {"gob1", "Gobliiins (Interactive Demo)", GF_GOB1, Common::UNK_LANG, "4f5bf4b9e4c39ebb93579747fc678e97"}, - {"gob1", "Gobliiins (Mac)", GF_GOB1 | GF_MAC, "4c0e8ce4a2f66ee8226952ad3c6c1155"}, + {"gob1", "Gobliiins (Mac)", GF_GOB1 | GF_MAC, Common::UNK_LANG, "4c0e8ce4a2f66ee8226952ad3c6c1155"}, - {"gob2", "Gobliins 2 (DOS)", GF_GOB2, "abb5f762f9979d4253002de20f6e7b56"}, - {"gob2", "Gobliins 2 (DOS)", GF_GOB2, "9b6de65d811c08eebf50391b84fcba92"}, - {"gob2", "Gobliins 2 (DOS)", GF_GOB2, "54d59c200e3823ad0af11a605a6fd06a"}, - {"gob2", "Gobliins 2 (DOS Ru)", GF_GOB2, "b6d47494bf88398ae59c1b5656cafce4"}, + {"gob2", "Gobliins 2 (DOS)", GF_GOB2, Common::FR_FRA, "abb5f762f9979d4253002de20f6e7b56"}, + {"gob2", "Gobliins 2 (DOS)", GF_GOB2, Common::EN_GRB, "9b6de65d811c08eebf50391b84fcba92"}, + {"gob2", "Gobliins 2 (DOS)", GF_GOB2, Common::EN_USA, "54d59c200e3823ad0af11a605a6fd06a"}, + {"gob2", "Gobliins 2 (DOS Ru)", GF_GOB2, Common::RU_RUS, "b6d47494bf88398ae59c1b5656cafce4"}, // CD 1.000. - {"gob2", "Gobliins 2 (CD)", GF_GOB2, "02bf538fd8003b8da23a3546299c3df4"}, + {"gob2", "Gobliins 2 (CD)", GF_GOB2, Common::EN_USA, "02bf538fd8003b8da23a3546299c3df4"}, // CD 1.01 - {"gob2", "Gobliins 2 (CD)", GF_GOB2, "410e632682ab11969bc3b3b588066d95"}, - {"gob2", "Gobliins 2 (Demo)", GF_GOB2, "be8b111191f965ac9b28fe530580d14e"}, + {"gob2", "Gobliins 2 (CD)", GF_GOB2, Common::UNK_LANG, "410e632682ab11969bc3b3b588066d95"}, + {"gob2", "Gobliins 2 (Demo)", GF_GOB2, Common::UNK_LANG, "be8b111191f965ac9b28fe530580d14e"}, #if 0 - {"gob3", "Goblins Quest 3", GF_GOB3, "36d9b4032b39a794c8640e500e98893a"}, - {"gob3", "Goblins Quest 3", GF_GOB3, "d129f639f6ca8d6b5f0f4e15edb91058"}, - {"gob3", "Goblins Quest 3", GF_GOB3, "8d17b0abc514b1512fdedc6072acd48b"}, + {"gob3", "Goblins Quest 3", GF_GOB3, Common::UNK_LANG, "36d9b4032b39a794c8640e500e98893a"}, + {"gob3", "Goblins Quest 3", GF_GOB3, Common::UNK_LANG, "d129f639f6ca8d6b5f0f4e15edb91058"}, + {"gob3", "Goblins Quest 3", GF_GOB3, Common::UNK_LANG, "8d17b0abc514b1512fdedc6072acd48b"}, // CD 1.000 - {"gob3", "Goblins Quest 3 (CD)", GF_GOB3, "8d17b0abc514b1512fdedc6072acd48b"}, + {"gob3", "Goblins Quest 3 (CD)", GF_GOB3, Common::UNK_LANG, "8d17b0abc514b1512fdedc6072acd48b"}, // CD 1.02. Spanish "Computer Gaming World"* distribution in Spain - {"gob3", "Goblins Quest 3 (CD)", GF_GOB3, "7d7ab9a987be7208b9b685846fbd3e82"}, + {"gob3", "Goblins Quest 3 (CD)", GF_GOB3, Common::UNK_LANG, "7d7ab9a987be7208b9b685846fbd3e82"}, - {"gob3", "Goblins Quest 3 (Interactive Demo)", GF_GOB3, "4986b44cec309589508d7904f924c217"}, + {"gob3", "Goblins Quest 3 (Interactive Demo)", GF_GOB3, Common::UNK_LANG, "4986b44cec309589508d7904f924c217"}, {"gob3", "Goblins Quest 3 (Demo)", GF_GOB3, "5024e7de8d6377fbbeabbaa92e0452bc"}, - {"gob3", "Goblins Quest 3 (Interactive Demo)", GF_GOB3, "59ab69dab5fddbbf698c77a84297a5a2"}, + {"gob3", "Goblins Quest 3 (Interactive Demo)", GF_GOB3, Common::UNK_LANG, "59ab69dab5fddbbf698c77a84297a5a2"}, // CD 1.0 - {"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble", GF_WOODRUFF, "c27402cee260d2ff1c4cecb2006a630a"}, + {"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble", GF_WOODRUFF, Common::UNK_LANG, "c27402cee260d2ff1c4cecb2006a630a"}, // CD 1.00, German release (INTRO.STRK seems to be multilingual, though?) - {"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble", GF_WOODRUFF, "751ba028d215e0db1e0254853de6a7e4"}, + {"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble", GF_WOODRUFF, Common::UNK_LANG, "751ba028d215e0db1e0254853de6a7e4"}, #endif - {0, 0, 0, 0} + {0, 0, 0, Common::UNK_LANG, 0} }; // Keep list of different supported games @@ -126,7 +127,7 @@ static const PlainGameDescriptor gob_list[] = { #define MAX_TIME_DELTA 100 -GobEngine::GobEngine(OSystem * syst, uint32 features) +GobEngine::GobEngine(OSystem * syst, uint32 features, Common::Language lang) : Engine(syst) { // Setup mixer if (!_mixer->isReady()) { @@ -137,6 +138,7 @@ GobEngine::GobEngine(OSystem * syst, uint32 features) _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _features = features; + _language = lang; _copyProtection = ConfMan.getBool("copy_protection"); Common::addSpecialDebugLevel(DEBUG_FUNCOP, "FuncOpcodes", "Script FuncOpcodes debug level"); @@ -243,19 +245,38 @@ int GobEngine::init() { _global->_useMouse = 1; _global->_soundFlags = 0; - switch (Common::parseLanguage(ConfMan.get("language"))) { + if (ConfMan.hasKey("language")) + _language = Common::parseLanguage(ConfMan.get("language")); + + switch (_language) { case Common::FR_FRA: + case Common::RU_RUS: _global->_language = 0; break; case Common::DE_DEU: _global->_language = 1; break; + case Common::EN_GRB: + _global->_language = 2; + break; case Common::ES_ESP: _global->_language = 3; break; case Common::IT_ITA: _global->_language = 4; break; + case Common::EN_USA: + _global->_language = 5; + break; + case Common::NL_NLD: + _global->_language = 6; + break; + case Common::KO_KOR: + _global->_language = 7; + break; + case Common::HB_ISR: + _global->_language = 8; + break; default: // Default to English _global->_language = 2; @@ -382,7 +403,7 @@ Engine *Engine_GOB_create(OSystem *syst) { printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str); } - return new GobEngine(syst, features); + return new GobEngine(syst, features, g->lang); } REGISTER_PLUGIN(GOB, "Gob Engine"); diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 8d2bb1271a..80e45551e2 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -88,7 +88,7 @@ protected: int init(); public: - GobEngine(OSystem *syst, uint32 features); + GobEngine(OSystem *syst, uint32 features, Common::Language lang); virtual ~GobEngine(); void shutdown(); @@ -96,6 +96,7 @@ public: Common::RandomSource _rnd; int32 _features; + Common::Language _language; bool _copyProtection; Game *_game; -- cgit v1.2.3