summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/debugger/callstack.cpp12
-rw-r--r--src/citra_qt/debugger/registers.cpp8
-rw-r--r--src/citra_qt/main.cpp2
-rw-r--r--src/common/file_util.cpp18
-rw-r--r--src/core/arm/dyncom/arm_dyncom_dec.cpp8
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp547
-rw-r--r--src/core/core.cpp15
-rw-r--r--src/core/core.h5
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp25
-rw-r--r--src/core/hle/kernel/thread.cpp2
-rw-r--r--src/core/hle/kernel/timer.cpp6
-rw-r--r--src/core/hle/service/act_u.cpp7
-rw-r--r--src/core/hle/service/am/am_net.cpp30
-rw-r--r--src/core/hle/service/am/am_sys.cpp15
-rw-r--r--src/core/hle/service/am/am_u.cpp28
-rw-r--r--src/core/hle/service/apt/apt_s.cpp6
-rw-r--r--src/core/hle/service/apt/apt_u.cpp6
-rw-r--r--src/core/hle/service/boss/boss_u.cpp3
-rw-r--r--src/core/hle/service/cam/cam_u.cpp5
-rw-r--r--src/core/hle/service/csnd_snd.cpp7
-rw-r--r--src/core/hle/service/dsp_dsp.cpp14
-rw-r--r--src/core/hle/service/frd/frd_u.cpp43
-rw-r--r--src/core/hle/service/fs/fs_user.cpp196
-rw-r--r--src/core/hle/service/gsp_lcd.cpp10
-rw-r--r--src/core/hle/service/hid/hid_user.cpp2
-rw-r--r--src/core/hle/service/http_c.cpp10
-rw-r--r--src/core/hle/service/mic_u.cpp10
-rw-r--r--src/core/hle/service/ndm_u.cpp16
-rw-r--r--src/core/hle/service/news/news_s.cpp12
-rw-r--r--src/core/hle/service/nim/nim_s.cpp3
-rw-r--r--src/core/hle/service/ns_s.cpp9
-rw-r--r--src/core/hle/service/nwm_uds.cpp18
-rw-r--r--src/core/hle/service/pm_app.cpp4
-rw-r--r--src/core/hle/service/ptm/ptm_sysm.cpp3
-rw-r--r--src/core/hle/service/ssl_c.cpp4
-rw-r--r--src/core/hle/service/y2r_u.cpp21
-rw-r--r--src/core/hle/svc.cpp4
-rw-r--r--src/video_core/renderer_base.cpp1
-rw-r--r--src/video_core/swrasterizer.h2
-rw-r--r--src/video_core/video_core.cpp11
-rw-r--r--src/video_core/video_core.h5
41 files changed, 679 insertions, 474 deletions
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp
index d45eed179..793944639 100644
--- a/src/citra_qt/debugger/callstack.cpp
+++ b/src/citra_qt/debugger/callstack.cpp
@@ -29,18 +29,16 @@ CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent)
29 29
30void CallstackWidget::OnDebugModeEntered() 30void CallstackWidget::OnDebugModeEntered()
31{ 31{
32 ARM_Interface* app_core = Core::g_app_core; 32 // Stack pointer
33 33 const u32 sp = Core::g_app_core->GetReg(13);
34 u32 sp = app_core->GetReg(13); //stack pointer
35 u32 ret_addr, call_addr, func_addr;
36 34
37 Clear(); 35 Clear();
38 36
39 int counter = 0; 37 int counter = 0;
40 for (u32 addr = 0x10000000; addr >= sp; addr -= 4) 38 for (u32 addr = 0x10000000; addr >= sp; addr -= 4)
41 { 39 {
42 ret_addr = Memory::Read32(addr); 40 const u32 ret_addr = Memory::Read32(addr);
43 call_addr = ret_addr - 4; //get call address??? 41 const u32 call_addr = ret_addr - 4; //get call address???
44 42
45 if (Memory::GetPointer(call_addr) == nullptr) 43 if (Memory::GetPointer(call_addr) == nullptr)
46 break; 44 break;
@@ -60,7 +58,7 @@ void CallstackWidget::OnDebugModeEntered()
60 // Pre-compute the left-shift and the prefetch offset 58 // Pre-compute the left-shift and the prefetch offset
61 i_offset <<= 2; 59 i_offset <<= 2;
62 i_offset += 8; 60 i_offset += 8;
63 func_addr = call_addr + i_offset; 61 const u32 func_addr = call_addr + i_offset;
64 62
65 callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); 63 callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0'))));
66 callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0')))); 64 callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0'))));
diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp
index 6100d67c5..1bd0bfebc 100644
--- a/src/citra_qt/debugger/registers.cpp
+++ b/src/citra_qt/debugger/registers.cpp
@@ -59,16 +59,14 @@ RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) {
59} 59}
60 60
61void RegistersWidget::OnDebugModeEntered() { 61void RegistersWidget::OnDebugModeEntered() {
62 ARM_Interface* app_core = Core::g_app_core; 62 if (!Core::g_app_core)
63
64 if (app_core == nullptr)
65 return; 63 return;
66 64
67 for (int i = 0; i < core_registers->childCount(); ++i) 65 for (int i = 0; i < core_registers->childCount(); ++i)
68 core_registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetReg(i), 8, 16, QLatin1Char('0'))); 66 core_registers->child(i)->setText(1, QString("0x%1").arg(Core::g_app_core->GetReg(i), 8, 16, QLatin1Char('0')));
69 67
70 for (int i = 0; i < vfp_registers->childCount(); ++i) 68 for (int i = 0; i < vfp_registers->childCount(); ++i)
71 vfp_registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetVFPReg(i), 8, 16, QLatin1Char('0'))); 69 vfp_registers->child(i)->setText(1, QString("0x%1").arg(Core::g_app_core->GetVFPReg(i), 8, 16, QLatin1Char('0')));
72 70
73 UpdateCPSRValues(); 71 UpdateCPSRValues();
74 UpdateVFPSystemRegisterValues(); 72 UpdateVFPSystemRegisterValues();
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index d6c27f0df..d292855ec 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -208,7 +208,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
208 208
209 show(); 209 show();
210 210
211 game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool()); 211 game_list->PopulateAsync(settings.value("gameListRootDir", "").toString(), settings.value("gameListDeepScan", false).toBool());
212 212
213 QStringList args = QApplication::arguments(); 213 QStringList args = QApplication::arguments();
214 if (args.length() >= 2) { 214 if (args.length() >= 2) {
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 4c7113390..052c0ecd6 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -427,6 +427,9 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
427 // How many files + directories we found 427 // How many files + directories we found
428 unsigned found_entries = 0; 428 unsigned found_entries = 0;
429 429
430 // Save the status of callback function
431 bool callback_error = false;
432
430#ifdef _WIN32 433#ifdef _WIN32
431 // Find the first file in the directory. 434 // Find the first file in the directory.
432 WIN32_FIND_DATA ffd; 435 WIN32_FIND_DATA ffd;
@@ -455,8 +458,10 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
455 continue; 458 continue;
456 459
457 unsigned ret_entries; 460 unsigned ret_entries;
458 if (!callback(&ret_entries, directory, virtual_name)) 461 if (!callback(&ret_entries, directory, virtual_name)) {
462 callback_error = true;
459 break; 463 break;
464 }
460 found_entries += ret_entries; 465 found_entries += ret_entries;
461 466
462#ifdef _WIN32 467#ifdef _WIN32
@@ -467,9 +472,14 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
467 closedir(dirp); 472 closedir(dirp);
468#endif 473#endif
469 474
470 // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it 475 if (!callback_error) {
471 if (num_entries_out != nullptr) 476 // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it
472 *num_entries_out = found_entries; 477 if (num_entries_out != nullptr)
478 *num_entries_out = found_entries;
479 return true;
480 } else {
481 return false;
482 }
473} 483}
474 484
475unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry) 485unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry)
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.cpp b/src/core/arm/dyncom/arm_dyncom_dec.cpp
index ee4288314..8cd6755cb 100644
--- a/src/core/arm/dyncom/arm_dyncom_dec.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_dec.cpp
@@ -6,10 +6,9 @@
6#include "core/arm/skyeye_common/armsupp.h" 6#include "core/arm/skyeye_common/armsupp.h"
7 7
8const InstructionSetEncodingItem arm_instruction[] = { 8const InstructionSetEncodingItem arm_instruction[] = {
9 { "vmla", 4, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 4, 4, 0 }}, 9 { "vmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }},
10 { "vmls", 7, ARMVFP2, { 28, 31, 0xF, 25, 27, 0x1, 23, 23, 1, 11, 11, 0, 8, 9, 0x2, 6, 6, 1, 4, 4, 0 }}, 10 { "vmls", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }},
11 { "vnmla", 4, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 4, 4, 0 }}, 11 { "vnmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }},
12 { "vnmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }},
13 { "vnmls", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }}, 12 { "vnmls", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }},
14 { "vnmul", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }}, 13 { "vnmul", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }},
15 { "vmul", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }}, 14 { "vmul", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }},
@@ -211,7 +210,6 @@ const InstructionSetEncodingItem arm_exclusion_code[] = {
211 { "vmla", 0, ARMVFP2, { 0 }}, 210 { "vmla", 0, ARMVFP2, { 0 }},
212 { "vmls", 0, ARMVFP2, { 0 }}, 211 { "vmls", 0, ARMVFP2, { 0 }},
213 { "vnmla", 0, ARMVFP2, { 0 }}, 212 { "vnmla", 0, ARMVFP2, { 0 }},
214 { "vnmla", 0, ARMVFP2, { 0 }},
215 { "vnmls", 0, ARMVFP2, { 0 }}, 213 { "vnmls", 0, ARMVFP2, { 0 }},
216 { "vnmul", 0, ARMVFP2, { 0 }}, 214 { "vnmul", 0, ARMVFP2, { 0 }},
217 { "vmul", 0, ARMVFP2, { 0 }}, 215 { "vmul", 0, ARMVFP2, { 0 }},
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 2cff2a26a..5f8826034 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -1623,9 +1623,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrb)(unsigned int inst, int index)
1623 inst_cream->inst = inst; 1623 inst_cream->inst = inst;
1624 inst_cream->get_addr = get_calc_addr_op(inst); 1624 inst_cream->get_addr = get_calc_addr_op(inst);
1625 1625
1626 if (BITS(inst, 12, 15) == 15) {
1627 inst_base->br = INDIRECT_BRANCH;
1628 }
1629 return inst_base; 1626 return inst_base;
1630} 1627}
1631static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrbt)(unsigned int inst, int index) 1628static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrbt)(unsigned int inst, int index)
@@ -1646,9 +1643,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrbt)(unsigned int inst, int index)
1646 DEBUG_MSG; 1643 DEBUG_MSG;
1647 } 1644 }
1648 1645
1649 if (BITS(inst, 12, 15) == 15) {
1650 inst_base->br = INDIRECT_BRANCH;
1651 }
1652 return inst_base; 1646 return inst_base;
1653} 1647}
1654static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrd)(unsigned int inst, int index) 1648static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrd)(unsigned int inst, int index)
@@ -1703,9 +1697,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrh)(unsigned int inst, int index)
1703 inst_cream->inst = inst; 1697 inst_cream->inst = inst;
1704 inst_cream->get_addr = get_calc_addr_op(inst); 1698 inst_cream->get_addr = get_calc_addr_op(inst);
1705 1699
1706 if (BITS(inst, 12, 15) == 15) {
1707 inst_base->br = INDIRECT_BRANCH;
1708 }
1709 return inst_base; 1700 return inst_base;
1710} 1701}
1711static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsb)(unsigned int inst, int index) 1702static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsb)(unsigned int inst, int index)
@@ -1720,9 +1711,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsb)(unsigned int inst, int index)
1720 inst_cream->inst = inst; 1711 inst_cream->inst = inst;
1721 inst_cream->get_addr = get_calc_addr_op(inst); 1712 inst_cream->get_addr = get_calc_addr_op(inst);
1722 1713
1723 if (BITS(inst, 12, 15) == 15) {
1724 inst_base->br = INDIRECT_BRANCH;
1725 }
1726 return inst_base; 1714 return inst_base;
1727} 1715}
1728static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsh)(unsigned int inst, int index) 1716static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsh)(unsigned int inst, int index)
@@ -1737,9 +1725,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsh)(unsigned int inst, int index)
1737 inst_cream->inst = inst; 1725 inst_cream->inst = inst;
1738 inst_cream->get_addr = get_calc_addr_op(inst); 1726 inst_cream->get_addr = get_calc_addr_op(inst);
1739 1727
1740 if (BITS(inst, 12, 15) == 15) {
1741 inst_base->br = INDIRECT_BRANCH;
1742 }
1743 return inst_base; 1728 return inst_base;
1744} 1729}
1745static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrt)(unsigned int inst, int index) 1730static ARM_INST_PTR INTERPRETER_TRANSLATE(ldrt)(unsigned int inst, int index)
@@ -2597,9 +2582,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(str)(unsigned int inst, int index)
2597 inst_cream->inst = inst; 2582 inst_cream->inst = inst;
2598 inst_cream->get_addr = get_calc_addr_op(inst); 2583 inst_cream->get_addr = get_calc_addr_op(inst);
2599 2584
2600 if (BITS(inst, 12, 15) == 15) {
2601 inst_base->br = INDIRECT_BRANCH;
2602 }
2603 return inst_base; 2585 return inst_base;
2604} 2586}
2605static ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb)(unsigned int inst, int index) 2587static ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb)(unsigned int inst, int index)
@@ -2645,9 +2627,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(strb)(unsigned int inst, int index)
2645 inst_cream->inst = inst; 2627 inst_cream->inst = inst;
2646 inst_cream->get_addr = get_calc_addr_op(inst); 2628 inst_cream->get_addr = get_calc_addr_op(inst);
2647 2629
2648 if (BITS(inst, 12, 15) == 15) {
2649 inst_base->br = INDIRECT_BRANCH;
2650 }
2651 return inst_base; 2630 return inst_base;
2652} 2631}
2653static ARM_INST_PTR INTERPRETER_TRANSLATE(strbt)(unsigned int inst, int index) 2632static ARM_INST_PTR INTERPRETER_TRANSLATE(strbt)(unsigned int inst, int index)
@@ -2669,9 +2648,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(strbt)(unsigned int inst, int index)
2669 DEBUG_MSG; 2648 DEBUG_MSG;
2670 } 2649 }
2671 2650
2672 if (BITS(inst, 12, 15) == 15) {
2673 inst_base->br = INDIRECT_BRANCH;
2674 }
2675 return inst_base; 2651 return inst_base;
2676} 2652}
2677static ARM_INST_PTR INTERPRETER_TRANSLATE(strd)(unsigned int inst, int index){ 2653static ARM_INST_PTR INTERPRETER_TRANSLATE(strd)(unsigned int inst, int index){
@@ -2685,9 +2661,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(strd)(unsigned int inst, int index){
2685 inst_cream->inst = inst; 2661 inst_cream->inst = inst;
2686 inst_cream->get_addr = get_calc_addr_op(inst); 2662 inst_cream->get_addr = get_calc_addr_op(inst);
2687 2663
2688 if (BITS(inst, 12, 15) == 15) {
2689 inst_base->br = INDIRECT_BRANCH;
2690 }
2691 return inst_base; 2664 return inst_base;
2692} 2665}
2693static ARM_INST_PTR INTERPRETER_TRANSLATE(strex)(unsigned int inst, int index) 2666static ARM_INST_PTR INTERPRETER_TRANSLATE(strex)(unsigned int inst, int index)
@@ -2729,9 +2702,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(strh)(unsigned int inst, int index)
2729 inst_cream->inst = inst; 2702 inst_cream->inst = inst;
2730 inst_cream->get_addr = get_calc_addr_op(inst); 2703 inst_cream->get_addr = get_calc_addr_op(inst);
2731 2704
2732 if (BITS(inst, 12, 15) == 15) {
2733 inst_base->br = INDIRECT_BRANCH;
2734 }
2735 return inst_base; 2705 return inst_base;
2736} 2706}
2737static ARM_INST_PTR INTERPRETER_TRANSLATE(strt)(unsigned int inst, int index) 2707static ARM_INST_PTR INTERPRETER_TRANSLATE(strt)(unsigned int inst, int index)
@@ -2757,9 +2727,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(strt)(unsigned int inst, int index)
2757 DEBUG_MSG; 2727 DEBUG_MSG;
2758 } 2728 }
2759 2729
2760 if (BITS(inst, 12, 15) == 15) {
2761 inst_base->br = INDIRECT_BRANCH;
2762 }
2763 return inst_base; 2730 return inst_base;
2764} 2731}
2765static ARM_INST_PTR INTERPRETER_TRANSLATE(sub)(unsigned int inst, int index) 2732static ARM_INST_PTR INTERPRETER_TRANSLATE(sub)(unsigned int inst, int index)
@@ -2808,9 +2775,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(swp)(unsigned int inst, int index)
2808 inst_cream->Rd = BITS(inst, 12, 15); 2775 inst_cream->Rd = BITS(inst, 12, 15);
2809 inst_cream->Rm = BITS(inst, 0, 3); 2776 inst_cream->Rm = BITS(inst, 0, 3);
2810 2777
2811 if (inst_cream->Rd == 15) {
2812 inst_base->br = INDIRECT_BRANCH;
2813 }
2814 return inst_base; 2778 return inst_base;
2815} 2779}
2816static ARM_INST_PTR INTERPRETER_TRANSLATE(swpb)(unsigned int inst, int index){ 2780static ARM_INST_PTR INTERPRETER_TRANSLATE(swpb)(unsigned int inst, int index){
@@ -2825,9 +2789,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(swpb)(unsigned int inst, int index){
2825 inst_cream->Rd = BITS(inst, 12, 15); 2789 inst_cream->Rd = BITS(inst, 12, 15);
2826 inst_cream->Rm = BITS(inst, 0, 3); 2790 inst_cream->Rm = BITS(inst, 0, 3);
2827 2791
2828 if (inst_cream->Rd == 15) {
2829 inst_base->br = INDIRECT_BRANCH;
2830 }
2831 return inst_base; 2792 return inst_base;
2832} 2793}
2833static ARM_INST_PTR INTERPRETER_TRANSLATE(sxtab)(unsigned int inst, int index){ 2794static ARM_INST_PTR INTERPRETER_TRANSLATE(sxtab)(unsigned int inst, int index){
@@ -2915,9 +2876,6 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(tst)(unsigned int inst, int index)
2915 inst_cream->shifter_operand = BITS(inst, 0, 11); 2876 inst_cream->shifter_operand = BITS(inst, 0, 11);
2916 inst_cream->shtop_func = get_shtop(inst); 2877 inst_cream->shtop_func = get_shtop(inst);
2917 2878
2918 if (inst_cream->Rd == 15)
2919 inst_base->br = INDIRECT_BRANCH;
2920
2921 return inst_base; 2879 return inst_base;
2922} 2880}
2923 2881
@@ -3244,7 +3202,6 @@ const transop_fp_t arm_instruction_trans[] = {
3244 INTERPRETER_TRANSLATE(vmla), 3202 INTERPRETER_TRANSLATE(vmla),
3245 INTERPRETER_TRANSLATE(vmls), 3203 INTERPRETER_TRANSLATE(vmls),
3246 INTERPRETER_TRANSLATE(vnmla), 3204 INTERPRETER_TRANSLATE(vnmla),
3247 INTERPRETER_TRANSLATE(vnmla),
3248 INTERPRETER_TRANSLATE(vnmls), 3205 INTERPRETER_TRANSLATE(vnmls),
3249 INTERPRETER_TRANSLATE(vnmul), 3206 INTERPRETER_TRANSLATE(vnmul),
3250 INTERPRETER_TRANSLATE(vmul), 3207 INTERPRETER_TRANSLATE(vmul),
@@ -3636,209 +3593,208 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
3636 case 0: goto VMLA_INST; \ 3593 case 0: goto VMLA_INST; \
3637 case 1: goto VMLS_INST; \ 3594 case 1: goto VMLS_INST; \
3638 case 2: goto VNMLA_INST; \ 3595 case 2: goto VNMLA_INST; \
3639 case 3: goto VNMLA_INST; \ 3596 case 3: goto VNMLS_INST; \
3640 case 4: goto VNMLS_INST; \ 3597 case 4: goto VNMUL_INST; \
3641 case 5: goto VNMUL_INST; \ 3598 case 5: goto VMUL_INST; \
3642 case 6: goto VMUL_INST; \ 3599 case 6: goto VADD_INST; \
3643 case 7: goto VADD_INST; \ 3600 case 7: goto VSUB_INST; \
3644 case 8: goto VSUB_INST; \ 3601 case 8: goto VDIV_INST; \
3645 case 9: goto VDIV_INST; \ 3602 case 9: goto VMOVI_INST; \
3646 case 10: goto VMOVI_INST; \ 3603 case 10: goto VMOVR_INST; \
3647 case 11: goto VMOVR_INST; \ 3604 case 11: goto VABS_INST; \
3648 case 12: goto VABS_INST; \ 3605 case 12: goto VNEG_INST; \
3649 case 13: goto VNEG_INST; \ 3606 case 13: goto VSQRT_INST; \
3650 case 14: goto VSQRT_INST; \ 3607 case 14: goto VCMP_INST; \
3651 case 15: goto VCMP_INST; \ 3608 case 15: goto VCMP2_INST; \
3652 case 16: goto VCMP2_INST; \ 3609 case 16: goto VCVTBDS_INST; \
3653 case 17: goto VCVTBDS_INST; \ 3610 case 17: goto VCVTBFF_INST; \
3654 case 18: goto VCVTBFF_INST; \ 3611 case 18: goto VCVTBFI_INST; \
3655 case 19: goto VCVTBFI_INST; \ 3612 case 19: goto VMOVBRS_INST; \
3656 case 20: goto VMOVBRS_INST; \ 3613 case 20: goto VMSR_INST; \
3657 case 21: goto VMSR_INST; \ 3614 case 21: goto VMOVBRC_INST; \
3658 case 22: goto VMOVBRC_INST; \ 3615 case 22: goto VMRS_INST; \
3659 case 23: goto VMRS_INST; \ 3616 case 23: goto VMOVBCR_INST; \
3660 case 24: goto VMOVBCR_INST; \ 3617 case 24: goto VMOVBRRSS_INST; \
3661 case 25: goto VMOVBRRSS_INST; \ 3618 case 25: goto VMOVBRRD_INST; \
3662 case 26: goto VMOVBRRD_INST; \ 3619 case 26: goto VSTR_INST; \
3663 case 27: goto VSTR_INST; \ 3620 case 27: goto VPUSH_INST; \
3664 case 28: goto VPUSH_INST; \ 3621 case 28: goto VSTM_INST; \
3665 case 29: goto VSTM_INST; \ 3622 case 29: goto VPOP_INST; \
3666 case 30: goto VPOP_INST; \ 3623 case 30: goto VLDR_INST; \
3667 case 31: goto VLDR_INST; \ 3624 case 31: goto VLDM_INST ; \
3668 case 32: goto VLDM_INST ; \ 3625 case 32: goto SRS_INST; \
3669 case 33: goto SRS_INST; \ 3626 case 33: goto RFE_INST; \
3670 case 34: goto RFE_INST; \ 3627 case 34: goto BKPT_INST; \
3671 case 35: goto BKPT_INST; \ 3628 case 35: goto BLX_INST; \
3672 case 36: goto BLX_INST; \ 3629 case 36: goto CPS_INST; \
3673 case 37: goto CPS_INST; \ 3630 case 37: goto PLD_INST; \
3674 case 38: goto PLD_INST; \ 3631 case 38: goto SETEND_INST; \
3675 case 39: goto SETEND_INST; \ 3632 case 39: goto CLREX_INST; \
3676 case 40: goto CLREX_INST; \ 3633 case 40: goto REV16_INST; \
3677 case 41: goto REV16_INST; \ 3634 case 41: goto USAD8_INST; \
3678 case 42: goto USAD8_INST; \ 3635 case 42: goto SXTB_INST; \
3679 case 43: goto SXTB_INST; \ 3636 case 43: goto UXTB_INST; \
3680 case 44: goto UXTB_INST; \ 3637 case 44: goto SXTH_INST; \
3681 case 45: goto SXTH_INST; \ 3638 case 45: goto SXTB16_INST; \
3682 case 46: goto SXTB16_INST; \ 3639 case 46: goto UXTH_INST; \
3683 case 47: goto UXTH_INST; \ 3640 case 47: goto UXTB16_INST; \
3684 case 48: goto UXTB16_INST; \ 3641 case 48: goto CPY_INST; \
3685 case 49: goto CPY_INST; \ 3642 case 49: goto UXTAB_INST; \
3686 case 50: goto UXTAB_INST; \ 3643 case 50: goto SSUB8_INST; \
3687 case 51: goto SSUB8_INST; \ 3644 case 51: goto SHSUB8_INST; \
3688 case 52: goto SHSUB8_INST; \ 3645 case 52: goto SSUBADDX_INST; \
3689 case 53: goto SSUBADDX_INST; \ 3646 case 53: goto STREX_INST; \
3690 case 54: goto STREX_INST; \ 3647 case 54: goto STREXB_INST; \
3691 case 55: goto STREXB_INST; \ 3648 case 55: goto SWP_INST; \
3692 case 56: goto SWP_INST; \ 3649 case 56: goto SWPB_INST; \
3693 case 57: goto SWPB_INST; \ 3650 case 57: goto SSUB16_INST; \
3694 case 58: goto SSUB16_INST; \ 3651 case 58: goto SSAT16_INST; \
3695 case 59: goto SSAT16_INST; \ 3652 case 59: goto SHSUBADDX_INST; \
3696 case 60: goto SHSUBADDX_INST; \ 3653 case 60: goto QSUBADDX_INST; \
3697 case 61: goto QSUBADDX_INST; \ 3654 case 61: goto SHADDSUBX_INST; \
3698 case 62: goto SHADDSUBX_INST; \ 3655 case 62: goto SHADD8_INST; \
3699 case 63: goto SHADD8_INST; \ 3656 case 63: goto SHADD16_INST; \
3700 case 64: goto SHADD16_INST; \ 3657 case 64: goto SEL_INST; \
3701 case 65: goto SEL_INST; \ 3658 case 65: goto SADDSUBX_INST; \
3702 case 66: goto SADDSUBX_INST; \ 3659 case 66: goto SADD8_INST; \
3703 case 67: goto SADD8_INST; \ 3660 case 67: goto SADD16_INST; \
3704 case 68: goto SADD16_INST; \ 3661 case 68: goto SHSUB16_INST; \
3705 case 69: goto SHSUB16_INST; \ 3662 case 69: goto UMAAL_INST; \
3706 case 70: goto UMAAL_INST; \ 3663 case 70: goto UXTAB16_INST; \
3707 case 71: goto UXTAB16_INST; \ 3664 case 71: goto USUBADDX_INST; \
3708 case 72: goto USUBADDX_INST; \ 3665 case 72: goto USUB8_INST; \
3709 case 73: goto USUB8_INST; \ 3666 case 73: goto USUB16_INST; \
3710 case 74: goto USUB16_INST; \ 3667 case 74: goto USAT16_INST; \
3711 case 75: goto USAT16_INST; \ 3668 case 75: goto USADA8_INST; \
3712 case 76: goto USADA8_INST; \ 3669 case 76: goto UQSUBADDX_INST; \
3713 case 77: goto UQSUBADDX_INST; \ 3670 case 77: goto UQSUB8_INST; \
3714 case 78: goto UQSUB8_INST; \ 3671 case 78: goto UQSUB16_INST; \
3715 case 79: goto UQSUB16_INST; \ 3672 case 79: goto UQADDSUBX_INST; \
3716 case 80: goto UQADDSUBX_INST; \ 3673 case 80: goto UQADD8_INST; \
3717 case 81: goto UQADD8_INST; \ 3674 case 81: goto UQADD16_INST; \
3718 case 82: goto UQADD16_INST; \ 3675 case 82: goto SXTAB_INST; \
3719 case 83: goto SXTAB_INST; \ 3676 case 83: goto UHSUBADDX_INST; \
3720 case 84: goto UHSUBADDX_INST; \ 3677 case 84: goto UHSUB8_INST; \
3721 case 85: goto UHSUB8_INST; \ 3678 case 85: goto UHSUB16_INST; \
3722 case 86: goto UHSUB16_INST; \ 3679 case 86: goto UHADDSUBX_INST; \
3723 case 87: goto UHADDSUBX_INST; \ 3680 case 87: goto UHADD8_INST; \
3724 case 88: goto UHADD8_INST; \ 3681 case 88: goto UHADD16_INST; \
3725 case 89: goto UHADD16_INST; \ 3682 case 89: goto UADDSUBX_INST; \
3726 case 90: goto UADDSUBX_INST; \ 3683 case 90: goto UADD8_INST; \
3727 case 91: goto UADD8_INST; \ 3684 case 91: goto UADD16_INST; \
3728 case 92: goto UADD16_INST; \ 3685 case 92: goto SXTAH_INST; \
3729 case 93: goto SXTAH_INST; \ 3686 case 93: goto SXTAB16_INST; \
3730 case 94: goto SXTAB16_INST; \ 3687 case 94: goto QADD8_INST; \
3731 case 95: goto QADD8_INST; \ 3688 case 95: goto BXJ_INST; \
3732 case 96: goto BXJ_INST; \ 3689 case 96: goto CLZ_INST; \
3733 case 97: goto CLZ_INST; \ 3690 case 97: goto UXTAH_INST; \
3734 case 98: goto UXTAH_INST; \ 3691 case 98: goto BX_INST; \
3735 case 99: goto BX_INST; \ 3692 case 99: goto REV_INST; \
3736 case 100: goto REV_INST; \ 3693 case 100: goto BLX_INST; \
3737 case 101: goto BLX_INST; \ 3694 case 101: goto REVSH_INST; \
3738 case 102: goto REVSH_INST; \ 3695 case 102: goto QADD_INST; \
3739 case 103: goto QADD_INST; \ 3696 case 103: goto QADD16_INST; \
3740 case 104: goto QADD16_INST; \ 3697 case 104: goto QADDSUBX_INST; \
3741 case 105: goto QADDSUBX_INST; \ 3698 case 105: goto LDREX_INST; \
3742 case 106: goto LDREX_INST; \ 3699 case 106: goto QDADD_INST; \
3743 case 107: goto QDADD_INST; \ 3700 case 107: goto QDSUB_INST; \
3744 case 108: goto QDSUB_INST; \ 3701 case 108: goto QSUB_INST; \
3745 case 109: goto QSUB_INST; \ 3702 case 109: goto LDREXB_INST; \
3746 case 110: goto LDREXB_INST; \ 3703 case 110: goto QSUB8_INST; \
3747 case 111: goto QSUB8_INST; \ 3704 case 111: goto QSUB16_INST; \
3748 case 112: goto QSUB16_INST; \ 3705 case 112: goto SMUAD_INST; \
3749 case 113: goto SMUAD_INST; \ 3706 case 113: goto SMMUL_INST; \
3750 case 114: goto SMMUL_INST; \ 3707 case 114: goto SMUSD_INST; \
3751 case 115: goto SMUSD_INST; \ 3708 case 115: goto SMLSD_INST; \
3752 case 116: goto SMLSD_INST; \ 3709 case 116: goto SMLSLD_INST; \
3753 case 117: goto SMLSLD_INST; \ 3710 case 117: goto SMMLA_INST; \
3754 case 118: goto SMMLA_INST; \ 3711 case 118: goto SMMLS_INST; \
3755 case 119: goto SMMLS_INST; \ 3712 case 119: goto SMLALD_INST; \
3756 case 120: goto SMLALD_INST; \ 3713 case 120: goto SMLAD_INST; \
3757 case 121: goto SMLAD_INST; \ 3714 case 121: goto SMLAW_INST; \
3758 case 122: goto SMLAW_INST; \ 3715 case 122: goto SMULW_INST; \
3759 case 123: goto SMULW_INST; \ 3716 case 123: goto PKHTB_INST; \
3760 case 124: goto PKHTB_INST; \ 3717 case 124: goto PKHBT_INST; \
3761 case 125: goto PKHBT_INST; \ 3718 case 125: goto SMUL_INST; \
3762 case 126: goto SMUL_INST; \ 3719 case 126: goto SMLALXY_INST; \
3763 case 127: goto SMLALXY_INST; \ 3720 case 127: goto SMLA_INST; \
3764 case 128: goto SMLA_INST; \ 3721 case 128: goto MCRR_INST; \
3765 case 129: goto MCRR_INST; \ 3722 case 129: goto MRRC_INST; \
3766 case 130: goto MRRC_INST; \ 3723 case 130: goto CMP_INST; \
3767 case 131: goto CMP_INST; \ 3724 case 131: goto TST_INST; \
3768 case 132: goto TST_INST; \ 3725 case 132: goto TEQ_INST; \
3769 case 133: goto TEQ_INST; \ 3726 case 133: goto CMN_INST; \
3770 case 134: goto CMN_INST; \ 3727 case 134: goto SMULL_INST; \
3771 case 135: goto SMULL_INST; \ 3728 case 135: goto UMULL_INST; \
3772 case 136: goto UMULL_INST; \ 3729 case 136: goto UMLAL_INST; \
3773 case 137: goto UMLAL_INST; \ 3730 case 137: goto SMLAL_INST; \
3774 case 138: goto SMLAL_INST; \ 3731 case 138: goto MUL_INST; \
3775 case 139: goto MUL_INST; \ 3732 case 139: goto MLA_INST; \
3776 case 140: goto MLA_INST; \ 3733 case 140: goto SSAT_INST; \
3777 case 141: goto SSAT_INST; \ 3734 case 141: goto USAT_INST; \
3778 case 142: goto USAT_INST; \ 3735 case 142: goto MRS_INST; \
3779 case 143: goto MRS_INST; \ 3736 case 143: goto MSR_INST; \
3780 case 144: goto MSR_INST; \ 3737 case 144: goto AND_INST; \
3781 case 145: goto AND_INST; \ 3738 case 145: goto BIC_INST; \
3782 case 146: goto BIC_INST; \ 3739 case 146: goto LDM_INST; \
3783 case 147: goto LDM_INST; \ 3740 case 147: goto EOR_INST; \
3784 case 148: goto EOR_INST; \ 3741 case 148: goto ADD_INST; \
3785 case 149: goto ADD_INST; \ 3742 case 149: goto RSB_INST; \
3786 case 150: goto RSB_INST; \ 3743 case 150: goto RSC_INST; \
3787 case 151: goto RSC_INST; \ 3744 case 151: goto SBC_INST; \
3788 case 152: goto SBC_INST; \ 3745 case 152: goto ADC_INST; \
3789 case 153: goto ADC_INST; \ 3746 case 153: goto SUB_INST; \
3790 case 154: goto SUB_INST; \ 3747 case 154: goto ORR_INST; \
3791 case 155: goto ORR_INST; \ 3748 case 155: goto MVN_INST; \
3792 case 156: goto MVN_INST; \ 3749 case 156: goto MOV_INST; \
3793 case 157: goto MOV_INST; \ 3750 case 157: goto STM_INST; \
3794 case 158: goto STM_INST; \ 3751 case 158: goto LDM_INST; \
3795 case 159: goto LDM_INST; \ 3752 case 159: goto LDRSH_INST; \
3796 case 160: goto LDRSH_INST; \ 3753 case 160: goto STM_INST; \
3797 case 161: goto STM_INST; \ 3754 case 161: goto LDM_INST; \
3798 case 162: goto LDM_INST; \ 3755 case 162: goto LDRSB_INST; \
3799 case 163: goto LDRSB_INST; \ 3756 case 163: goto STRD_INST; \
3800 case 164: goto STRD_INST; \ 3757 case 164: goto LDRH_INST; \
3801 case 165: goto LDRH_INST; \ 3758 case 165: goto STRH_INST; \
3802 case 166: goto STRH_INST; \ 3759 case 166: goto LDRD_INST; \
3803 case 167: goto LDRD_INST; \ 3760 case 167: goto STRT_INST; \
3804 case 168: goto STRT_INST; \ 3761 case 168: goto STRBT_INST; \
3805 case 169: goto STRBT_INST; \ 3762 case 169: goto LDRBT_INST; \
3806 case 170: goto LDRBT_INST; \ 3763 case 170: goto LDRT_INST; \
3807 case 171: goto LDRT_INST; \ 3764 case 171: goto MRC_INST; \
3808 case 172: goto MRC_INST; \ 3765 case 172: goto MCR_INST; \
3809 case 173: goto MCR_INST; \ 3766 case 173: goto MSR_INST; \
3810 case 174: goto MSR_INST; \ 3767 case 174: goto MSR_INST; \
3811 case 175: goto MSR_INST; \ 3768 case 175: goto MSR_INST; \
3812 case 176: goto MSR_INST; \ 3769 case 176: goto MSR_INST; \
3813 case 177: goto MSR_INST; \ 3770 case 177: goto MSR_INST; \
3814 case 178: goto MSR_INST; \ 3771 case 178: goto LDRB_INST; \
3815 case 179: goto LDRB_INST; \ 3772 case 179: goto STRB_INST; \
3816 case 180: goto STRB_INST; \ 3773 case 180: goto LDR_INST; \
3817 case 181: goto LDR_INST; \ 3774 case 181: goto LDRCOND_INST ; \
3818 case 182: goto LDRCOND_INST ; \ 3775 case 182: goto STR_INST; \
3819 case 183: goto STR_INST; \ 3776 case 183: goto CDP_INST; \
3820 case 184: goto CDP_INST; \ 3777 case 184: goto STC_INST; \
3821 case 185: goto STC_INST; \ 3778 case 185: goto LDC_INST; \
3822 case 186: goto LDC_INST; \ 3779 case 186: goto LDREXD_INST; \
3823 case 187: goto LDREXD_INST; \ 3780 case 187: goto STREXD_INST; \
3824 case 188: goto STREXD_INST; \ 3781 case 188: goto LDREXH_INST; \
3825 case 189: goto LDREXH_INST; \ 3782 case 189: goto STREXH_INST; \
3826 case 190: goto STREXH_INST; \ 3783 case 190: goto NOP_INST; \
3827 case 191: goto NOP_INST; \ 3784 case 191: goto YIELD_INST; \
3828 case 192: goto YIELD_INST; \ 3785 case 192: goto WFE_INST; \
3829 case 193: goto WFE_INST; \ 3786 case 193: goto WFI_INST; \
3830 case 194: goto WFI_INST; \ 3787 case 194: goto SEV_INST; \
3831 case 195: goto SEV_INST; \ 3788 case 195: goto SWI_INST; \
3832 case 196: goto SWI_INST; \ 3789 case 196: goto BBL_INST; \
3833 case 197: goto BBL_INST; \ 3790 case 197: goto B_2_THUMB ; \
3834 case 198: goto B_2_THUMB ; \ 3791 case 198: goto B_COND_THUMB ; \
3835 case 199: goto B_COND_THUMB ; \ 3792 case 199: goto BL_1_THUMB ; \
3836 case 200: goto BL_1_THUMB ; \ 3793 case 200: goto BL_2_THUMB ; \
3837 case 201: goto BL_2_THUMB ; \ 3794 case 201: goto BLX_1_THUMB ; \
3838 case 202: goto BLX_1_THUMB ; \ 3795 case 202: goto DISPATCH; \
3839 case 203: goto DISPATCH; \ 3796 case 203: goto INIT_INST_LENGTH; \
3840 case 204: goto INIT_INST_LENGTH; \ 3797 case 204: goto END; \
3841 case 205: goto END; \
3842 } 3798 }
3843#endif 3799#endif
3844 3800
@@ -3865,7 +3821,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
3865 // to a clunky switch statement. 3821 // to a clunky switch statement.
3866#if defined __GNUC__ || defined __clang__ 3822#if defined __GNUC__ || defined __clang__
3867 void *InstLabel[] = { 3823 void *InstLabel[] = {
3868 &&VMLA_INST, &&VMLS_INST, &&VNMLA_INST, &&VNMLA_INST, &&VNMLS_INST, &&VNMUL_INST, &&VMUL_INST, &&VADD_INST, &&VSUB_INST, 3824 &&VMLA_INST, &&VMLS_INST, &&VNMLA_INST, &&VNMLS_INST, &&VNMUL_INST, &&VMUL_INST, &&VADD_INST, &&VSUB_INST,
3869 &&VDIV_INST, &&VMOVI_INST, &&VMOVR_INST, &&VABS_INST, &&VNEG_INST, &&VSQRT_INST, &&VCMP_INST, &&VCMP2_INST, &&VCVTBDS_INST, 3825 &&VDIV_INST, &&VMOVI_INST, &&VMOVR_INST, &&VABS_INST, &&VNEG_INST, &&VSQRT_INST, &&VCMP_INST, &&VCMP2_INST, &&VCVTBDS_INST,
3870 &&VCVTBFF_INST, &&VCVTBFI_INST, &&VMOVBRS_INST, &&VMSR_INST, &&VMOVBRC_INST, &&VMRS_INST, &&VMOVBCR_INST, &&VMOVBRRSS_INST, 3826 &&VCVTBFF_INST, &&VCVTBFI_INST, &&VMOVBRS_INST, &&VMSR_INST, &&VMOVBRC_INST, &&VMRS_INST, &&VMOVBCR_INST, &&VMOVBRRSS_INST,
3871 &&VMOVBRRD_INST, &&VSTR_INST, &&VPUSH_INST, &&VSTM_INST, &&VPOP_INST, &&VLDR_INST, &&VLDM_INST, 3827 &&VMOVBRRD_INST, &&VSTR_INST, &&VPUSH_INST, &&VSTM_INST, &&VPOP_INST, &&VLDR_INST, &&VLDM_INST,
@@ -4477,11 +4433,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4477 inst_cream->get_addr(cpu, inst_cream->inst, addr); 4433 inst_cream->get_addr(cpu, inst_cream->inst, addr);
4478 4434
4479 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory8(addr); 4435 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory8(addr);
4480
4481 if (BITS(inst_cream->inst, 12, 15) == 15) {
4482 INC_PC(sizeof(ldst_inst));
4483 goto DISPATCH;
4484 }
4485 } 4436 }
4486 cpu->Reg[15] += cpu->GetInstructionSize(); 4437 cpu->Reg[15] += cpu->GetInstructionSize();
4487 INC_PC(sizeof(ldst_inst)); 4438 INC_PC(sizeof(ldst_inst));
@@ -4494,12 +4445,14 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4494 ldst_inst* inst_cream = (ldst_inst*)inst_base->component; 4445 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
4495 inst_cream->get_addr(cpu, inst_cream->inst, addr); 4446 inst_cream->get_addr(cpu, inst_cream->inst, addr);
4496 4447
4497 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory8(addr); 4448 const u32 dest_index = BITS(inst_cream->inst, 12, 15);
4449 const u32 previous_mode = cpu->Mode;
4498 4450
4499 if (BITS(inst_cream->inst, 12, 15) == 15) { 4451 cpu->ChangePrivilegeMode(USER32MODE);
4500 INC_PC(sizeof(ldst_inst)); 4452 const u8 value = cpu->ReadMemory8(addr);
4501 goto DISPATCH; 4453 cpu->ChangePrivilegeMode(previous_mode);
4502 } 4454
4455 cpu->Reg[dest_index] = value;
4503 } 4456 }
4504 cpu->Reg[15] += cpu->GetInstructionSize(); 4457 cpu->Reg[15] += cpu->GetInstructionSize();
4505 INC_PC(sizeof(ldst_inst)); 4458 INC_PC(sizeof(ldst_inst));
@@ -4535,10 +4488,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4535 cpu->SetExclusiveMemoryAddress(read_addr); 4488 cpu->SetExclusiveMemoryAddress(read_addr);
4536 4489
4537 RD = cpu->ReadMemory32(read_addr); 4490 RD = cpu->ReadMemory32(read_addr);
4538 if (inst_cream->Rd == 15) {
4539 INC_PC(sizeof(generic_arm_inst));
4540 goto DISPATCH;
4541 }
4542 } 4491 }
4543 cpu->Reg[15] += cpu->GetInstructionSize(); 4492 cpu->Reg[15] += cpu->GetInstructionSize();
4544 INC_PC(sizeof(generic_arm_inst)); 4493 INC_PC(sizeof(generic_arm_inst));
@@ -4554,10 +4503,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4554 cpu->SetExclusiveMemoryAddress(read_addr); 4503 cpu->SetExclusiveMemoryAddress(read_addr);
4555 4504
4556 RD = cpu->ReadMemory8(read_addr); 4505 RD = cpu->ReadMemory8(read_addr);
4557 if (inst_cream->Rd == 15) {
4558 INC_PC(sizeof(generic_arm_inst));
4559 goto DISPATCH;
4560 }
4561 } 4506 }
4562 cpu->Reg[15] += cpu->GetInstructionSize(); 4507 cpu->Reg[15] += cpu->GetInstructionSize();
4563 INC_PC(sizeof(generic_arm_inst)); 4508 INC_PC(sizeof(generic_arm_inst));
@@ -4573,10 +4518,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4573 cpu->SetExclusiveMemoryAddress(read_addr); 4518 cpu->SetExclusiveMemoryAddress(read_addr);
4574 4519
4575 RD = cpu->ReadMemory16(read_addr); 4520 RD = cpu->ReadMemory16(read_addr);
4576 if (inst_cream->Rd == 15) {
4577 INC_PC(sizeof(generic_arm_inst));
4578 goto DISPATCH;
4579 }
4580 } 4521 }
4581 cpu->Reg[15] += cpu->GetInstructionSize(); 4522 cpu->Reg[15] += cpu->GetInstructionSize();
4582 INC_PC(sizeof(generic_arm_inst)); 4523 INC_PC(sizeof(generic_arm_inst));
@@ -4593,11 +4534,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4593 4534
4594 RD = cpu->ReadMemory32(read_addr); 4535 RD = cpu->ReadMemory32(read_addr);
4595 RD2 = cpu->ReadMemory32(read_addr + 4); 4536 RD2 = cpu->ReadMemory32(read_addr + 4);
4596
4597 if (inst_cream->Rd == 15) {
4598 INC_PC(sizeof(generic_arm_inst));
4599 goto DISPATCH;
4600 }
4601 } 4537 }
4602 cpu->Reg[15] += cpu->GetInstructionSize(); 4538 cpu->Reg[15] += cpu->GetInstructionSize();
4603 INC_PC(sizeof(generic_arm_inst)); 4539 INC_PC(sizeof(generic_arm_inst));
@@ -4611,10 +4547,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4611 inst_cream->get_addr(cpu, inst_cream->inst, addr); 4547 inst_cream->get_addr(cpu, inst_cream->inst, addr);
4612 4548
4613 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory16(addr); 4549 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory16(addr);
4614 if (BITS(inst_cream->inst, 12, 15) == 15) {
4615 INC_PC(sizeof(ldst_inst));
4616 goto DISPATCH;
4617 }
4618 } 4550 }
4619 cpu->Reg[15] += cpu->GetInstructionSize(); 4551 cpu->Reg[15] += cpu->GetInstructionSize();
4620 INC_PC(sizeof(ldst_inst)); 4552 INC_PC(sizeof(ldst_inst));
@@ -4631,10 +4563,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4631 value |= 0xffffff00; 4563 value |= 0xffffff00;
4632 } 4564 }
4633 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; 4565 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value;
4634 if (BITS(inst_cream->inst, 12, 15) == 15) {
4635 INC_PC(sizeof(ldst_inst));
4636 goto DISPATCH;
4637 }
4638 } 4566 }
4639 cpu->Reg[15] += cpu->GetInstructionSize(); 4567 cpu->Reg[15] += cpu->GetInstructionSize();
4640 INC_PC(sizeof(ldst_inst)); 4568 INC_PC(sizeof(ldst_inst));
@@ -4652,10 +4580,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4652 value |= 0xffff0000; 4580 value |= 0xffff0000;
4653 } 4581 }
4654 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; 4582 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value;
4655 if (BITS(inst_cream->inst, 12, 15) == 15) {
4656 INC_PC(sizeof(ldst_inst));
4657 goto DISPATCH;
4658 }
4659 } 4583 }
4660 cpu->Reg[15] += cpu->GetInstructionSize(); 4584 cpu->Reg[15] += cpu->GetInstructionSize();
4661 INC_PC(sizeof(ldst_inst)); 4585 INC_PC(sizeof(ldst_inst));
@@ -4668,13 +4592,14 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4668 ldst_inst* inst_cream = (ldst_inst*)inst_base->component; 4592 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
4669 inst_cream->get_addr(cpu, inst_cream->inst, addr); 4593 inst_cream->get_addr(cpu, inst_cream->inst, addr);
4670 4594
4671 unsigned int value = cpu->ReadMemory32(addr); 4595 const u32 dest_index = BITS(inst_cream->inst, 12, 15);
4672 cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; 4596 const u32 previous_mode = cpu->Mode;
4673 4597
4674 if (BITS(inst_cream->inst, 12, 15) == 15) { 4598 cpu->ChangePrivilegeMode(USER32MODE);
4675 INC_PC(sizeof(ldst_inst)); 4599 const u32 value = cpu->ReadMemory32(addr);
4676 goto DISPATCH; 4600 cpu->ChangePrivilegeMode(previous_mode);
4677 } 4601
4602 cpu->Reg[dest_index] = value;
4678 } 4603 }
4679 cpu->Reg[15] += cpu->GetInstructionSize(); 4604 cpu->Reg[15] += cpu->GetInstructionSize();
4680 INC_PC(sizeof(ldst_inst)); 4605 INC_PC(sizeof(ldst_inst));
@@ -4731,10 +4656,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4731 UPDATE_NFLAG(RD); 4656 UPDATE_NFLAG(RD);
4732 UPDATE_ZFLAG(RD); 4657 UPDATE_ZFLAG(RD);
4733 } 4658 }
4734 if (inst_cream->Rd == 15) {
4735 INC_PC(sizeof(mla_inst));
4736 goto DISPATCH;
4737 }
4738 } 4659 }
4739 cpu->Reg[15] += cpu->GetInstructionSize(); 4660 cpu->Reg[15] += cpu->GetInstructionSize();
4740 INC_PC(sizeof(mla_inst)); 4661 INC_PC(sizeof(mla_inst));
@@ -4773,18 +4694,15 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4773 if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { 4694 if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) {
4774 mrc_inst* inst_cream = (mrc_inst*)inst_base->component; 4695 mrc_inst* inst_cream = (mrc_inst*)inst_base->component;
4775 4696
4776 unsigned int inst = inst_cream->inst; 4697 if (inst_cream->cp_num == 15) {
4777 if (inst_cream->Rd == 15) { 4698 const uint32_t value = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2);
4778 DEBUG_MSG; 4699
4779 } 4700 if (inst_cream->Rd == 15) {
4780 if (inst_cream->inst == 0xeef04a10) { 4701 cpu->Cpsr = (cpu->Cpsr & ~0xF0000000) | (value & 0xF0000000);
4781 // Undefined instruction fmrx 4702 LOAD_NZCVT;
4782 RD = 0x20000000; 4703 } else {
4783 CITRA_IGNORE_EXIT(-1); 4704 RD = value;
4784 goto END; 4705 }
4785 } else {
4786 if (inst_cream->cp_num == 15)
4787 RD = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2);
4788 } 4706 }
4789 } 4707 }
4790 cpu->Reg[15] += cpu->GetInstructionSize(); 4708 cpu->Reg[15] += cpu->GetInstructionSize();
@@ -4883,10 +4801,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
4883 UPDATE_NFLAG(RD); 4801 UPDATE_NFLAG(RD);
4884 UPDATE_ZFLAG(RD); 4802 UPDATE_ZFLAG(RD);
4885 } 4803 }
4886 if (inst_cream->Rd == 15) {
4887 INC_PC(sizeof(mul_inst));
4888 goto DISPATCH;
4889 }
4890 } 4804 }
4891 cpu->Reg[15] += cpu->GetInstructionSize(); 4805 cpu->Reg[15] += cpu->GetInstructionSize();
4892 INC_PC(sizeof(mul_inst)); 4806 INC_PC(sizeof(mul_inst));
@@ -6061,8 +5975,13 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
6061 if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { 5975 if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) {
6062 ldst_inst* inst_cream = (ldst_inst*)inst_base->component; 5976 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
6063 inst_cream->get_addr(cpu, inst_cream->inst, addr); 5977 inst_cream->get_addr(cpu, inst_cream->inst, addr);
6064 unsigned int value = cpu->Reg[BITS(inst_cream->inst, 12, 15)] & 0xff; 5978
5979 const u32 previous_mode = cpu->Mode;
5980 const u32 value = cpu->Reg[BITS(inst_cream->inst, 12, 15)] & 0xff;
5981
5982 cpu->ChangePrivilegeMode(USER32MODE);
6065 cpu->WriteMemory8(addr, value); 5983 cpu->WriteMemory8(addr, value);
5984 cpu->ChangePrivilegeMode(previous_mode);
6066 } 5985 }
6067 cpu->Reg[15] += cpu->GetInstructionSize(); 5986 cpu->Reg[15] += cpu->GetInstructionSize();
6068 INC_PC(sizeof(ldst_inst)); 5987 INC_PC(sizeof(ldst_inst));
@@ -6196,8 +6115,16 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
6196 ldst_inst* inst_cream = (ldst_inst*)inst_base->component; 6115 ldst_inst* inst_cream = (ldst_inst*)inst_base->component;
6197 inst_cream->get_addr(cpu, inst_cream->inst, addr); 6116 inst_cream->get_addr(cpu, inst_cream->inst, addr);
6198 6117
6199 unsigned int value = cpu->Reg[BITS(inst_cream->inst, 12, 15)]; 6118 const u32 previous_mode = cpu->Mode;
6119 const u32 rt_index = BITS(inst_cream->inst, 12, 15);
6120
6121 u32 value = cpu->Reg[rt_index];
6122 if (rt_index == 15)
6123 value += 2 * cpu->GetInstructionSize();
6124
6125 cpu->ChangePrivilegeMode(USER32MODE);
6200 cpu->WriteMemory32(addr, value); 6126 cpu->WriteMemory32(addr, value);
6127 cpu->ChangePrivilegeMode(previous_mode);
6201 } 6128 }
6202 cpu->Reg[15] += cpu->GetInstructionSize(); 6129 cpu->Reg[15] += cpu->GetInstructionSize();
6203 INC_PC(sizeof(ldst_inst)); 6130 INC_PC(sizeof(ldst_inst));
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 219b03af4..453c7162d 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -2,6 +2,9 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <memory>
6
7#include "common/make_unique.h"
5#include "common/logging/log.h" 8#include "common/logging/log.h"
6 9
7#include "core/core.h" 10#include "core/core.h"
@@ -17,8 +20,8 @@
17 20
18namespace Core { 21namespace Core {
19 22
20ARM_Interface* g_app_core = nullptr; ///< ARM11 application core 23std::unique_ptr<ARM_Interface> g_app_core; ///< ARM11 application core
21ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core 24std::unique_ptr<ARM_Interface> g_sys_core; ///< ARM11 system (OS) core
22 25
23/// Run the core CPU loop 26/// Run the core CPU loop
24void RunLoop(int tight_loop) { 27void RunLoop(int tight_loop) {
@@ -71,16 +74,16 @@ void Stop() {
71 74
72/// Initialize the core 75/// Initialize the core
73int Init() { 76int Init() {
74 g_sys_core = new ARM_DynCom(USER32MODE); 77 g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE);
75 g_app_core = new ARM_DynCom(USER32MODE); 78 g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE);
76 79
77 LOG_DEBUG(Core, "Initialized OK"); 80 LOG_DEBUG(Core, "Initialized OK");
78 return 0; 81 return 0;
79} 82}
80 83
81void Shutdown() { 84void Shutdown() {
82 delete g_app_core; 85 g_app_core.reset();
83 delete g_sys_core; 86 g_sys_core.reset();
84 87
85 LOG_DEBUG(Core, "Shutdown OK"); 88 LOG_DEBUG(Core, "Shutdown OK");
86} 89}
diff --git a/src/core/core.h b/src/core/core.h
index 491230a74..453e0a5f0 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory>
7#include "common/common_types.h" 8#include "common/common_types.h"
8 9
9class ARM_Interface; 10class ARM_Interface;
@@ -23,8 +24,8 @@ struct ThreadContext {
23 u32 fpexc; 24 u32 fpexc;
24}; 25};
25 26
26extern ARM_Interface* g_app_core; ///< ARM11 application core 27extern std::unique_ptr<ARM_Interface> g_app_core; ///< ARM11 application core
27extern ARM_Interface* g_sys_core; ///< ARM11 system (OS) core 28extern std::unique_ptr<ARM_Interface> g_sys_core; ///< ARM11 system (OS) core
28 29
29//////////////////////////////////////////////////////////////////////////////////////////////////// 30////////////////////////////////////////////////////////////////////////////////////////////////////
30 31
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 195286422..5c3c47acf 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -45,30 +45,32 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address,
45 45
46 // Wait current thread (acquire the arbiter)... 46 // Wait current thread (acquire the arbiter)...
47 case ArbitrationType::WaitIfLessThan: 47 case ArbitrationType::WaitIfLessThan:
48 if ((s32)Memory::Read32(address) <= value) { 48 if ((s32)Memory::Read32(address) < value) {
49 Kernel::WaitCurrentThread_ArbitrateAddress(address); 49 Kernel::WaitCurrentThread_ArbitrateAddress(address);
50 } 50 }
51 break; 51 break;
52 case ArbitrationType::WaitIfLessThanWithTimeout: 52 case ArbitrationType::WaitIfLessThanWithTimeout:
53 if ((s32)Memory::Read32(address) <= value) { 53 if ((s32)Memory::Read32(address) < value) {
54 Kernel::WaitCurrentThread_ArbitrateAddress(address); 54 Kernel::WaitCurrentThread_ArbitrateAddress(address);
55 GetCurrentThread()->WakeAfterDelay(nanoseconds); 55 GetCurrentThread()->WakeAfterDelay(nanoseconds);
56 } 56 }
57 break; 57 break;
58 case ArbitrationType::DecrementAndWaitIfLessThan: 58 case ArbitrationType::DecrementAndWaitIfLessThan:
59 { 59 {
60 s32 memory_value = Memory::Read32(address) - 1; 60 s32 memory_value = Memory::Read32(address);
61 Memory::Write32(address, memory_value); 61 if (memory_value < value) {
62 if (memory_value <= value) { 62 // Only change the memory value if the thread should wait
63 Memory::Write32(address, (s32)memory_value - 1);
63 Kernel::WaitCurrentThread_ArbitrateAddress(address); 64 Kernel::WaitCurrentThread_ArbitrateAddress(address);
64 } 65 }
65 break; 66 break;
66 } 67 }
67 case ArbitrationType::DecrementAndWaitIfLessThanWithTimeout: 68 case ArbitrationType::DecrementAndWaitIfLessThanWithTimeout:
68 { 69 {
69 s32 memory_value = Memory::Read32(address) - 1; 70 s32 memory_value = Memory::Read32(address);
70 Memory::Write32(address, memory_value); 71 if (memory_value < value) {
71 if (memory_value <= value) { 72 // Only change the memory value if the thread should wait
73 Memory::Write32(address, (s32)memory_value - 1);
72 Kernel::WaitCurrentThread_ArbitrateAddress(address); 74 Kernel::WaitCurrentThread_ArbitrateAddress(address);
73 GetCurrentThread()->WakeAfterDelay(nanoseconds); 75 GetCurrentThread()->WakeAfterDelay(nanoseconds);
74 } 76 }
@@ -82,6 +84,13 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address,
82 84
83 HLE::Reschedule(__func__); 85 HLE::Reschedule(__func__);
84 86
87 // The calls that use a timeout seem to always return a Timeout error even if they did not put the thread to sleep
88 if (type == ArbitrationType::WaitIfLessThanWithTimeout ||
89 type == ArbitrationType::DecrementAndWaitIfLessThanWithTimeout) {
90
91 return ResultCode(ErrorDescription::Timeout, ErrorModule::OS,
92 ErrorSummary::StatusChanged, ErrorLevel::Info);
93 }
85 return RESULT_SUCCESS; 94 return RESULT_SUCCESS;
86} 95}
87 96
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index c08fc1c7a..bf32f653d 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -300,7 +300,7 @@ static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) {
300 300
301 thread->waitsynch_waited = false; 301 thread->waitsynch_waited = false;
302 302
303 if (thread->status == THREADSTATUS_WAIT_SYNCH) { 303 if (thread->status == THREADSTATUS_WAIT_SYNCH || thread->status == THREADSTATUS_WAIT_ARB) {
304 thread->SetWaitSynchronizationResult(ResultCode(ErrorDescription::Timeout, ErrorModule::OS, 304 thread->SetWaitSynchronizationResult(ResultCode(ErrorDescription::Timeout, ErrorModule::OS,
305 ErrorSummary::StatusChanged, ErrorLevel::Info)); 305 ErrorSummary::StatusChanged, ErrorLevel::Info));
306 306
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 08b3ea8c0..ce6bbd719 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -42,6 +42,9 @@ bool Timer::ShouldWait() {
42 42
43void Timer::Acquire() { 43void Timer::Acquire() {
44 ASSERT_MSG( !ShouldWait(), "object unavailable!"); 44 ASSERT_MSG( !ShouldWait(), "object unavailable!");
45
46 if (reset_type == RESETTYPE_ONESHOT)
47 signaled = false;
45} 48}
46 49
47void Timer::Set(s64 initial, s64 interval) { 50void Timer::Set(s64 initial, s64 interval) {
@@ -84,9 +87,6 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
84 // Resume all waiting threads 87 // Resume all waiting threads
85 timer->WakeupAllWaitingThreads(); 88 timer->WakeupAllWaitingThreads();
86 89
87 if (timer->reset_type == RESETTYPE_ONESHOT)
88 timer->signaled = false;
89
90 if (timer->interval_delay != 0) { 90 if (timer->interval_delay != 0) {
91 // Reschedule the timer with the interval delay 91 // Reschedule the timer with the interval delay
92 u64 interval_microseconds = timer->interval_delay / 1000; 92 u64 interval_microseconds = timer->interval_delay / 1000;
diff --git a/src/core/hle/service/act_u.cpp b/src/core/hle/service/act_u.cpp
index 57f49c91f..bbe8e1625 100644
--- a/src/core/hle/service/act_u.cpp
+++ b/src/core/hle/service/act_u.cpp
@@ -10,14 +10,15 @@
10 10
11namespace ACT_U { 11namespace ACT_U {
12 12
13// Empty arrays are illegal -- commented out until an entry is added. 13const Interface::FunctionInfo FunctionTable[] = {
14//const Interface::FunctionInfo FunctionTable[] = { }; 14 {0x000600C2, nullptr, "GetAccountDataBlock"},
15};
15 16
16//////////////////////////////////////////////////////////////////////////////////////////////////// 17////////////////////////////////////////////////////////////////////////////////////////////////////
17// Interface class 18// Interface class
18 19
19Interface::Interface() { 20Interface::Interface() {
20 //Register(FunctionTable); 21 Register(FunctionTable);
21} 22}
22 23
23} // namespace 24} // namespace
diff --git a/src/core/hle/service/am/am_net.cpp b/src/core/hle/service/am/am_net.cpp
index aa391f3b2..7515a4e6e 100644
--- a/src/core/hle/service/am/am_net.cpp
+++ b/src/core/hle/service/am/am_net.cpp
@@ -10,6 +10,36 @@ namespace Service {
10namespace AM { 10namespace AM {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
14 {0x00020082, GetTitleIDList, "GetTitleIDList"},
15 {0x00030084, nullptr, "ListTitles"},
16 {0x000400C0, nullptr, "DeleteApplicationTitle"},
17 {0x000500C0, nullptr, "GetTitleProductCode"},
18 {0x00080000, nullptr, "TitleIDListGetTotal3"},
19 {0x00090082, nullptr, "GetTitleIDList3"},
20 {0x000A0000, nullptr, "GetDeviceID"},
21 {0x000D0084, nullptr, "ListTitles2"},
22 {0x00140040, nullptr, "FinishInstallToMedia"},
23 {0x00180080, nullptr, "InitializeTitleDatabase"},
24 {0x00190040, nullptr, "ReloadDBS"},
25 {0x001A00C0, nullptr, "GetDSiWareExportSize"},
26 {0x001B0144, nullptr, "ExportDSiWare"},
27 {0x001C0084, nullptr, "ImportDSiWare"},
28 {0x00230080, nullptr, "TitleIDListGetTotal2"},
29 {0x002400C2, nullptr, "GetTitleIDList2"},
30 {0x04010080, nullptr, "InstallFIRM"},
31 {0x04020040, nullptr, "StartInstallCIADB0"},
32 {0x04030000, nullptr, "StartInstallCIADB1"},
33 {0x04040002, nullptr, "AbortCIAInstall"},
34 {0x04050002, nullptr, "CloseCIAFinalizeInstall"},
35 {0x04060002, nullptr, "CloseCIA"},
36 {0x040700C2, nullptr, "FinalizeTitlesInstall"},
37 {0x04080042, nullptr, "GetCiaFileInfo"},
38 {0x040E00C2, nullptr, "InstallTitlesFinish"},
39 {0x040F0000, nullptr, "InstallNATIVEFIRM"},
40 {0x041000C0, nullptr, "DeleteTitle"},
41 {0x04120000, nullptr, "Initialize"},
42 {0x041700C0, nullptr, "MigrateAGBtoSAV"},
13 {0x08010000, nullptr, "OpenTicket"}, 43 {0x08010000, nullptr, "OpenTicket"},
14 {0x08020002, nullptr, "TicketAbortInstall"}, 44 {0x08020002, nullptr, "TicketAbortInstall"},
15 {0x08030002, nullptr, "TicketFinalizeInstall"}, 45 {0x08030002, nullptr, "TicketFinalizeInstall"},
diff --git a/src/core/hle/service/am/am_sys.cpp b/src/core/hle/service/am/am_sys.cpp
index 864fc14df..715b7b55d 100644
--- a/src/core/hle/service/am/am_sys.cpp
+++ b/src/core/hle/service/am/am_sys.cpp
@@ -12,6 +12,21 @@ namespace AM {
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"}, 13 {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
14 {0x00020082, GetTitleIDList, "GetTitleIDList"}, 14 {0x00020082, GetTitleIDList, "GetTitleIDList"},
15 {0x00030084, nullptr, "ListTitles"},
16 {0x000400C0, nullptr, "DeleteApplicationTitle"},
17 {0x000500C0, nullptr, "GetTitleProductCode"},
18 {0x00080000, nullptr, "TitleIDListGetTotal3"},
19 {0x00090082, nullptr, "GetTitleIDList3"},
20 {0x000A0000, nullptr, "GetDeviceID"},
21 {0x000D0084, nullptr, "ListTitles2"},
22 {0x00140040, nullptr, "FinishInstallToMedia"},
23 {0x00180080, nullptr, "InitializeTitleDatabase"},
24 {0x00190040, nullptr, "ReloadDBS"},
25 {0x001A00C0, nullptr, "GetDSiWareExportSize"},
26 {0x001B0144, nullptr, "ExportDSiWare"},
27 {0x001C0084, nullptr, "ImportDSiWare"},
28 {0x00230080, nullptr, "TitleIDListGetTotal2"},
29 {0x002400C2, nullptr, "GetTitleIDList2"}
15}; 30};
16 31
17AM_SYS_Interface::AM_SYS_Interface() { 32AM_SYS_Interface::AM_SYS_Interface() {
diff --git a/src/core/hle/service/am/am_u.cpp b/src/core/hle/service/am/am_u.cpp
index 6bf84b36b..b1e1ea5e4 100644
--- a/src/core/hle/service/am/am_u.cpp
+++ b/src/core/hle/service/am/am_u.cpp
@@ -12,6 +12,34 @@ namespace AM {
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"}, 13 {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
14 {0x00020082, GetTitleIDList, "GetTitleIDList"}, 14 {0x00020082, GetTitleIDList, "GetTitleIDList"},
15 {0x00030084, nullptr, "ListTitles"},
16 {0x000400C0, nullptr, "DeleteApplicationTitle"},
17 {0x000500C0, nullptr, "GetTitleProductCode"},
18 {0x00080000, nullptr, "TitleIDListGetTotal3"},
19 {0x00090082, nullptr, "GetTitleIDList3"},
20 {0x000A0000, nullptr, "GetDeviceID"},
21 {0x000D0084, nullptr, "ListTitles2"},
22 {0x00140040, nullptr, "FinishInstallToMedia"},
23 {0x00180080, nullptr, "InitializeTitleDatabase"},
24 {0x00190040, nullptr, "ReloadDBS"},
25 {0x001A00C0, nullptr, "GetDSiWareExportSize"},
26 {0x001B0144, nullptr, "ExportDSiWare"},
27 {0x001C0084, nullptr, "ImportDSiWare"},
28 {0x00230080, nullptr, "TitleIDListGetTotal2"},
29 {0x002400C2, nullptr, "GetTitleIDList2"},
30 {0x04010080, nullptr, "InstallFIRM"},
31 {0x04020040, nullptr, "StartInstallCIADB0"},
32 {0x04030000, nullptr, "StartInstallCIADB1"},
33 {0x04040002, nullptr, "AbortCIAInstall"},
34 {0x04050002, nullptr, "CloseCIAFinalizeInstall"},
35 {0x04060002, nullptr, "CloseCIA"},
36 {0x040700C2, nullptr, "FinalizeTitlesInstall"},
37 {0x04080042, nullptr, "GetCiaFileInfo"},
38 {0x040E00C2, nullptr, "InstallTitlesFinish"},
39 {0x040F0000, nullptr, "InstallNATIVEFIRM"},
40 {0x041000C0, nullptr, "DeleteTitle"},
41 {0x04120000, nullptr, "Initialize"},
42 {0x041700C0, nullptr, "MigrateAGBtoSAV"}
15}; 43};
16 44
17AM_U_Interface::AM_U_Interface() { 45AM_U_Interface::AM_U_Interface() {
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp
index 3ac6ff94f..e5fd9165c 100644
--- a/src/core/hle/service/apt/apt_s.cpp
+++ b/src/core/hle/service/apt/apt_s.cpp
@@ -91,6 +91,12 @@ const Interface::FunctionInfo FunctionTable[] = {
91 {0x004E0000, nullptr, "HardwareResetAsync"}, 91 {0x004E0000, nullptr, "HardwareResetAsync"},
92 {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"}, 92 {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"},
93 {0x00500040, nullptr, "GetApplicationCpuTimeLimit"}, 93 {0x00500040, nullptr, "GetApplicationCpuTimeLimit"},
94 {0x00510080, nullptr, "GetStartupArgument"},
95 {0x00520104, nullptr, "Wrap1"},
96 {0x00530104, nullptr, "Unwrap1"},
97 {0x00580002, nullptr, "GetProgramID"},
98 {0x01010000, nullptr, "CheckNew3DSApp"},
99 {0x01020000, nullptr, "CheckNew3DS"}
94}; 100};
95 101
96APT_S_Interface::APT_S_Interface() { 102APT_S_Interface::APT_S_Interface() {
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp
index 146bfd595..aba627f54 100644
--- a/src/core/hle/service/apt/apt_u.cpp
+++ b/src/core/hle/service/apt/apt_u.cpp
@@ -92,6 +92,12 @@ const Interface::FunctionInfo FunctionTable[] = {
92 {0x004E0000, nullptr, "HardwareResetAsync"}, 92 {0x004E0000, nullptr, "HardwareResetAsync"},
93 {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, 93 {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
94 {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, 94 {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
95 {0x00510080, nullptr, "GetStartupArgument"},
96 {0x00520104, nullptr, "Wrap1"},
97 {0x00530104, nullptr, "Unwrap1"},
98 {0x00580002, nullptr, "GetProgramID"},
99 {0x01010000, nullptr, "CheckNew3DSApp"},
100 {0x01020000, nullptr, "CheckNew3DS"}
95}; 101};
96 102
97APT_U_Interface::APT_U_Interface() { 103APT_U_Interface::APT_U_Interface() {
diff --git a/src/core/hle/service/boss/boss_u.cpp b/src/core/hle/service/boss/boss_u.cpp
index ed978b963..9f17711bb 100644
--- a/src/core/hle/service/boss/boss_u.cpp
+++ b/src/core/hle/service/boss/boss_u.cpp
@@ -11,6 +11,9 @@ namespace BOSS {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00020100, nullptr, "GetStorageInfo"}, 13 {0x00020100, nullptr, "GetStorageInfo"},
14 {0x000C0082, nullptr, "UnregisterTask"},
15 {0x001E0042, nullptr, "CancelTask"},
16 {0x00330042, nullptr, "StartBgImmediate"},
14}; 17};
15 18
16BOSS_U_Interface::BOSS_U_Interface() { 19BOSS_U_Interface::BOSS_U_Interface() {
diff --git a/src/core/hle/service/cam/cam_u.cpp b/src/core/hle/service/cam/cam_u.cpp
index 55083e0c7..1c292ea23 100644
--- a/src/core/hle/service/cam/cam_u.cpp
+++ b/src/core/hle/service/cam/cam_u.cpp
@@ -54,12 +54,17 @@ const Interface::FunctionInfo FunctionTable[] = {
54 {0x002A0080, nullptr, "GetLatestVsyncTiming"}, 54 {0x002A0080, nullptr, "GetLatestVsyncTiming"},
55 {0x002B0000, nullptr, "GetStereoCameraCalibrationData"}, 55 {0x002B0000, nullptr, "GetStereoCameraCalibrationData"},
56 {0x002C0400, nullptr, "SetStereoCameraCalibrationData"}, 56 {0x002C0400, nullptr, "SetStereoCameraCalibrationData"},
57 {0x002D00C0, nullptr, "WriteRegisterI2c"},
58 {0x002E00C0, nullptr, "WriteMcuVariableI2c"},
59 {0x002F0080, nullptr, "ReadRegisterI2cExclusive"},
60 {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"},
57 {0x00310180, nullptr, "SetImageQualityCalibrationData"}, 61 {0x00310180, nullptr, "SetImageQualityCalibrationData"},
58 {0x00320000, nullptr, "GetImageQualityCalibrationData"}, 62 {0x00320000, nullptr, "GetImageQualityCalibrationData"},
59 {0x003302C0, nullptr, "SetPackageParameterWithoutContext"}, 63 {0x003302C0, nullptr, "SetPackageParameterWithoutContext"},
60 {0x00340140, nullptr, "SetPackageParameterWithContext"}, 64 {0x00340140, nullptr, "SetPackageParameterWithContext"},
61 {0x003501C0, nullptr, "SetPackageParameterWithContextDetail"}, 65 {0x003501C0, nullptr, "SetPackageParameterWithContextDetail"},
62 {0x00360000, nullptr, "GetSuitableY2rStandardCoefficient"}, 66 {0x00360000, nullptr, "GetSuitableY2rStandardCoefficient"},
67 {0x00370202, nullptr, "PlayShutterSoundWithWave"},
63 {0x00380040, nullptr, "PlayShutterSound"}, 68 {0x00380040, nullptr, "PlayShutterSound"},
64 {0x00390000, nullptr, "DriverInitialize"}, 69 {0x00390000, nullptr, "DriverInitialize"},
65 {0x003A0000, nullptr, "DriverFinalize"}, 70 {0x003A0000, nullptr, "DriverFinalize"},
diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp
index 669659510..6318bf2a7 100644
--- a/src/core/hle/service/csnd_snd.cpp
+++ b/src/core/hle/service/csnd_snd.cpp
@@ -22,9 +22,10 @@ const Interface::FunctionInfo FunctionTable[] = {
22 {0x00060000, nullptr, "ReleaseSoundChannels"}, 22 {0x00060000, nullptr, "ReleaseSoundChannels"},
23 {0x00070000, nullptr, "AcquireCaptureDevice"}, 23 {0x00070000, nullptr, "AcquireCaptureDevice"},
24 {0x00080040, nullptr, "ReleaseCaptureDevice"}, 24 {0x00080040, nullptr, "ReleaseCaptureDevice"},
25 {0x00090082, nullptr, "FlushDCache"}, 25 {0x00090082, nullptr, "FlushDataCache"},
26 {0x000A0082, nullptr, "StoreDCache"}, 26 {0x000A0082, nullptr, "StoreDataCache"},
27 {0x000B0082, nullptr, "InvalidateDCache"}, 27 {0x000B0082, nullptr, "InvalidateDataCache"},
28 {0x000C0000, nullptr, "Reset"},
28}; 29};
29 30
30//////////////////////////////////////////////////////////////////////////////////////////////////// 31////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index ce5619069..d6b8d1318 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -150,13 +150,13 @@ static void RegisterInterruptEvents(Service::Interface* self) {
150} 150}
151 151
152/** 152/**
153 * DSP_DSP::WriteReg0x10 service function 153 * DSP_DSP::SetSemaphore service function
154 * Inputs: 154 * Inputs:
155 * 1 : Unknown (observed only half word used) 155 * 1 : Unknown (observed only half word used)
156 * Outputs: 156 * Outputs:
157 * 1 : Result of function, 0 on success, otherwise error code 157 * 1 : Result of function, 0 on success, otherwise error code
158 */ 158 */
159static void WriteReg0x10(Service::Interface* self) { 159static void SetSemaphore(Service::Interface* self) {
160 u32* cmd_buff = Kernel::GetCommandBuffer(); 160 u32* cmd_buff = Kernel::GetCommandBuffer();
161 161
162 SignalInterrupt(); 162 SignalInterrupt();
@@ -276,12 +276,17 @@ const Interface::FunctionInfo FunctionTable[] = {
276 {0x00020040, nullptr, "RecvDataIsReady"}, 276 {0x00020040, nullptr, "RecvDataIsReady"},
277 {0x00030080, nullptr, "SendData"}, 277 {0x00030080, nullptr, "SendData"},
278 {0x00040040, nullptr, "SendDataIsEmpty"}, 278 {0x00040040, nullptr, "SendDataIsEmpty"},
279 {0x00070040, WriteReg0x10, "WriteReg0x10"}, 279 {0x000500C2, nullptr, "SendFifoEx"},
280 {0x000600C0, nullptr, "RecvFifoEx"},
281 {0x00070040, SetSemaphore, "SetSemaphore"},
280 {0x00080000, nullptr, "GetSemaphore"}, 282 {0x00080000, nullptr, "GetSemaphore"},
281 {0x00090040, nullptr, "ClearSemaphore"}, 283 {0x00090040, nullptr, "ClearSemaphore"},
284 {0x000A0040, nullptr, "MaskSemaphore"},
282 {0x000B0000, nullptr, "CheckSemaphoreRequest"}, 285 {0x000B0000, nullptr, "CheckSemaphoreRequest"},
283 {0x000C0040, ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"}, 286 {0x000C0040, ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"},
284 {0x000D0082, WriteProcessPipe, "WriteProcessPipe"}, 287 {0x000D0082, WriteProcessPipe, "WriteProcessPipe"},
288 {0x000E00C0, nullptr, "ReadPipe"},
289 {0x000F0080, nullptr, "GetPipeReadableSize"},
285 {0x001000C0, ReadPipeIfPossible, "ReadPipeIfPossible"}, 290 {0x001000C0, ReadPipeIfPossible, "ReadPipeIfPossible"},
286 {0x001100C2, LoadComponent, "LoadComponent"}, 291 {0x001100C2, LoadComponent, "LoadComponent"},
287 {0x00120000, nullptr, "UnloadComponent"}, 292 {0x00120000, nullptr, "UnloadComponent"},
@@ -295,7 +300,10 @@ const Interface::FunctionInfo FunctionTable[] = {
295 {0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"}, 300 {0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"},
296 {0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"}, 301 {0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"},
297 {0x001C0082, nullptr, "SetIirFilterEQ"}, 302 {0x001C0082, nullptr, "SetIirFilterEQ"},
303 {0x001D00C0, nullptr, "ReadMultiEx_SPI2"},
304 {0x001E00C2, nullptr, "WriteMultiEx_SPI2"},
298 {0x001F0000, GetHeadphoneStatus, "GetHeadphoneStatus"}, 305 {0x001F0000, GetHeadphoneStatus, "GetHeadphoneStatus"},
306 {0x00200040, nullptr, "ForceHeadphoneOut"},
299 {0x00210000, nullptr, "GetIsDspOccupied"}, 307 {0x00210000, nullptr, "GetIsDspOccupied"},
300}; 308};
301 309
diff --git a/src/core/hle/service/frd/frd_u.cpp b/src/core/hle/service/frd/frd_u.cpp
index 3a5897d06..9e70ec901 100644
--- a/src/core/hle/service/frd/frd_u.cpp
+++ b/src/core/hle/service/frd/frd_u.cpp
@@ -11,25 +11,58 @@ namespace FRD {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010000, nullptr, "HasLoggedIn"}, 13 {0x00010000, nullptr, "HasLoggedIn"},
14 {0x00020000, nullptr, "IsOnline"},
14 {0x00030000, nullptr, "Login"}, 15 {0x00030000, nullptr, "Login"},
15 {0x00040000, nullptr, "Logout"}, 16 {0x00040000, nullptr, "Logout"},
16 {0x00050000, nullptr, "GetFriendKey"}, 17 {0x00050000, nullptr, "GetMyFriendKey"},
18 {0x00060000, nullptr, "GetMyPreference"},
19 {0x00070000, nullptr, "GetMyProfile"},
17 {0x00080000, nullptr, "GetMyPresence"}, 20 {0x00080000, nullptr, "GetMyPresence"},
18 {0x00090000, nullptr, "GetMyScreenName"}, 21 {0x00090000, nullptr, "GetMyScreenName"},
19 {0x00100040, nullptr, "GetPassword"}, 22 {0x000A0000, nullptr, "GetMyMii"},
23 {0x000B0000, nullptr, "GetMyLocalAccountId"},
24 {0x000C0000, nullptr, "GetMyPlayingGame"},
25 {0x000D0000, nullptr, "GetMyFavoriteGame"},
26 {0x000E0000, nullptr, "GetMyNcPrincipalId"},
27 {0x000F0000, nullptr, "GetMyComment"},
28 {0x00100040, nullptr, "GetMyPassword"},
20 {0x00110080, nullptr, "GetFriendKeyList"}, 29 {0x00110080, nullptr, "GetFriendKeyList"},
30 {0x00120042, nullptr, "GetFriendPresence"},
31 {0x00130142, nullptr, "GetFriendScreenName"},
32 {0x00140044, nullptr, "GetFriendMii"},
33 {0x00150042, nullptr, "GetFriendProfile"},
34 {0x00160042, nullptr, "GetFriendRelationship"},
35 {0x00170042, nullptr, "GetFriendAttributeFlags"},
36 {0x00180044, nullptr, "GetFriendPlayingGame"},
21 {0x00190042, nullptr, "GetFriendFavoriteGame"}, 37 {0x00190042, nullptr, "GetFriendFavoriteGame"},
22 {0x001A00C4, nullptr, "GetFriendInfo"}, 38 {0x001A00C4, nullptr, "GetFriendInfo"},
23 {0x001B0080, nullptr, "IsOnFriendList"}, 39 {0x001B0080, nullptr, "IsIncludedInFriendList"},
24 {0x001C0042, nullptr, "DecodeLocalFriendCode"}, 40 {0x001C0042, nullptr, "UnscrambleLocalFriendCode"},
25 {0x001D0002, nullptr, "SetCurrentlyPlayingText"}, 41 {0x001D0002, nullptr, "UpdateGameModeDescription"},
42 {0x001E02C2, nullptr, "UpdateGameMode"},
43 {0x001F0042, nullptr, "SendInvitation"},
44 {0x00200002, nullptr, "AttachToEventNotification"},
45 {0x00210040, nullptr, "SetNotificationMask"},
46 {0x00220040, nullptr, "GetEventNotification"},
26 {0x00230000, nullptr, "GetLastResponseResult"}, 47 {0x00230000, nullptr, "GetLastResponseResult"},
48 {0x00240040, nullptr, "PrincipalIdToFriendCode"},
49 {0x00250080, nullptr, "FriendCodeToPrincipalId"},
50 {0x00260080, nullptr, "IsValidFriendCode"},
27 {0x00270040, nullptr, "ResultToErrorCode"}, 51 {0x00270040, nullptr, "ResultToErrorCode"},
28 {0x00280244, nullptr, "RequestGameAuthentication"}, 52 {0x00280244, nullptr, "RequestGameAuthentication"},
29 {0x00290000, nullptr, "GetGameAuthenticationData"}, 53 {0x00290000, nullptr, "GetGameAuthenticationData"},
30 {0x002A0204, nullptr, "RequestServiceLocator"}, 54 {0x002A0204, nullptr, "RequestServiceLocator"},
31 {0x002B0000, nullptr, "GetServiceLocatorData"}, 55 {0x002B0000, nullptr, "GetServiceLocatorData"},
56 {0x002C0002, nullptr, "DetectNatProperties"},
57 {0x002D0000, nullptr, "GetNatProperties"},
58 {0x002E0000, nullptr, "GetServerTimeInterval"},
59 {0x002F0040, nullptr, "AllowHalfAwake"},
60 {0x00300000, nullptr, "GetServerTypes"},
61 {0x00310082, nullptr, "GetFriendComment"},
32 {0x00320042, nullptr, "SetClientSdkVersion"}, 62 {0x00320042, nullptr, "SetClientSdkVersion"},
63 {0x00330000, nullptr, "GetMyApproachContext"},
64 {0x00340046, nullptr, "AddFriendWithApproach"},
65 {0x00350082, nullptr, "DecryptApproachContext"},
33}; 66};
34 67
35FRD_U_Interface::FRD_U_Interface() { 68FRD_U_Interface::FRD_U_Interface() {
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index b3fa89302..632620a56 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -708,96 +708,114 @@ static void GetPriority(Service::Interface* self) {
708} 708}
709 709
710const Interface::FunctionInfo FunctionTable[] = { 710const Interface::FunctionInfo FunctionTable[] = {
711 {0x000100C6, nullptr, "Dummy1"}, 711 {0x000100C6, nullptr, "Dummy1"},
712 {0x040100C4, nullptr, "Control"}, 712 {0x040100C4, nullptr, "Control"},
713 {0x08010002, Initialize, "Initialize"}, 713 {0x08010002, Initialize, "Initialize"},
714 {0x080201C2, OpenFile, "OpenFile"}, 714 {0x080201C2, OpenFile, "OpenFile"},
715 {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, 715 {0x08030204, OpenFileDirectly, "OpenFileDirectly"},
716 {0x08040142, DeleteFile, "DeleteFile"}, 716 {0x08040142, DeleteFile, "DeleteFile"},
717 {0x08050244, RenameFile, "RenameFile"}, 717 {0x08050244, RenameFile, "RenameFile"},
718 {0x08060142, DeleteDirectory, "DeleteDirectory"}, 718 {0x08060142, DeleteDirectory, "DeleteDirectory"},
719 {0x08070142, nullptr, "DeleteDirectoryRecursively"}, 719 {0x08070142, nullptr, "DeleteDirectoryRecursively"},
720 {0x08080202, CreateFile, "CreateFile"}, 720 {0x08080202, CreateFile, "CreateFile"},
721 {0x08090182, CreateDirectory, "CreateDirectory"}, 721 {0x08090182, CreateDirectory, "CreateDirectory"},
722 {0x080A0244, RenameDirectory, "RenameDirectory"}, 722 {0x080A0244, RenameDirectory, "RenameDirectory"},
723 {0x080B0102, OpenDirectory, "OpenDirectory"}, 723 {0x080B0102, OpenDirectory, "OpenDirectory"},
724 {0x080C00C2, OpenArchive, "OpenArchive"}, 724 {0x080C00C2, OpenArchive, "OpenArchive"},
725 {0x080D0144, nullptr, "ControlArchive"}, 725 {0x080D0144, nullptr, "ControlArchive"},
726 {0x080E0080, CloseArchive, "CloseArchive"}, 726 {0x080E0080, CloseArchive, "CloseArchive"},
727 {0x080F0180, FormatThisUserSaveData,"FormatThisUserSaveData"}, 727 {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"},
728 {0x08100200, nullptr, "CreateSystemSaveData"}, 728 {0x08100200, nullptr, "CreateSystemSaveData"},
729 {0x08110040, nullptr, "DeleteSystemSaveData"}, 729 {0x08110040, nullptr, "DeleteSystemSaveData"},
730 {0x08120080, GetFreeBytes, "GetFreeBytes"}, 730 {0x08120080, GetFreeBytes, "GetFreeBytes"},
731 {0x08130000, nullptr, "GetCardType"}, 731 {0x08130000, nullptr, "GetCardType"},
732 {0x08140000, nullptr, "GetSdmcArchiveResource"}, 732 {0x08140000, nullptr, "GetSdmcArchiveResource"},
733 {0x08150000, nullptr, "GetNandArchiveResource"}, 733 {0x08150000, nullptr, "GetNandArchiveResource"},
734 {0x08160000, nullptr, "GetSdmcFatfsErro"}, 734 {0x08160000, nullptr, "GetSdmcFatfsError"},
735 {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, 735 {0x08170000, IsSdmcDetected, "IsSdmcDetected"},
736 {0x08180000, IsSdmcWriteable, "IsSdmcWritable"}, 736 {0x08180000, IsSdmcWriteable, "IsSdmcWritable"},
737 {0x08190042, nullptr, "GetSdmcCid"}, 737 {0x08190042, nullptr, "GetSdmcCid"},
738 {0x081A0042, nullptr, "GetNandCid"}, 738 {0x081A0042, nullptr, "GetNandCid"},
739 {0x081B0000, nullptr, "GetSdmcSpeedInfo"}, 739 {0x081B0000, nullptr, "GetSdmcSpeedInfo"},
740 {0x081C0000, nullptr, "GetNandSpeedInfo"}, 740 {0x081C0000, nullptr, "GetNandSpeedInfo"},
741 {0x081D0042, nullptr, "GetSdmcLog"}, 741 {0x081D0042, nullptr, "GetSdmcLog"},
742 {0x081E0042, nullptr, "GetNandLog"}, 742 {0x081E0042, nullptr, "GetNandLog"},
743 {0x081F0000, nullptr, "ClearSdmcLog"}, 743 {0x081F0000, nullptr, "ClearSdmcLog"},
744 {0x08200000, nullptr, "ClearNandLog"}, 744 {0x08200000, nullptr, "ClearNandLog"},
745 {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, 745 {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"},
746 {0x08220000, nullptr, "CardSlotPowerOn"}, 746 {0x08220000, nullptr, "CardSlotPowerOn"},
747 {0x08230000, nullptr, "CardSlotPowerOff"}, 747 {0x08230000, nullptr, "CardSlotPowerOff"},
748 {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"}, 748 {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"},
749 {0x08250040, nullptr, "CardNorDirectCommand"}, 749 {0x08250040, nullptr, "CardNorDirectCommand"},
750 {0x08260080, nullptr, "CardNorDirectCommandWithAddress"}, 750 {0x08260080, nullptr, "CardNorDirectCommandWithAddress"},
751 {0x08270082, nullptr, "CardNorDirectRead"}, 751 {0x08270082, nullptr, "CardNorDirectRead"},
752 {0x082800C2, nullptr, "CardNorDirectReadWithAddress"}, 752 {0x082800C2, nullptr, "CardNorDirectReadWithAddress"},
753 {0x08290082, nullptr, "CardNorDirectWrite"}, 753 {0x08290082, nullptr, "CardNorDirectWrite"},
754 {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"}, 754 {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"},
755 {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"}, 755 {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"},
756 {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, 756 {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"},
757 {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, 757 {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"},
758 {0x082E0040, nullptr, "GetProductInfo"}, 758 {0x082E0040, nullptr, "GetProductInfo"},
759 {0x082F0040, nullptr, "GetProgramLaunchInfo"}, 759 {0x082F0040, nullptr, "GetProgramLaunchInfo"},
760 {0x08300182, nullptr, "CreateExtSaveData"}, 760 {0x08300182, nullptr, "CreateExtSaveData"},
761 {0x08310180, nullptr, "CreateSharedExtSaveData"}, 761 {0x08310180, nullptr, "CreateSharedExtSaveData"},
762 {0x08320102, nullptr, "ReadExtSaveDataIcon"}, 762 {0x08320102, nullptr, "ReadExtSaveDataIcon"},
763 {0x08330082, nullptr, "EnumerateExtSaveData"}, 763 {0x08330082, nullptr, "EnumerateExtSaveData"},
764 {0x08340082, nullptr, "EnumerateSharedExtSaveData"}, 764 {0x08340082, nullptr, "EnumerateSharedExtSaveData"},
765 {0x08350080, nullptr, "DeleteExtSaveData"}, 765 {0x08350080, nullptr, "DeleteExtSaveData"},
766 {0x08360080, nullptr, "DeleteSharedExtSaveData"}, 766 {0x08360080, nullptr, "DeleteSharedExtSaveData"},
767 {0x08370040, nullptr, "SetCardSpiBaudRate"}, 767 {0x08370040, nullptr, "SetCardSpiBaudRate"},
768 {0x08380040, nullptr, "SetCardSpiBusMode"}, 768 {0x08380040, nullptr, "SetCardSpiBusMode"},
769 {0x08390000, nullptr, "SendInitializeInfoTo9"}, 769 {0x08390000, nullptr, "SendInitializeInfoTo9"},
770 {0x083A0100, nullptr, "GetSpecialContentIndex"}, 770 {0x083A0100, nullptr, "GetSpecialContentIndex"},
771 {0x083B00C2, nullptr, "GetLegacyRomHeader"}, 771 {0x083B00C2, nullptr, "GetLegacyRomHeader"},
772 {0x083C00C2, nullptr, "GetLegacyBannerData"}, 772 {0x083C00C2, nullptr, "GetLegacyBannerData"},
773 {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"}, 773 {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"},
774 {0x083E00C2, nullptr, "QueryTotalQuotaSize"}, 774 {0x083E00C2, nullptr, "QueryTotalQuotaSize"},
775 {0x083F00C0, nullptr, "GetExtDataBlockSize"}, 775 {0x083F00C0, nullptr, "GetExtDataBlockSize"},
776 {0x08400040, nullptr, "AbnegateAccessRight"}, 776 {0x08400040, nullptr, "AbnegateAccessRight"},
777 {0x08410000, nullptr, "DeleteSdmcRoot"}, 777 {0x08410000, nullptr, "DeleteSdmcRoot"},
778 {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"}, 778 {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"},
779 {0x08430000, nullptr, "InitializeCtrFileSystem"}, 779 {0x08430000, nullptr, "InitializeCtrFileSystem"},
780 {0x08440000, nullptr, "CreateSeed"}, 780 {0x08440000, nullptr, "CreateSeed"},
781 {0x084500C2, nullptr, "GetFormatInfo"}, 781 {0x084500C2, nullptr, "GetFormatInfo"},
782 {0x08460102, nullptr, "GetLegacyRomHeader2"}, 782 {0x08460102, nullptr, "GetLegacyRomHeader2"},
783 {0x08470180, nullptr, "FormatCtrCardUserSaveData"}, 783 {0x08470180, nullptr, "FormatCtrCardUserSaveData"},
784 {0x08480042, nullptr, "GetSdmcCtrRootPath"}, 784 {0x08480042, nullptr, "GetSdmcCtrRootPath"},
785 {0x08490040, nullptr, "GetArchiveResource"}, 785 {0x08490040, nullptr, "GetArchiveResource"},
786 {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"}, 786 {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"},
787 {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"}, 787 {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"},
788 {0x084C0242, FormatSaveData, "FormatSaveData"}, 788 {0x084C0242, FormatSaveData, "FormatSaveData"},
789 {0x084D0102, nullptr, "GetLegacySubBannerData"}, 789 {0x084D0102, nullptr, "GetLegacySubBannerData"},
790 {0x084E0342, nullptr, "UpdateSha256Context"}, 790 {0x084E0342, nullptr, "UpdateSha256Context"},
791 {0x084F0102, nullptr, "ReadSpecialFile"}, 791 {0x084F0102, nullptr, "ReadSpecialFile"},
792 {0x08500040, nullptr, "GetSpecialFileSize"}, 792 {0x08500040, nullptr, "GetSpecialFileSize"},
793 {0x08510242, CreateExtSaveData, "CreateExtSaveData"}, 793 {0x08510242, CreateExtSaveData, "CreateExtSaveData"},
794 {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"}, 794 {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"},
795 {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"}, 795 {0x08530142, nullptr, "ReadExtSaveDataIcon"},
796 {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"}, 796 {0x085400C0, nullptr, "GetExtDataBlockSize"},
797 {0x08580000, nullptr, "GetMovableSedHashedKeyYRandomData"}, 797 {0x08550102, nullptr, "EnumerateExtSaveData"},
798 {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"},
799 {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"},
800 {0x08580000, nullptr, "StartDeviceMoveAsSource"},
801 {0x08590200, nullptr, "StartDeviceMoveAsDestination"},
802 {0x085A00C0, nullptr, "SetArchivePriority"},
803 {0x085B0080, nullptr, "GetArchivePriority"},
804 {0x085C00C0, nullptr, "SetCtrCardLatencyParameter"},
805 {0x085D01C0, nullptr, "SetFsCompatibilityInfo"},
806 {0x085E0040, nullptr, "ResetCardCompatibilityParameter"},
807 {0x085F0040, nullptr, "SwitchCleanupInvalidSaveData"},
808 {0x08600042, nullptr, "EnumerateSystemSaveData"},
798 {0x08610042, InitializeWithSdkVersion, "InitializeWithSdkVersion"}, 809 {0x08610042, InitializeWithSdkVersion, "InitializeWithSdkVersion"},
799 {0x08620040, SetPriority, "SetPriority"}, 810 {0x08620040, SetPriority, "SetPriority"},
800 {0x08630000, GetPriority, "GetPriority"}, 811 {0x08630000, GetPriority, "GetPriority"},
812 {0x08640000, nullptr, "GetNandInfo"},
813 {0x08650140, nullptr, "SetSaveDataSecureValue"},
814 {0x086600C0, nullptr, "GetSaveDataSecureValue"},
815 {0x086700C4, nullptr, "ControlSecureSave"},
816 {0x08680000, nullptr, "GetMediaType"},
817 {0x08690000, nullptr, "GetNandEraseCount"},
818 {0x086A0082, nullptr, "ReadNandReport"}
801}; 819};
802 820
803//////////////////////////////////////////////////////////////////////////////////////////////////// 821////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/gsp_lcd.cpp b/src/core/hle/service/gsp_lcd.cpp
index 9e36732b4..59ee9b73c 100644
--- a/src/core/hle/service/gsp_lcd.cpp
+++ b/src/core/hle/service/gsp_lcd.cpp
@@ -11,14 +11,18 @@
11 11
12namespace GSP_LCD { 12namespace GSP_LCD {
13 13
14/*const Interface::FunctionInfo FunctionTable[] = { 14const Interface::FunctionInfo FunctionTable[] = {
15};*/ 15 {0x000F0000, nullptr, "PowerOnAllBacklights"},
16 {0x00100000, nullptr, "PowerOffAllBacklights"},
17 {0x00110040, nullptr, "PowerOnBacklight"},
18 {0x00120040, nullptr, "PowerOffBacklight"},
19};
16 20
17//////////////////////////////////////////////////////////////////////////////////////////////////// 21////////////////////////////////////////////////////////////////////////////////////////////////////
18// Interface class 22// Interface class
19 23
20Interface::Interface() { 24Interface::Interface() {
21 //Register(FunctionTable); 25 Register(FunctionTable);
22} 26}
23 27
24} // namespace 28} // namespace
diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp
index fbfb9e885..e103881b1 100644
--- a/src/core/hle/service/hid/hid_user.cpp
+++ b/src/core/hle/service/hid/hid_user.cpp
@@ -11,6 +11,8 @@ namespace HID {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x000A0000, GetIPCHandles, "GetIPCHandles"}, 13 {0x000A0000, GetIPCHandles, "GetIPCHandles"},
14 {0x000B0000, nullptr, "StartAnalogStickCalibration"},
15 {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"},
14 {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, 16 {0x00110000, EnableAccelerometer, "EnableAccelerometer"},
15 {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, 17 {0x00120000, DisableAccelerometer, "DisableAccelerometer"},
16 {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"}, 18 {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"},
diff --git a/src/core/hle/service/http_c.cpp b/src/core/hle/service/http_c.cpp
index 0a3aba0a0..43d8a3b85 100644
--- a/src/core/hle/service/http_c.cpp
+++ b/src/core/hle/service/http_c.cpp
@@ -47,10 +47,18 @@ const Interface::FunctionInfo FunctionTable[] = {
47 {0x00220040, nullptr, "GetResponseStatusCode"}, 47 {0x00220040, nullptr, "GetResponseStatusCode"},
48 {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"}, 48 {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"},
49 {0x00240082, nullptr, "AddTrustedRootCA"}, 49 {0x00240082, nullptr, "AddTrustedRootCA"},
50 {0x00250080, nullptr, "AddDefaultCert"},
51 {0x00260080, nullptr, "SelectRootCertChain"},
52 {0x002700C4, nullptr, "SetClientCert"},
53 {0x002D0000, nullptr, "CreateRootCertChain"},
54 {0x002E0040, nullptr, "DestroyRootCertChain"},
55 {0x002F0082, nullptr, "RootCertChainAddCert"},
56 {0x00300080, nullptr, "RootCertChainAddDefaultCert"},
50 {0x00350186, nullptr, "SetDefaultProxy"}, 57 {0x00350186, nullptr, "SetDefaultProxy"},
51 {0x00360000, nullptr, "ClearDNSCache"}, 58 {0x00360000, nullptr, "ClearDNSCache"},
52 {0x00370080, nullptr, "SetKeepAlive"}, 59 {0x00370080, nullptr, "SetKeepAlive"},
53 {0x003800C0, nullptr, "Finalize"}, 60 {0x003800C0, nullptr, "SetPostDataTypeSize"},
61 {0x00390000, nullptr, "Finalize"},
54}; 62};
55 63
56//////////////////////////////////////////////////////////////////////////////////////////////////// 64////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp
index 25e70d321..1f27e9c1f 100644
--- a/src/core/hle/service/mic_u.cpp
+++ b/src/core/hle/service/mic_u.cpp
@@ -18,14 +18,14 @@ const Interface::FunctionInfo FunctionTable[] = {
18 {0x00050000, nullptr, "StopSampling"}, 18 {0x00050000, nullptr, "StopSampling"},
19 {0x00060000, nullptr, "IsSampling"}, 19 {0x00060000, nullptr, "IsSampling"},
20 {0x00070000, nullptr, "GetEventHandle"}, 20 {0x00070000, nullptr, "GetEventHandle"},
21 {0x00080040, nullptr, "SetControl"}, 21 {0x00080040, nullptr, "SetGain"},
22 {0x00090000, nullptr, "GetControl"}, 22 {0x00090000, nullptr, "GetGain"},
23 {0x000A0040, nullptr, "SetBias"}, 23 {0x000A0040, nullptr, "SetPower"},
24 {0x000B0000, nullptr, "GetBias"}, 24 {0x000B0000, nullptr, "GetPower"},
25 {0x000C0042, nullptr, "size"}, 25 {0x000C0042, nullptr, "size"},
26 {0x000D0040, nullptr, "SetClamp"}, 26 {0x000D0040, nullptr, "SetClamp"},
27 {0x000E0000, nullptr, "GetClamp"}, 27 {0x000E0000, nullptr, "GetClamp"},
28 {0x000F0040, nullptr, "unknown_input1"}, 28 {0x000F0040, nullptr, "SetAllowShellClosed"},
29 {0x00100040, nullptr, "unknown_input2"}, 29 {0x00100040, nullptr, "unknown_input2"},
30}; 30};
31 31
diff --git a/src/core/hle/service/ndm_u.cpp b/src/core/hle/service/ndm_u.cpp
index df3c97193..ad247fd1f 100644
--- a/src/core/hle/service/ndm_u.cpp
+++ b/src/core/hle/service/ndm_u.cpp
@@ -14,10 +14,26 @@ const Interface::FunctionInfo FunctionTable[] = {
14 {0x00010042, nullptr, "EnterExclusiveState"}, 14 {0x00010042, nullptr, "EnterExclusiveState"},
15 {0x00020002, nullptr, "LeaveExclusiveState"}, 15 {0x00020002, nullptr, "LeaveExclusiveState"},
16 {0x00030000, nullptr, "QueryExclusiveMode"}, 16 {0x00030000, nullptr, "QueryExclusiveMode"},
17 {0x00040002, nullptr, "LockState"},
18 {0x00050002, nullptr, "UnlockState"},
17 {0x00060040, nullptr, "SuspendDaemons"}, 19 {0x00060040, nullptr, "SuspendDaemons"},
20 {0x00070040, nullptr, "ResumeDaemons"},
18 {0x00080040, nullptr, "DisableWifiUsage"}, 21 {0x00080040, nullptr, "DisableWifiUsage"},
19 {0x00090000, nullptr, "EnableWifiUsage"}, 22 {0x00090000, nullptr, "EnableWifiUsage"},
23 {0x000A0000, nullptr, "GetCurrentState"},
24 {0x000B0000, nullptr, "GetTargetState"},
25 {0x000C0000, nullptr, "<Stubbed>"},
26 {0x000D0040, nullptr, "QueryStatus"},
27 {0x000E0040, nullptr, "GetDaemonDisableCount"},
28 {0x000F0000, nullptr, "GetSchedulerDisableCount"},
29 {0x00100040, nullptr, "SetScanInterval"},
30 {0x00110000, nullptr, "GetScanInterval"},
31 {0x00120040, nullptr, "SetRetryInterval"},
32 {0x00130000, nullptr, "GetRetryInterval"},
20 {0x00140040, nullptr, "OverrideDefaultDaemons"}, 33 {0x00140040, nullptr, "OverrideDefaultDaemons"},
34 {0x00150000, nullptr, "ResetDefaultDaemons"},
35 {0x00160000, nullptr, "GetDefaultDaemons"},
36 {0x00170000, nullptr, "ClearHalfAwakeMacFilter"},
21}; 37};
22 38
23//////////////////////////////////////////////////////////////////////////////////////////////////// 39////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp
index 2f8c37d9e..5b8db3288 100644
--- a/src/core/hle/service/news/news_s.cpp
+++ b/src/core/hle/service/news/news_s.cpp
@@ -11,6 +11,18 @@ namespace NEWS {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x000100C6, nullptr, "AddNotification"}, 13 {0x000100C6, nullptr, "AddNotification"},
14 {0x00050000, nullptr, "GetTotalNotifications"},
15 {0x00060042, nullptr, "SetNewsDBHeader"},
16 {0x00070082, nullptr, "SetNotificationHeader"},
17 {0x00080082, nullptr, "SetNotificationMessage"},
18 {0x00090082, nullptr, "SetNotificationImage"},
19 {0x000A0042, nullptr, "GetNewsDBHeader"},
20 {0x000B0082, nullptr, "GetNotificationHeader"},
21 {0x000C0082, nullptr, "GetNotificationMessage"},
22 {0x000D0082, nullptr, "GetNotificationImage"},
23 {0x000E0040, nullptr, "SetInfoLEDPattern"},
24 {0x00120082, nullptr, "GetNotificationHeaderOther"},
25 {0x00130000, nullptr, "WriteNewsDBSavedata"},
14}; 26};
15 27
16NEWS_S_Interface::NEWS_S_Interface() { 28NEWS_S_Interface::NEWS_S_Interface() {
diff --git a/src/core/hle/service/nim/nim_s.cpp b/src/core/hle/service/nim/nim_s.cpp
index 5d8bc059f..1172770ac 100644
--- a/src/core/hle/service/nim/nim_s.cpp
+++ b/src/core/hle/service/nim/nim_s.cpp
@@ -11,6 +11,9 @@ namespace NIM {
11 11
12const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"}, 13 {0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"},
14 {0x0016020A, nullptr, "ListTitles"},
15 {0x002D0042, nullptr, "DownloadTickets"},
16 {0x00420240, nullptr, "StartDownload"},
14}; 17};
15 18
16NIM_S_Interface::NIM_S_Interface() { 19NIM_S_Interface::NIM_S_Interface() {
diff --git a/src/core/hle/service/ns_s.cpp b/src/core/hle/service/ns_s.cpp
index 6b3ef6ece..99e8e0880 100644
--- a/src/core/hle/service/ns_s.cpp
+++ b/src/core/hle/service/ns_s.cpp
@@ -12,7 +12,16 @@
12namespace NS_S { 12namespace NS_S {
13 13
14const Interface::FunctionInfo FunctionTable[] = { 14const Interface::FunctionInfo FunctionTable[] = {
15 {0x000100C0, nullptr, "LaunchFIRM"},
15 {0x000200C0, nullptr, "LaunchTitle"}, 16 {0x000200C0, nullptr, "LaunchTitle"},
17 {0x000500C0, nullptr, "LaunchApplicationFIRM"},
18 {0x00060042, nullptr, "SetFIRMParams4A0"},
19 {0x00070042, nullptr, "CardUpdateInitialize"},
20 {0x000D0140, nullptr, "SetFIRMParams4B0"},
21 {0x000E0000, nullptr, "ShutdownAsync"},
22 {0x00100180, nullptr, "RebootSystem"},
23 {0x00150140, nullptr, "LaunchApplication"},
24 {0x00160000, nullptr, "HardRebootSystem"},
16}; 25};
17 26
18//////////////////////////////////////////////////////////////////////////////////////////////////// 27////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp
index 18b22956f..adca64a3a 100644
--- a/src/core/hle/service/nwm_uds.cpp
+++ b/src/core/hle/service/nwm_uds.cpp
@@ -106,14 +106,32 @@ static void Initialize(Service::Interface* self) {
106} 106}
107 107
108const Interface::FunctionInfo FunctionTable[] = { 108const Interface::FunctionInfo FunctionTable[] = {
109 {0x00020000, nullptr, "Scrap"},
109 {0x00030000, Shutdown, "Shutdown"}, 110 {0x00030000, Shutdown, "Shutdown"},
111 {0x00040402, nullptr, "CreateNetwork"},
112 {0x00050040, nullptr, "EjectClient"},
113 {0x00060000, nullptr, "EjectSpectator"},
114 {0x00070080, nullptr, "UpdateNetworkAttribute"},
115 {0x00080000, nullptr, "DestroyNetwork"},
116 {0x000A0000, nullptr, "DisconnectNetwork"},
117 {0x000B0000, nullptr, "GetConnectionStatus"},
118 {0x000D0040, nullptr, "GetNodeInformation"},
110 {0x000F0404, RecvBeaconBroadcastData, "RecvBeaconBroadcastData"}, 119 {0x000F0404, RecvBeaconBroadcastData, "RecvBeaconBroadcastData"},
111 {0x00100042, nullptr, "SetBeaconAdditionalData"}, 120 {0x00100042, nullptr, "SetBeaconAdditionalData"},
121 {0x00110040, nullptr, "GetApplicationData"},
122 {0x00120100, nullptr, "Bind"},
123 {0x00130040, nullptr, "Unbind"},
112 {0x001400C0, nullptr, "RecvBroadcastDataFrame"}, 124 {0x001400C0, nullptr, "RecvBroadcastDataFrame"},
125 {0x00150080, nullptr, "SetMaxSendDelay"},
126 {0x00170182, nullptr, "SendTo"},
127 {0x001A0000, nullptr, "GetChannel"},
113 {0x001B0302, Initialize, "Initialize"}, 128 {0x001B0302, Initialize, "Initialize"},
114 {0x001D0044, nullptr, "BeginHostingNetwork"}, 129 {0x001D0044, nullptr, "BeginHostingNetwork"},
115 {0x001E0084, nullptr, "ConnectToNetwork"}, 130 {0x001E0084, nullptr, "ConnectToNetwork"},
116 {0x001F0006, nullptr, "DecryptBeaconData"}, 131 {0x001F0006, nullptr, "DecryptBeaconData"},
132 {0x00200040, nullptr, "Flush"},
133 {0x00210080, nullptr, "SetProbeResponseParam"},
134 {0x00220402, nullptr, "ScanOnConnection"},
117}; 135};
118 136
119//////////////////////////////////////////////////////////////////////////////////////////////////// 137////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/pm_app.cpp b/src/core/hle/service/pm_app.cpp
index 7420a62f4..48646ed72 100644
--- a/src/core/hle/service/pm_app.cpp
+++ b/src/core/hle/service/pm_app.cpp
@@ -19,6 +19,10 @@ const Interface::FunctionInfo FunctionTable[] = {
19 {0x00070042, nullptr, "GetFIRMLaunchParams"}, 19 {0x00070042, nullptr, "GetFIRMLaunchParams"},
20 {0x00080100, nullptr, "GetTitleExheaderFlags"}, 20 {0x00080100, nullptr, "GetTitleExheaderFlags"},
21 {0x00090042, nullptr, "SetFIRMLaunchParams"}, 21 {0x00090042, nullptr, "SetFIRMLaunchParams"},
22 {0x000A0140, nullptr, "SetResourceLimit"},
23 {0x000B0140, nullptr, "GetResourceLimitMax"},
24 {0x000C0080, nullptr, "UnregisterProcess"},
25 {0x000D0240, nullptr, "LaunchTitleUpdate"},
22}; 26};
23 27
24//////////////////////////////////////////////////////////////////////////////////////////////////// 28////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp
index 655658f3b..3ecfab05c 100644
--- a/src/core/hle/service/ptm/ptm_sysm.cpp
+++ b/src/core/hle/service/ptm/ptm_sysm.cpp
@@ -39,7 +39,8 @@ const Interface::FunctionInfo FunctionTable[] = {
39 {0x08110000, nullptr, "GetShellStatus"}, 39 {0x08110000, nullptr, "GetShellStatus"},
40 {0x08120000, nullptr, "IsShutdownByBatteryEmpty"}, 40 {0x08120000, nullptr, "IsShutdownByBatteryEmpty"},
41 {0x08130000, nullptr, "FormatSavedata"}, 41 {0x08130000, nullptr, "FormatSavedata"},
42 {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"} 42 {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"},
43 {0x08180040, nullptr, "ConfigureNew3DSCPU"},
43}; 44};
44 45
45PTM_Sysm_Interface::PTM_Sysm_Interface() { 46PTM_Sysm_Interface::PTM_Sysm_Interface() {
diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp
index cabd18c80..9ecb72c77 100644
--- a/src/core/hle/service/ssl_c.cpp
+++ b/src/core/hle/service/ssl_c.cpp
@@ -62,10 +62,14 @@ static void GenerateRandomData(Service::Interface* self) {
62const Interface::FunctionInfo FunctionTable[] = { 62const Interface::FunctionInfo FunctionTable[] = {
63 {0x00010002, Initialize, "Initialize"}, 63 {0x00010002, Initialize, "Initialize"},
64 {0x000200C2, nullptr, "CreateContext"}, 64 {0x000200C2, nullptr, "CreateContext"},
65 {0x00030000, nullptr, "CreateRootCertChain"},
66 {0x00040040, nullptr, "DestroyRootCertChain"},
65 {0x00050082, nullptr, "AddTrustedRootCA"}, 67 {0x00050082, nullptr, "AddTrustedRootCA"},
68 {0x00060080, nullptr, "RootCertChainAddDefaultCert"},
66 {0x00110042, GenerateRandomData, "GenerateRandomData"}, 69 {0x00110042, GenerateRandomData, "GenerateRandomData"},
67 {0x00150082, nullptr, "Read"}, 70 {0x00150082, nullptr, "Read"},
68 {0x00170082, nullptr, "Write"}, 71 {0x00170082, nullptr, "Write"},
72 {0x00180080, nullptr, "ContextSetRootCertChain"},
69}; 73};
70 74
71//////////////////////////////////////////////////////////////////////////////////////////////////// 75////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index 0429927f2..69d0bf4a3 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -375,21 +375,41 @@ static void DriverFinalize(Service::Interface* self) {
375 375
376const Interface::FunctionInfo FunctionTable[] = { 376const Interface::FunctionInfo FunctionTable[] = {
377 {0x00010040, SetInputFormat, "SetInputFormat"}, 377 {0x00010040, SetInputFormat, "SetInputFormat"},
378 {0x00020000, nullptr, "GetInputFormat"},
378 {0x00030040, SetOutputFormat, "SetOutputFormat"}, 379 {0x00030040, SetOutputFormat, "SetOutputFormat"},
380 {0x00040000, nullptr, "GetOutputFormat"},
379 {0x00050040, SetRotation, "SetRotation"}, 381 {0x00050040, SetRotation, "SetRotation"},
382 {0x00060000, nullptr, "GetRotation"},
380 {0x00070040, SetBlockAlignment, "SetBlockAlignment"}, 383 {0x00070040, SetBlockAlignment, "SetBlockAlignment"},
384 {0x00080000, nullptr, "GetBlockAlignment"},
385 {0x00090040, nullptr, "SetSpacialDithering"},
386 {0x000A0000, nullptr, "GetSpacialDithering"},
387 {0x000B0040, nullptr, "SetTemporalDithering"},
388 {0x000C0000, nullptr, "GetTemporalDithering"},
381 {0x000D0040, SetTransferEndInterrupt, "SetTransferEndInterrupt"}, 389 {0x000D0040, SetTransferEndInterrupt, "SetTransferEndInterrupt"},
382 {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"}, 390 {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"},
383 {0x00100102, SetSendingY, "SetSendingY"}, 391 {0x00100102, SetSendingY, "SetSendingY"},
384 {0x00110102, SetSendingU, "SetSendingU"}, 392 {0x00110102, SetSendingU, "SetSendingU"},
385 {0x00120102, SetSendingV, "SetSendingV"}, 393 {0x00120102, SetSendingV, "SetSendingV"},
386 {0x00130102, SetSendingYUYV, "SetSendingYUYV"}, 394 {0x00130102, SetSendingYUYV, "SetSendingYUYV"},
395 {0x00140000, nullptr, "IsFinishedSendingYuv"},
396 {0x00150000, nullptr, "IsFinishedSendingY"},
397 {0x00160000, nullptr, "IsFinishedSendingU"},
398 {0x00170000, nullptr, "IsFinishedSendingV"},
387 {0x00180102, SetReceiving, "SetReceiving"}, 399 {0x00180102, SetReceiving, "SetReceiving"},
400 {0x00190000, nullptr, "IsFinishedReceiving"},
388 {0x001A0040, SetInputLineWidth, "SetInputLineWidth"}, 401 {0x001A0040, SetInputLineWidth, "SetInputLineWidth"},
402 {0x001B0000, nullptr, "GetInputLineWidth"},
389 {0x001C0040, SetInputLines, "SetInputLines"}, 403 {0x001C0040, SetInputLines, "SetInputLines"},
404 {0x001D0000, nullptr, "GetInputLines"},
390 {0x001E0100, SetCoefficient, "SetCoefficient"}, 405 {0x001E0100, SetCoefficient, "SetCoefficient"},
406 {0x001F0000, nullptr, "GetCoefficient"},
391 {0x00200040, SetStandardCoefficient, "SetStandardCoefficient"}, 407 {0x00200040, SetStandardCoefficient, "SetStandardCoefficient"},
408 {0x00210040, nullptr, "GetStandardCoefficientParams"},
392 {0x00220040, SetAlpha, "SetAlpha"}, 409 {0x00220040, SetAlpha, "SetAlpha"},
410 {0x00230000, nullptr, "GetAlpha"},
411 {0x00240200, nullptr, "SetDitheringWeightParams"},
412 {0x00250000, nullptr, "GetDitheringWeightParams"},
393 {0x00260000, StartConversion, "StartConversion"}, 413 {0x00260000, StartConversion, "StartConversion"},
394 {0x00270000, StopConversion, "StopConversion"}, 414 {0x00270000, StopConversion, "StopConversion"},
395 {0x00280000, IsBusyConversion, "IsBusyConversion"}, 415 {0x00280000, IsBusyConversion, "IsBusyConversion"},
@@ -397,6 +417,7 @@ const Interface::FunctionInfo FunctionTable[] = {
397 {0x002A0000, PingProcess, "PingProcess"}, 417 {0x002A0000, PingProcess, "PingProcess"},
398 {0x002B0000, DriverInitialize, "DriverInitialize"}, 418 {0x002B0000, DriverInitialize, "DriverInitialize"},
399 {0x002C0000, DriverFinalize, "DriverFinalize"}, 419 {0x002C0000, DriverFinalize, "DriverFinalize"},
420 {0x002D0000, nullptr, "GetPackageParameter"},
400}; 421};
401 422
402//////////////////////////////////////////////////////////////////////////////////////////////////// 423////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 7f63ff505..e39edcc16 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -781,7 +781,7 @@ static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32
781static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { 781static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) {
782 using Kernel::MemoryRegion; 782 using Kernel::MemoryRegion;
783 783
784 LOG_TRACE(Kernel_SVC, "called process=0x%08X type=%u param=%d", process_handle, type, param); 784 LOG_TRACE(Kernel_SVC, "called type=%u param=%d", type, param);
785 785
786 switch ((SystemInfoType)type) { 786 switch ((SystemInfoType)type) {
787 case SystemInfoType::REGION_MEMORY_USAGE: 787 case SystemInfoType::REGION_MEMORY_USAGE:
@@ -807,7 +807,7 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) {
807 } 807 }
808 break; 808 break;
809 case SystemInfoType::KERNEL_ALLOCATED_PAGES: 809 case SystemInfoType::KERNEL_ALLOCATED_PAGES:
810 LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", type, param); 810 LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", param);
811 *out = 0; 811 *out = 0;
812 break; 812 break;
813 case SystemInfoType::KERNEL_SPAWNED_PIDS: 813 case SystemInfoType::KERNEL_SPAWNED_PIDS:
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp
index 93e980216..6467ff723 100644
--- a/src/video_core/renderer_base.cpp
+++ b/src/video_core/renderer_base.cpp
@@ -24,5 +24,6 @@ void RendererBase::RefreshRasterizerSetting() {
24 rasterizer = Common::make_unique<VideoCore::SWRasterizer>(); 24 rasterizer = Common::make_unique<VideoCore::SWRasterizer>();
25 } 25 }
26 rasterizer->InitObjects(); 26 rasterizer->InitObjects();
27 rasterizer->Reset();
27 } 28 }
28} 29}
diff --git a/src/video_core/swrasterizer.h b/src/video_core/swrasterizer.h
index e9a4e39c6..9a9a76d7a 100644
--- a/src/video_core/swrasterizer.h
+++ b/src/video_core/swrasterizer.h
@@ -15,7 +15,7 @@ class SWRasterizer : public RasterizerInterface {
15 void Reset() override {} 15 void Reset() override {}
16 void AddTriangle(const Pica::Shader::OutputVertex& v0, 16 void AddTriangle(const Pica::Shader::OutputVertex& v0,
17 const Pica::Shader::OutputVertex& v1, 17 const Pica::Shader::OutputVertex& v1,
18 const Pica::Shader::OutputVertex& v2); 18 const Pica::Shader::OutputVertex& v2) override;
19 void DrawTriangles() override {} 19 void DrawTriangles() override {}
20 void FlushFramebuffer() override {} 20 void FlushFramebuffer() override {}
21 void NotifyPicaRegisterChanged(u32 id) override {} 21 void NotifyPicaRegisterChanged(u32 id) override {}
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index eaddda668..912db91a4 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -2,7 +2,10 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <memory>
6
5#include "common/emu_window.h" 7#include "common/emu_window.h"
8#include "common/make_unique.h"
6#include "common/logging/log.h" 9#include "common/logging/log.h"
7 10
8#include "core/core.h" 11#include "core/core.h"
@@ -18,8 +21,8 @@
18 21
19namespace VideoCore { 22namespace VideoCore {
20 23
21EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window 24EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window
22RendererBase* g_renderer = nullptr; ///< Renderer plugin 25std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
23 26
24std::atomic<bool> g_hw_renderer_enabled; 27std::atomic<bool> g_hw_renderer_enabled;
25std::atomic<bool> g_shader_jit_enabled; 28std::atomic<bool> g_shader_jit_enabled;
@@ -29,7 +32,7 @@ void Init(EmuWindow* emu_window) {
29 Pica::Init(); 32 Pica::Init();
30 33
31 g_emu_window = emu_window; 34 g_emu_window = emu_window;
32 g_renderer = new RendererOpenGL(); 35 g_renderer = Common::make_unique<RendererOpenGL>();
33 g_renderer->SetWindow(g_emu_window); 36 g_renderer->SetWindow(g_emu_window);
34 g_renderer->Init(); 37 g_renderer->Init();
35 38
@@ -40,7 +43,7 @@ void Init(EmuWindow* emu_window) {
40void Shutdown() { 43void Shutdown() {
41 Pica::Shutdown(); 44 Pica::Shutdown();
42 45
43 delete g_renderer; 46 g_renderer.reset();
44 47
45 LOG_DEBUG(Render, "shutdown OK"); 48 LOG_DEBUG(Render, "shutdown OK");
46} 49}
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h
index 2867bf03e..accb0a4eb 100644
--- a/src/video_core/video_core.h
+++ b/src/video_core/video_core.h
@@ -5,6 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include <atomic> 7#include <atomic>
8#include <memory>
8 9
9class EmuWindow; 10class EmuWindow;
10class RendererBase; 11class RendererBase;
@@ -29,8 +30,8 @@ static const int kScreenBottomHeight = 240; ///< 3DS bottom screen height
29// Video core renderer 30// Video core renderer
30// --------------------- 31// ---------------------
31 32
32extern RendererBase* g_renderer; ///< Renderer plugin 33extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
33extern EmuWindow* g_emu_window; ///< Emu window 34extern EmuWindow* g_emu_window; ///< Emu window
34 35
35// TODO: Wrap these in a user settings struct along with any other graphics settings (often set from qt ui) 36// TODO: Wrap these in a user settings struct along with any other graphics settings (often set from qt ui)
36extern std::atomic<bool> g_hw_renderer_enabled; 37extern std::atomic<bool> g_hw_renderer_enabled;