General Formatting
This commit is contained in:
parent
ede4977d12
commit
eff924e9e2
|
@ -240,14 +240,14 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
|
||||||
m_Content.resize(m_numEntries);
|
m_Content.resize(m_numEntries);
|
||||||
|
|
||||||
|
|
||||||
for (u32 i=0; i<m_numEntries; i++)
|
for (u32 i=0; i < m_numEntries; i++)
|
||||||
{
|
{
|
||||||
SNANDContent& rContent = m_Content[i];
|
SNANDContent& rContent = m_Content[i];
|
||||||
|
|
||||||
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
|
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
|
||||||
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
|
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
|
||||||
rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i);
|
rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i);
|
||||||
rContent.m_Size= (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
|
rContent.m_Size = (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
|
||||||
memcpy(rContent.m_SHA1Hash, pTMD + 0x01f4 + 0x24*i, 20);
|
memcpy(rContent.m_SHA1Hash, pTMD + 0x01f4 + 0x24*i, 20);
|
||||||
memcpy(rContent.m_Header, pTMD + 0x01e4 + 0x24*i, 36);
|
memcpy(rContent.m_Header, pTMD + 0x01e4 + 0x24*i, 36);
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
|
||||||
else
|
else
|
||||||
rContent.m_Filename = StringFromFormat("%s/%08x.app", m_Path.c_str(), rContent.m_ContentID);
|
rContent.m_Filename = StringFromFormat("%s/%08x.app", m_Path.c_str(), rContent.m_ContentID);
|
||||||
|
|
||||||
// Be graceful about incorrect tmds.
|
// Be graceful about incorrect TMDs.
|
||||||
if (File::Exists(rContent.m_Filename))
|
if (File::Exists(rContent.m_Filename))
|
||||||
rContent.m_Size = (u32) File::GetSize(rContent.m_Filename);
|
rContent.m_Size = (u32) File::GetSize(rContent.m_Filename);
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ void CNANDContentLoader::RemoveTitle() const
|
||||||
INFO_LOG(DISCIO, "RemoveTitle %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID);
|
INFO_LOG(DISCIO, "RemoveTitle %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID);
|
||||||
if (IsValid())
|
if (IsValid())
|
||||||
{
|
{
|
||||||
// remove tmd?
|
// remove TMD?
|
||||||
for (u32 i = 0; i < m_numEntries; i++)
|
for (u32 i = 0; i < m_numEntries; i++)
|
||||||
{
|
{
|
||||||
if (!(m_Content[i].m_Type & 0x8000)) // skip shared apps
|
if (!(m_Content[i].m_Type & 0x8000)) // skip shared apps
|
||||||
|
@ -455,7 +455,7 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName)
|
||||||
|
|
||||||
u64 TitleID = ContentLoader.GetTitleID();
|
u64 TitleID = ContentLoader.GetTitleID();
|
||||||
|
|
||||||
//copy WAD's tmd header and contents to content directory
|
//copy WAD's TMD header and contents to content directory
|
||||||
|
|
||||||
std::string ContentPath(Common::GetTitleContentPath(TitleID));
|
std::string ContentPath(Common::GetTitleContentPath(TitleID));
|
||||||
std::string TMDFileName(Common::GetTMDFileName(TitleID));
|
std::string TMDFileName(Common::GetTMDFileName(TitleID));
|
||||||
|
|
|
@ -22,6 +22,7 @@ CVolumeWAD::CVolumeWAD(IBlobReader* _pReader)
|
||||||
: m_pReader(_pReader), m_offset(0), m_tmd_offset(0), m_opening_bnr_offset(0),
|
: m_pReader(_pReader), m_offset(0), m_tmd_offset(0), m_opening_bnr_offset(0),
|
||||||
m_hdr_size(0), m_cert_size(0), m_tick_size(0), m_tmd_size(0), m_data_size(0)
|
m_hdr_size(0), m_cert_size(0), m_tick_size(0), m_tmd_size(0), m_data_size(0)
|
||||||
{
|
{
|
||||||
|
// Source: http://wiibrew.org/wiki/WAD_files
|
||||||
Read(0x00, 4, (u8*)&m_hdr_size);
|
Read(0x00, 4, (u8*)&m_hdr_size);
|
||||||
Read(0x08, 4, (u8*)&m_cert_size);
|
Read(0x08, 4, (u8*)&m_cert_size);
|
||||||
Read(0x10, 4, (u8*)&m_tick_size);
|
Read(0x10, 4, (u8*)&m_tick_size);
|
||||||
|
|
Loading…
Reference in New Issue