mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 14:15:41 +12:00
Fix cmp in x64 shader JIT
This commit is contained in:
parent
7094544c29
commit
745da35324
1 changed files with 11 additions and 4 deletions
|
@ -403,11 +403,18 @@ void ShaderEmitter::checkCmpRegister(const PICAShader& shader, u32 instruction)
|
|||
switch (condition) {
|
||||
case 0: // Either cmp register matches
|
||||
// Z flag is 0 if at least 1 of them is set
|
||||
test(word[statePointer + cmpRegXOffset], refX_refY_merged);
|
||||
|
||||
// Invert z flag
|
||||
setz(al);
|
||||
test(al, al);
|
||||
// Check if X matches
|
||||
cmp(byte[statePointer + cmpRegXOffset], refX);
|
||||
sete(al);
|
||||
|
||||
// Or if Y matches
|
||||
cmp(byte[statePointer + cmpRegYOffset], refY);
|
||||
sete(cl);
|
||||
or_(al, cl);
|
||||
|
||||
// If either of them matches, set Z to 1, else set it to 0
|
||||
xor_(al, 1);
|
||||
break;
|
||||
case 1: // Both cmp registers match
|
||||
cmp(word[statePointer + cmpRegXOffset], refX_refY_merged);
|
||||
|
|
Loading…
Add table
Reference in a new issue