interp: Don't write lane 2 on single colorconv.

Not that it's valid to use the op with that size anyway.
This commit is contained in:
Unknown W. Brackets committed 2019-03-30 12:27:56 -07:00
1 parent f1a6539c62
commit d35ea0e81a
2 files changed
+6 -2

No files matched your search

+2 -1
View File
@@ -1940,8 +1940,9 @@ namespace MIPSComp {
void IRFrontend::Comp_ColorConv(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix())
if (js.HasUnknownPrefix() || !IsPrefixWithinSize(js.prefixS, op) || js.HasTPrefix()) {
DISABLE;
}
// Vector color conversion
// d[N] = ConvertTo16(s[N*2]) | (ConvertTo16(s[N*2+1]) << 16)
+4 -1
View File
@@ -1045,10 +1045,13 @@ namespace MIPSInt
int vd = _VD;
int vs = _VS;
u32 s[4];
VectorSize isz = GetVecSize(op);
VectorSize sz = V_Quad;
ReadVector(reinterpret_cast<float *>(s), sz, vs);
ApplySwizzleS(reinterpret_cast<float *>(s), sz);
u16 colors[4];
// TODO: Invalid swizzle values almost seem to use the last value converted in a
// previous execution of these ops. It's a bit odd.
for (int i = 0; i < 4; i++)
{
u32 in = s[i];
@@ -1086,7 +1089,7 @@ namespace MIPSInt
}
u32 ov[2] = {(u32)colors[0] | (colors[1] << 16), (u32)colors[2] | (colors[3] << 16)};
ApplyPrefixD(reinterpret_cast<float *>(ov), V_Pair);
WriteVector((const float *)ov, V_Pair, vd);
WriteVector((const float *)ov, isz == V_Single ? V_Single : V_Pair, vd);
PC += 4;
EatPrefixes();
}