From 1ef4ccc5a1b222cc18c7710a00436d0794442c24 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 16 Feb 2013 02:04:04 -0800 Subject: [PATCH] Log an error when vfpu swizzle is used badly. --- Core/MIPS/MIPSIntVFPU.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 4313f0101b..8466b5250c 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -113,7 +113,10 @@ void ApplyPrefixST(float *v, u32 data, VectorSize size) // Prefix may say "z, z, z, z" but if this is a pair, we force to x. // TODO: But some ops seem to use const 0 instead? if (regnum >= n) + { + ERROR_LOG(CPU, "Invalid VFPU swizzle: %08x / %d", data, size); regnum = 0; + } v[i] = origV[regnum]; if (abs) @@ -1185,7 +1188,11 @@ namespace MIPSInt ReadVector(s, sz, vs); ApplySwizzleS(s, sz); float scale = V(vt); - ApplySwizzleT(&scale, V_Single); + if (currentMIPS->vfpuCtrl[VFPU_CTRL_TPREFIX] != 0xE4) + { + WARN_LOG(CPU, "Broken T prefix used with VScl: %08x / %08x", currentMIPS->vfpuCtrl[VFPU_CTRL_TPREFIX], op); + ApplySwizzleT(&scale, V_Single); + } int n = GetNumVectorElements(sz); for (int i = 0; i < n; i++) {