diff --git a/ARMeilleure/Instructions/InstEmitSystem32.cs b/ARMeilleure/Instructions/InstEmitSystem32.cs index 808b4fdd7a..45783c3163 100644 --- a/ARMeilleure/Instructions/InstEmitSystem32.cs +++ b/ARMeilleure/Instructions/InstEmitSystem32.cs @@ -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)); + } } }