mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
CPU: Don't raise #RI on write to read-only COP0 registers
Should be silently ignored instead apparently.
This commit is contained in:
@@ -1796,12 +1796,6 @@ restart_instruction:
|
||||
}
|
||||
break;
|
||||
|
||||
case Cop0Reg::JUMPDEST:
|
||||
{
|
||||
WARNING_LOG("Ignoring write to Cop0 JUMPDEST");
|
||||
}
|
||||
break;
|
||||
|
||||
case Cop0Reg::DCIC:
|
||||
{
|
||||
g_state.cop0_regs.dcic.bits = (g_state.cop0_regs.dcic.bits & ~Cop0Registers::DCIC::WRITE_MASK) |
|
||||
@@ -1834,6 +1828,15 @@ restart_instruction:
|
||||
}
|
||||
break;
|
||||
|
||||
case Cop0Reg::JUMPDEST:
|
||||
case Cop0Reg::BadVaddr:
|
||||
case Cop0Reg::EPC:
|
||||
{
|
||||
WARNING_LOG("Ignoring write to COP0 register {} value 0x{:08X}",
|
||||
GetCop0RegisterName(static_cast<u8>(inst.r.rd.GetValue())), value);
|
||||
}
|
||||
break;
|
||||
|
||||
[[unlikely]] default:
|
||||
RaiseException(Exception::RI);
|
||||
return;
|
||||
|
||||
@@ -385,7 +385,7 @@ void CPU::FormatInstruction(SmallStringBase* dest, const Instruction inst, u32 p
|
||||
}
|
||||
else if (std::strncmp(str, "cop", 3) == 0)
|
||||
{
|
||||
dest->append_format("{}", static_cast<u8>(inst.op.GetValue()) & INSTRUCTION_COP_N_MASK);
|
||||
dest->append_format("{}", inst.cop.cop_n.GetValue());
|
||||
str += 3;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -110,9 +110,6 @@ enum class InstructionOp : u8
|
||||
swc2 = 58,
|
||||
swc3 = 59,
|
||||
};
|
||||
constexpr u8 INSTRUCTION_COP_BITS = 0x10;
|
||||
constexpr u8 INSTRUCTION_COP_MASK = 0x3C;
|
||||
constexpr u8 INSTRUCTION_COP_N_MASK = 0x03;
|
||||
|
||||
enum class InstructionFunct : u8
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user