[Scummvm-cvs-logs] scummvm master -> f3c2d7629d23654bf2fc16d73ef3952adea10198
m-kiewitz
m_kiewitz at users.sourceforge.net
Wed Feb 24 00:51:38 CET 2016
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:
f3c2d7629d SCI: Fix FM-Towns audio language selection
Commit: f3c2d7629d23654bf2fc16d73ef3952adea10198
https://github.com/scummvm/scummvm/commit/f3c2d7629d23654bf2fc16d73ef3952adea10198
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-24T00:51:50+01:00
Commit Message:
SCI: Fix FM-Towns audio language selection
This first of all combines both detection entries and makes it
possible so that the user can directly choose English or Japanese
without having to add the game twice.
But it also fixes the in-game option to switch between English
and Japanese. Prior to this commit it was only possible to for
example switch from Japanese to English once, but it was not
possible to switch back without quitting the game and starting it
again.
Changed paths:
engines/sci/detection_tables.h
engines/sci/engine/ksound.cpp
engines/sci/sci.cpp
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index af4937f..2fd4332 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1531,13 +1531,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "71afd220d46bde1109c58e6acc0f3a01", 469094},
{"resource.001", 0, "72a569f46f1abf2d9d2b1526ad3799c3", 12808839},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO2(GUIO_NOASPECT, GUIO_MIDITOWNS) },
- {"kq5", "", {
- {"resource.map", 0, "20c7cd248ff1a349ed354568eebd972b", 12733},
- {"resource.000", 0, "71afd220d46bde1109c58e6acc0f3a01", 469094},
- {"resource.001", 0, "72a569f46f1abf2d9d2b1526ad3799c3", 12808839},
- AD_LISTEND},
- Common::JA_JPN, Common::kPlatformFMTowns, 0, GUIO2(GUIO_NOASPECT, GUIO_MIDITOWNS) },
+ Common::JA_JPN, Common::kPlatformFMTowns, ADGF_ADDENGLISH, GUIO3(GUIO_NOASPECT, GAMEOPTION_ORIGINAL_SAVELOAD, GUIO_MIDITOWNS) },
// King's Quest 5 - Japanese PC-98 Floppy 0.000.015 (supplied by omer_mor in bug report #3073583)
{"kq5", "", {
@@ -2601,12 +2595,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "b11e971ccd2040bebba59dfb409a08ef", 5772},
{"resource.001", 0, "d49625d9b8005ec01c852f8322a82867", 4330713},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
- {"mothergoose256", "", {
- {"resource.map", 0, "b11e971ccd2040bebba59dfb409a08ef", 5772},
- {"resource.001", 0, "d49625d9b8005ec01c852f8322a82867", 4330713},
- AD_LISTEND},
- Common::JA_JPN, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::JA_JPN, Common::kPlatformFMTowns, ADGF_ADDENGLISH, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 32636fb..398a623 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -206,8 +206,15 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
// athrxx: It seems from disasm that the original KQ5 FM-Towns loads a default language (Japanese) audio map at the beginning
// right after loading the video and audio drivers. The -1 language argument in here simply means that the original will stick
// with Japanese. Instead of doing that we switch to the language selected in the launcher.
- if (g_sci->getPlatform() == Common::kPlatformFMTowns && language == -1)
- language = (g_sci->getLanguage() == Common::JA_JPN) ? K_LANG_JAPANESE : K_LANG_ENGLISH;
+ if (g_sci->getPlatform() == Common::kPlatformFMTowns && language == -1) {
+ // FM-Towns calls us to get the current language / also set the default language
+ // This doesn't just happen right at the start, but also when the user clicks on the Sierra logo in the game menu
+ // It uses the result of this call to either show "English Voices" or "Japanese Voices".
+
+ // Language should have been set by setLauncherLanguage() already (or could have been modified by the scripts).
+ // Get this language setting, so that the chosen language will get set for resource manager.
+ language = g_sci->getSciLanguage();
+ }
debugC(kDebugLevelSound, "kDoAudio: set language to %d", language);
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 577abb2..6d36fab 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -910,12 +910,30 @@ int SciEngine::inQfGImportRoom() const {
void SciEngine::setLauncherLanguage() {
if (_gameDescription->flags & ADGF_ADDENGLISH) {
// If game is multilingual
- if (Common::parseLanguage(ConfMan.get("language")) == Common::EN_ANY) {
+ Common::Language chosenLanguage = Common::parseLanguage(ConfMan.get("language"));
+ uint16 languageToSet = 0;
+
+ switch (chosenLanguage) {
+ case Common::EN_ANY:
// and English was selected as language
- if (SELECTOR(printLang) != -1) // set text language to English
- writeSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(printLang), K_LANG_ENGLISH);
- if (SELECTOR(parseLang) != -1) // and set parser language to English as well
- writeSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(parseLang), K_LANG_ENGLISH);
+ languageToSet = K_LANG_ENGLISH;
+ break;
+ case Common::JA_JPN: {
+ // Set Japanese for FM-Towns games
+ // KQ5 on FM-Towns has no initial language set
+ if (g_sci->getPlatform() == Common::kPlatformFMTowns) {
+ languageToSet = K_LANG_JAPANESE;
+ }
+ }
+ default:
+ break;
+ }
+
+ if (languageToSet) {
+ if (SELECTOR(printLang) != -1) // set text language
+ writeSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(printLang), languageToSet);
+ if (SELECTOR(parseLang) != -1) // and set parser language as well
+ writeSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(parseLang), languageToSet);
}
}
}
More information about the Scummvm-git-logs
mailing list