VIF: Fixed undefined behaviour of Unpack V3-16 in final QW write.

Fixes Homerun
This commit is contained in:
refractionpcsx2 2020-10-18 17:24:43 +01:00
parent f1e2a2efbb
commit 2409486c2d
3 changed files with 5 additions and 2 deletions

View File

@ -239,7 +239,8 @@ _vifT void vifUnpackSetup(const u32 *data) {
//Ugh things are never easy.
//Alright, in most cases with V2 and V3 we only need to know if its offset 32bits.
//However in V3-16 if the data it requires ends on a QW boundary of the source data
//the W vector becomes 0, so we need to know how far through the current QW the data begins
//the W vector becomes 0, so we need to know how far through the current QW the data begins.
//same happens with V3 8
vifX.start_aligned = 4-((vifX.vifpacketsize-1) & 0x3);
//DevCon.Warning("Aligned %d packetsize at data start %d", vifX.start_aligned, vifX.vifpacketsize - 1);
}

View File

@ -184,7 +184,7 @@ void VifUnpackSSE_Dynarec::ModUnpack( int upknum, bool PostOp )
case 8: if(PostOp) { UnpkLoopIteration++; UnpkLoopIteration = UnpkLoopIteration & 0x1; } break;
case 9: if (!PostOp) { UnpkLoopIteration++; } break;
case 10: break;
case 10:if (!PostOp) { UnpkLoopIteration++; } break;
case 12: break;
case 13: break;

View File

@ -289,6 +289,8 @@ void VifUnpackSSE_Base::xUPK_V3_8() const {
xPUNPCK.LWD(destReg, destReg);
xShiftR (destReg, 24);
}
if (UnpkLoopIteration != IsAligned)
xAND.PS(destReg, ptr128[SSEXYZWMask[0]]);
}
void VifUnpackSSE_Base::xUPK_V4_32() const {