aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/State
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/State')
-rw-r--r--ARMeilleure/State/ExecutionContext.cs10
-rw-r--r--ARMeilleure/State/NativeContext.cs10
2 files changed, 17 insertions, 3 deletions
diff --git a/ARMeilleure/State/ExecutionContext.cs b/ARMeilleure/State/ExecutionContext.cs
index 482665db..57a05dbf 100644
--- a/ARMeilleure/State/ExecutionContext.cs
+++ b/ARMeilleure/State/ExecutionContext.cs
@@ -5,7 +5,7 @@ namespace ARMeilleure.State
{
public class ExecutionContext
{
- private const int MinCountForCheck = 40000;
+ private const int MinCountForCheck = 4000;
private NativeContext _nativeContext;
@@ -57,7 +57,7 @@ namespace ARMeilleure.State
}
}
- public bool Running { get; set; }
+ internal bool Running { get; private set; }
public event EventHandler<EventArgs> Interrupt;
public event EventHandler<InstExceptionEventArgs> Break;
@@ -126,6 +126,12 @@ namespace ARMeilleure.State
Undefined?.Invoke(this, new InstUndefinedEventArgs(address, opCode));
}
+ public void StopRunning()
+ {
+ Running = false;
+ _nativeContext.SetCounter(0);
+ }
+
public void Dispose()
{
_nativeContext.Dispose();
diff --git a/ARMeilleure/State/NativeContext.cs b/ARMeilleure/State/NativeContext.cs
index eb54505c..0ab9a3fd 100644
--- a/ARMeilleure/State/NativeContext.cs
+++ b/ARMeilleure/State/NativeContext.cs
@@ -10,7 +10,7 @@ namespace ARMeilleure.State
private const int IntSize = 8;
private const int VecSize = 16;
private const int FlagSize = 4;
- private const int ExtraSize = 4;
+ private const int ExtraSize = 8;
private const int TotalSize = RegisterConsts.IntRegsCount * IntSize +
RegisterConsts.VecRegsCount * VecSize +
@@ -183,6 +183,14 @@ namespace ARMeilleure.State
RegisterConsts.FpFlagsCount * FlagSize;
}
+ public static int GetCallAddressOffset()
+ {
+ return RegisterConsts.IntRegsCount * IntSize +
+ RegisterConsts.VecRegsCount * VecSize +
+ RegisterConsts.FlagsCount * FlagSize +
+ RegisterConsts.FpFlagsCount * FlagSize + 4;
+ }
+
public void Dispose()
{
MemoryManagement.Free(BasePtr);