From 97fbbffee8ba9cc3adcba2e74c89f61569e97062 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 18 Jul 2023 07:27:49 +0930 Subject: [PATCH] RSP: A little clean up of VABS --- Source/Project64-rsp/Interpreter Ops.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Source/Project64-rsp/Interpreter Ops.cpp b/Source/Project64-rsp/Interpreter Ops.cpp index 6d6c11ef7..7a59cd9f9 100644 --- a/Source/Project64-rsp/Interpreter Ops.cpp +++ b/Source/Project64-rsp/Interpreter Ops.cpp @@ -1262,10 +1262,9 @@ void RSP_Vector_VSUB(void) void RSP_Vector_VABS(void) { - uint8_t el, del; + uint8_t del; RSPVector Result; - - for (el = 0; el < 8; el++) + for (uint8_t el = 0; el < 8; el++) { del = EleSpec[RSPOpC.rs].B[el]; @@ -1275,14 +1274,7 @@ void RSP_Vector_VABS(void) } else if (RSP_Vect[RSPOpC.vs].s16(el) < 0) { - if (RSP_Vect[RSPOpC.vt].u16(del) == 0x8000) - { - Result.u16(el) = 0x7FFF; - } - else - { - Result.u16(el) = RSP_Vect[RSPOpC.vt].s16(del) * -1; - } + Result.u16(el) = RSP_Vect[RSPOpC.vt].u16(del) == 0x8000 ? 0x7FFF : RSP_Vect[RSPOpC.vt].s16(del) * -1; } else {