From 65105c2a3bf136202decd5ec1f5d9626d636033b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 26 Jun 2018 01:09:32 -0300 Subject: Implement SvcGetThreadContext3 --- ChocolArm64/State/AThreadState.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'ChocolArm64/State/AThreadState.cs') diff --git a/ChocolArm64/State/AThreadState.cs b/ChocolArm64/State/AThreadState.cs index a93e4cf9..a84e3242 100644 --- a/ChocolArm64/State/AThreadState.cs +++ b/ChocolArm64/State/AThreadState.cs @@ -51,6 +51,17 @@ namespace ChocolArm64.State public int Fpcr { get; set; } public int Fpsr { get; set; } + public int Psr + { + get + { + return (Negative ? (int)APState.N : 0) | + (Zero ? (int)APState.Z : 0) | + (Carry ? (int)APState.C : 0) | + (Overflow ? (int)APState.V : 0); + } + } + public uint CtrEl0 => 0x8444c004; public uint DczidEl0 => 0x00000004; @@ -89,14 +100,14 @@ namespace ChocolArm64.State TickCounter.Start(); } - internal void OnBreak(int Imm) + internal void OnBreak(long Position, int Imm) { - Break?.Invoke(this, new AInstExceptionEventArgs(Imm)); + Break?.Invoke(this, new AInstExceptionEventArgs(Position, Imm)); } - internal void OnSvcCall(int Imm) + internal void OnSvcCall(long Position, int Imm) { - SvcCall?.Invoke(this, new AInstExceptionEventArgs(Imm)); + SvcCall?.Invoke(this, new AInstExceptionEventArgs(Position, Imm)); } internal void OnUndefined(long Position, int RawOpCode) -- cgit v1.2.3