diff options
Diffstat (limited to 'ChocolArm64/State/CpuThreadState.cs')
| -rw-r--r-- | ChocolArm64/State/CpuThreadState.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ChocolArm64/State/CpuThreadState.cs b/ChocolArm64/State/CpuThreadState.cs index caf73deb..1cbbcf40 100644 --- a/ChocolArm64/State/CpuThreadState.cs +++ b/ChocolArm64/State/CpuThreadState.cs @@ -9,11 +9,11 @@ namespace ChocolArm64.State { public class CpuThreadState { + private const int MinCountForCheck = 40000; + internal const int ErgSizeLog2 = 4; internal const int DczSizeLog2 = 4; - private const int MinInstForCheck = 4000000; - public ulong X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19, X20, X21, X22, X23, @@ -124,13 +124,13 @@ namespace ChocolArm64.State } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool Synchronize(int bbWeight) + internal bool Synchronize() { //Firing a interrupt frequently is expensive, so we only //do it after a given number of instructions has executed. - _syncCount += bbWeight; + _syncCount++; - if (_syncCount >= MinInstForCheck) + if (_syncCount >= MinCountForCheck) { CheckInterrupt(); } @@ -138,11 +138,6 @@ namespace ChocolArm64.State return Running; } - internal void RequestInterrupt() - { - _interrupted = true; - } - [MethodImpl(MethodImplOptions.NoInlining)] private void CheckInterrupt() { @@ -156,6 +151,11 @@ namespace ChocolArm64.State } } + internal void RequestInterrupt() + { + _interrupted = true; + } + internal void OnBreak(long position, int imm) { Break?.Invoke(this, new InstExceptionEventArgs(position, imm)); |
