From 924021b11986e544534ec5215fb47ac2af641bbf Mon Sep 17 00:00:00 2001 From: megazig Date: Wed, 22 Apr 2009 20:12:38 -0500 Subject: second wnd1 fix --- brlyt.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'brlyt.c') 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(" %04x\n", short_swap_bytes(wndy.unk8[i])); printf(" \n"); // } + + if (data.flag2 == 0x5) + { + brlyt_wnd_addon2 wndy2; + BRLYT_ReadDataFromMemory(&wndy2, brlyt_file, sizeof(brlyt_wnd_addon2)); + printf(" \n"); + for(i=0;i<2;i++) printf(" %08x\n", be32(wndy2.unk1[i])); + for(i=0;i<8;i++) printf(" %04x\n", short_swap_bytes(wndy2.unk2[i])); + printf(" \n"); + } + printf(" \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) { -- cgit v1.3.1