Implement SvcGetThreadContext3
This commit is contained in:
parent
31871077e2
commit
a12f31867c
3 changed files with 21 additions and 7 deletions
|
@ -4,11 +4,13 @@ namespace ChocolArm64.Events
|
||||||
{
|
{
|
||||||
public class AInstExceptionEventArgs : EventArgs
|
public class AInstExceptionEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public long Position { get; private set; }
|
||||||
|
public int Id { get; private set; }
|
||||||
|
|
||||||
public AInstExceptionEventArgs(int Id)
|
public AInstExceptionEventArgs(long Position, int Id)
|
||||||
{
|
{
|
||||||
this.Id = Id;
|
this.Position = Position;
|
||||||
|
this.Id = Id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,7 @@ namespace ChocolArm64.Instruction
|
||||||
|
|
||||||
Context.EmitLdarg(ATranslatedSub.StateArgIdx);
|
Context.EmitLdarg(ATranslatedSub.StateArgIdx);
|
||||||
|
|
||||||
|
Context.EmitLdc_I8(Op.Position);
|
||||||
Context.EmitLdc_I4(Op.Id);
|
Context.EmitLdc_I4(Op.Id);
|
||||||
|
|
||||||
Context.EmitPrivateCall(typeof(AThreadState), MthdName);
|
Context.EmitPrivateCall(typeof(AThreadState), MthdName);
|
||||||
|
|
|
@ -51,6 +51,17 @@ namespace ChocolArm64.State
|
||||||
public int Fpcr { get; set; }
|
public int Fpcr { get; set; }
|
||||||
public int Fpsr { 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 CtrEl0 => 0x8444c004;
|
||||||
public uint DczidEl0 => 0x00000004;
|
public uint DczidEl0 => 0x00000004;
|
||||||
|
|
||||||
|
@ -89,14 +100,14 @@ namespace ChocolArm64.State
|
||||||
TickCounter.Start();
|
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)
|
internal void OnUndefined(long Position, int RawOpCode)
|
||||||
|
|
Loading…
Reference in a new issue