diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index aa91c777bf..1e299668a0 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -503,13 +503,37 @@ vifOp(vifCode_STMod) { return 0; } +template< uint idx > +static uint calc_addr(bool flg) +{ + VIFregisters& vifRegs = vifXRegs; + + uint retval = vifRegs.code; + if (idx && flg) retval += vifRegs.tops; + return retval & (idx ? 0x3ff : 0xff); +} + vifOp(vifCode_Unpack) { pass1 { vifUnpackSetup(data); return 1; } pass2 { return nVifUnpack((u8*)data); } - pass3 { VifCodeLog("Unpack"); } + pass3 { + vifStruct& vifX = GetVifX; + VIFregisters& vifRegs = vifXRegs; + uint vl = vifX.cmd & 0x03; + uint vn = (vifX.cmd >> 2) & 0x3; + bool flg = (vifRegs.code >> 15) & 1; + static const char* const vntbl[] = { "S", "V2", "V3", "V4" }; + static const uint vltbl[] = { 32, 16, 8, 5 }; + + VifCodeLog("Unpack %s_%u (%s) @ 0x%04X%s (cl=%u wl=%u num=0x%02X)", + vntbl[vn], vltbl[vl], (vifX.cmd & 0x10) ? "masked" : "unmasked", + calc_addr(flg), flg ? "(FLG)" : "", + vifRegs.cycle.cl, vifRegs.cycle.wl, (vifXRegs.code >> 16) & 0xff + ); + } return 0; } diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index a4455dd3c8..91ef28364f 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -86,7 +86,13 @@ _vifT void vifTransferLoop(u32* &data) { vifX.cmd = data[0] >> 24; iBit = data[0] >> 31; - VIF_LOG("New VifCMD %x tagsize %x", vifX.cmd, vifX.tag.size); + //VIF_LOG("New VifCMD %x tagsize %x", vifX.cmd, vifX.tag.size); + if (IsDevBuild && SysTrace.EE.VIFcode.IsActive()) + { + // Pass 2 means "log it" + vifCmdHandler[idx][vifX.cmd & 0x7f](2, data); + } + vifCmdHandler[idx][vifX.cmd & 0x7f](0, data); data++; pSize--; if (analyzeIbit(data, iBit)) break; diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 88dbcda10b..41f836ca56 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -880,8 +880,8 @@ static __noinline s32 recExecuteBlock( s32 eeCycles ) iopCycleEE = eeCycles; #ifdef PCSX2_DEVBUILD - if (SysTrace.SIF.IsActive()) - SysTrace.IOP.R3000A.Write("Switching to IOP CPU for %d cycles", eeCycles); + //if (SysTrace.SIF.IsActive()) + // SysTrace.IOP.R3000A.Write("Switching to IOP CPU for %d cycles", eeCycles); #endif // [TODO] recExecuteBlock could be replaced by a direct call to the iopEnterRecompiledCode()