summaryrefslogtreecommitdiff
path: root/src/core/arm/interpreter/armsupp.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2014-12-28 06:07:24 -0500
committerGravatar Lioncash2014-12-28 06:09:43 -0500
commit059c65a27af538cba40aa43d2eeb3a544661a9b8 (patch)
tree250facd7671854ca8818c7900515813a3b7d94de /src/core/arm/interpreter/armsupp.cpp
parentMerge pull request #349 from lioncash/uhdync (diff)
downloadyuzu-059c65a27af538cba40aa43d2eeb3a544661a9b8.tar.gz
yuzu-059c65a27af538cba40aa43d2eeb3a544661a9b8.tar.xz
yuzu-059c65a27af538cba40aa43d2eeb3a544661a9b8.zip
armemu: Fix underflows in USAD8/USADA8
Initially reported by xdec.
Diffstat (limited to 'src/core/arm/interpreter/armsupp.cpp')
-rw-r--r--src/core/arm/interpreter/armsupp.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index 6774f8a74..61639d156 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -392,6 +392,15 @@ ARMul_NthReg (ARMword instr, unsigned number)
392 return (bit - 1); 392 return (bit - 1);
393} 393}
394 394
395/* Unsigned sum of absolute difference */
396u8 ARMul_UnsignedAbsoluteDifference(u8 left, u8 right)
397{
398 if (left > right)
399 return left - right;
400
401 return right - left;
402}
403
395/* Assigns the N and Z flags depending on the value of result. */ 404/* Assigns the N and Z flags depending on the value of result. */
396 405
397void 406void