Format CP0 instructions in its own function.
parent
6132f8ec15
commit
f05442bb40
|
@ -119,19 +119,6 @@
|
|||
return Format(instruction, FormatRegister(instruction.RD, cpu), FormatRegister(instruction.RT, cpu), (sbyte)instruction.SA);
|
||||
}
|
||||
|
||||
switch (instruction.OP)
|
||||
{
|
||||
case VR4300.OpCode.COP0:
|
||||
switch ((VR4300.SystemControlUnit.OpCode)instruction.RS)
|
||||
{
|
||||
case VR4300.SystemControlUnit.OpCode.MT:
|
||||
case VR4300.SystemControlUnit.OpCode.MF:
|
||||
return Format(instruction, FormatRegister(instruction.RT, cpu), FormatCP0Register(instruction.RD, cpu));
|
||||
default:
|
||||
return FormatOpCode(instruction);
|
||||
}
|
||||
}
|
||||
|
||||
return Format(instruction, FormatRegister(instruction.RD, cpu), FormatRegister(instruction.RS, cpu), FormatRegister(instruction.RT, cpu));
|
||||
}
|
||||
|
||||
|
@ -140,6 +127,18 @@
|
|||
/// </summary>
|
||||
public static string J(VR4300.Instruction instruction, VR4300 cpu) => Format(instruction, $"0x{((cpu != null ? (cpu.DelaySlot ?? cpu.PC) : 0) & ~(ulong)((1 << 28) - 1)) | (instruction.Target << 2):X8}");
|
||||
|
||||
public static string CP0(VR4300.Instruction instruction, VR4300 cpu)
|
||||
{
|
||||
switch ((VR4300.SystemControlUnit.OpCode)instruction.RS)
|
||||
{
|
||||
case VR4300.SystemControlUnit.OpCode.MT:
|
||||
case VR4300.SystemControlUnit.OpCode.MF:
|
||||
return Format(instruction, FormatRegister(instruction.RT, cpu), FormatCP0Register(instruction.RD, cpu));
|
||||
default:
|
||||
return FormatOpCode(instruction);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Unknown(VR4300.Instruction instruction) => FormatOpCode(instruction);
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace DotN64.Diagnostics
|
|||
[VR4300.Instruction.From(VR4300.OpCode.BNE)] = InstructionFormat.I,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.BNEL)] = InstructionFormat.I,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.CACHE)] = null,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.COP0)] = InstructionFormat.R, // FIXME: all CP0 ops are treated as such at the moment.
|
||||
[VR4300.Instruction.From(VR4300.OpCode.COP0)] = InstructionFormat.CP0,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.JAL)] = InstructionFormat.J,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.J)] = InstructionFormat.J,
|
||||
[VR4300.Instruction.From(VR4300.OpCode.LB)] = InstructionFormat.I,
|
||||
|
|
Loading…
Reference in New Issue