aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegazig <megazig@megazig-desktop.(none)>2009-04-22 20:12:38 -0500
committermegazig <megazig@megazig-desktop.(none)>2009-04-22 20:12:38 -0500
commit924021b11986e544534ec5215fb47ac2af641bbf (patch)
treebb53ad7f1562b673e84207d8c22753d7fa1bd7ad
parent071620b08197787182f2a951ece8185455792107 (diff)
second wnd1 fix
-rw-r--r--brlyt.c35
-rw-r--r--brlyt.h16
2 files changed, 39 insertions, 12 deletions
diff --git a/brlyt.c b/brlyt.c
index 3aff3c8..d3090a9 100644
--- a/brlyt.c
+++ b/brlyt.c
@@ -513,6 +513,17 @@ void PrintBRLYTEntry_wnd1(brlyt_entry entry, u8* brlyt_file)
for(i=0;i<6;i++) printf(" <unk8>%04x</unk8>\n", short_swap_bytes(wndy.unk8[i]));
printf(" </addon>\n");
// }
+
+ if (data.flag2 == 0x5)
+ {
+ brlyt_wnd_addon2 wndy2;
+ BRLYT_ReadDataFromMemory(&wndy2, brlyt_file, sizeof(brlyt_wnd_addon2));
+ printf(" <addon2>\n");
+ for(i=0;i<2;i++) printf(" <unk1>%08x</unk1>\n", be32(wndy2.unk1[i]));
+ for(i=0;i<8;i++) printf(" <unk2>%04x</unk2>\n", short_swap_bytes(wndy2.unk2[i]));
+ printf(" </addon2>\n");
+ }
+
printf(" </tag>\n");
}
@@ -2422,6 +2433,30 @@ void WriteBRLYTEntry(mxml_node_t *tree, mxml_node_t *node, u8** tagblob, u32* bl
}
fwrite(&wndy, sizeof(brlyt_wnd_addon), 1, fp);
*fileOffset = *fileOffset + sizeof(brlyt_wnd_addon);
+ brlyt_wnd_addon2 wndy2;
+ subnode = mxmlFindElement(node, node, "addon2", NULL, NULL, MXML_DESCEND);
+ if(subnode != NULL)
+ {
+ i=0;
+ mxml_node_t *subsubnode;
+ for(subsubnode = mxmlFindElement(subnode, subnode, "unk1", NULL, NULL, MXML_DESCEND); subsubnode != NULL; subsubnode = mxmlFindElement(subsubnode, subnode, "unk1", NULL, NULL, MXML_DESCEND))
+ {
+ char tempCoord[256];
+ get_value(subsubnode, tempCoord, 256);
+ wndy2.unk1[i] = int_swap_bytes(strtoul(tempCoord, NULL, 16));
+ i++;
+ }
+ i = 0;
+ for(subsubnode = mxmlFindElement(subnode, subnode, "unk2", NULL, NULL, MXML_DESCEND); subsubnode != NULL; subsubnode = mxmlFindElement(subsubnode, subnode, "unk2", NULL, NULL, MXML_DESCEND))
+ {
+ char tempCoord[256];
+ get_value(subsubnode, tempCoord, 256);
+ wndy2.unk2[i] = short_swap_bytes(strtoul(tempCoord, NULL, 16));
+ i++;
+ }
+ fwrite(&wndy2, sizeof(brlyt_wnd_addon2), 1, fp);
+ *fileOffset = *fileOffset + sizeof(brlyt_wnd_addon2);
+ }
}
if ( memcmp(temp, txt1, sizeof(txt1)) == 0)
{
diff --git a/brlyt.h b/brlyt.h
index 98a8b77..d58ae8e 100644
--- a/brlyt.h
+++ b/brlyt.h
@@ -91,19 +91,11 @@ typedef struct //0001-0004
u16 unk8[4]; // 0x0000 0x0
} brlyt_wnd_addon;
-/*
-typedef struct // 0003-0004
+typedef struct // 0003-0005
{
- u32 unk1[4]; // all 0x00000000
- u8 unk2[4]; // 0x01 0x00 0x00 0x00
- u32 unk3; // 0x00000068
- u32 unk4; // 0x0000009c
- u32 unk5[4]; // all 0xffffffff
- u16 unk6[6]; // 0x00 0x0100 0x00 0x00 0x00 0x00
- float unk7[6]; // 3f800000 0x00 0x00 3f800000 3f800000 3f800000
- u16 unk8[4]; // 0x0000 0x00a0 0x0001 0x0000
-}
-*/
+ u32 unk1[2]; // 0xb4 0xb8
+ u16 unk2[8]; // 0x0012 0x0000 0x0013 0x0000 0x0014 0x0500 0x0015 0x0200
+} brlyt_wnd_addon2;
typedef struct
{