Core: add helper function to apply a memory patch and mark the 'PPCPatches' as final

This commit is contained in:
iwubcode
2022-12-22 17:33:53 -06:00
parent ce92350140
commit 4743d74985
4 changed files with 27 additions and 3 deletions

View File

@@ -23,9 +23,8 @@
#include "Core/PowerPC/PPCSymbolDB.h"
#include "Core/PowerPC/PowerPC.h"
void PPCPatches::Patch(std::size_t index)
void ApplyMemoryPatch(Common::Debug::MemoryPatch& patch)
{
auto& patch = m_patches[index];
if (patch.value.empty())
return;
@@ -50,6 +49,18 @@ void PPCPatches::Patch(std::size_t index)
}
}
void PPCPatches::ApplyExistingPatch(std::size_t index)
{
auto& patch = m_patches[index];
ApplyMemoryPatch(patch);
}
void PPCPatches::Patch(std::size_t index)
{
auto& patch = m_patches[index];
ApplyMemoryPatch(patch);
}
PPCDebugInterface::PPCDebugInterface() = default;
PPCDebugInterface::~PPCDebugInterface() = default;
@@ -168,6 +179,11 @@ void PPCDebugInterface::ClearPatches()
m_patches.ClearPatches();
}
void PPCDebugInterface::ApplyExistingPatch(std::size_t index)
{
m_patches.ApplyExistingPatch(index);
}
Common::Debug::Threads PPCDebugInterface::GetThreads() const
{
Common::Debug::Threads threads;