From 711b36075cd74c936d86b832e96c9f25d39932fd Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 8 Dec 2019 19:40:57 +0100 Subject: [PATCH] Fix scrubbing unencrypted Wii disc images (for real this time) Unlike what my past self apparently thought, % is in fact not the "round down" operator. https://bugs.dolphin-emu.org/issues/11906 --- Source/Core/DiscIO/DiscScrubber.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index 6e2ba07646..8a06d9266e 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -13,6 +13,7 @@ #include #include +#include "Common/Align.h" #include "Common/CommonTypes.h" #include "Common/File.h" #include "Common/Logging/Log.h" @@ -124,7 +125,7 @@ u64 DiscScrubber::ToClusterOffset(u64 offset) const if (m_disc->IsEncryptedAndHashed()) return offset / 0x7c00 * CLUSTER_SIZE; else - return offset % CLUSTER_SIZE; + return Common::AlignDown(offset, CLUSTER_SIZE); } // Helper functions for reading the BE volume