mirror of https://github.com/AxioDL/nod.git
Fix parseDol
This commit is contained in:
parent
dfdfdb2749
commit
8cd695c229
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue