Latte: Add support for more fence conditions

MEM_OP_GREATER is required by Injustice: Gods Among Us
This commit is contained in:
Exzap 2024-03-27 15:59:13 +01:00
parent b0b2c25762
commit 60adc38205

View File

@ -475,18 +475,45 @@ LatteCMDPtr LatteCP_itWaitRegMem(LatteCMDPtr cmd, uint32 nWords)
{
uint32 fenceMemValue = _swapEndianU32(*fencePtr);
fenceMemValue &= fenceMask;
if (compareOp == GPU7_WAIT_MEM_OP_GEQUAL)
if (compareOp == GPU7_WAIT_MEM_OP_LESS)
{
// greater or equal
if (fenceMemValue >= fenceValue)
if (fenceMemValue < fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_LEQUAL)
{
if (fenceMemValue <= fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_EQUAL)
{
// equal
if (fenceMemValue == fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_NOTEQUAL)
{
if (fenceMemValue != fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_GEQUAL)
{
if (fenceMemValue >= fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_GREATER)
{
if (fenceMemValue > fenceValue)
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_ALWAYS)
{
break;
}
else if (compareOp == GPU7_WAIT_MEM_OP_NEVER)
{
cemuLog_logOnce(LogType::Force, "Latte: WAIT_MEM_OP_NEVER encountered");
break;
}
else
assert_dbg();
if (!stalls)