summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-12-18 02:56:37 +0100
committerbunnei <bunneidev@gmail.com>2014-12-18 02:56:37 +0100
commite00e303275b8e5f9d4a5d3e8a2e4146af5dece3d (patch)
treefb1875face2f6b8329506802cf1555ed24ea924b
parentMerge pull request #185 from purpasmart96/mem_perm (diff)
parentarmemu: Fix SSUB16 (diff)
downloadyuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar.gz
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar.bz2
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar.lz
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar.xz
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.tar.zst
yuzu-e00e303275b8e5f9d4a5d3e8a2e4146af5dece3d.zip
-rw-r--r--src/core/arm/interpreter/armemu.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index 1a589e39c..2b5d8c68e 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -5801,14 +5801,14 @@ L_stm_s_takeabort:
break;
case 0x61:
if ((instr & 0xFF0) == 0xf70) { //ssub16
- u8 tar = BITS(12, 15);
- u8 src1 = BITS(16, 19);
- u8 src2 = BITS(0, 3);
- s16 a1 = (state->Reg[src1] & 0xFFFF);
- s16 a2 = ((state->Reg[src1] >> 0x10) & 0xFFFF);
- s16 b1 = (state->Reg[src2] & 0xFFFF);
- s16 b2 = ((state->Reg[src2] >> 0x10) & 0xFFFF);
- state->Reg[tar] = ((a1 - a2) & 0xFFFF) | (((b1 - b2) & 0xFFFF) << 0x10);
+ const u8 rd_idx = BITS(12, 15);
+ const u8 rm_idx = BITS(0, 3);
+ const u8 rn_idx = BITS(16, 19);
+ const s16 rn_lo = (state->Reg[rn_idx] & 0xFFFF);
+ const s16 rn_hi = ((state->Reg[rn_idx] >> 16) & 0xFFFF);
+ const s16 rm_lo = (state->Reg[rm_idx] & 0xFFFF);
+ const s16 rm_hi = ((state->Reg[rm_idx] >> 16) & 0xFFFF);
+ state->Reg[rd_idx] = ((rn_lo - rm_lo) & 0xFFFF) | (((rn_hi - rm_hi) & 0xFFFF) << 16);
return 1;
} else if ((instr & 0xFF0) == 0xf10) { //sadd16
const u8 rd_idx = BITS(12, 15);