aboutsummaryrefslogtreecommitdiff
path: root/tools/create_kyradat
diff options
context:
space:
mode:
Diffstat (limited to 'tools/create_kyradat')
-rw-r--r--tools/create_kyradat/create_kyradat.cpp51
-rw-r--r--tools/create_kyradat/create_kyradat.h19
-rw-r--r--tools/create_kyradat/lol_cd.h18
-rw-r--r--tools/create_kyradat/misc.h17
4 files changed, 102 insertions, 3 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 775af9cc9c..8705ccfeb8 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 35,
+ kKyraDatVersion = 36,
kIndexSize = 12
};
@@ -74,6 +74,7 @@ bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const u
bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
int extractHofSeqData_checkString(const void *ptr, uint8 checkSize);
int extractHofSeqData_isSequence(const void *ptr, const Game *g, uint32 maxCheckSize);
@@ -99,6 +100,7 @@ const ExtractType extractTypeTable[] = {
{ k3TypeShpData, extractMrShapeAnimData, createFilename },
{ lolTypeRaw16, extractRaw16, createFilename },
+ { lolTypeButtonDef, extractLolButtonDefs, createFilename },
{ -1, 0, 0}
};
@@ -269,6 +271,7 @@ const ExtractFilename extractFilenames[] = {
{ lolMusicTrackMap, kTypeRawData, "MUSIC.MAP" },
{ lolGMSfxIndex, kTypeRawData, "SFX_GM.MAP" },
{ lolMT32SfxIndex, kTypeRawData, "SFX_MT32.MAP" },
+ //{ lolADLSfxIndex, kTypeRawData, "SFX_ADL.MAP" },
{ lolSpellProperties, kTypeRawData, "SPELLS.DEF" },
{ lolGameShapeMap, kTypeRawData, "GAMESHP.MAP" },
{ lolLevelShpList, kTypeStringList, "SHPFILES.TXT" },
@@ -297,6 +300,21 @@ const ExtractFilename extractFilenames[] = {
{ lolDscDoorX, lolTypeRaw16, "DSCDOORX.DEF" },
{ lolDscDoorY, lolTypeRaw16, "DSCDOORY.DEF" },
+ { lolScrollXTop, k3TypeRaw16to8, "SCROLLXT.DEF" },
+ { lolScrollYTop, k3TypeRaw16to8, "SCROLLYT.DEF" },
+ { lolScrollXBottom, k3TypeRaw16to8, "SCROLLXB.DEF" },
+ { lolScrollYBottom, k3TypeRaw16to8, "SCROLLYB.DEF" },
+
+ { lolButtonDefs, lolTypeButtonDef, "BUTTONS.DEF" },
+ { lolButtonList1, lolTypeRaw16, "BUTTON1.LST" },
+ { lolButtonList2, lolTypeRaw16, "BUTTON2.LST" },
+ { lolButtonList3, lolTypeRaw16, "BUTTON3.LST" },
+ { lolButtonList4, lolTypeRaw16, "BUTTON4.LST" },
+ { lolButtonList5, lolTypeRaw16, "BUTTON5.LST" },
+ { lolButtonList6, lolTypeRaw16, "BUTTON6.LST" },
+ { lolButtonList7, lolTypeRaw16, "BUTTON7.LST" },
+ { lolButtonList8, lolTypeRaw16, "BUTTON84.LST" },
+
{ -1, 0, 0 }
};
@@ -1065,6 +1083,37 @@ bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 si
return out.addFile(filename, buffer, size);
}
+bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ int num = size / 22;
+ uint32 outsize = num * 18;
+ uint8 *buffer = new uint8[size];
+ const uint8 *src = data;
+ uint8 *dst = buffer;
+
+ for (int i = 0; i < num; i++) {
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ *dst++ = *src++;
+ *dst++ = *src++;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 6; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
+ src += 2; dst += 2;
+ }
+
+ return out.addFile(filename, buffer, size);
+}
+
bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
int outsize = 1;
uint8 *buffer = new uint8[size + 1];
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index f996cfe491..5be72e363f 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -182,6 +182,7 @@ enum kExtractID {
lolMusicTrackMap,
lolGMSfxIndex,
lolMT32SfxIndex,
+ //lolADLSfxIndex,
lolSpellProperties,
lolGameShapeMap,
lolLevelShpList,
@@ -210,6 +211,21 @@ enum kExtractID {
lolDscDoorX,
lolDscDoorY,
+ lolScrollXTop,
+ lolScrollYTop,
+ lolScrollXBottom,
+ lolScrollYBottom,
+
+ lolButtonDefs,
+ lolButtonList1,
+ lolButtonList2,
+ lolButtonList3,
+ lolButtonList4,
+ lolButtonList5,
+ lolButtonList6,
+ lolButtonList7,
+ lolButtonList8,
+
kMaxResIDs
};
@@ -305,7 +321,8 @@ enum kExtractType {
k3TypeRaw16to8,
k3TypeShpData,
- lolTypeRaw16
+ lolTypeRaw16,
+ lolTypeButtonDef
};
struct ExtractType {
diff --git a/tools/create_kyradat/lol_cd.h b/tools/create_kyradat/lol_cd.h
index 8f9e5453d1..3bab171b9f 100644
--- a/tools/create_kyradat/lol_cd.h
+++ b/tools/create_kyradat/lol_cd.h
@@ -5,6 +5,7 @@ const ExtractEntry lolCDFile2[] = {
{ lolMusicTrackMap, 0x0002A240, 0x0002A330 },
{ lolGMSfxIndex, 0x0002B010, 0x0002B10A },
{ lolMT32SfxIndex, 0x0002B110, 0x0002B20A },
+ //{ lolADLSfxIndex, 0x0002B210, 0x0002B30A },
{ lolSpellProperties, 0x0002B5D0, 0x0002B6E8 },
{ lolGameShapeMap, 0x0002B35D, 0x0002B52C },
{ lolLevelShpList, 0x00032826, 0x000328A5 },
@@ -31,7 +32,22 @@ const ExtractEntry lolCDFile2[] = {
{ lolDscBlockIndex, 0x00033B53, 0x00033B9B },
{ lolDscDoor1, 0x0002B550, 0x0002B5D0 },
{ lolDscDoorX, 0x00027CC0, 0x00028140 },
- { lolDscDoorY, 0x00028140, 0x000285C0 },
+ { lolDscDoorY, 0x00028140, 0x000285C0 },
+
+ { lolScrollXTop, 0x00033D40, 0x00033D4A },
+ { lolScrollYTop, 0x00033D4A, 0x00033D54 },
+ { lolScrollXBottom, 0x00033D54, 0x00033D5E },
+ { lolScrollYBottom, 0x00033D5E, 0x00033D68 },
+
+ { lolButtonDefs, 0x00028E80, 0x000296AA },
+ { lolButtonList1, 0x000296B0, 0x00029700 },
+ { lolButtonList2, 0x00029700, 0x0002971E },
+ { lolButtonList3, 0x00029720, 0x00029724 },
+ { lolButtonList4, 0x00029730, 0x0002974E },
+ { lolButtonList5, 0x00029750, 0x00029770 },
+ { lolButtonList6, 0x00029770, 0x0002978C },
+ { lolButtonList7, 0x00029790, 0x00029796 },
+ { lolButtonList8, 0x000297A0, 0x000297A4 },
{ -1, 0, 0 }
};
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index c664afc004..d565c7504a 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -488,6 +488,7 @@ const int lolCDFile2Need[] = {
lolMusicTrackMap,
lolGMSfxIndex,
lolMT32SfxIndex,
+ //lolADLSfxIndex,
lolSpellProperties,
lolGameShapeMap,
lolLevelShpList,
@@ -515,6 +516,22 @@ const int lolCDFile2Need[] = {
lolDscDoorX,
lolDscDoorY,
+ lolScrollXTop,
+ lolScrollYTop,
+ lolScrollXBottom,
+ lolScrollYBottom,
+
+ lolButtonDefs,
+ lolButtonList1,
+ lolButtonList1,
+ lolButtonList2,
+ lolButtonList3,
+ lolButtonList4,
+ lolButtonList5,
+ lolButtonList6,
+ lolButtonList7,
+ lolButtonList8,
+
-1
};