Emit undefined instruction on invalid coprocessor
...rather than throwing.
This commit is contained in:
parent
679509e698
commit
ad05af16c8
1 changed files with 12 additions and 3 deletions
|
@ -17,7 +17,8 @@ namespace ARMeilleure.Instructions
|
|||
|
||||
if (op.Coproc != 15)
|
||||
{
|
||||
throw new NotImplementedException($"Unknown MRC Coprocessor ID 0x{op.Coproc:X16} at 0x{op.Address:X16}.");
|
||||
EmitUndefined(context);
|
||||
return;
|
||||
}
|
||||
|
||||
if (op.Opc1 != 0)
|
||||
|
@ -70,7 +71,8 @@ namespace ARMeilleure.Instructions
|
|||
|
||||
if (op.Coproc != 15)
|
||||
{
|
||||
throw new NotImplementedException($"Unknown MRC Coprocessor ID 0x{op.Coproc:X16} at 0x{op.Address:X16}.");
|
||||
EmitUndefined(context);
|
||||
return;
|
||||
}
|
||||
|
||||
if (op.Opc1 != 0)
|
||||
|
@ -119,7 +121,8 @@ namespace ARMeilleure.Instructions
|
|||
|
||||
if (op.Coproc != 15)
|
||||
{
|
||||
throw new NotImplementedException($"Unknown MRC Coprocessor ID 0x{op.Coproc:X16} at 0x{op.Address:X16}.");
|
||||
EmitUndefined(context);
|
||||
return;
|
||||
}
|
||||
|
||||
var opc = op.MrrcOp;
|
||||
|
@ -229,5 +232,11 @@ namespace ARMeilleure.Instructions
|
|||
SetFlag(context, PState.ZFlag, z);
|
||||
SetFlag(context, PState.NFlag, n);
|
||||
}
|
||||
|
||||
private static void EmitUndefined(ArmEmitterContext context)
|
||||
{
|
||||
OpCode32 op = (OpCode32)context.CurrOp;
|
||||
context.Call(new _Void_U64_S32(NativeInterface.Undefined), Const(op.Address), Const(op.RawOpCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue