DiscIO: Add parameters to BlobReader::SupportsReadWiiDecrypted

It's possible (but rare) for a WIA or RVZ file to support
this for some partitions but not all, and for the game and
the blob code to disagree on how large a partition is.
This commit is contained in:
JosJuice
2020-08-29 15:12:02 +02:00
parent 800b2480ec
commit 047bb80337
7 changed files with 72 additions and 34 deletions

View File

@ -171,11 +171,9 @@ bool VolumeWii::Read(u64 offset, u64 length, u8* buffer, const Partition& partit
return false;
const PartitionDetails& partition_details = it->second;
if (m_reader->SupportsReadWiiDecrypted())
{
return m_reader->ReadWiiDecrypted(offset, length, buffer,
partition.offset + *partition_details.data_offset);
}
const u64 partition_data_offset = partition.offset + *partition_details.data_offset;
if (m_reader->SupportsReadWiiDecrypted(offset, length, partition_data_offset))
return m_reader->ReadWiiDecrypted(offset, length, buffer, partition_data_offset);
if (!m_encrypted)
{