mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 18:52:46 +01:00
99ceb03a1c
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
43 lines
960 B
C++
43 lines
960 B
C++
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "common/common_types.h"
|
|
#include "core/file_sys/vfs.h"
|
|
|
|
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:
|
|
struct IPSwitchPatch;
|
|
|
|
void ParseFlag(const std::string& flag);
|
|
void Parse();
|
|
|
|
bool valid = false;
|
|
|
|
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
|