ips_layer.h 976 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <memory>
  7. #include <vector>
  8. #include "common/common_types.h"
  9. #include "core/file_sys/vfs.h"
  10. namespace FileSys {
  11. VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips);
  12. class IPSwitchCompiler {
  13. public:
  14. explicit IPSwitchCompiler(VirtualFile patch_text);
  15. ~IPSwitchCompiler();
  16. std::array<u8, 0x20> GetBuildID() const;
  17. bool IsValid() const;
  18. VirtualFile Apply(const VirtualFile& in) const;
  19. private:
  20. struct IPSwitchPatch;
  21. void ParseFlag(const std::string& flag);
  22. void Parse();
  23. bool valid = false;
  24. VirtualFile patch_text;
  25. std::vector<IPSwitchPatch> patches;
  26. std::array<u8, 0x20> nso_build_id{};
  27. bool is_little_endian = false;
  28. s64 offset_shift = 0;
  29. bool print_values = false;
  30. std::string last_comment = "";
  31. };
  32. } // namespace FileSys