From 14118841f590718fff02a7acfd53400653e0d81f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 6 Jan 2025 07:55:37 +0300 Subject: [PATCH] TETRAEDGE: Support UTF-8 Switch releases --- engines/tetraedge/detection.h | 4 +++ engines/tetraedge/detection_tables.h | 54 ++++++++++++++++++++++++++-- engines/tetraedge/te/te_i_font.cpp | 2 ++ engines/tetraedge/tetraedge.cpp | 4 +++ engines/tetraedge/tetraedge.h | 2 ++ 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/engines/tetraedge/detection.h b/engines/tetraedge/detection.h index cf5bbf1c7962..9908ab2a8c0d 100644 --- a/engines/tetraedge/detection.h +++ b/engines/tetraedge/detection.h @@ -34,6 +34,10 @@ enum TetraedgeDebugChannels { kDebugScript = 1 << 4 }; +enum GameFeatures { + GF_UTF8 = 1 << 0, +}; + extern const PlainGameDescriptor GAME_NAMES[]; extern const ADGameDescription GAME_DESCRIPTIONS[]; diff --git a/engines/tetraedge/detection_tables.h b/engines/tetraedge/detection_tables.h index 4464ec7f81ef..9b1ad93a1f97 100644 --- a/engines/tetraedge/detection_tables.h +++ b/engines/tetraedge/detection_tables.h @@ -80,7 +80,8 @@ const ADGameDescription GAME_DESCRIPTIONS[] = { { "syberia", nullptr, - AD_ENTRY1s("InGame.lua", "acaf61504a12aebf3862648e04cf29aa", 3920), + AD_ENTRY2s("InGame.lua", "acaf61504a12aebf3862648e04cf29aa", 3920, + "texts/de.xml", "14681ac50bbfa50427058d2793b415eb", 364224), Common::UNK_LANG, Common::kPlatformNintendoSwitch, ADGF_NO_FLAGS, @@ -89,14 +90,61 @@ const ADGameDescription GAME_DESCRIPTIONS[] = { { "syberia2", nullptr, - AD_ENTRY2s("Debug.lua", "a2ea493892e96bea64013819195c081e", 7024, - "InGame.lua", "a7df110fe816cb342574150c6f992964", 4654), + AD_ENTRY3s("Debug.lua", "a2ea493892e96bea64013819195c081e", 7024, + "InGame.lua", "a7df110fe816cb342574150c6f992964", 4654, + "texts/de.xml", "dabad822a917b1f87de8f09eadc3ec85", 247098), Common::UNK_LANG, Common::kPlatformNintendoSwitch, ADGF_NO_FLAGS, GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT) }, + // Nintendo Switch, from Syberia1+2 Online bundle, v0 + { + "syberia", + nullptr, + AD_ENTRY2s("InGame.lua", "ca319e6f014d04baaf1e77f13f89b44f", 4271, + "texts/de.xml", "14681ac50bbfa50427058d2793b415eb", 364387), + Common::UNK_LANG, + Common::kPlatformNintendoSwitch, + ADGF_NO_FLAGS, + GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT) + }, + { + "syberia2", + nullptr, + AD_ENTRY3s("Debug.lua", "a2ea493892e96bea64013819195c081e", 7024, + "InGame.lua", "7d7fdb9005675618220e7cd8962c6482", 4745, + "texts/de.xml", "dabad822a917b1f87de8f09eadc3ec85", 247264), + Common::UNK_LANG, + Common::kPlatformNintendoSwitch, + ADGF_NO_FLAGS, + GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT) + }, + + // Nintendo Switch, from Syberia1+2 Online bundle, v196608 + { + "syberia", + nullptr, + AD_ENTRY2s("InGame.lua", "ca319e6f014d04baaf1e77f13f89b44f", 4271, + "texts/de.xml", "17d7a875e81a7761d2b30698bd947c15", 368356), + Common::UNK_LANG, + Common::kPlatformNintendoSwitch, + ADGF_NO_FLAGS | GF_UTF8, + GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT) + }, + { + "syberia2", + nullptr, + AD_ENTRY3s("Debug.lua", "a2ea493892e96bea64013819195c081e", 7024, + "InGame.lua", "7d7fdb9005675618220e7cd8962c6482", 4745, + "texts/de.xml", "78ed3567b3621459229f39c03132e5bb", 248994), + Common::UNK_LANG, + Common::kPlatformNintendoSwitch, + ADGF_NO_FLAGS | GF_UTF8, + GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT) + }, + // Android v1.0.5 { "syberia", diff --git a/engines/tetraedge/te/te_i_font.cpp b/engines/tetraedge/te/te_i_font.cpp index 65fb6034cbd5..4cd0a968e183 100644 --- a/engines/tetraedge/te/te_i_font.cpp +++ b/engines/tetraedge/te/te_i_font.cpp @@ -51,6 +51,8 @@ TeIFont::GlyphData TeIFont::glyph(uint pxSize, uint charcode) { Common::CodePage TeIFont::codePage() const { Common::String lang = g_engine->getCore()->language(); + if (g_engine->isUtf8Release()) + return Common::CodePage::kUtf8; if (lang == "ru") return Common::kISO8859_5; if (g_engine->getGamePlatform() == Common::Platform::kPlatformAndroid) diff --git a/engines/tetraedge/tetraedge.cpp b/engines/tetraedge/tetraedge.cpp index e5f6b6a672d1..ed40e3908dfe 100644 --- a/engines/tetraedge/tetraedge.cpp +++ b/engines/tetraedge/tetraedge.cpp @@ -149,6 +149,10 @@ Common::Platform TetraedgeEngine::getGamePlatform() const { return _gameDescription->platform; } +bool TetraedgeEngine::isUtf8Release() const { + return !!(_gameDescription->flags & GF_UTF8); +} + bool TetraedgeEngine::isGameDemo() const { return (_gameDescription->flags & ADGF_DEMO) != 0; } diff --git a/engines/tetraedge/tetraedge.h b/engines/tetraedge/tetraedge.h index 0ee7299f4c3e..28904d8614e1 100644 --- a/engines/tetraedge/tetraedge.h +++ b/engines/tetraedge/tetraedge.h @@ -124,6 +124,8 @@ class TetraedgeEngine : public Engine { Common::Platform getGamePlatform() const; + bool isUtf8Release() const; + bool isGameDemo() const; /**