DEVTOOLS: Fix languages in create_nancy

Replace Common::Language with a custom enum.
This commit is contained in:
Kaloyan Chehlarski
2024-11-27 11:02:55 +01:00
parent 211815a566
commit 37aca37208
11 changed files with 40 additions and 39 deletions
+9 -9
View File
@@ -44,7 +44,7 @@
* 2 bytes Number of games (ignoring multiple languages)
* 4 bytes per game File offsets for every game's data
* Rest of file Game data
*
*
* Game data contents:
* Various data sections, depending on title;
* e.g.: only nancy1 has a hint section, since later
@@ -53,14 +53,14 @@
* 4 bytes Offset to next section
* 4 bytes Section tag (generated using MKTAG macro)
* variable Section data
*
*
* Arrays in the game data are variable-size.
* All arrays are preceded by a 2-byte size property.
* 2D arrays with strings (e.g conditional dialogue) are also preceded
* by a list of 4-byte offsets (one per language).
* All offsets are absolute (relative to start of file).
* All data is little endian.
*
*
* Game order:
* The Vampire Diaries
* Nancy Drew: Secrets Can Kill
@@ -108,8 +108,8 @@ void writeSoundChannels(File &output, const SoundChannelInfo &soundChannelInfo)
writeToFile(output, soundChannelInfo.sfxChannels);
}
void writeLanguages(File &output, const Common::Array<Common::Language> &languages) {
output.writeUint32(MKTAG('L', 'A', 'N', 'G'));
void writeLanguages(File &output, const Common::Array<GameLanguage> &languages) {
output.writeUint32(MKTAG('L', 'A', 'N', '2'));
writeToFile(output, languages);
}
@@ -209,7 +209,7 @@ int main(int argc, char *argv[]) {
WRAPWITHOFFSET(writeGoodbyes(output, _tvdGoodbyes, _tvdGoodbyeTexts))
WRAPWITHOFFSET(writeEmptySaveTexts(output, _tvdEmptySaveStrings))
WRAPWITHOFFSET(writeEventFlagNames(output, _tvdEventFlagNames))
// Nancy Drew: Secrets Can Kill data
gameOffsets.push_back(output.pos());
WRAPWITHOFFSET(writeConstants(output, _nancy1Constants))
@@ -222,7 +222,7 @@ int main(int argc, char *argv[]) {
WRAPWITHOFFSET(writeRingingTexts(output, _nancy1TelephoneRinging))
WRAPWITHOFFSET(writeEmptySaveTexts(output, _nancy1EmptySaveStrings))
WRAPWITHOFFSET(writeEventFlagNames(output, _nancy1EventFlagNames))
// Nancy Drew: Stay Tuned for Danger data
gameOffsets.push_back(output.pos());
WRAPWITHOFFSET(writeConstants(output, _nancy2Constants))
@@ -235,7 +235,7 @@ int main(int argc, char *argv[]) {
WRAPWITHOFFSET(writeEventFlagNames(output, _nancy2EventFlagNames))
WRAPWITHOFFSET(writePatchFile(output, 3, nancy2PatchSrcFiles, "files/nancy2"))
WRAPWITHOFFSET(writePatchAssociations(output, nancy2PatchAssociations))
// Nancy Drew: Message in a Haunted Mansion data
gameOffsets.push_back(output.pos());
WRAPWITHOFFSET(writeConstants(output, _nancy3Constants))
@@ -248,7 +248,7 @@ int main(int argc, char *argv[]) {
WRAPWITHOFFSET(writeEventFlagNames(output, _nancy3EventFlagNames))
WRAPWITHOFFSET(writePatchFile(output, 4, nancy3PatchSrcFiles, "files/nancy3"))
WRAPWITHOFFSET(writePatchAssociations(output, nancy3PatchAssociations))
// Nancy Drew: Treasure in the Royal Tower data
gameOffsets.push_back(output.pos());
WRAPWITHOFFSET(writeConstants(output, _nancy4Constants))
+5 -5
View File
@@ -39,9 +39,9 @@ const Common::Array<uint16> _nancy1MapAccessSceneIDs = {
9, 10, 11, 666, 888, 1200, 1250, 1666
};
const Common::Array<Common::Language> _nancy1LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy1LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy1ConditionalDialogue = {
@@ -84,7 +84,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy1ConditionalDialog
{ { kEv, 0x1E, kFalse }, { kEv, 0x63, kTrue }, { kEv, 0x78, kFalse } } }
},
{ // Connie, 10 responses
{ 26, 233, "CIC1",
{ 26, 233, "CIC1",
{ { kEv, 0x1D, kTrue }, { kEv, 0x18, kFalse } } },
{ 25, 234, "CIC2",
{ { kEv, 0x1F, kTrue }, { kEv, 0x19, kFalse } } },
@@ -97,7 +97,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy1ConditionalDialog
{ 21, 238, "CIC6",
{ { kEv, 2, kTrue }, { kEv, 3, kTrue }, { kEv, 0x17, kFalse } } },
{ 13, 239, "DIC5",
{ { kEv, 0x64, kTrue }, { kEv, 0x16, kFalse } } },
{ { kEv, 0x64, kTrue }, { kEv, 0x16, kFalse } } },
{ 20, 240, "CIC8",
{ { kEv, 0x5, kTrue }, { kEv, 0x14, kFalse } } },
{ 19, 245, "CIC9",
+3 -3
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy2Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy2LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy2LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy2ConditionalDialogue = {
+4 -4
View File
@@ -42,9 +42,9 @@ const SoundChannelInfo _nancy3andUpSoundChannelInfo = {
{ 4, 5, 6, 7, 8, 9, 10, 11, 17, 18, 20, 21, 22, 23, 24, 25, 31 }
};
const Common::Array<Common::Language> _nancy3LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy3LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy3ConditionalDialogue = {
@@ -212,7 +212,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy3ConditionalDialog
},
{ // Ned, 0 responses
},
{ // Rose,
{ // Rose,
{ 75, 1750, "NRM17",
{ { kEv, 211, true }, { kEv, 186, false } } },
{ 76, 1751, "NRM18",
+4 -4
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy4Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy4LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy4LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy4ConditionalDialogue = {
@@ -300,7 +300,7 @@ const Common::Array<Common::Array<const char *>> _nancy4ConditionalDialogueTexts
"How can I get to that secret door when the elevator's always in the way?<h><n>", // NDN24a
// 65
"According to the decoder, the symbols in the stained glass window mean 'Purple Rose Holds Diamond Key of Queen.'<h><n>", // NDN25a
"How do you think Ezra Wickford got his hands on Marie Antoinette's red medallion?<h><n>", // NDN26
"How do you think Ezra Wickford got his hands on Marie Antoinette's red medallion?<h><n>", // NDN26
"How do you think Professor Hotchkiss ended up with Marie Antoinette's green medallion?<h><n>", // NDN27
"What do you think 'hope to those who search' means?<h><n>", // NDN28
"What do you think 'Diamond of misery in my journal' means?<h><n>", // NDN29
+3 -3
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy5Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy5LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy5LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy5ConditionalDialogue = {
+3 -3
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy6Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy6LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy6LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy6ConditionalDialogue = {
+3 -3
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy7Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy7LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy7LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy7ConditionalDialogue = {
+3 -3
View File
@@ -35,9 +35,9 @@ const GameConstants _nancy8Constants ={
32 // wonGameFlagID
};
const Common::Array<Common::Language> _nancy8LanguagesOrder = {
Common::Language::EN_ANY,
Common::Language::RU_RUS
const Common::Array<GameLanguage> _nancy8LanguagesOrder = {
GameLanguage::kEnglish,
GameLanguage::kRussian
};
const Common::Array<Common::Array<ConditionalDialogue>> _nancy8ConditionalDialogue = {
+2 -2
View File
@@ -44,8 +44,8 @@ const SoundChannelInfo _tvdToNancy2SoundChannelInfo = {
{ 3, 4, 5, 6, 17, 18, 20, 21, 22, 23, 24, 25, 26, 31 }
};
const Common::Array<Common::Language> _tvdLanguagesOrder = {
Common::Language::EN_ANY
const Common::Array<GameLanguage> _tvdLanguagesOrder = {
GameLanguage::kEnglish
};
const Common::Array<Common::Array<ConditionalDialogue>> _tvdConditionalDialogue = {
+1
View File
@@ -30,6 +30,7 @@
enum NancyFlag : byte { kFalse = 1, kTrue = 2 };
enum ConditionType : byte { kEv = 0, kIn = 1, kDi = 2 };
enum GameLanguage : byte { kEnglish = 0, kRussian = 1, kGerman = 2, kFrench = 3 };
struct GameConstants {
uint16 numItems;