aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Memory
diff options
context:
space:
mode:
Diffstat (limited to 'ChocolArm64/Memory')
-rw-r--r--ChocolArm64/Memory/AMemory.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/ChocolArm64/Memory/AMemory.cs b/ChocolArm64/Memory/AMemory.cs
index bb6a2b54..2854871e 100644
--- a/ChocolArm64/Memory/AMemory.cs
+++ b/ChocolArm64/Memory/AMemory.cs
@@ -1,3 +1,4 @@
+using ChocolArm64.Events;
using ChocolArm64.Exceptions;
using ChocolArm64.State;
using System;
@@ -51,6 +52,8 @@ namespace ChocolArm64.Memory
private byte*** PageTable;
+ public event EventHandler<AInvalidAccessEventArgs> InvalidAccess;
+
public AMemory(IntPtr Ram)
{
Monitors = new Dictionary<int, ArmMonitor>();
@@ -512,6 +515,8 @@ Unmapped:
return (byte*)Ptr + (Position & PageMask);
}
+ InvalidAccess?.Invoke(this, new AInvalidAccessEventArgs(Position));
+
throw new VmmPageFaultException(Position);
}
@@ -560,6 +565,8 @@ Unmapped:
return (byte*)Ptr + (Position & PageMask);
}
+ InvalidAccess?.Invoke(this, new AInvalidAccessEventArgs(Position));
+
throw new VmmPageFaultException(Position);
}