diff options
author | athrxx | 2011-07-24 20:29:54 +0200 |
---|---|---|
committer | athrxx | 2011-07-24 20:39:08 +0200 |
commit | 7174f14c61781de8143a03af4801426fdb5ed69f (patch) | |
tree | d830906c8646df574a7cb4325f58c061b25097cf /engines | |
parent | 950faa4143a8473f77ddc78c02fda7d38f1f557d (diff) | |
download | scummvm-rg350-7174f14c61781de8143a03af4801426fdb5ed69f.tar.gz scummvm-rg350-7174f14c61781de8143a03af4801426fdb5ed69f.tar.bz2 scummvm-rg350-7174f14c61781de8143a03af4801426fdb5ed69f.zip |
LOL: add support for Russian floppy version
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/detection_tables.h | 60 | ||||
-rw-r--r-- | engines/kyra/gui_lol.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 57 | ||||
-rw-r--r-- | engines/kyra/lol.h | 4 | ||||
-rw-r--r-- | engines/kyra/sequences_lol.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/staticres_lol.cpp | 22 |
7 files changed, 111 insertions, 41 deletions
diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 165eddf599..d47df47726 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -49,6 +49,7 @@ namespace { #define LOL_CD_FLAGS FLAGS(false, false, true, false, false, false, false, Kyra::GI_LOL) #define LOL_CD_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, true, false, false, false, false, Kyra::GI_LOL) #define LOL_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_LOL) +#define LOL_FLOPPY_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, false, false, false, false, false, Kyra::GI_LOL) #define LOL_FLOPPY_CMP_FLAGS FLAGS(false, false, false, false, false, false, true, Kyra::GI_LOL) #define LOL_PC98_SJIS_FLAGS FLAGS(false, false, false, true, true, false, false, Kyra::GI_LOL) #define LOL_DEMO_FLAGS FLAGS(true, true, false, false, false, false, false, Kyra::GI_LOL) @@ -95,12 +96,13 @@ const KYRAGameDescription adGameDescs[] = { }, KYRA1_FLOPPY_FLAGS }, + { { "kyra1", "Extracted", - AD_ENTRY1("GEMCUT.EMC", "689b62b7519215c1b2571d466c95624c"), - Common::RU_RUS, + AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), + Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIPCSPK @@ -111,8 +113,8 @@ const KYRAGameDescription adGameDescs[] = { { "kyra1", "Extracted", - AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), - Common::EN_ANY, + AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), + Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIPCSPK @@ -123,19 +125,19 @@ const KYRAGameDescription adGameDescs[] = { { "kyra1", "Extracted", - AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), - Common::FR_FRA, + AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), + Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIPCSPK }, KYRA1_FLOPPY_FLAGS }, - { + { // from Arne.F { "kyra1", "Extracted", - AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), + AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, @@ -143,12 +145,12 @@ const KYRAGameDescription adGameDescs[] = { }, KYRA1_FLOPPY_FLAGS }, - { // from Arne.F + { { "kyra1", "Extracted", - AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), - Common::DE_DEU, + AD_ENTRY1("GEMCUT.EMC", "689b62b7519215c1b2571d466c95624c"), + Common::RU_RUS, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIPCSPK @@ -989,24 +991,6 @@ const KYRAGameDescription adGameDescs[] = { "lol", "CD", { - { "GENERAL.PAK", 0, "19354b0f464295c38c801d30588df062", -1 }, - { "L01.PAK", 0, "174d37f21e0336c5d91020f8c58717ef", -1 }, - { "VOC.PAK", 0, "eb398f09ba3321d872b6174a68a987d9", -1 }, - { 0, 0, 0, 0 } - }, - Common::RU_RUS, - Common::kPlatformPC, - ADGF_DROPLANGUAGE | ADGF_CD, - Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK - }, - LOL_CD_FLAGS - }, - - { - { - "lol", - "CD", - { { "GENERAL.PAK", 0, "05a4f588fb81dc9c0ef1f2ec20d89e24", -1 }, { "L01.PAK", 0, "759a0ac26808d77ea968bd392355ba1d", -1 }, { 0, 0, 0, 0 } @@ -1306,6 +1290,24 @@ const KYRAGameDescription adGameDescs[] = { LOL_FLOPPY_FLAGS }, + // Russian fan translation + { + { + "lol", + "Extracted", + { + { "GENERAL.PAK", 0, "d8f4c1153aed2418f41f886c3fb27543", -1 }, + { "CHAPTER7.PAK", 0, "f0b8a2fdff951738834fadc12248ac1f", -1 }, + { 0, 0, 0, 0 } + }, + Common::RU_RUS, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_FLOPPY_FAN_FLAGS(Common::RU_RUS, Common::EN_ANY) + }, + { { "lol", diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index c64d3e7723..9b70e536b8 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -395,8 +395,8 @@ void LoLEngine::gui_drawCharPortraitWithStats(int charNum) { } else { gui_drawLiveMagicBar(33, 32, _characters[charNum].magicPointsCur, 0, _characters[charNum].magicPointsMax, 5, 32, 162, 1, 0); gui_drawLiveMagicBar(39, 32, _characters[charNum].hitPointsCur, 0, _characters[charNum].hitPointsMax, 5, 32, 154, 1, 1); - _screen->printText(getLangString(0x4253), 33, 1, 160, 0); - _screen->printText(getLangString(0x4254), 39, 1, 152, 0); + _screen->printText((_flags.platform == Common::kPlatformPC && !_flags.isTalkie) ? "M" : getLangString(0x4253), 33, 1, 160, 0); + _screen->printText((_flags.platform == Common::kPlatformPC && !_flags.isTalkie) ? "H" : getLangString(0x4254), 39, 1, 152, 0); } int spellLevels = 0; diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 2cca4fd4e3..8ce77d0021 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1038,11 +1038,14 @@ char *LoLEngine::getLangString(uint16 id) { char *string = (char *)getTableEntry(buffer, realId); char *srcBuffer = _stringBuffer[_lastUsedStringBuffer]; - if (_flags.lang != Common::JA_JPN) { - Util::decodeString1(string, srcBuffer); + if (_flags.lang == Common::JA_JPN) { + decodeSjis(string, srcBuffer); + } else if (_flags.lang == Common::RU_RUS) { + decodeCyrillic(string, srcBuffer); Util::decodeString2(srcBuffer, srcBuffer); } else { - decodeSjis(string, srcBuffer); + Util::decodeString1(string, srcBuffer); + Util::decodeString2(srcBuffer, srcBuffer); } ++_lastUsedStringBuffer; @@ -1081,6 +1084,54 @@ void LoLEngine::decodeSjis(const char *src, char *dst) { *dst = 0; } +int LoLEngine::decodeCyrillic(const char *src, char *dst) { + static const uint8 decodeTable1[] = { + 0x20, 0xAE, 0xA5, 0xA0, 0xE2, 0xAD, 0xA8, 0xE0, 0xE1, 0xAB, 0xA2, + 0xA4, 0xAC, 0xAA, 0xE3, 0x2E + }; + + static const uint8 decodeTable2[] = { + 0xAD, 0xAF, 0xA2, 0xE1, 0xAC, 0xAA, 0x20, 0xA4, 0xAB, 0x20, + 0xE0, 0xE2, 0xA4, 0xA2, 0xA6, 0xAA, 0x20, 0xAD, 0xE2, 0xE0, + 0xAB, 0xAC, 0xE1, 0xA1, 0x20, 0xAC, 0xE1, 0xAA, 0xAB, 0xE0, + 0xE2, 0xAD, 0xAE, 0xEC, 0xA8, 0xA5, 0xA0, 0x20, 0xE0, 0xEB, + 0xAE, 0xA0, 0xA8, 0xA5, 0xEB, 0xEF, 0x20, 0xE3, 0xE2, 0x20, + 0xAD, 0xE7, 0xAB, 0xAC, 0xA5, 0xE0, 0xAE, 0xA0, 0xA5, 0xA8, + 0xE3, 0xEB, 0xEF, 0xAA, 0xE2, 0xEF, 0xA5, 0xEC, 0xAB, 0xAE, + 0xAA, 0xAF, 0xA8, 0xA0, 0xA5, 0xEF, 0xAE, 0xEE, 0xEC, 0xE3, + 0xA0, 0xAE, 0xA5, 0xA8, 0xEB, 0x20, 0xE0, 0xE3, 0xA0, 0xA5, + 0xAE, 0xA8, 0xE3, 0xE1, 0xAD, 0xAB, 0x20, 0xAE, 0xA5, 0xA0, + 0xA8, 0xAD, 0x2E, 0xE3, 0xAE, 0xA0, 0xA8, 0x20, 0xE0, 0xE3, + 0xAB, 0xE1, 0x20, 0xA4, 0xAD, 0xE2, 0xA1, 0xA6, 0xAC, 0xE1, + 0x0D, 0x20, 0x2E, 0x09, 0xA0, 0xA1, 0x9D, 0xA5 + }; + + int size = 0; + uint cChar = 0; + while ((cChar = *src++) != 0) { + if (cChar & 0x80) { + cChar &= 0x7F; + int index = (cChar & 0x78) >> 3; + *dst++ = decodeTable1[index]; + ++size; + assert(cChar < sizeof(decodeTable2)); + cChar = decodeTable2[cChar]; + } else if (cChar >= 0x70) { + cChar = *src++; + } else if (cChar >= 0x30) { + if (cChar < 0x60) + cChar -= 0x30; + cChar |= 0x80; + } + + *dst++ = cChar; + ++size; + } + + *dst++ = 0; + return size; +} + bool LoLEngine::addCharacter(int id) { const uint16 *cdf[] = { _charDefsMan, _charDefsMan, _charDefsMan, _charDefsWoman, _charDefsMan, _charDefsMan, _charDefsWoman, _charDefsKieran, _charDefsAkshel }; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 06a4f29f63..705110ecfc 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -363,12 +363,13 @@ private: void showIntro(); struct CharacterPrev { - const char *name; int x, y; int attrib[3]; }; static const CharacterPrev _charPreviews[]; + static const char *const _charPreviewNamesDefault[]; + static const char *const _charPreviewNamesRussian[]; // PC98 specific data static const uint16 _charPosXPC98[]; @@ -875,6 +876,7 @@ private: char *getLangString(uint16 id); uint8 *getTableEntry(uint8 *buffer, uint16 id); void decodeSjis(const char *src, char *dst); + int decodeCyrillic(const char *src, char *dst); static const char * const _languageExt[]; diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 27f3951faf..7c28e9a2e7 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -316,8 +316,9 @@ int LoLEngine::chooseCharacter() { _screen->printText(_tim->getCTableEntry(53), 72, 184, 0x81, 0x00); _screen->printText(_tim->getCTableEntry(55), 72, 192, 0x81, 0x00); } else { + const char *const *previewNames = _flags.lang == Common::RU_RUS ? _charPreviewNamesRussian : _charPreviewNamesDefault; for (int i = 0; i < 4; ++i) { - _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name); + _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, previewNames[i]); _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]); _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]); _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]); diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index d56abc5d47..5fc4f18b39 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -38,7 +38,7 @@ namespace Kyra { -#define RESFILE_VERSION 74 +#define RESFILE_VERSION 75 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { diff --git a/engines/kyra/staticres_lol.cpp b/engines/kyra/staticres_lol.cpp index cf75a317e1..2e5743d3ac 100644 --- a/engines/kyra/staticres_lol.cpp +++ b/engines/kyra/staticres_lol.cpp @@ -687,11 +687,25 @@ const char * const LoLEngine::_languageExt[] = { "GER" }; +const char *const LoLEngine::_charPreviewNamesDefault[] = { + "Ak\'shel", + "Michael", + "Kieran", + "Conrad" +}; + +const char *const LoLEngine::_charPreviewNamesRussian[] = { + "\x80\xAA\xE8\xA5\xAB\0", + "\x8C\xA0\xA9\xAA\xAB\0", + "\x8A\xA8\xE0\xA0\xAD\0", + "\x8A\xAE\xAD\xE0\xA0\xA4\0" +}; + const LoLEngine::CharacterPrev LoLEngine::_charPreviews[] = { - { "Ak\'shel", 0x060, 0x7F, { 0x0F, 0x08, 0x05 } }, - { "Michael", 0x09A, 0x7F, { 0x06, 0x0A, 0x0F } }, - { "Kieran", 0x0D4, 0x7F, { 0x08, 0x06, 0x08 } }, - { "Conrad", 0x10F, 0x7F, { 0x0A, 0x0C, 0x0A } } + { 0x060, 0x7F, { 0x0F, 0x08, 0x05 } }, + { 0x09A, 0x7F, { 0x06, 0x0A, 0x0F } }, + { 0x0D4, 0x7F, { 0x08, 0x06, 0x08 } }, + { 0x10F, 0x7F, { 0x0A, 0x0C, 0x0A } } }; const uint16 LoLEngine::_charPosXPC98[] = { |