From 588c31acb61d966dc05e0c1b346aad37deeb4905 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 29 Sep 2021 07:49:32 +0200 Subject: [PATCH] RiivolutionPatcher: Ignore last two bits of offset in file patches to match console behavior. --- Source/Core/DiscIO/RiivolutionPatcher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index 0af7ad93b7..af8be05944 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -298,7 +298,8 @@ static void ApplyPatchToFile(const Patch& patch, DiscIO::FSTBuilderNode* file_no static void ApplyPatchToFile(const Patch& patch, const File& file_patch, DiscIO::FSTBuilderNode* file_node) { - ApplyPatchToFile(patch, file_node, file_patch.m_external, file_patch.m_offset, + // The last two bits of the offset seem to be ignored by actual Riivolution. + ApplyPatchToFile(patch, file_node, file_patch.m_external, file_patch.m_offset & ~u64(3), file_patch.m_fileoffset, file_patch.m_length, file_patch.m_resize); }