DEVTOOLS: Add support for English 1.00.42 EXE to create_titanic

This commit is contained in:
Paul Gilbert 2016-08-21 09:21:14 -04:00
parent df838f50eb
commit c7ac12272a

View File

@ -62,19 +62,24 @@ Common::PEResources res;
uint headerOffset = 6;
uint dataOffset = HEADER_SIZE;
#define ENGLISH_GOG_FILESIZE 4099072
#define ENGLISH_ORIG_FILESIZE 4095488
#define ENGLISH_10042C_FILESIZE 4099072
#define ENGLISH_10042B_FILESIZE 4095488
#define ENGLISH_10042_FILESIZE 4094976
enum {
ENGLISH_ORIG_DIFF = 0x401400,
ENGLISH_GOG_DIFF = 0x401C00
ENGLISH_10042C_DIFF = 0x401C00,
ENGLISH_10042B_DIFF = 0x401400,
ENGLISH_10042_DIFF = 0x402000
};
enum Version {
ENGLISH_GOG = 0,
ENGLISH_ORIG = 1
ENGLISH_10042C = 0,
ENGLISH_10042B = 1,
ENGLISH_10042 = 2
};
Version _version;
const int FILE_DIFF[2] = { ENGLISH_GOG_DIFF, ENGLISH_ORIG_DIFF };
const int FILE_DIFF[3] = {
ENGLISH_10042C_DIFF, ENGLISH_10042B_DIFF, ENGLISH_10042_DIFF
};
static const char *const ITEM_NAMES[46] = {
"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
@ -305,7 +310,7 @@ void writeFinalEntryHeader() {
void writeStringArray(const char *name, uint offset, int count) {
outputFile.seek(dataOffset);
inputFile.seek(offset);
inputFile.seek(offset - FILE_DIFF[_version]);
uint *offsets = new uint[count];
for (int idx = 0; idx < count; ++idx)
offsets[idx] = inputFile.readLong();
@ -443,7 +448,7 @@ void writeString(uint offset) {
void writeResponseTree() {
outputFile.seek(dataOffset);
const int OFFSETS[2] = { 0x619520, 0x618340 };
const int OFFSETS[3] = { 0x619520, 0x618340, 0x617380 };
for (int idx = 0; idx < 1022; ++idx) {
inputFile.seek(OFFSETS[_version] - FILE_DIFF[_version] + idx * 8);
uint id = inputFile.readLong();
@ -558,7 +563,7 @@ void writeSentenceMappings(const char *name, uint offset, int numValues) {
void writeStarfieldPoints() {
outputFile.seek(dataOffset);
const int OFFSETS[2] = { 0x59DE4C, 0x59DBEC };
const int OFFSETS[3] = { 0x59DE4C, 0x59DBEC, 0x59CC1C };
inputFile.seek(OFFSETS[_version] - FILE_DIFF[_version]);
uint size = 876 * 12;
@ -570,7 +575,7 @@ void writeStarfieldPoints() {
void writeStarfieldPoints2() {
outputFile.seek(dataOffset);
const int OFFSETS[2] = { 0x5A2F28, 0x5A2CC8 };
const int OFFSETS[3] = { 0x5A2F28, 0x5A2CC8, 0x5A1CF8 };
for (int rootCtr = 0; rootCtr < 80; ++rootCtr) {
inputFile.seek(OFFSETS[_version] - FILE_DIFF[_version] + rootCtr * 8);
uint offset = inputFile.readUint32LE();
@ -655,27 +660,32 @@ void writeData() {
writeStringArray("TEXT/ITEM_IDS", ITEM_IDS, 40);
writeStringArray("TEXT/ROOM_NAMES", ROOM_NAMES, 34);
const int TEXT_PHRASES[2] = { 0x21B7C8, 0x21ADA0 };
const int TEXT_REPLACEMENTS1[2] = { 0x21BDB0, 0x21B388 };
const int TEXT_REPLACEMENTS2[2] = { 0x21C120, 0x21B6F8 };
const int TEXT_REPLACEMENTS3[2] = { 0x21D9C8, 0x21CFA0 };
const int TEXT_PRONOUNS[2] = { 0x22F718, 0x22ECF8 };
const int TEXT_PHRASES[3] = { 0x61D3C8, 0x618340, 0x61B1E0 };
const int TEXT_REPLACEMENTS1[3] = { 0x61D9B0, 0x61C788, 0x61B7C8 };
const int TEXT_REPLACEMENTS2[3] = { 0x61DD20, 0x61CAF8, 0x61BB38 };
const int TEXT_REPLACEMENTS3[3] = { 0x61F5C8, 0x61E3A0, 0x61D3E0 };
const int TEXT_PRONOUNS[3] = { 0x631318, 0x6300F8, 0x62F138 };
writeStringArray("TEXT/PHRASES", TEXT_PHRASES[_version], 376);
writeStringArray("TEXT/REPLACEMENTS1", TEXT_REPLACEMENTS1[_version], 218);
writeStringArray("TEXT/REPLACEMENTS2", TEXT_REPLACEMENTS2[_version], 1576);
writeStringArray("TEXT/REPLACEMENTS3", TEXT_REPLACEMENTS3[_version], 82);
writeStringArray("TEXT/PRONOUNS", TEXT_PRONOUNS[_version], 15);
const int SENTENCES_DEFAULT[2] = { 0x5C0130, 0x5BEFC8 };
const int SENTENCES_BARBOT[2][2] = { { 0x5ABE60, 0x5AACF8 }, { 0x5BD4E8, 0x5BC380 } };
const int SENTENCES_BELLBOT[21][2] = {
{ 0x5C2230, 0x5C10C8 }, { 0x5D1670, 0x5D0508 }, { 0x5D1A80, 0x5D0918 },
{ 0x5D1AE8, 0x5D0980 }, { 0x5D1B88, 0x5D0A20 }, { 0x5D2A60, 0x5D18F8 },
{ 0x5D2CD0, 0x5D1B68 }, { 0x5D3488, 0x5D2320 }, { 0x5D3900, 0x5D2798 },
{ 0x5D3968, 0x5D2800 }, { 0x5D4668, 0x5D3500 }, { 0x5D47A0, 0x5D3638 },
{ 0x5D4EC0, 0x5D3D58 }, { 0x5D5100, 0x5D3F98 }, { 0x5D5370, 0x5D4208 },
{ 0x5D5548, 0x5D43E0 }, { 0x5D56B8, 0x5D4550 }, { 0x5D57C0, 0x5D4658 },
{ 0x5D5B38, 0x5D49D0 }, { 0x5D61B8, 0x5D5050 }
const int SENTENCES_DEFAULT[3] = { 0x5C0130, 0x5BEFC8, 0x5BE008 };
const int SENTENCES_BARBOT[2][3] = {
{ 0x5ABE60, 0x5AACF8, 0x5A9D38 }, { 0x5BD4E8, 0x5BC380, 0x5BB3C0 }
};
const int SENTENCES_BELLBOT[20][3] = {
{ 0x5C2230, 0x5C10C8, 0X5C0108 }, { 0x5D1670, 0x5D0508, 0x5CF548 },
{ 0x5D1A80, 0x5D0918, 0x5CF958 }, { 0x5D1AE8, 0x5D0980, 0x5CF9C0 },
{ 0x5D1B88, 0x5D0A20, 0x5CFA60 }, { 0x5D2A60, 0x5D18F8, 0x5D0938 },
{ 0x5D2CD0, 0x5D1B68, 0x5D0BA8 }, { 0x5D3488, 0x5D2320, 0x5D1360 },
{ 0x5D3900, 0x5D2798, 0x5D17D8 }, { 0x5D3968, 0x5D2800, 0x5D1840 },
{ 0x5D4668, 0x5D3500, 0x5D2540 }, { 0x5D47A0, 0x5D3638, 0x5D2678 },
{ 0x5D4EC0, 0x5D3D58, 0x5D2D98 }, { 0x5D5100, 0x5D3F98, 0x5D2FD8 },
{ 0x5D5370, 0x5D4208, 0x5D3248 }, { 0x5D5548, 0x5D43E0, 0x5D3420 },
{ 0x5D56B8, 0x5D4550, 0x5D3590 }, { 0x5D57C0, 0x5D4658, 0x5D3698 },
{ 0x5D5B38, 0x5D49D0, 0x5D3A10 }, { 0x5D61B8, 0x5D5050, 0x5D4090 }
};
writeSentenceEntries("Sentences/Default", SENTENCES_DEFAULT[_version]);
writeSentenceEntries("Sentences/Barbot", SENTENCES_BARBOT[0][_version]);
@ -701,18 +711,21 @@ void writeData() {
writeSentenceEntries("Sentences/Bellbot/18", SENTENCES_BELLBOT[18][_version]);
writeSentenceEntries("Sentences/Bellbot/19", SENTENCES_BELLBOT[19][_version]);
const int SENTENCES_DESKBOT[3][2] = {
{ 0x5DCD10, 0x5DBBA8 }, { 0x5E8E18, 0x5E7CB0 }, { 0x5E8BA8, 0x5E7A40 }
const int SENTENCES_DESKBOT[3][3] = {
{ 0x5DCD10, 0x5DBBA8, 0x5DABE8 }, { 0x5E8E18, 0x5E7CB0, 0x5E6CF0 },
{ 0x5E8BA8, 0x5E7A40, 0x5E6A80 }
};
writeSentenceEntries("Sentences/Deskbot", SENTENCES_DESKBOT[0][_version]);
writeSentenceEntries("Sentences/Deskbot/2", SENTENCES_DESKBOT[1][_version]);
writeSentenceEntries("Sentences/Deskbot/3", SENTENCES_DESKBOT[2][_version]);
const int SENTENCES_DOORBOT[12][2] = {
{ 0x5EC110, 0x5EAFA8 }, { 0x5FD930, 0x5FC7C8 }, { 0x5FDD0C, 0x5FCBA4 },
{ 0x5FE668, 0x5FD500 }, { 0x5FDD40, 0x5FCBD8 }, { 0x5FFF08, 0x5FEDA0 },
{ 0x5FE3C0, 0x5FD258 }, { 0x5FF0C8, 0x5FDF60 }, { 0x5FF780, 0x5FE618 },
{ 0x5FFAC0, 0x5FE958 }, { 0x5FFC30, 0x5FEAC8 }, { 0x6000E0, 0x5FEF78 }
const int SENTENCES_DOORBOT[12][3] = {
{ 0x5EC110, 0x5EAFA8, 0x5E9FE8 }, { 0x5FD930, 0x5FC7C8, 0x5FB808 },
{ 0x5FDD0C, 0x5FCBA4, 0x5FBBE4 }, { 0x5FE668, 0x5FD500, 0x5FC540 },
{ 0x5FDD40, 0x5FCBD8, 0X5FBC18 }, { 0x5FFF08, 0x5FEDA0, 0x5FDDE0 },
{ 0x5FE3C0, 0x5FD258, 0x5FC298 }, { 0x5FF0C8, 0x5FDF60, 0x5FCFA0 },
{ 0x5FF780, 0x5FE618, 0x5FD658 }, { 0x5FFAC0, 0x5FE958, 0x5FD998 },
{ 0x5FFC30, 0x5FEAC8, 0x5FDB08 }, { 0x6000E0, 0x5FEF78, 0x5FDFB8 }
};
writeSentenceEntries("Sentences/Doorbot", SENTENCES_DOORBOT[0][_version]);
writeSentenceEntries("Sentences/Doorbot/2", SENTENCES_DOORBOT[1][_version]);
@ -727,23 +740,25 @@ void writeData() {
writeSentenceEntries("Sentences/Doorbot/131", SENTENCES_DOORBOT[10][_version]);
writeSentenceEntries("Sentences/Doorbot/132", SENTENCES_DOORBOT[11][_version]);
const int SENTENCES_LIFTBOT[2] = { 0x6026B0, 0x601548 };
const int SENTENCES_MAITRED[2][2] = { { 0x60CFD8, 0x60BE70 }, { 0x614288, 0x613120 } };
const int SENTENCES_PARROT[2] = { 0x615858, 0x6146F0 };
const int SENTENCES_SUCCUBUS[2] = { 0x616698, 0x615530 };
const int MAPPINGS_BARBOT[2] = { 0x5B28A0, 0x5B173E };
const int MAPPINGS_BELLBOT[2] = { 0x5CD830, 0x5CC6C8 };
const int MAPPINGS_DESKBOT[2] = { 0x5E2BB8, 0x5E1A50 };
const int MAPPINGS_DOORBOT[2] = { 0x5F7950, 0x5F67E8 };
const int MAPPINGS_LIFTBOT[2] = { 0x608660, 0x6074F8 };
const int MAPPINGS_MAITRED[2] = { 0x6125C8, 0x611460 };
const int MAPPINGS_PARROT[2] = { 0x615B68, 0x614A00 };
const int MAPPINGS_SUCCUBUS[2] = { 0x6189F0, 0x617888 };
const int WORDS_BARBOT[2] = { 0x5BE2E0, 0x5BD178 };
const int WORDS_BELLBOT[2] = { 0x5D8230, 0x5D70C8 };
const int WORDS_DESKBOT[2] = { 0x5EAAA8, 0x5E9940 };
const int WORDS_DOORBOT[2] = { 0x601098, 0x5FFF30 };
const int WORDS_LIFTBOT[2] = { 0x60C788, 0x60B620 };
const int SENTENCES_LIFTBOT[3] = { 0x6026B0, 0x601548, 0x600588 };
const int SENTENCES_MAITRED[2][3] = {
{ 0x60CFD8, 0x60BE70, 0x60AEB0 }, { 0x614288, 0x613120, 0x612160 }
};
const int SENTENCES_PARROT[3] = { 0x615858, 0x6146F0, 0x613730 };
const int SENTENCES_SUCCUBUS[3] = { 0x616698, 0x615530, 0x614570 };
const int MAPPINGS_BARBOT[3] = { 0x5B28A0, 0x5B173E, 0x5B0778 };
const int MAPPINGS_BELLBOT[3] = { 0x5CD830, 0x5CC6C8, 0x5CB708 };
const int MAPPINGS_DESKBOT[3] = { 0x5E2BB8, 0x5E1A50, 0x5E0A90 };
const int MAPPINGS_DOORBOT[3] = { 0x5F7950, 0x5F67E8, 0x5F5828 };
const int MAPPINGS_LIFTBOT[3] = { 0x608660, 0x6074F8, 0x606538 };
const int MAPPINGS_MAITRED[3] = { 0x6125C8, 0x611460, 0x6104A0 };
const int MAPPINGS_PARROT[3] = { 0x615B68, 0x614A00, 0x613A40 };
const int MAPPINGS_SUCCUBUS[3] = { 0x6189F0, 0x617888, 0x6168C8 };
const int WORDS_BARBOT[3] = { 0x5BE2E0, 0x5BD178, 0x5BC1B8 };
const int WORDS_BELLBOT[3] = { 0x5D8230, 0x5D70C8, 0x5D6108 };
const int WORDS_DESKBOT[3] = { 0x5EAAA8, 0x5E9940, 0x5E8980 };
const int WORDS_DOORBOT[3] = { 0x601098, 0x5FFF30, 0x5FEF70 };
const int WORDS_LIFTBOT[3] = { 0x60C788, 0x60B620, 0x60A660 };
writeSentenceEntries("Sentences/Liftbot", SENTENCES_LIFTBOT[_version]);
writeSentenceEntries("Sentences/MaitreD", SENTENCES_MAITRED[0][_version]);
writeSentenceEntries("Sentences/MaitreD/1", SENTENCES_MAITRED[1][_version]);
@ -827,10 +842,12 @@ int main(int argc, char *argv[]) {
}
res.loadFromEXE(argv[1]);
if (inputFile.size() == ENGLISH_GOG_FILESIZE)
_version = ENGLISH_GOG;
else if (inputFile.size() == ENGLISH_ORIG_FILESIZE)
_version = ENGLISH_ORIG;
if (inputFile.size() == ENGLISH_10042C_FILESIZE)
_version = ENGLISH_10042C;
else if (inputFile.size() == ENGLISH_10042B_FILESIZE)
_version = ENGLISH_10042B;
else if (inputFile.size() == ENGLISH_10042_FILESIZE)
_version = ENGLISH_10042;
else {
printf("Unknown version of ST.exe specified");
exit(0);