mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-09-27 11:36:29 -05:00
Latte: Use the Wii U overflow value for MOVA
The Wii U returns -256 when MOVA goes out of range. Cemu clamped large positive values to 255 instead.
This commit is contained in:
@@ -1084,7 +1084,7 @@ void _emitALUOP2InstructionCode(LatteDecompilerShaderContext* shaderContext, Lat
|
||||
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_FLOAT);
|
||||
src->add(";" _CRLF);
|
||||
src->add("tempResultf = floor(tempResultf);" _CRLF);
|
||||
src->add("tempResultf = clamp(tempResultf, -256.0, 255.0);" _CRLF);
|
||||
src->add("tempResultf = (tempResultf >= -256.0 && tempResultf <= 255.0) ? tempResultf : -256.0;" _CRLF);
|
||||
// set AR
|
||||
if( aluInstruction->destElem == 0 )
|
||||
src->add("ARi.x = int(tempResultf);" _CRLF);
|
||||
@@ -1109,7 +1109,7 @@ void _emitALUOP2InstructionCode(LatteDecompilerShaderContext* shaderContext, Lat
|
||||
src->add("tempResulti = ");
|
||||
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_SIGNED_INT);
|
||||
src->add(";" _CRLF);
|
||||
src->add("tempResulti = clamp(tempResulti, -256, 255);" _CRLF);
|
||||
src->add("tempResulti = (tempResulti >= -256 && tempResulti <= 255) ? tempResulti : -256;" _CRLF);
|
||||
// set AR
|
||||
if( aluInstruction->destElem == 0 )
|
||||
src->add("ARi.x = tempResulti;" _CRLF);
|
||||
|
||||
@@ -1018,7 +1018,7 @@ static void _emitALUOP2InstructionCode(LatteDecompilerShaderContext* shaderConte
|
||||
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_FLOAT);
|
||||
src->add(";" _CRLF);
|
||||
src->add("tempResultf = floor(tempResultf);" _CRLF);
|
||||
src->add("tempResultf = clamp(tempResultf, -256.0, 255.0);" _CRLF);
|
||||
src->add("tempResultf = (tempResultf >= -256.0 && tempResultf <= 255.0) ? tempResultf : -256.0;" _CRLF);
|
||||
// set AR
|
||||
if( aluInstruction->destElem == 0 )
|
||||
src->add("ARi.x = int(tempResultf);" _CRLF);
|
||||
@@ -1043,7 +1043,7 @@ static void _emitALUOP2InstructionCode(LatteDecompilerShaderContext* shaderConte
|
||||
src->add("tempResulti = ");
|
||||
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_SIGNED_INT);
|
||||
src->add(";" _CRLF);
|
||||
src->add("tempResulti = clamp(tempResulti, -256, 255);" _CRLF);
|
||||
src->add("tempResulti = (tempResulti >= -256 && tempResulti <= 255) ? tempResulti : -256;" _CRLF);
|
||||
// set AR
|
||||
if( aluInstruction->destElem == 0 )
|
||||
src->add("ARi.x = tempResulti;" _CRLF);
|
||||
|
||||
Reference in New Issue
Block a user