diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-11-01 11:53:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 11:53:56 +0100 |
| commit | 166d8a1aa3b615fc7e30fd07dd0b943eff95e77d (patch) | |
| tree | 6a3d6bb3971572a0381fedf30fff79dc5306332a /Source/Core/Common/CodeBlock.h | |
| parent | b32ac9353ee760e13b7e62a4b633e33a39f51972 (diff) | |
| parent | d04e67be3d26b7017f2bb061618181fd71611f9a (diff) | |
Merge pull request #12211 from JosJuice/toggle-dcache
PowerPC: Allow toggling write-back cache during emulation
Diffstat (limited to 'Source/Core/Common/CodeBlock.h')
| -rw-r--r-- | Source/Core/Common/CodeBlock.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index aa35d3b782..fbd4cdb00a 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -82,9 +82,14 @@ public: } bool IsInSpace(const u8* ptr) const { return ptr >= region && ptr < (region + region_size); } - // Cannot currently be undone. Will write protect the entire code region. - // Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()). - void WriteProtect() { Common::WriteProtectMemory(region, region_size, true); } + void WriteProtect(bool allow_execute) + { + Common::WriteProtectMemory(region, region_size, allow_execute); + } + void UnWriteProtect(bool allow_execute) + { + Common::UnWriteProtectMemory(region, region_size, allow_execute); + } void ResetCodePtr() { T::SetCodePtr(region, region + region_size); } size_t GetSpaceLeft() const { |
