diff options
| author | JosJuice <josjuice@gmail.com> | 2019-12-27 22:04:51 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2020-04-24 14:16:55 +0200 |
| commit | a4c7100bcc1d7bcd92ba436503d41361d46eb38c (patch) | |
| tree | e5f2d79d4b6504ed41dae38e1d533e58682451b6 /Source/Core/DiscIO/VolumeWii.cpp | |
| parent | 7e94d6ed375cecae59717626f6ab1b32674a15dc (diff) | |
DiscIO: Use partition data offset for ReadWiiDecrypted parameter
Instead of the partition offset (which is usually 0x20000 less).
Diffstat (limited to 'Source/Core/DiscIO/VolumeWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWii.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index d2a1fba3db..970f3ad7e5 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -162,14 +162,17 @@ bool VolumeWii::Read(u64 offset, u64 length, u8* buffer, const Partition& partit if (partition == PARTITION_NONE) return m_reader->Read(offset, length, buffer); - if (m_reader->SupportsReadWiiDecrypted()) - return m_reader->ReadWiiDecrypted(offset, length, buffer, partition.offset); - auto it = m_partitions.find(partition); if (it == m_partitions.end()) 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); + } + if (!m_encrypted) { return m_reader->Read(partition.offset + *partition_details.data_offset + offset, length, |
