From 731382ad516a5d5fd7891c9f88146561ff5860da Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 1 Nov 2011 11:59:52 +0100 Subject: [PATCH] SCI: add Japanese detection entry for KQ5 FM-Towns and fix audio language handling --- engines/sci/detection_tables.h | 10 ++++++++-- engines/sci/engine/ksound.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 5da12d6695e8..21324ef92e84 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -1382,7 +1382,13 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.000", 0, "71afd220d46bde1109c58e6acc0f3a01", 469094}, {"resource.001", 0, "72a569f46f1abf2d9d2b1526ad3799c3", 12808839}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO1(GUIO_NOASPECT) }, + 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) }, // King's Quest 5 - Japanese PC-98 Floppy 0.000.015 (supplied by omer_mor in bug report #3073583) {"kq5", "", { @@ -3786,4 +3792,4 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_TABLE_END_MARKER }; -} // End of namespace Sci +} // End of namespace Sci \ No newline at end of file diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 33bef58e52f7..c469f775f970 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -195,6 +195,13 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { return make_reg(0, 1); } else { int16 language = argv[1].toSint16(); + + // 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; + debugC(kDebugLevelSound, "kDoAudio: set language to %d", language); if (language != -1)