DirectoryBlob: Use DiscContent for everything in ReadPartition
This commit is contained in:
parent
936ef5b9dd
commit
a0fa350ca6
|
@ -165,39 +165,17 @@ DirectoryBlobReader::DirectoryBlobReader(File::IOFile dol_file, const std::strin
|
||||||
SetDOLAndDiskType(std::move(dol_file));
|
SetDOLAndDiskType(std::move(dol_file));
|
||||||
|
|
||||||
BuildFST();
|
BuildFST();
|
||||||
|
|
||||||
|
m_virtual_disc.emplace(DISKHEADER_ADDRESS, DISKHEADERINFO_ADDRESS, m_disk_header.data());
|
||||||
|
m_virtual_disc.emplace(DISKHEADERINFO_ADDRESS, sizeof(m_disk_header_info),
|
||||||
|
reinterpret_cast<const u8*>(m_disk_header_info.get()));
|
||||||
|
m_virtual_disc.emplace(APPLOADER_ADDRESS, m_apploader.size(), m_apploader.data());
|
||||||
|
m_virtual_disc.emplace(m_dol_address, m_dol.size(), m_dol.data());
|
||||||
|
m_virtual_disc.emplace(m_fst_address, m_fst_data.size(), m_fst_data.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DirectoryBlobReader::ReadPartition(u64 offset, u64 length, u8* buffer)
|
bool DirectoryBlobReader::ReadPartition(u64 offset, u64 length, u8* buffer)
|
||||||
{
|
{
|
||||||
// header
|
|
||||||
if (offset < DISKHEADERINFO_ADDRESS)
|
|
||||||
{
|
|
||||||
WriteToBuffer(DISKHEADER_ADDRESS, DISKHEADERINFO_ADDRESS, m_disk_header.data(), &offset,
|
|
||||||
&length, &buffer);
|
|
||||||
}
|
|
||||||
// header info
|
|
||||||
if (offset >= DISKHEADERINFO_ADDRESS && offset < APPLOADER_ADDRESS)
|
|
||||||
{
|
|
||||||
WriteToBuffer(DISKHEADERINFO_ADDRESS, sizeof(m_disk_header_info), (u8*)m_disk_header_info.get(),
|
|
||||||
&offset, &length, &buffer);
|
|
||||||
}
|
|
||||||
// apploader
|
|
||||||
if (offset >= APPLOADER_ADDRESS && offset < APPLOADER_ADDRESS + m_apploader.size())
|
|
||||||
{
|
|
||||||
WriteToBuffer(APPLOADER_ADDRESS, m_apploader.size(), m_apploader.data(), &offset, &length,
|
|
||||||
&buffer);
|
|
||||||
}
|
|
||||||
// dol
|
|
||||||
if (offset >= m_dol_address && offset < m_dol_address + m_dol.size())
|
|
||||||
{
|
|
||||||
WriteToBuffer(m_dol_address, m_dol.size(), m_dol.data(), &offset, &length, &buffer);
|
|
||||||
}
|
|
||||||
// fst
|
|
||||||
if (offset >= m_fst_address && offset < m_data_start_address)
|
|
||||||
{
|
|
||||||
WriteToBuffer(m_fst_address, m_fst_data.size(), m_fst_data.data(), &offset, &length, &buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_virtual_disc.empty())
|
if (m_virtual_disc.empty())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue