From 9e5bc98496ef59bd2e30e7157b1d33a363ac538f Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 8 Jun 2022 23:07:15 +0200 Subject: DiscIO/RiivolutionPatcher: Skip main.dol patches if no main.dol was given. --- Source/Core/DiscIO/RiivolutionPatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp') diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index e3d3d88af9..a9593dddcd 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -397,7 +397,7 @@ static void ApplyFilePatchToFST(const Patch& patch, const File& file, if (node) ApplyPatchToFile(patch, file, node); } - else if (CaseInsensitiveEquals(file.m_disc, "main.dol")) + else if (dol_node && CaseInsensitiveEquals(file.m_disc, "main.dol")) { // Special case: If the filename is "main.dol", we want to patch the main executable. ApplyPatchToFile(patch, file, dol_node); -- cgit v1.2.3 From cc315cb7afa26693979d6faf43bedd6dd50722e1 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Thu, 9 Jun 2022 00:25:11 +0200 Subject: DiscIO/Riivolution: Add dolphin-specific extensions "dolphin_sys_file" and "dolphin_sys_folder" to patch sys files like you would patch regular files. --- Source/Core/DiscIO/RiivolutionPatcher.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp') diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index a9593dddcd..8ad65f8c57 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -458,15 +458,20 @@ static void ApplyFolderPatchToFST(const Patch& patch, const Folder& folder, ApplyFolderPatchToFST(patch, folder, fst, dol_node, folder.m_disc, folder.m_external); } -void ApplyPatchesToFiles(const std::vector& patches, +void ApplyPatchesToFiles(const std::vector& patches, PatchIndex index, std::vector* fst, DiscIO::FSTBuilderNode* dol_node) { for (const auto& patch : patches) { - for (const auto& file : patch.m_file_patches) + const auto& file_patches = + index == PatchIndex::DolphinSysFiles ? patch.m_sys_file_patches : patch.m_file_patches; + const auto& folder_patches = + index == PatchIndex::DolphinSysFiles ? patch.m_sys_folder_patches : patch.m_folder_patches; + + for (const auto& file : file_patches) ApplyFilePatchToFST(patch, file, fst, dol_node); - for (const auto& folder : patch.m_folder_patches) + for (const auto& folder : folder_patches) ApplyFolderPatchToFST(patch, folder, fst, dol_node); } } -- cgit v1.2.3