diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-09 19:39:23 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-09 20:10:13 +0200 |
commit | f7d2889fb46bf5589b53952c656fdc090334b9de (patch) | |
tree | b0b1cb2608b66f2553a271614b1fc4eaa38f020d | |
parent | ips_layer: std::move data within PatchIPS() and Apply() (diff) | |
download | yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.gz yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.bz2 yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.lz yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.xz yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.zst yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.zip |
-rw-r--r-- | src/core/file_sys/ips_layer.cpp | 13 | ||||
-rw-r--r-- | src/core/file_sys/ips_layer.h | 11 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index b7a3df1b0..f832bf8e6 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -2,9 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <cstring> +#include <map> #include <sstream> -#include "common/assert.h" +#include <string> +#include <utility> + #include "common/hex_util.h" +#include "common/logging/log.h" #include "common/swap.h" #include "core/file_sys/ips_layer.h" #include "core/file_sys/vfs_vector.h" @@ -95,6 +100,12 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { in->GetContainingDirectory()); } +struct IPSwitchCompiler::IPSwitchPatch { + std::string name; + bool enabled; + std::map<u32, std::vector<u8>> records; +}; + IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) { Parse(); } diff --git a/src/core/file_sys/ips_layer.h b/src/core/file_sys/ips_layer.h index 57da00da8..450b2f71e 100644 --- a/src/core/file_sys/ips_layer.h +++ b/src/core/file_sys/ips_layer.h @@ -4,8 +4,11 @@ #pragma once +#include <array> #include <memory> +#include <vector> +#include "common/common_types.h" #include "core/file_sys/vfs.h" namespace FileSys { @@ -22,17 +25,13 @@ public: VirtualFile Apply(const VirtualFile& in) const; private: + struct IPSwitchPatch; + void ParseFlag(const std::string& flag); void Parse(); bool valid = false; - struct IPSwitchPatch { - std::string name; - bool enabled; - std::map<u32, std::vector<u8>> records; - }; - VirtualFile patch_text; std::vector<IPSwitchPatch> patches; std::array<u8, 0x20> nso_build_id{}; |