Skip to content

Commit

Permalink
Latte: Add support for more fence conditions
Browse files Browse the repository at this point in the history
MEM_OP_GREATER is required by Injustice: Gods Among Us
  • Loading branch information
Exzap committed Mar 27, 2024
1 parent a5756b5 commit 42122b6
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/Cafe/HW/Latte/Core/LatteCommandProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 42122b6

Please sign in to comment.