From a4c7100bcc1d7bcd92ba436503d41361d46eb38c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 27 Dec 2019 22:04:51 +0100 Subject: DiscIO: Use partition data offset for ReadWiiDecrypted parameter Instead of the partition offset (which is usually 0x20000 less). --- Source/Core/DiscIO/VolumeWii.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWii.cpp') 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, -- cgit v1.2.3