mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DiscIO: Merge WiiWAD into VolumeWAD
These two classes are very similar, so let's merge them.
This commit is contained in:
@ -61,10 +61,6 @@ VolumeWAD::VolumeWAD(std::unique_ptr<BlobReader> reader) : m_reader(std::move(re
|
||||
Read(m_cert_chain_offset, m_cert_chain_size, m_cert_chain.data());
|
||||
}
|
||||
|
||||
VolumeWAD::~VolumeWAD()
|
||||
{
|
||||
}
|
||||
|
||||
bool VolumeWAD::Read(u64 offset, u64 length, u8* buffer, const Partition& partition) const
|
||||
{
|
||||
if (partition != PARTITION_NONE)
|
||||
@ -118,6 +114,24 @@ const std::vector<u8>& VolumeWAD::GetCertificateChain(const Partition& partition
|
||||
return m_cert_chain;
|
||||
}
|
||||
|
||||
std::vector<u8> VolumeWAD::GetContent(u16 index) const
|
||||
{
|
||||
u64 offset = m_data_offset;
|
||||
for (const IOS::ES::Content& content : m_tmd.GetContents())
|
||||
{
|
||||
const u64 aligned_size = Common::AlignUp(content.size, 0x40);
|
||||
if (content.index == index)
|
||||
{
|
||||
std::vector<u8> data(aligned_size);
|
||||
if (!m_reader->Read(offset, aligned_size, data.data()))
|
||||
return {};
|
||||
return data;
|
||||
}
|
||||
offset += aligned_size;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<u64> VolumeWAD::GetContentOffsets() const
|
||||
{
|
||||
const std::vector<IOS::ES::Content> contents = m_tmd.GetContents();
|
||||
|
Reference in New Issue
Block a user