aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Cpu/CpuContext.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Cpu/CpuContext.cs')
-rw-r--r--Ryujinx.Cpu/CpuContext.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/Ryujinx.Cpu/CpuContext.cs b/Ryujinx.Cpu/CpuContext.cs
index 275fcc68..45040586 100644
--- a/Ryujinx.Cpu/CpuContext.cs
+++ b/Ryujinx.Cpu/CpuContext.cs
@@ -10,10 +10,22 @@ namespace Ryujinx.Cpu
public CpuContext(MemoryManager memory)
{
_translator = new Translator(new JitMemoryAllocator(), memory);
+ memory.UnmapEvent += UnmapHandler;
}
- public static ExecutionContext CreateExecutionContext() => new ExecutionContext(new JitMemoryAllocator());
+ private void UnmapHandler(ulong address, ulong size)
+ {
+ _translator.InvalidateJitCacheRegion(address, size);
+ }
- public void Execute(ExecutionContext context, ulong address) => _translator.Execute(context, address);
+ public static ExecutionContext CreateExecutionContext()
+ {
+ return new ExecutionContext(new JitMemoryAllocator());
+ }
+
+ public void Execute(ExecutionContext context, ulong address)
+ {
+ _translator.Execute(context, address);
+ }
}
}