Commit 8412afd8 authored by Connor Abbott's avatar Connor Abbott

Work around differences in MBS format

It apprears that earlier versions of the SYMB block had an extra field.
Since we have no idea what it's for, just skip it for now.
parent 19b38024
......@@ -71,6 +71,7 @@ bool PrintBlock(unsigned indent, uint8_t **data);
// TODO make this less hacky
unsigned hwVersion = 0;
unsigned mbsVersion = 0;
// Attempt to parse a single block with maxSize words
bool ParseSingleBlock(unsigned indent, uint8_t* blockBlob, uint32_t cookie, uint32_t size)
......@@ -92,6 +93,7 @@ bool ParseSingleBlock(unsigned indent, uint8_t* blockBlob, uint32_t cookie, uint
{
Block_MBS2* block = reinterpret_cast<Block_MBS2*>(blockBlob);
iprintf(indent, "\tversion = 0x%08x\n", block->version);
mbsVersion = block->version;
PrintBlocks(indent + 1, blockBlob + sizeof(Block_MBS2),
size - sizeof(Block_MBS2));
}
......@@ -169,6 +171,8 @@ bool ParseSingleBlock(unsigned indent, uint8_t* blockBlob, uint32_t cookie, uint
iprintf(indent + 1, "unk2 = 0x%08x\n", pt1->unk2);
iprintf(indent + 1, "unk3 = 0x%08x\n", pt1->unk3);
blockBlob += sizeof(Block_SYMB_pt1);
if (mbsVersion <= 0x14)
blockBlob += sizeof(uint32_t);
// Then, the type
assert(*reinterpret_cast<uint32_t*>(blockBlob) == COOKIE("TYPE"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment