From 4c2a94fa94e0192402c816c74f5a09061e3df520 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 29 Sep 2018 22:14:01 -0400 Subject: patch_manager: Use strings for patch type instead of enum --- src/core/file_sys/patch_manager.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/core/file_sys/patch_manager.h') diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 3a2a9d212..7807515f9 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h @@ -24,14 +24,6 @@ enum class TitleVersionFormat : u8 { std::string FormatTitleVersion(u32 version, TitleVersionFormat format = TitleVersionFormat::ThreeElements); -enum class PatchType { - Update, - LayeredFS, - DLC, -}; - -std::string FormatPatchTypeName(PatchType type); - // A centralized class to manage patches to games. class PatchManager { public: @@ -49,8 +41,8 @@ public: ContentRecordType type = ContentRecordType::Program) const; // Returns a vector of pairs between patch names and patch versions. - // i.e. Update v80 will return {Update, 80} - std::map GetPatchVersionNames() const; + // i.e. Update 3.2.2 will return {"Update", "3.2.2"} + std::map GetPatchVersionNames() const; // Given title_id of the program, attempts to get the control data of the update and parse it, // falling back to the base control data. -- cgit v1.2.3 From 42fb4e82d3239f9d2fa4e5369ac58436c96b7466 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 29 Sep 2018 22:15:16 -0400 Subject: patch_manager: Add PatchNSO function While PatchExeFS operated on the entire directory, this function operates on the uncompressed NSO. Avoids copying decompression code to PatchManager. --- src/core/file_sys/patch_manager.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/file_sys/patch_manager.h') diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 7807515f9..254f7bfc9 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h @@ -34,6 +34,14 @@ public: // - Game Updates VirtualDir PatchExeFS(VirtualDir exefs) const; + // Currently tracked NSO patches: + // - IPS + std::vector PatchNSO(const std::vector& nso) const; + + // Checks to see if PatchNSO() will have any effect given the NSO's build ID. + // Used to prevent expensive copies in NSO loader. + bool HasNSOPatch(const std::array& build_id) const; + // Currently tracked RomFS patches: // - Game Updates // - LayeredFS -- cgit v1.2.3 From 215b65fe75810b72bb76ae8dbb75ea59ac16f13f Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 2 Oct 2018 17:03:34 -0400 Subject: nso: Optimize loading of IPS patches Avoid resource-heavy classes and remove quasi-duplicated code. --- src/core/file_sys/patch_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/patch_manager.h') diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 254f7bfc9..6a864ec43 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h @@ -50,7 +50,7 @@ public: // Returns a vector of pairs between patch names and patch versions. // i.e. Update 3.2.2 will return {"Update", "3.2.2"} - std::map GetPatchVersionNames() const; + std::map> GetPatchVersionNames() const; // Given title_id of the program, attempts to get the control data of the update and parse it, // falling back to the base control data. -- cgit v1.2.3