summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DiscScrubber.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2018-09-20 19:35:29 +0200
committerJosJuice <josjuice@gmail.com>2018-09-20 23:23:10 +0200
commitfacaeb615e2f9719273459d41a3fe7b83d607772 (patch)
tree9de93f9ba8852da09dc65d413302debb52fdbbbb /Source/Core/DiscIO/DiscScrubber.cpp
parentce3e0fc091efccf84145fead400edf73f8effd8e (diff)
Fix scrubbing unencrypted Wii disc images
Untested with unencrypted Wii disc images, because I don't have any. I tested that normal Wii disc images still work, though.
Diffstat (limited to 'Source/Core/DiscIO/DiscScrubber.cpp')
-rw-r--r--Source/Core/DiscIO/DiscScrubber.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp
index 4830fbc403..dc3c9bf590 100644
--- a/Source/Core/DiscIO/DiscScrubber.cpp
+++ b/Source/Core/DiscIO/DiscScrubber.cpp
@@ -127,7 +127,10 @@ void DiscScrubber::MarkAsUsedE(u64 partition_data_offset, u64 offset, u64 size)
// Compensate for 0x400 (SHA-1) per 0x8000 (cluster), and round to whole clusters
u64 DiscScrubber::ToClusterOffset(u64 offset) const
{
- return offset / 0x7c00 * CLUSTER_SIZE;
+ if (m_disc->IsEncryptedAndHashed())
+ return offset / 0x7c00 * CLUSTER_SIZE;
+ else
+ return offset % CLUSTER_SIZE;
}
// Helper functions for reading the BE volume