summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra/CMakeLists.txt14
-rw-r--r--src/citra_qt/CMakeLists.txt4
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp94
3 files changed, 97 insertions, 15 deletions
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index f2add394f..b06259f5e 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -12,22 +12,20 @@ set(HEADERS
12 12
13create_directory_groups(${SRCS} ${HEADERS}) 13create_directory_groups(${SRCS} ${HEADERS})
14 14
15# NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable)
16if (NOT X11_xf86vmode_LIB)
17 set(X11_xv86vmode_LIB Xxf86vm)
18endif()
19
20add_executable(citra ${SRCS} ${HEADERS}) 15add_executable(citra ${SRCS} ${HEADERS})
21target_link_libraries(citra core common video_core) 16target_link_libraries(citra core common video_core)
22target_link_libraries(citra ${OPENGL_gl_LIBRARY} ${GLFW_LIBRARIES} inih) 17target_link_libraries(citra ${OPENGL_gl_LIBRARY} ${GLFW_LIBRARIES} inih)
23 18
19if (UNIX)
20 target_link_libraries(citra -pthread)
21endif()
22
24if (APPLE) 23if (APPLE)
25 target_link_libraries(citra iconv pthread ${COREFOUNDATION_LIBRARY}) 24 target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY})
26elseif (WIN32) 25elseif (WIN32)
27 target_link_libraries(citra winmm) 26 target_link_libraries(citra winmm)
28else() # Unix 27else() # Unix
29 target_link_libraries(citra pthread rt) 28 target_link_libraries(citra rt)
30 target_link_libraries(citra ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
31endif() 29endif()
32 30
33#install(TARGETS citra RUNTIME DESTINATION ${bindir}) 31#install(TARGETS citra RUNTIME DESTINATION ${bindir})
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index 90e5c6aa6..54d0a1271 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -60,6 +60,10 @@ add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
60target_link_libraries(citra-qt core common video_core qhexedit) 60target_link_libraries(citra-qt core common video_core qhexedit)
61target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) 61target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS})
62 62
63if (UNIX)
64 target_link_libraries(citra-qt -pthread)
65endif()
66
63if (APPLE) 67if (APPLE)
64 target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY}) 68 target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY})
65elseif (WIN32) 69elseif (WIN32)
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index ae407585e..460001b1a 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -2390,15 +2390,41 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(pld)(unsigned int inst, int index)
2390 return inst_base; 2390 return inst_base;
2391} 2391}
2392ARM_INST_PTR INTERPRETER_TRANSLATE(qadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD"); } 2392ARM_INST_PTR INTERPRETER_TRANSLATE(qadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD"); }
2393ARM_INST_PTR INTERPRETER_TRANSLATE(qadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD16"); }
2394ARM_INST_PTR INTERPRETER_TRANSLATE(qadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD8"); } 2393ARM_INST_PTR INTERPRETER_TRANSLATE(qadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD8"); }
2395ARM_INST_PTR INTERPRETER_TRANSLATE(qaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADDSUBX"); } 2394ARM_INST_PTR INTERPRETER_TRANSLATE(qadd16)(unsigned int inst, int index)
2395{
2396 arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(generic_arm_inst));
2397 generic_arm_inst* const inst_cream = (generic_arm_inst*)inst_base->component;
2398
2399 inst_base->cond = BITS(inst, 28, 31);
2400 inst_base->idx = index;
2401 inst_base->br = NON_BRANCH;
2402 inst_base->load_r15 = 0;
2403
2404 inst_cream->Rm = BITS(inst, 0, 3);
2405 inst_cream->Rn = BITS(inst, 16, 19);
2406 inst_cream->Rd = BITS(inst, 12, 15);
2407 inst_cream->op1 = BITS(inst, 20, 21);
2408 inst_cream->op2 = BITS(inst, 5, 7);
2409
2410 return inst_base;
2411}
2412ARM_INST_PTR INTERPRETER_TRANSLATE(qaddsubx)(unsigned int inst, int index)
2413{
2414 return INTERPRETER_TRANSLATE(qadd16)(inst, index);
2415}
2396ARM_INST_PTR INTERPRETER_TRANSLATE(qdadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDADD"); } 2416ARM_INST_PTR INTERPRETER_TRANSLATE(qdadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDADD"); }
2397ARM_INST_PTR INTERPRETER_TRANSLATE(qdsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDSUB"); } 2417ARM_INST_PTR INTERPRETER_TRANSLATE(qdsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDSUB"); }
2398ARM_INST_PTR INTERPRETER_TRANSLATE(qsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB"); } 2418ARM_INST_PTR INTERPRETER_TRANSLATE(qsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB"); }
2399ARM_INST_PTR INTERPRETER_TRANSLATE(qsub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB16"); }
2400ARM_INST_PTR INTERPRETER_TRANSLATE(qsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB8"); } 2419ARM_INST_PTR INTERPRETER_TRANSLATE(qsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB8"); }
2401ARM_INST_PTR INTERPRETER_TRANSLATE(qsubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUBADDX"); } 2420ARM_INST_PTR INTERPRETER_TRANSLATE(qsub16)(unsigned int inst, int index)
2421{
2422 return INTERPRETER_TRANSLATE(qadd16)(inst, index);
2423}
2424ARM_INST_PTR INTERPRETER_TRANSLATE(qsubaddx)(unsigned int inst, int index)
2425{
2426 return INTERPRETER_TRANSLATE(qadd16)(inst, index);
2427}
2402ARM_INST_PTR INTERPRETER_TRANSLATE(rev)(unsigned int inst, int index) 2428ARM_INST_PTR INTERPRETER_TRANSLATE(rev)(unsigned int inst, int index)
2403{ 2429{
2404 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rev_inst)); 2430 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rev_inst));
@@ -5561,15 +5587,69 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5561 GOTO_NEXT_INST; 5587 GOTO_NEXT_INST;
5562 } 5588 }
5563 QADD_INST: 5589 QADD_INST:
5564 QADD16_INST:
5565 QADD8_INST: 5590 QADD8_INST:
5591
5592 QADD16_INST:
5566 QADDSUBX_INST: 5593 QADDSUBX_INST:
5594 QSUB16_INST:
5595 QSUBADDX_INST:
5596 {
5597 INC_ICOUNTER;
5598 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
5599 generic_arm_inst* const inst_cream = (generic_arm_inst*)inst_base->component;
5600 const s16 rm_lo = (RM & 0xFFFF);
5601 const s16 rm_hi = ((RM >> 16) & 0xFFFF);
5602 const s16 rn_lo = (RN & 0xFFFF);
5603 const s16 rn_hi = ((RN >> 16) & 0xFFFF);
5604 const u8 op2 = inst_cream->op2;
5605
5606 s32 lo_result = 0;
5607 s32 hi_result = 0;
5608
5609 // QADD16
5610 if (op2 == 0x00) {
5611 lo_result = (rn_lo + rm_lo);
5612 hi_result = (rn_hi + rm_hi);
5613 }
5614 // QASX
5615 else if (op2 == 0x01) {
5616 lo_result = (rn_lo - rm_hi);
5617 hi_result = (rn_hi + rm_lo);
5618 }
5619 // QSAX
5620 else if (op2 == 0x02) {
5621 lo_result = (rn_lo + rm_hi);
5622 hi_result = (rn_hi - rm_lo);
5623 }
5624 // QSUB16
5625 else if (op2 == 0x03) {
5626 lo_result = (rn_lo - rm_lo);
5627 hi_result = (rn_hi - rm_hi);
5628 }
5629
5630 if (lo_result > 0x7FFF)
5631 lo_result = 0x7FFF;
5632 else if (lo_result < -0x8000)
5633 lo_result = -0x8000;
5634
5635 if (hi_result > 0x7FFF)
5636 hi_result = 0x7FFF;
5637 else if (hi_result < -0x8000)
5638 hi_result = -0x8000;
5639
5640 RD = (lo_result & 0xFFFF) | ((hi_result & 0xFFFF) << 16);
5641 }
5642
5643 cpu->Reg[15] += GET_INST_SIZE(cpu);
5644 INC_PC(sizeof(generic_arm_inst));
5645 FETCH_INST;
5646 GOTO_NEXT_INST;
5647 }
5648
5567 QDADD_INST: 5649 QDADD_INST:
5568 QDSUB_INST: 5650 QDSUB_INST:
5569 QSUB_INST: 5651 QSUB_INST:
5570 QSUB16_INST:
5571 QSUB8_INST: 5652 QSUB8_INST:
5572 QSUBADDX_INST:
5573 REV_INST: 5653 REV_INST:
5574 { 5654 {
5575 INC_ICOUNTER; 5655 INC_ICOUNTER;