mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Core: add ability to add memory patches to the patch engine that will be executed each frame
This commit is contained in:
@ -19,12 +19,19 @@ struct MemoryPatch
|
||||
Disabled
|
||||
};
|
||||
|
||||
enum class ApplyType
|
||||
{
|
||||
Once,
|
||||
EachFrame
|
||||
};
|
||||
|
||||
MemoryPatch(u32 address_, std::vector<u8> value_);
|
||||
MemoryPatch(u32 address_, u32 value_);
|
||||
|
||||
u32 address;
|
||||
std::vector<u8> value;
|
||||
State is_enabled = State::Enabled;
|
||||
ApplyType type = ApplyType::Once;
|
||||
};
|
||||
|
||||
class MemoryPatches
|
||||
@ -35,6 +42,8 @@ public:
|
||||
|
||||
void SetPatch(u32 address, u32 value);
|
||||
void SetPatch(u32 address, std::vector<u8> value);
|
||||
void SetFramePatch(u32 address, u32 value);
|
||||
void SetFramePatch(u32 address, std::vector<u8> value);
|
||||
const std::vector<MemoryPatch>& GetPatches() const;
|
||||
void UnsetPatch(u32 address);
|
||||
void EnablePatch(std::size_t index);
|
||||
@ -46,6 +55,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void Patch(std::size_t index) = 0;
|
||||
virtual void UnPatch(std::size_t index) = 0;
|
||||
|
||||
std::vector<MemoryPatch> m_patches;
|
||||
};
|
||||
|
Reference in New Issue
Block a user