Fix parseDol

This commit is contained in:
Phillip Stephens 2015-09-27 10:10:40 -07:00
parent dfdfdb2749
commit 8cd695c229
2 changed files with 6 additions and 5 deletions

View File

@ -173,7 +173,6 @@ public:
std::vector<Node> m_nodes; std::vector<Node> m_nodes;
void parseFST(IPartReadStream& s); void parseFST(IPartReadStream& s);
DOLHeader m_dolHead;
uint64_t m_dolSz; uint64_t m_dolSz;
void parseDOL(IPartReadStream& s); void parseDOL(IPartReadStream& s);

View File

@ -47,14 +47,16 @@ void DiscBase::IPartition::parseFST(IPartReadStream& s)
void DiscBase::IPartition::parseDOL(IPartReadStream& s) void DiscBase::IPartition::parseDOL(IPartReadStream& s)
{ {
/* Read Dol header */ /* Read Dol header */
s.read(&m_dolHead, sizeof(DOLHeader)); DOLHeader dolHeader;
s.read(&dolHeader, sizeof(DOLHeader));
/* Calculate Dol size */ /* Calculate Dol size */
uint32_t dolSize = SBig(m_dolHead.textOff[0]) - sizeof(DOLHeader); uint32_t dolSize = SBig(dolHeader.textOff[0]);
for (uint32_t i = 0 ; i < 7 ; i++) for (uint32_t i = 0 ; i < 7 ; i++)
dolSize += SBig(m_dolHead.textSizes[i]); dolSize += SBig(dolHeader.textSizes[i]);
for (uint32_t i = 0 ; i < 11 ; i++) for (uint32_t i = 0 ; i < 11 ; i++)
dolSize += SBig(m_dolHead.dataSizes[i]); dolSize += SBig(dolHeader.dataSizes[i]);
m_dolSz = dolSize; m_dolSz = dolSize;
} }