Continue big Instruction struct rewrite

This commit is contained in:
irisz64
2025-08-28 09:25:22 +02:00
parent 68620ce893
commit dd98e19c95
9 changed files with 399 additions and 326 deletions

View File

@@ -451,25 +451,23 @@ ExceptionCode Cop0::GetTLBExceptionCode(const TLBError error, const TLBAccessTyp
}
}
void Cop0::decode(const u32 instr) {
void Cop0::decode(const Instruction instr) {
Registers& regs = Core::GetRegs();
const u8 mask_cop = instr >> 21 & 0x1F;
const u8 mask_cop2 = instr & 0x3F;
switch (mask_cop) {
switch (instr.cop_rs()) {
case 0x00:
mfc0(instr);
mfc0(u32(instr));
break;
case 0x01:
dmfc0(instr);
dmfc0(u32(instr));
break;
case 0x04:
mtc0(instr);
mtc0(u32(instr));
break;
case 0x05:
dmtc0(instr);
dmtc0(u32(instr));
break;
case 0x10 ... 0x1F:
switch (mask_cop2) {
switch (instr.cop_funct()) {
case 0x01:
tlbr();
break;
@@ -486,7 +484,7 @@ void Cop0::decode(const u32 instr) {
eret();
break;
default:
panic("Unimplemented COP0 function {} {} ({:08X}) ({:016X})", mask_cop2 >> 3, mask_cop2 & 7, instr,
panic("Unimplemented COP0 function {} ({:08X}) ({:016X})", instr.cop_funct(), u32(instr),
regs.oldPC);
}
break;