summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp64
1 files changed, 62 insertions, 2 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index cfa6de8fc..2765cb36e 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -2156,7 +2156,22 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(revsh)(unsigned int inst, int index)
2156 return INTERPRETER_TRANSLATE(rev)(inst, index); 2156 return INTERPRETER_TRANSLATE(rev)(inst, index);
2157} 2157}
2158 2158
2159static ARM_INST_PTR INTERPRETER_TRANSLATE(rfe)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("RFE"); } 2159static ARM_INST_PTR INTERPRETER_TRANSLATE(rfe)(unsigned int inst, int index)
2160{
2161 arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst));
2162 ldst_inst* const inst_cream = (ldst_inst*)inst_base->component;
2163
2164 inst_base->cond = AL;
2165 inst_base->idx = index;
2166 inst_base->br = INDIRECT_BRANCH;
2167 inst_base->load_r15 = 0;
2168
2169 inst_cream->inst = inst;
2170 inst_cream->get_addr = get_calc_addr_op(inst);
2171
2172 return inst_base;
2173}
2174
2160static ARM_INST_PTR INTERPRETER_TRANSLATE(rsb)(unsigned int inst, int index) 2175static ARM_INST_PTR INTERPRETER_TRANSLATE(rsb)(unsigned int inst, int index)
2161{ 2176{
2162 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst)); 2177 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst));
@@ -2570,7 +2585,23 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(smulw)(unsigned int inst, int index)
2570 inst_base->load_r15 = 1; 2585 inst_base->load_r15 = 1;
2571 return inst_base; 2586 return inst_base;
2572} 2587}
2573static ARM_INST_PTR INTERPRETER_TRANSLATE(srs)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SRS"); } 2588
2589static ARM_INST_PTR INTERPRETER_TRANSLATE(srs)(unsigned int inst, int index)
2590{
2591 arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst));
2592 ldst_inst* const inst_cream = (ldst_inst*)inst_base->component;
2593
2594 inst_base->cond = AL;
2595 inst_base->idx = index;
2596 inst_base->br = NON_BRANCH;
2597 inst_base->load_r15 = 0;
2598
2599 inst_cream->inst = inst;
2600 inst_cream->get_addr = get_calc_addr_op(inst);
2601
2602 return inst_base;
2603}
2604
2574static ARM_INST_PTR INTERPRETER_TRANSLATE(ssat)(unsigned int inst, int index) 2605static ARM_INST_PTR INTERPRETER_TRANSLATE(ssat)(unsigned int inst, int index)
2575{ 2606{
2576 arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ssat_inst)); 2607 arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(ssat_inst));
@@ -5293,6 +5324,20 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
5293 } 5324 }
5294 5325
5295 RFE_INST: 5326 RFE_INST:
5327 {
5328 // RFE is unconditional
5329 ldst_inst* const inst_cream = (ldst_inst*)inst_base->component;
5330
5331 u32 address = 0;
5332 inst_cream->get_addr(cpu, inst_cream->inst, address, 1);
5333
5334 cpu->Cpsr = ReadMemory32(cpu, address);
5335 cpu->Reg[15] = ReadMemory32(cpu, address + 4);
5336
5337 INC_PC(sizeof(ldst_inst));
5338 goto DISPATCH;
5339 }
5340
5296 RSB_INST: 5341 RSB_INST:
5297 { 5342 {
5298 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { 5343 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
@@ -5934,6 +5979,21 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
5934 } 5979 }
5935 5980
5936 SRS_INST: 5981 SRS_INST:
5982 {
5983 // SRS is unconditional
5984 ldst_inst* const inst_cream = (ldst_inst*)inst_base->component;
5985
5986 u32 address = 0;
5987 inst_cream->get_addr(cpu, inst_cream->inst, address, 1);
5988
5989 WriteMemory32(cpu, address + 0, cpu->Reg[14]);
5990 WriteMemory32(cpu, address + 4, cpu->Spsr_copy);
5991
5992 cpu->Reg[15] += GET_INST_SIZE(cpu);
5993 INC_PC(sizeof(ldst_inst));
5994 FETCH_INST;
5995 GOTO_NEXT_INST;
5996 }
5937 5997
5938 SSAT_INST: 5998 SSAT_INST:
5939 { 5999 {