// Copyright 2018 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include #include #include #include "Common/CommonTypes.h" namespace Common::Debug { struct MemoryPatch { enum class State { Enabled, Disabled }; MemoryPatch(u32 address, std::vector value); MemoryPatch(u32 address, u32 value); u32 address; std::vector value; State is_enabled = State::Enabled; }; class MemoryPatches { public: MemoryPatches(); virtual ~MemoryPatches(); void SetPatch(u32 address, u32 value); void SetPatch(u32 address, std::vector value); const std::vector& GetPatches() const; void UnsetPatch(u32 address); void EnablePatch(std::size_t index); void DisablePatch(std::size_t index); bool HasEnabledPatch(u32 address) const; void RemovePatch(std::size_t index); void ClearPatches(); protected: virtual void Patch(std::size_t index) = 0; std::vector m_patches; }; } // namespace Common::Debug