diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-08 18:30:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 18:30:33 +0200 |
commit | 6b48ba52712e5ea9cadb1177c06cb3ca65492c38 (patch) | |
tree | 365bb902d31fd5d5d585fc2f5d9e9dac274b02ec /src/core/file_sys/ips_layer.h | |
parent | Merge pull request #1456 from ogniK5377/aoc-u-fixups (diff) | |
parent | ips_layer: Fix inaccuracies with comments and flags (diff) | |
download | yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar.gz yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar.bz2 yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar.lz yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar.xz yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.tar.zst yuzu-6b48ba52712e5ea9cadb1177c06cb3ca65492c38.zip |
Diffstat (limited to 'src/core/file_sys/ips_layer.h')
-rw-r--r-- | src/core/file_sys/ips_layer.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/file_sys/ips_layer.h b/src/core/file_sys/ips_layer.h index 81c163494..57da00da8 100644 --- a/src/core/file_sys/ips_layer.h +++ b/src/core/file_sys/ips_layer.h @@ -12,4 +12,34 @@ namespace FileSys { VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips); +class IPSwitchCompiler { +public: + explicit IPSwitchCompiler(VirtualFile patch_text); + ~IPSwitchCompiler(); + + std::array<u8, 0x20> GetBuildID() const; + bool IsValid() const; + VirtualFile Apply(const VirtualFile& in) const; + +private: + 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{}; + bool is_little_endian = false; + s64 offset_shift = 0; + bool print_values = false; + std::string last_comment = ""; +}; + } // namespace FileSys |