summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2014-12-17 15:34:58 -0500
committerGravatar Lioncash2014-12-17 15:40:10 -0500
commit58dc5547333cfb946f3881eb746811794a0f39a7 (patch)
treee47a81d31aa2ef319e1a7d2f1f23f191b8ad548c
parentMerge pull request #293 from lioncash/sops (diff)
downloadyuzu-58dc5547333cfb946f3881eb746811794a0f39a7.tar.gz
yuzu-58dc5547333cfb946f3881eb746811794a0f39a7.tar.xz
yuzu-58dc5547333cfb946f3881eb746811794a0f39a7.zip
armemu: Fix SSUB16
Broken from the same reason SADD16 was. The lo part of the result should only be constructed from the lo halfwords of rm and rn. The hi part of the result should only be constructed from the hi halfwords of rm and rn.
Diffstat (limited to '')
-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:
5801 break; 5801 break;
5802 case 0x61: 5802 case 0x61:
5803 if ((instr & 0xFF0) == 0xf70) { //ssub16 5803 if ((instr & 0xFF0) == 0xf70) { //ssub16
5804 u8 tar = BITS(12, 15); 5804 const u8 rd_idx = BITS(12, 15);
5805 u8 src1 = BITS(16, 19); 5805 const u8 rm_idx = BITS(0, 3);
5806 u8 src2 = BITS(0, 3); 5806 const u8 rn_idx = BITS(16, 19);
5807 s16 a1 = (state->Reg[src1] & 0xFFFF); 5807 const s16 rn_lo = (state->Reg[rn_idx] & 0xFFFF);
5808 s16 a2 = ((state->Reg[src1] >> 0x10) & 0xFFFF); 5808 const s16 rn_hi = ((state->Reg[rn_idx] >> 16) & 0xFFFF);
5809 s16 b1 = (state->Reg[src2] & 0xFFFF); 5809 const s16 rm_lo = (state->Reg[rm_idx] & 0xFFFF);
5810 s16 b2 = ((state->Reg[src2] >> 0x10) & 0xFFFF); 5810 const s16 rm_hi = ((state->Reg[rm_idx] >> 16) & 0xFFFF);
5811 state->Reg[tar] = ((a1 - a2) & 0xFFFF) | (((b1 - b2) & 0xFFFF) << 0x10); 5811 state->Reg[rd_idx] = ((rn_lo - rm_lo) & 0xFFFF) | (((rn_hi - rm_hi) & 0xFFFF) << 16);
5812 return 1; 5812 return 1;
5813 } else if ((instr & 0xFF0) == 0xf10) { //sadd16 5813 } else if ((instr & 0xFF0) == 0xf10) { //sadd16
5814 const u8 rd_idx = BITS(12, 15); 5814 const u8 rd_idx = BITS(12, 15);