summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2015-01-17 13:51:00 -0500
committerGravatar Lioncash2015-01-17 13:53:35 -0500
commit8575010a68e6d0fd28a81b5080efc04f5a5b2d16 (patch)
tree2a7cd0604af5ca2ded1c209e55888bf1845b6345 /src
parentMerge pull request #488 from lioncash/strbt (diff)
downloadyuzu-8575010a68e6d0fd28a81b5080efc04f5a5b2d16.tar.gz
yuzu-8575010a68e6d0fd28a81b5080efc04f5a5b2d16.tar.xz
yuzu-8575010a68e6d0fd28a81b5080efc04f5a5b2d16.zip
dyncom: Handle the ARM A2 encoding of STRT/LDRT
These were also missing the shifted register case.
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 6052e4f58..d0347566c 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -1840,17 +1840,24 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsh)(unsigned int inst, int index)
1840} 1840}
1841ARM_INST_PTR INTERPRETER_TRANSLATE(ldrt)(unsigned int inst, int index) 1841ARM_INST_PTR INTERPRETER_TRANSLATE(ldrt)(unsigned int inst, int index)
1842{ 1842{
1843 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); 1843 arm_inst* inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst));
1844 ldst_inst *inst_cream = (ldst_inst *)inst_base->component; 1844 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
1845 1845
1846 inst_base->cond = BITS(inst, 28, 31); 1846 inst_base->cond = BITS(inst, 28, 31);
1847 inst_base->idx = index; 1847 inst_base->idx = index;
1848 inst_base->br = NON_BRANCH; 1848 inst_base->br = NON_BRANCH;
1849 1849
1850 inst_cream->inst = inst; 1850 inst_cream->inst = inst;
1851 if (I_BIT == 0) { 1851 if (BITS(inst, 25, 27) == 2) {
1852 inst_cream->get_addr = LnSWoUB(ImmediatePostIndexed); 1852 inst_cream->get_addr = LnSWoUB(ImmediatePostIndexed);
1853 } else if (BITS(inst, 25, 27) == 3) {
1854 inst_cream->get_addr = LnSWoUB(ScaledRegisterPostIndexed);
1853 } else { 1855 } else {
1856 // Reaching this would indicate the thumb version
1857 // of this instruction, however the 3DS CPU doesn't
1858 // support this variant (the 3DS CPU is only ARMv6K,
1859 // while this variant is added in ARMv6T2).
1860 // So it's sufficient for citra to not implement this.
1854 DEBUG_MSG; 1861 DEBUG_MSG;
1855 } 1862 }
1856 1863
@@ -2792,17 +2799,24 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(strh)(unsigned int inst, int index)
2792} 2799}
2793ARM_INST_PTR INTERPRETER_TRANSLATE(strt)(unsigned int inst, int index) 2800ARM_INST_PTR INTERPRETER_TRANSLATE(strt)(unsigned int inst, int index)
2794{ 2801{
2795 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); 2802 arm_inst* inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst));
2796 ldst_inst *inst_cream = (ldst_inst *)inst_base->component; 2803 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
2797 2804
2798 inst_base->cond = BITS(inst, 28, 31); 2805 inst_base->cond = BITS(inst, 28, 31);
2799 inst_base->idx = index; 2806 inst_base->idx = index;
2800 inst_base->br = NON_BRANCH; 2807 inst_base->br = NON_BRANCH;
2801 2808
2802 inst_cream->inst = inst; 2809 inst_cream->inst = inst;
2803 if (I_BIT == 0) { 2810 if (BITS(inst, 25, 27) == 2) {
2804 inst_cream->get_addr = LnSWoUB(ImmediatePostIndexed); 2811 inst_cream->get_addr = LnSWoUB(ImmediatePostIndexed);
2812 } else if (BITS(inst, 25, 27) == 3) {
2813 inst_cream->get_addr = LnSWoUB(ScaledRegisterPostIndexed);
2805 } else { 2814 } else {
2815 // Reaching this would indicate the thumb version
2816 // of this instruction, however the 3DS CPU doesn't
2817 // support this variant (the 3DS CPU is only ARMv6K,
2818 // while this variant is added in ARMv6T2).
2819 // So it's sufficient for citra to not implement this.
2806 DEBUG_MSG; 2820 DEBUG_MSG;
2807 } 2821 }
2808 2822