Only throw undefined instruction exception at execution, not at translation stage
This commit is contained in:
parent
9f612682e0
commit
55743c0cba
28 changed files with 94 additions and 43 deletions
|
@ -2,11 +2,11 @@ using System;
|
|||
|
||||
namespace ChocolArm64.State
|
||||
{
|
||||
public class AExceptionEventArgs : EventArgs
|
||||
public class AInstExceptEventArgs : EventArgs
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public AExceptionEventArgs(int Id)
|
||||
public AInstExceptEventArgs(int Id)
|
||||
{
|
||||
this.Id = Id;
|
||||
}
|
16
Ryujinx/Cpu/State/AInstUndEventArgs.cs
Normal file
16
Ryujinx/Cpu/State/AInstUndEventArgs.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
|
||||
namespace ChocolArm64.State
|
||||
{
|
||||
public class AInstUndEventArgs : EventArgs
|
||||
{
|
||||
public long Position { get; private set; }
|
||||
public int RawOpCode { get; private set; }
|
||||
|
||||
public AInstUndEventArgs(long Position, int RawOpCode)
|
||||
{
|
||||
this.Position = Position;
|
||||
this.RawOpCode = RawOpCode;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,23 +42,23 @@ namespace ChocolArm64.State
|
|||
|
||||
public long CntpctEl0 => Environment.TickCount * TicksPerMS;
|
||||
|
||||
public event EventHandler<AExceptionEventArgs> Break;
|
||||
public event EventHandler<AExceptionEventArgs> SvcCall;
|
||||
public event EventHandler<EventArgs> Undefined;
|
||||
public event EventHandler<AInstExceptEventArgs> Break;
|
||||
public event EventHandler<AInstExceptEventArgs> SvcCall;
|
||||
public event EventHandler<AInstUndEventArgs> Undefined;
|
||||
|
||||
public void OnBreak(int Imm)
|
||||
{
|
||||
Break?.Invoke(this, new AExceptionEventArgs(Imm));
|
||||
Break?.Invoke(this, new AInstExceptEventArgs(Imm));
|
||||
}
|
||||
|
||||
public void OnSvcCall(int Imm)
|
||||
{
|
||||
SvcCall?.Invoke(this, new AExceptionEventArgs(Imm));
|
||||
SvcCall?.Invoke(this, new AInstExceptEventArgs(Imm));
|
||||
}
|
||||
|
||||
public void OnUndefined()
|
||||
public void OnUndefined(long Position, int RawOpCode)
|
||||
{
|
||||
Undefined?.Invoke(this, EventArgs.Empty);
|
||||
Undefined?.Invoke(this, new AInstUndEventArgs(Position, RawOpCode));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue