diff options
42 files changed, 682 insertions, 475 deletions
diff --git a/appveyor.yml b/appveyor.yml index d05cc2213..a5ed35392 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,8 @@ environment: BUILD_PASSWORD: secure: EXGNlWKJsCtbeImEJ5EP9qrxZ+EqUFfNy+CP61nDOMA= +os: Visual Studio 2015 + platform: - x64 @@ -17,7 +19,7 @@ install: before_build: - mkdir build - cd build - - cmake -G "Visual Studio 14 Win64" -DCITRA_USE_BUNDLED_GLFW=1 -DCITRA_USE_BUNDLED_QT=1 .. + - cmake -G "Visual Studio 14 2015 Win64" -DCITRA_USE_BUNDLED_GLFW=1 -DCITRA_USE_BUNDLED_QT=1 .. - cd .. after_build: 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) void CallstackWidget::OnDebugModeEntered() { - ARM_Interface* app_core = Core::g_app_core; - - u32 sp = app_core->GetReg(13); //stack pointer - u32 ret_addr, call_addr, func_addr; + // Stack pointer + const u32 sp = Core::g_app_core->GetReg(13); Clear(); int counter = 0; for (u32 addr = 0x10000000; addr >= sp; addr -= 4) { - ret_addr = Memory::Read32(addr); - call_addr = ret_addr - 4; //get call address??? + const u32 ret_addr = Memory::Read32(addr); + const u32 call_addr = ret_addr - 4; //get call address??? if (Memory::GetPointer(call_addr) == nullptr) break; @@ -60,7 +58,7 @@ void CallstackWidget::OnDebugModeEntered() // Pre-compute the left-shift and the prefetch offset i_offset <<= 2; i_offset += 8; - func_addr = call_addr + i_offset; + const u32 func_addr = call_addr + i_offset; callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); 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) { } void RegistersWidget::OnDebugModeEntered() { - ARM_Interface* app_core = Core::g_app_core; - - if (app_core == nullptr) + if (!Core::g_app_core) return; for (int i = 0; i < core_registers->childCount(); ++i) - core_registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetReg(i), 8, 16, QLatin1Char('0'))); + core_registers->child(i)->setText(1, QString("0x%1").arg(Core::g_app_core->GetReg(i), 8, 16, QLatin1Char('0'))); for (int i = 0; i < vfp_registers->childCount(); ++i) - vfp_registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetVFPReg(i), 8, 16, QLatin1Char('0'))); + vfp_registers->child(i)->setText(1, QString("0x%1").arg(Core::g_app_core->GetVFPReg(i), 8, 16, QLatin1Char('0'))); UpdateCPSRValues(); 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) show(); - game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool()); + game_list->PopulateAsync(settings.value("gameListRootDir", "").toString(), settings.value("gameListDeepScan", false).toBool()); QStringList args = QApplication::arguments(); 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 // How many files + directories we found unsigned found_entries = 0; + // Save the status of callback function + bool callback_error = false; + #ifdef _WIN32 // Find the first file in the directory. WIN32_FIND_DATA ffd; @@ -455,8 +458,10 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo continue; unsigned ret_entries; - if (!callback(&ret_entries, directory, virtual_name)) + if (!callback(&ret_entries, directory, virtual_name)) { + callback_error = true; break; + } found_entries += ret_entries; #ifdef _WIN32 @@ -467,9 +472,14 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo closedir(dirp); #endif - // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it - if (num_entries_out != nullptr) - *num_entries_out = found_entries; + if (!callback_error) { + // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it + if (num_entries_out != nullptr) + *num_entries_out = found_entries; + return true; + } else { + return false; + } } unsigned 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 @@ #include "core/arm/skyeye_common/armsupp.h" const InstructionSetEncodingItem arm_instruction[] = { - { "vmla", 4, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 4, 4, 0 }}, - { "vmls", 7, ARMVFP2, { 28, 31, 0xF, 25, 27, 0x1, 23, 23, 1, 11, 11, 0, 8, 9, 0x2, 6, 6, 1, 4, 4, 0 }}, - { "vnmla", 4, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 4, 4, 0 }}, - { "vnmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }}, + { "vmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }}, + { "vmls", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x0, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }}, + { "vnmla", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }}, { "vnmls", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x1, 9, 11, 0x5, 6, 6, 0, 4, 4, 0 }}, { "vnmul", 5, ARMVFP2, { 23, 27, 0x1C, 20, 21, 0x2, 9, 11, 0x5, 6, 6, 1, 4, 4, 0 }}, { "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[] = { { "vmla", 0, ARMVFP2, { 0 }}, { "vmls", 0, ARMVFP2, { 0 }}, { "vnmla", 0, ARMVFP2, { 0 }}, - { "vnmla", 0, ARMVFP2, { 0 }}, { "vnmls", 0, ARMVFP2, { 0 }}, { "vnmul", 0, ARMVFP2, { 0 }}, { "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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) DEBUG_MSG; } - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) DEBUG_MSG; } - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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){ inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->inst = inst; inst_cream->get_addr = get_calc_addr_op(inst); - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) DEBUG_MSG; } - if (BITS(inst, 12, 15) == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->Rd = BITS(inst, 12, 15); inst_cream->Rm = BITS(inst, 0, 3); - if (inst_cream->Rd == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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){ inst_cream->Rd = BITS(inst, 12, 15); inst_cream->Rm = BITS(inst, 0, 3); - if (inst_cream->Rd == 15) { - inst_base->br = INDIRECT_BRANCH; - } return inst_base; } static 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) inst_cream->shifter_operand = BITS(inst, 0, 11); inst_cream->shtop_func = get_shtop(inst); - if (inst_cream->Rd == 15) - inst_base->br = INDIRECT_BRANCH; - return inst_base; } @@ -3244,7 +3202,6 @@ const transop_fp_t arm_instruction_trans[] = { INTERPRETER_TRANSLATE(vmla), INTERPRETER_TRANSLATE(vmls), INTERPRETER_TRANSLATE(vnmla), - INTERPRETER_TRANSLATE(vnmla), INTERPRETER_TRANSLATE(vnmls), INTERPRETER_TRANSLATE(vnmul), INTERPRETER_TRANSLATE(vmul), @@ -3636,209 +3593,208 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { case 0: goto VMLA_INST; \ case 1: goto VMLS_INST; \ case 2: goto VNMLA_INST; \ - case 3: goto VNMLA_INST; \ - case 4: goto VNMLS_INST; \ - case 5: goto VNMUL_INST; \ - case 6: goto VMUL_INST; \ - case 7: goto VADD_INST; \ - case 8: goto VSUB_INST; \ - case 9: goto VDIV_INST; \ - case 10: goto VMOVI_INST; \ - case 11: goto VMOVR_INST; \ - case 12: goto VABS_INST; \ - case 13: goto VNEG_INST; \ - case 14: goto VSQRT_INST; \ - case 15: goto VCMP_INST; \ - case 16: goto VCMP2_INST; \ - case 17: goto VCVTBDS_INST; \ - case 18: goto VCVTBFF_INST; \ - case 19: goto VCVTBFI_INST; \ - case 20: goto VMOVBRS_INST; \ - case 21: goto VMSR_INST; \ - case 22: goto VMOVBRC_INST; \ - case 23: goto VMRS_INST; \ - case 24: goto VMOVBCR_INST; \ - case 25: goto VMOVBRRSS_INST; \ - case 26: goto VMOVBRRD_INST; \ - case 27: goto VSTR_INST; \ - case 28: goto VPUSH_INST; \ - case 29: goto VSTM_INST; \ - case 30: goto VPOP_INST; \ - case 31: goto VLDR_INST; \ - case 32: goto VLDM_INST ; \ - case 33: goto SRS_INST; \ - case 34: goto RFE_INST; \ - case 35: goto BKPT_INST; \ - case 36: goto BLX_INST; \ - case 37: goto CPS_INST; \ - case 38: goto PLD_INST; \ - case 39: goto SETEND_INST; \ - case 40: goto CLREX_INST; \ - case 41: goto REV16_INST; \ - case 42: goto USAD8_INST; \ - case 43: goto SXTB_INST; \ - case 44: goto UXTB_INST; \ - case 45: goto SXTH_INST; \ - case 46: goto SXTB16_INST; \ - case 47: goto UXTH_INST; \ - case 48: goto UXTB16_INST; \ - case 49: goto CPY_INST; \ - case 50: goto UXTAB_INST; \ - case 51: goto SSUB8_INST; \ - case 52: goto SHSUB8_INST; \ - case 53: goto SSUBADDX_INST; \ - case 54: goto STREX_INST; \ - case 55: goto STREXB_INST; \ - case 56: goto SWP_INST; \ - case 57: goto SWPB_INST; \ - case 58: goto SSUB16_INST; \ - case 59: goto SSAT16_INST; \ - case 60: goto SHSUBADDX_INST; \ - case 61: goto QSUBADDX_INST; \ - case 62: goto SHADDSUBX_INST; \ - case 63: goto SHADD8_INST; \ - case 64: goto SHADD16_INST; \ - case 65: goto SEL_INST; \ - case 66: goto SADDSUBX_INST; \ - case 67: goto SADD8_INST; \ - case 68: goto SADD16_INST; \ - case 69: goto SHSUB16_INST; \ - case 70: goto UMAAL_INST; \ - case 71: goto UXTAB16_INST; \ - case 72: goto USUBADDX_INST; \ - case 73: goto USUB8_INST; \ - case 74: goto USUB16_INST; \ - case 75: goto USAT16_INST; \ - case 76: goto USADA8_INST; \ - case 77: goto UQSUBADDX_INST; \ - case 78: goto UQSUB8_INST; \ - case 79: goto UQSUB16_INST; \ - case 80: goto UQADDSUBX_INST; \ - case 81: goto UQADD8_INST; \ - case 82: goto UQADD16_INST; \ - case 83: goto SXTAB_INST; \ - case 84: goto UHSUBADDX_INST; \ - case 85: goto UHSUB8_INST; \ - case 86: goto UHSUB16_INST; \ - case 87: goto UHADDSUBX_INST; \ - case 88: goto UHADD8_INST; \ - case 89: goto UHADD16_INST; \ - case 90: goto UADDSUBX_INST; \ - case 91: goto UADD8_INST; \ - case 92: goto UADD16_INST; \ - case 93: goto SXTAH_INST; \ - case 94: goto SXTAB16_INST; \ - case 95: goto QADD8_INST; \ - case 96: goto BXJ_INST; \ - case 97: goto CLZ_INST; \ - case 98: goto UXTAH_INST; \ - case 99: goto BX_INST; \ - case 100: goto REV_INST; \ - case 101: goto BLX_INST; \ - case 102: goto REVSH_INST; \ - case 103: goto QADD_INST; \ - case 104: goto QADD16_INST; \ - case 105: goto QADDSUBX_INST; \ - case 106: goto LDREX_INST; \ - case 107: goto QDADD_INST; \ - case 108: goto QDSUB_INST; \ - case 109: goto QSUB_INST; \ - case 110: goto LDREXB_INST; \ - case 111: goto QSUB8_INST; \ - case 112: goto QSUB16_INST; \ - case 113: goto SMUAD_INST; \ - case 114: goto SMMUL_INST; \ - case 115: goto SMUSD_INST; \ - case 116: goto SMLSD_INST; \ - case 117: goto SMLSLD_INST; \ - case 118: goto SMMLA_INST; \ - case 119: goto SMMLS_INST; \ - case 120: goto SMLALD_INST; \ - case 121: goto SMLAD_INST; \ - case 122: goto SMLAW_INST; \ - case 123: goto SMULW_INST; \ - case 124: goto PKHTB_INST; \ - case 125: goto PKHBT_INST; \ - case 126: goto SMUL_INST; \ - case 127: goto SMLALXY_INST; \ - case 128: goto SMLA_INST; \ - case 129: goto MCRR_INST; \ - case 130: goto MRRC_INST; \ - case 131: goto CMP_INST; \ - case 132: goto TST_INST; \ - case 133: goto TEQ_INST; \ - case 134: goto CMN_INST; \ - case 135: goto SMULL_INST; \ - case 136: goto UMULL_INST; \ - case 137: goto UMLAL_INST; \ - case 138: goto SMLAL_INST; \ - case 139: goto MUL_INST; \ - case 140: goto MLA_INST; \ - case 141: goto SSAT_INST; \ - case 142: goto USAT_INST; \ - case 143: goto MRS_INST; \ - case 144: goto MSR_INST; \ - case 145: goto AND_INST; \ - case 146: goto BIC_INST; \ - case 147: goto LDM_INST; \ - case 148: goto EOR_INST; \ - case 149: goto ADD_INST; \ - case 150: goto RSB_INST; \ - case 151: goto RSC_INST; \ - case 152: goto SBC_INST; \ - case 153: goto ADC_INST; \ - case 154: goto SUB_INST; \ - case 155: goto ORR_INST; \ - case 156: goto MVN_INST; \ - case 157: goto MOV_INST; \ - case 158: goto STM_INST; \ - case 159: goto LDM_INST; \ - case 160: goto LDRSH_INST; \ - case 161: goto STM_INST; \ - case 162: goto LDM_INST; \ - case 163: goto LDRSB_INST; \ - case 164: goto STRD_INST; \ - case 165: goto LDRH_INST; \ - case 166: goto STRH_INST; \ - case 167: goto LDRD_INST; \ - case 168: goto STRT_INST; \ - case 169: goto STRBT_INST; \ - case 170: goto LDRBT_INST; \ - case 171: goto LDRT_INST; \ - case 172: goto MRC_INST; \ - case 173: goto MCR_INST; \ + case 3: goto VNMLS_INST; \ + case 4: goto VNMUL_INST; \ + case 5: goto VMUL_INST; \ + case 6: goto VADD_INST; \ + case 7: goto VSUB_INST; \ + case 8: goto VDIV_INST; \ + case 9: goto VMOVI_INST; \ + case 10: goto VMOVR_INST; \ + case 11: goto VABS_INST; \ + case 12: goto VNEG_INST; \ + case 13: goto VSQRT_INST; \ + case 14: goto VCMP_INST; \ + case 15: goto VCMP2_INST; \ + case 16: goto VCVTBDS_INST; \ + case 17: goto VCVTBFF_INST; \ + case 18: goto VCVTBFI_INST; \ + case 19: goto VMOVBRS_INST; \ + case 20: goto VMSR_INST; \ + case 21: goto VMOVBRC_INST; \ + case 22: goto VMRS_INST; \ + case 23: goto VMOVBCR_INST; \ + case 24: goto VMOVBRRSS_INST; \ + case 25: goto VMOVBRRD_INST; \ + case 26: goto VSTR_INST; \ + case 27: goto VPUSH_INST; \ + case 28: goto VSTM_INST; \ + case 29: goto VPOP_INST; \ + case 30: goto VLDR_INST; \ + case 31: goto VLDM_INST ; \ + case 32: goto SRS_INST; \ + case 33: goto RFE_INST; \ + case 34: goto BKPT_INST; \ + case 35: goto BLX_INST; \ + case 36: goto CPS_INST; \ + case 37: goto PLD_INST; \ + case 38: goto SETEND_INST; \ + case 39: goto CLREX_INST; \ + case 40: goto REV16_INST; \ + case 41: goto USAD8_INST; \ + case 42: goto SXTB_INST; \ + case 43: goto UXTB_INST; \ + case 44: goto SXTH_INST; \ + case 45: goto SXTB16_INST; \ + case 46: goto UXTH_INST; \ + case 47: goto UXTB16_INST; \ + case 48: goto CPY_INST; \ + case 49: goto UXTAB_INST; \ + case 50: goto SSUB8_INST; \ + case 51: goto SHSUB8_INST; \ + case 52: goto SSUBADDX_INST; \ + case 53: goto STREX_INST; \ + case 54: goto STREXB_INST; \ + case 55: goto SWP_INST; \ + case 56: goto SWPB_INST; \ + case 57: goto SSUB16_INST; \ + case 58: goto SSAT16_INST; \ + case 59: goto SHSUBADDX_INST; \ + case 60: goto QSUBADDX_INST; \ + case 61: goto SHADDSUBX_INST; \ + case 62: goto SHADD8_INST; \ + case 63: goto SHADD16_INST; \ + case 64: goto SEL_INST; \ + case 65: goto SADDSUBX_INST; \ + case 66: goto SADD8_INST; \ + case 67: goto SADD16_INST; \ + case 68: goto SHSUB16_INST; \ + case 69: goto UMAAL_INST; \ + case 70: goto UXTAB16_INST; \ + case 71: goto USUBADDX_INST; \ + case 72: goto USUB8_INST; \ + case 73: goto USUB16_INST; \ + case 74: goto USAT16_INST; \ + case 75: goto USADA8_INST; \ + case 76: goto UQSUBADDX_INST; \ + case 77: goto UQSUB8_INST; \ + case 78: goto UQSUB16_INST; \ + case 79: goto UQADDSUBX_INST; \ + case 80: goto UQADD8_INST; \ + case 81: goto UQADD16_INST; \ + case 82: goto SXTAB_INST; \ + case 83: goto UHSUBADDX_INST; \ + case 84: goto UHSUB8_INST; \ + case 85: goto UHSUB16_INST; \ + case 86: goto UHADDSUBX_INST; \ + case 87: goto UHADD8_INST; \ + case 88: goto UHADD16_INST; \ + case 89: goto UADDSUBX_INST; \ + case 90: goto UADD8_INST; \ + case 91: goto UADD16_INST; \ + case 92: goto SXTAH_INST; \ + case 93: goto SXTAB16_INST; \ + case 94: goto QADD8_INST; \ + case 95: goto BXJ_INST; \ + case 96: goto CLZ_INST; \ + case 97: goto UXTAH_INST; \ + case 98: goto BX_INST; \ + case 99: goto REV_INST; \ + case 100: goto BLX_INST; \ + case 101: goto REVSH_INST; \ + case 102: goto QADD_INST; \ + case 103: goto QADD16_INST; \ + case 104: goto QADDSUBX_INST; \ + case 105: goto LDREX_INST; \ + case 106: goto QDADD_INST; \ + case 107: goto QDSUB_INST; \ + case 108: goto QSUB_INST; \ + case 109: goto LDREXB_INST; \ + case 110: goto QSUB8_INST; \ + case 111: goto QSUB16_INST; \ + case 112: goto SMUAD_INST; \ + case 113: goto SMMUL_INST; \ + case 114: goto SMUSD_INST; \ + case 115: goto SMLSD_INST; \ + case 116: goto SMLSLD_INST; \ + case 117: goto SMMLA_INST; \ + case 118: goto SMMLS_INST; \ + case 119: goto SMLALD_INST; \ + case 120: goto SMLAD_INST; \ + case 121: goto SMLAW_INST; \ + case 122: goto SMULW_INST; \ + case 123: goto PKHTB_INST; \ + case 124: goto PKHBT_INST; \ + case 125: goto SMUL_INST; \ + case 126: goto SMLALXY_INST; \ + case 127: goto SMLA_INST; \ + case 128: goto MCRR_INST; \ + case 129: goto MRRC_INST; \ + case 130: goto CMP_INST; \ + case 131: goto TST_INST; \ + case 132: goto TEQ_INST; \ + case 133: goto CMN_INST; \ + case 134: goto SMULL_INST; \ + case 135: goto UMULL_INST; \ + case 136: goto UMLAL_INST; \ + case 137: goto SMLAL_INST; \ + case 138: goto MUL_INST; \ + case 139: goto MLA_INST; \ + case 140: goto SSAT_INST; \ + case 141: goto USAT_INST; \ + case 142: goto MRS_INST; \ + case 143: goto MSR_INST; \ + case 144: goto AND_INST; \ + case 145: goto BIC_INST; \ + case 146: goto LDM_INST; \ + case 147: goto EOR_INST; \ + case 148: goto ADD_INST; \ + case 149: goto RSB_INST; \ + case 150: goto RSC_INST; \ + case 151: goto SBC_INST; \ + case 152: goto ADC_INST; \ + case 153: goto SUB_INST; \ + case 154: goto ORR_INST; \ + case 155: goto MVN_INST; \ + case 156: goto MOV_INST; \ + case 157: goto STM_INST; \ + case 158: goto LDM_INST; \ + case 159: goto LDRSH_INST; \ + case 160: goto STM_INST; \ + case 161: goto LDM_INST; \ + case 162: goto LDRSB_INST; \ + case 163: goto STRD_INST; \ + case 164: goto LDRH_INST; \ + case 165: goto STRH_INST; \ + case 166: goto LDRD_INST; \ + case 167: goto STRT_INST; \ + case 168: goto STRBT_INST; \ + case 169: goto LDRBT_INST; \ + case 170: goto LDRT_INST; \ + case 171: goto MRC_INST; \ + case 172: goto MCR_INST; \ + case 173: goto MSR_INST; \ case 174: goto MSR_INST; \ case 175: goto MSR_INST; \ case 176: goto MSR_INST; \ case 177: goto MSR_INST; \ - case 178: goto MSR_INST; \ - case 179: goto LDRB_INST; \ - case 180: goto STRB_INST; \ - case 181: goto LDR_INST; \ - case 182: goto LDRCOND_INST ; \ - case 183: goto STR_INST; \ - case 184: goto CDP_INST; \ - case 185: goto STC_INST; \ - case 186: goto LDC_INST; \ - case 187: goto LDREXD_INST; \ - case 188: goto STREXD_INST; \ - case 189: goto LDREXH_INST; \ - case 190: goto STREXH_INST; \ - case 191: goto NOP_INST; \ - case 192: goto YIELD_INST; \ - case 193: goto WFE_INST; \ - case 194: goto WFI_INST; \ - case 195: goto SEV_INST; \ - case 196: goto SWI_INST; \ - case 197: goto BBL_INST; \ - case 198: goto B_2_THUMB ; \ - case 199: goto B_COND_THUMB ; \ - case 200: goto BL_1_THUMB ; \ - case 201: goto BL_2_THUMB ; \ - case 202: goto BLX_1_THUMB ; \ - case 203: goto DISPATCH; \ - case 204: goto INIT_INST_LENGTH; \ - case 205: goto END; \ + case 178: goto LDRB_INST; \ + case 179: goto STRB_INST; \ + case 180: goto LDR_INST; \ + case 181: goto LDRCOND_INST ; \ + case 182: goto STR_INST; \ + case 183: goto CDP_INST; \ + case 184: goto STC_INST; \ + case 185: goto LDC_INST; \ + case 186: goto LDREXD_INST; \ + case 187: goto STREXD_INST; \ + case 188: goto LDREXH_INST; \ + case 189: goto STREXH_INST; \ + case 190: goto NOP_INST; \ + case 191: goto YIELD_INST; \ + case 192: goto WFE_INST; \ + case 193: goto WFI_INST; \ + case 194: goto SEV_INST; \ + case 195: goto SWI_INST; \ + case 196: goto BBL_INST; \ + case 197: goto B_2_THUMB ; \ + case 198: goto B_COND_THUMB ; \ + case 199: goto BL_1_THUMB ; \ + case 200: goto BL_2_THUMB ; \ + case 201: goto BLX_1_THUMB ; \ + case 202: goto DISPATCH; \ + case 203: goto INIT_INST_LENGTH; \ + case 204: goto END; \ } #endif @@ -3865,7 +3821,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { // to a clunky switch statement. #if defined __GNUC__ || defined __clang__ void *InstLabel[] = { - &&VMLA_INST, &&VMLS_INST, &&VNMLA_INST, &&VNMLA_INST, &&VNMLS_INST, &&VNMUL_INST, &&VMUL_INST, &&VADD_INST, &&VSUB_INST, + &&VMLA_INST, &&VMLS_INST, &&VNMLA_INST, &&VNMLS_INST, &&VNMUL_INST, &&VMUL_INST, &&VADD_INST, &&VSUB_INST, &&VDIV_INST, &&VMOVI_INST, &&VMOVR_INST, &&VABS_INST, &&VNEG_INST, &&VSQRT_INST, &&VCMP_INST, &&VCMP2_INST, &&VCVTBDS_INST, &&VCVTBFF_INST, &&VCVTBFI_INST, &&VMOVBRS_INST, &&VMSR_INST, &&VMOVBRC_INST, &&VMRS_INST, &&VMOVBCR_INST, &&VMOVBRRSS_INST, &&VMOVBRRD_INST, &&VSTR_INST, &&VPUSH_INST, &&VSTM_INST, &&VPOP_INST, &&VLDR_INST, &&VLDM_INST, @@ -4477,11 +4433,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { inst_cream->get_addr(cpu, inst_cream->inst, addr); cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory8(addr); - - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4494,12 +4445,14 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { ldst_inst* inst_cream = (ldst_inst*)inst_base->component; inst_cream->get_addr(cpu, inst_cream->inst, addr); - cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory8(addr); + const u32 dest_index = BITS(inst_cream->inst, 12, 15); + const u32 previous_mode = cpu->Mode; - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } + cpu->ChangePrivilegeMode(USER32MODE); + const u8 value = cpu->ReadMemory8(addr); + cpu->ChangePrivilegeMode(previous_mode); + + cpu->Reg[dest_index] = value; } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4535,10 +4488,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { cpu->SetExclusiveMemoryAddress(read_addr); RD = cpu->ReadMemory32(read_addr); - if (inst_cream->Rd == 15) { - INC_PC(sizeof(generic_arm_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(generic_arm_inst)); @@ -4554,10 +4503,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { cpu->SetExclusiveMemoryAddress(read_addr); RD = cpu->ReadMemory8(read_addr); - if (inst_cream->Rd == 15) { - INC_PC(sizeof(generic_arm_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(generic_arm_inst)); @@ -4573,10 +4518,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { cpu->SetExclusiveMemoryAddress(read_addr); RD = cpu->ReadMemory16(read_addr); - if (inst_cream->Rd == 15) { - INC_PC(sizeof(generic_arm_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(generic_arm_inst)); @@ -4593,11 +4534,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { RD = cpu->ReadMemory32(read_addr); RD2 = cpu->ReadMemory32(read_addr + 4); - - if (inst_cream->Rd == 15) { - INC_PC(sizeof(generic_arm_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(generic_arm_inst)); @@ -4611,10 +4547,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { inst_cream->get_addr(cpu, inst_cream->inst, addr); cpu->Reg[BITS(inst_cream->inst, 12, 15)] = cpu->ReadMemory16(addr); - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4631,10 +4563,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { value |= 0xffffff00; } cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4652,10 +4580,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { value |= 0xffff0000; } cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4668,13 +4592,14 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { ldst_inst* inst_cream = (ldst_inst*)inst_base->component; inst_cream->get_addr(cpu, inst_cream->inst, addr); - unsigned int value = cpu->ReadMemory32(addr); - cpu->Reg[BITS(inst_cream->inst, 12, 15)] = value; + const u32 dest_index = BITS(inst_cream->inst, 12, 15); + const u32 previous_mode = cpu->Mode; - if (BITS(inst_cream->inst, 12, 15) == 15) { - INC_PC(sizeof(ldst_inst)); - goto DISPATCH; - } + cpu->ChangePrivilegeMode(USER32MODE); + const u32 value = cpu->ReadMemory32(addr); + cpu->ChangePrivilegeMode(previous_mode); + + cpu->Reg[dest_index] = value; } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -4731,10 +4656,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { UPDATE_NFLAG(RD); UPDATE_ZFLAG(RD); } - if (inst_cream->Rd == 15) { - INC_PC(sizeof(mla_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(mla_inst)); @@ -4773,18 +4694,15 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { mrc_inst* inst_cream = (mrc_inst*)inst_base->component; - unsigned int inst = inst_cream->inst; - if (inst_cream->Rd == 15) { - DEBUG_MSG; - } - if (inst_cream->inst == 0xeef04a10) { - // Undefined instruction fmrx - RD = 0x20000000; - CITRA_IGNORE_EXIT(-1); - goto END; - } else { - if (inst_cream->cp_num == 15) - RD = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); + if (inst_cream->cp_num == 15) { + const uint32_t value = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); + + if (inst_cream->Rd == 15) { + cpu->Cpsr = (cpu->Cpsr & ~0xF0000000) | (value & 0xF0000000); + LOAD_NZCVT; + } else { + RD = value; + } } } cpu->Reg[15] += cpu->GetInstructionSize(); @@ -4883,10 +4801,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { UPDATE_NFLAG(RD); UPDATE_ZFLAG(RD); } - if (inst_cream->Rd == 15) { - INC_PC(sizeof(mul_inst)); - goto DISPATCH; - } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(mul_inst)); @@ -6061,8 +5975,13 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { ldst_inst* inst_cream = (ldst_inst*)inst_base->component; inst_cream->get_addr(cpu, inst_cream->inst, addr); - unsigned int value = cpu->Reg[BITS(inst_cream->inst, 12, 15)] & 0xff; + + const u32 previous_mode = cpu->Mode; + const u32 value = cpu->Reg[BITS(inst_cream->inst, 12, 15)] & 0xff; + + cpu->ChangePrivilegeMode(USER32MODE); cpu->WriteMemory8(addr, value); + cpu->ChangePrivilegeMode(previous_mode); } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldst_inst)); @@ -6196,8 +6115,16 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { ldst_inst* inst_cream = (ldst_inst*)inst_base->component; inst_cream->get_addr(cpu, inst_cream->inst, addr); - unsigned int value = cpu->Reg[BITS(inst_cream->inst, 12, 15)]; + const u32 previous_mode = cpu->Mode; + const u32 rt_index = BITS(inst_cream->inst, 12, 15); + + u32 value = cpu->Reg[rt_index]; + if (rt_index == 15) + value += 2 * cpu->GetInstructionSize(); + + cpu->ChangePrivilegeMode(USER32MODE); cpu->WriteMemory32(addr, value); + cpu->ChangePrivilegeMode(previous_mode); } cpu->Reg[15] += cpu->GetInstructionSize(); 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 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <memory> + +#include "common/make_unique.h" #include "common/logging/log.h" #include "core/core.h" @@ -17,8 +20,8 @@ namespace Core { -ARM_Interface* g_app_core = nullptr; ///< ARM11 application core -ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core +std::unique_ptr<ARM_Interface> g_app_core; ///< ARM11 application core +std::unique_ptr<ARM_Interface> g_sys_core; ///< ARM11 system (OS) core /// Run the core CPU loop void RunLoop(int tight_loop) { @@ -71,16 +74,16 @@ void Stop() { /// Initialize the core int Init() { - g_sys_core = new ARM_DynCom(USER32MODE); - g_app_core = new ARM_DynCom(USER32MODE); + g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE); + g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE); LOG_DEBUG(Core, "Initialized OK"); return 0; } void Shutdown() { - delete g_app_core; - delete g_sys_core; + g_app_core.reset(); + g_sys_core.reset(); LOG_DEBUG(Core, "Shutdown OK"); } 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 @@ #pragma once +#include <memory> #include "common/common_types.h" class ARM_Interface; @@ -23,8 +24,8 @@ struct ThreadContext { u32 fpexc; }; -extern ARM_Interface* g_app_core; ///< ARM11 application core -extern ARM_Interface* g_sys_core; ///< ARM11 system (OS) core +extern std::unique_ptr<ARM_Interface> g_app_core; ///< ARM11 application core +extern std::unique_ptr<ARM_Interface> g_sys_core; ///< ARM11 system (OS) core //////////////////////////////////////////////////////////////////////////////////////////////////// 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, // Wait current thread (acquire the arbiter)... case ArbitrationType::WaitIfLessThan: - if ((s32)Memory::Read32(address) <= value) { + if ((s32)Memory::Read32(address) < value) { Kernel::WaitCurrentThread_ArbitrateAddress(address); } break; case ArbitrationType::WaitIfLessThanWithTimeout: - if ((s32)Memory::Read32(address) <= value) { + if ((s32)Memory::Read32(address) < value) { Kernel::WaitCurrentThread_ArbitrateAddress(address); GetCurrentThread()->WakeAfterDelay(nanoseconds); } break; case ArbitrationType::DecrementAndWaitIfLessThan: { - s32 memory_value = Memory::Read32(address) - 1; - Memory::Write32(address, memory_value); - if (memory_value <= value) { + s32 memory_value = Memory::Read32(address); + if (memory_value < value) { + // Only change the memory value if the thread should wait + Memory::Write32(address, (s32)memory_value - 1); Kernel::WaitCurrentThread_ArbitrateAddress(address); } break; } case ArbitrationType::DecrementAndWaitIfLessThanWithTimeout: { - s32 memory_value = Memory::Read32(address) - 1; - Memory::Write32(address, memory_value); - if (memory_value <= value) { + s32 memory_value = Memory::Read32(address); + if (memory_value < value) { + // Only change the memory value if the thread should wait + Memory::Write32(address, (s32)memory_value - 1); Kernel::WaitCurrentThread_ArbitrateAddress(address); GetCurrentThread()->WakeAfterDelay(nanoseconds); } @@ -82,6 +84,13 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, HLE::Reschedule(__func__); + // The calls that use a timeout seem to always return a Timeout error even if they did not put the thread to sleep + if (type == ArbitrationType::WaitIfLessThanWithTimeout || + type == ArbitrationType::DecrementAndWaitIfLessThanWithTimeout) { + + return ResultCode(ErrorDescription::Timeout, ErrorModule::OS, + ErrorSummary::StatusChanged, ErrorLevel::Info); + } return RESULT_SUCCESS; } 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) { thread->waitsynch_waited = false; - if (thread->status == THREADSTATUS_WAIT_SYNCH) { + if (thread->status == THREADSTATUS_WAIT_SYNCH || thread->status == THREADSTATUS_WAIT_ARB) { thread->SetWaitSynchronizationResult(ResultCode(ErrorDescription::Timeout, ErrorModule::OS, ErrorSummary::StatusChanged, ErrorLevel::Info)); 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() { void Timer::Acquire() { ASSERT_MSG( !ShouldWait(), "object unavailable!"); + + if (reset_type == RESETTYPE_ONESHOT) + signaled = false; } void Timer::Set(s64 initial, s64 interval) { @@ -84,9 +87,6 @@ static void TimerCallback(u64 timer_handle, int cycles_late) { // Resume all waiting threads timer->WakeupAllWaitingThreads(); - if (timer->reset_type == RESETTYPE_ONESHOT) - timer->signaled = false; - if (timer->interval_delay != 0) { // Reschedule the timer with the interval delay 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 @@ namespace ACT_U { -// Empty arrays are illegal -- commented out until an entry is added. -//const Interface::FunctionInfo FunctionTable[] = { }; +const Interface::FunctionInfo FunctionTable[] = { + {0x000600C2, nullptr, "GetAccountDataBlock"}, +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class Interface::Interface() { - //Register(FunctionTable); + Register(FunctionTable); } } // 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 { namespace AM { const Interface::FunctionInfo FunctionTable[] = { + {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"}, + {0x00020082, GetTitleIDList, "GetTitleIDList"}, + {0x00030084, nullptr, "ListTitles"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x00080000, nullptr, "TitleIDListGetTotal3"}, + {0x00090082, nullptr, "GetTitleIDList3"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "ListTitles2"}, + {0x00140040, nullptr, "FinishInstallToMedia"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"}, + {0x04010080, nullptr, "InstallFIRM"}, + {0x04020040, nullptr, "StartInstallCIADB0"}, + {0x04030000, nullptr, "StartInstallCIADB1"}, + {0x04040002, nullptr, "AbortCIAInstall"}, + {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, + {0x04060002, nullptr, "CloseCIA"}, + {0x040700C2, nullptr, "FinalizeTitlesInstall"}, + {0x04080042, nullptr, "GetCiaFileInfo"}, + {0x040E00C2, nullptr, "InstallTitlesFinish"}, + {0x040F0000, nullptr, "InstallNATIVEFIRM"}, + {0x041000C0, nullptr, "DeleteTitle"}, + {0x04120000, nullptr, "Initialize"}, + {0x041700C0, nullptr, "MigrateAGBtoSAV"}, {0x08010000, nullptr, "OpenTicket"}, {0x08020002, nullptr, "TicketAbortInstall"}, {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 { const Interface::FunctionInfo FunctionTable[] = { {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"}, {0x00020082, GetTitleIDList, "GetTitleIDList"}, + {0x00030084, nullptr, "ListTitles"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x00080000, nullptr, "TitleIDListGetTotal3"}, + {0x00090082, nullptr, "GetTitleIDList3"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "ListTitles2"}, + {0x00140040, nullptr, "FinishInstallToMedia"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"} }; AM_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 { const Interface::FunctionInfo FunctionTable[] = { {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"}, {0x00020082, GetTitleIDList, "GetTitleIDList"}, + {0x00030084, nullptr, "ListTitles"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x00080000, nullptr, "TitleIDListGetTotal3"}, + {0x00090082, nullptr, "GetTitleIDList3"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "ListTitles2"}, + {0x00140040, nullptr, "FinishInstallToMedia"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"}, + {0x04010080, nullptr, "InstallFIRM"}, + {0x04020040, nullptr, "StartInstallCIADB0"}, + {0x04030000, nullptr, "StartInstallCIADB1"}, + {0x04040002, nullptr, "AbortCIAInstall"}, + {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, + {0x04060002, nullptr, "CloseCIA"}, + {0x040700C2, nullptr, "FinalizeTitlesInstall"}, + {0x04080042, nullptr, "GetCiaFileInfo"}, + {0x040E00C2, nullptr, "InstallTitlesFinish"}, + {0x040F0000, nullptr, "InstallNATIVEFIRM"}, + {0x041000C0, nullptr, "DeleteTitle"}, + {0x04120000, nullptr, "Initialize"}, + {0x041700C0, nullptr, "MigrateAGBtoSAV"} }; AM_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[] = { {0x004E0000, nullptr, "HardwareResetAsync"}, {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"}, {0x00500040, nullptr, "GetApplicationCpuTimeLimit"}, + {0x00510080, nullptr, "GetStartupArgument"}, + {0x00520104, nullptr, "Wrap1"}, + {0x00530104, nullptr, "Unwrap1"}, + {0x00580002, nullptr, "GetProgramID"}, + {0x01010000, nullptr, "CheckNew3DSApp"}, + {0x01020000, nullptr, "CheckNew3DS"} }; APT_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[] = { {0x004E0000, nullptr, "HardwareResetAsync"}, {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, + {0x00510080, nullptr, "GetStartupArgument"}, + {0x00520104, nullptr, "Wrap1"}, + {0x00530104, nullptr, "Unwrap1"}, + {0x00580002, nullptr, "GetProgramID"}, + {0x01010000, nullptr, "CheckNew3DSApp"}, + {0x01020000, nullptr, "CheckNew3DS"} }; APT_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 { const Interface::FunctionInfo FunctionTable[] = { {0x00020100, nullptr, "GetStorageInfo"}, + {0x000C0082, nullptr, "UnregisterTask"}, + {0x001E0042, nullptr, "CancelTask"}, + {0x00330042, nullptr, "StartBgImmediate"}, }; BOSS_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[] = { {0x002A0080, nullptr, "GetLatestVsyncTiming"}, {0x002B0000, nullptr, "GetStereoCameraCalibrationData"}, {0x002C0400, nullptr, "SetStereoCameraCalibrationData"}, + {0x002D00C0, nullptr, "WriteRegisterI2c"}, + {0x002E00C0, nullptr, "WriteMcuVariableI2c"}, + {0x002F0080, nullptr, "ReadRegisterI2cExclusive"}, + {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"}, {0x00310180, nullptr, "SetImageQualityCalibrationData"}, {0x00320000, nullptr, "GetImageQualityCalibrationData"}, {0x003302C0, nullptr, "SetPackageParameterWithoutContext"}, {0x00340140, nullptr, "SetPackageParameterWithContext"}, {0x003501C0, nullptr, "SetPackageParameterWithContextDetail"}, {0x00360000, nullptr, "GetSuitableY2rStandardCoefficient"}, + {0x00370202, nullptr, "PlayShutterSoundWithWave"}, {0x00380040, nullptr, "PlayShutterSound"}, {0x00390000, nullptr, "DriverInitialize"}, {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[] = { {0x00060000, nullptr, "ReleaseSoundChannels"}, {0x00070000, nullptr, "AcquireCaptureDevice"}, {0x00080040, nullptr, "ReleaseCaptureDevice"}, - {0x00090082, nullptr, "FlushDCache"}, - {0x000A0082, nullptr, "StoreDCache"}, - {0x000B0082, nullptr, "InvalidateDCache"}, + {0x00090082, nullptr, "FlushDataCache"}, + {0x000A0082, nullptr, "StoreDataCache"}, + {0x000B0082, nullptr, "InvalidateDataCache"}, + {0x000C0000, nullptr, "Reset"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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) { } /** - * DSP_DSP::WriteReg0x10 service function + * DSP_DSP::SetSemaphore service function * Inputs: * 1 : Unknown (observed only half word used) * Outputs: * 1 : Result of function, 0 on success, otherwise error code */ -static void WriteReg0x10(Service::Interface* self) { +static void SetSemaphore(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); SignalInterrupt(); @@ -276,12 +276,17 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00020040, nullptr, "RecvDataIsReady"}, {0x00030080, nullptr, "SendData"}, {0x00040040, nullptr, "SendDataIsEmpty"}, - {0x00070040, WriteReg0x10, "WriteReg0x10"}, + {0x000500C2, nullptr, "SendFifoEx"}, + {0x000600C0, nullptr, "RecvFifoEx"}, + {0x00070040, SetSemaphore, "SetSemaphore"}, {0x00080000, nullptr, "GetSemaphore"}, {0x00090040, nullptr, "ClearSemaphore"}, + {0x000A0040, nullptr, "MaskSemaphore"}, {0x000B0000, nullptr, "CheckSemaphoreRequest"}, {0x000C0040, ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"}, {0x000D0082, WriteProcessPipe, "WriteProcessPipe"}, + {0x000E00C0, nullptr, "ReadPipe"}, + {0x000F0080, nullptr, "GetPipeReadableSize"}, {0x001000C0, ReadPipeIfPossible, "ReadPipeIfPossible"}, {0x001100C2, LoadComponent, "LoadComponent"}, {0x00120000, nullptr, "UnloadComponent"}, @@ -295,7 +300,10 @@ const Interface::FunctionInfo FunctionTable[] = { {0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"}, {0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"}, {0x001C0082, nullptr, "SetIirFilterEQ"}, + {0x001D00C0, nullptr, "ReadMultiEx_SPI2"}, + {0x001E00C2, nullptr, "WriteMultiEx_SPI2"}, {0x001F0000, GetHeadphoneStatus, "GetHeadphoneStatus"}, + {0x00200040, nullptr, "ForceHeadphoneOut"}, {0x00210000, nullptr, "GetIsDspOccupied"}, }; 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 { const Interface::FunctionInfo FunctionTable[] = { {0x00010000, nullptr, "HasLoggedIn"}, + {0x00020000, nullptr, "IsOnline"}, {0x00030000, nullptr, "Login"}, {0x00040000, nullptr, "Logout"}, - {0x00050000, nullptr, "GetFriendKey"}, + {0x00050000, nullptr, "GetMyFriendKey"}, + {0x00060000, nullptr, "GetMyPreference"}, + {0x00070000, nullptr, "GetMyProfile"}, {0x00080000, nullptr, "GetMyPresence"}, {0x00090000, nullptr, "GetMyScreenName"}, - {0x00100040, nullptr, "GetPassword"}, + {0x000A0000, nullptr, "GetMyMii"}, + {0x000B0000, nullptr, "GetMyLocalAccountId"}, + {0x000C0000, nullptr, "GetMyPlayingGame"}, + {0x000D0000, nullptr, "GetMyFavoriteGame"}, + {0x000E0000, nullptr, "GetMyNcPrincipalId"}, + {0x000F0000, nullptr, "GetMyComment"}, + {0x00100040, nullptr, "GetMyPassword"}, {0x00110080, nullptr, "GetFriendKeyList"}, + {0x00120042, nullptr, "GetFriendPresence"}, + {0x00130142, nullptr, "GetFriendScreenName"}, + {0x00140044, nullptr, "GetFriendMii"}, + {0x00150042, nullptr, "GetFriendProfile"}, + {0x00160042, nullptr, "GetFriendRelationship"}, + {0x00170042, nullptr, "GetFriendAttributeFlags"}, + {0x00180044, nullptr, "GetFriendPlayingGame"}, {0x00190042, nullptr, "GetFriendFavoriteGame"}, {0x001A00C4, nullptr, "GetFriendInfo"}, - {0x001B0080, nullptr, "IsOnFriendList"}, - {0x001C0042, nullptr, "DecodeLocalFriendCode"}, - {0x001D0002, nullptr, "SetCurrentlyPlayingText"}, + {0x001B0080, nullptr, "IsIncludedInFriendList"}, + {0x001C0042, nullptr, "UnscrambleLocalFriendCode"}, + {0x001D0002, nullptr, "UpdateGameModeDescription"}, + {0x001E02C2, nullptr, "UpdateGameMode"}, + {0x001F0042, nullptr, "SendInvitation"}, + {0x00200002, nullptr, "AttachToEventNotification"}, + {0x00210040, nullptr, "SetNotificationMask"}, + {0x00220040, nullptr, "GetEventNotification"}, {0x00230000, nullptr, "GetLastResponseResult"}, + {0x00240040, nullptr, "PrincipalIdToFriendCode"}, + {0x00250080, nullptr, "FriendCodeToPrincipalId"}, + {0x00260080, nullptr, "IsValidFriendCode"}, {0x00270040, nullptr, "ResultToErrorCode"}, {0x00280244, nullptr, "RequestGameAuthentication"}, {0x00290000, nullptr, "GetGameAuthenticationData"}, {0x002A0204, nullptr, "RequestServiceLocator"}, {0x002B0000, nullptr, "GetServiceLocatorData"}, + {0x002C0002, nullptr, "DetectNatProperties"}, + {0x002D0000, nullptr, "GetNatProperties"}, + {0x002E0000, nullptr, "GetServerTimeInterval"}, + {0x002F0040, nullptr, "AllowHalfAwake"}, + {0x00300000, nullptr, "GetServerTypes"}, + {0x00310082, nullptr, "GetFriendComment"}, {0x00320042, nullptr, "SetClientSdkVersion"}, + {0x00330000, nullptr, "GetMyApproachContext"}, + {0x00340046, nullptr, "AddFriendWithApproach"}, + {0x00350082, nullptr, "DecryptApproachContext"}, }; FRD_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) { } const Interface::FunctionInfo FunctionTable[] = { - {0x000100C6, nullptr, "Dummy1"}, - {0x040100C4, nullptr, "Control"}, - {0x08010002, Initialize, "Initialize"}, - {0x080201C2, OpenFile, "OpenFile"}, - {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, - {0x08040142, DeleteFile, "DeleteFile"}, - {0x08050244, RenameFile, "RenameFile"}, - {0x08060142, DeleteDirectory, "DeleteDirectory"}, - {0x08070142, nullptr, "DeleteDirectoryRecursively"}, - {0x08080202, CreateFile, "CreateFile"}, - {0x08090182, CreateDirectory, "CreateDirectory"}, - {0x080A0244, RenameDirectory, "RenameDirectory"}, - {0x080B0102, OpenDirectory, "OpenDirectory"}, - {0x080C00C2, OpenArchive, "OpenArchive"}, - {0x080D0144, nullptr, "ControlArchive"}, - {0x080E0080, CloseArchive, "CloseArchive"}, - {0x080F0180, FormatThisUserSaveData,"FormatThisUserSaveData"}, - {0x08100200, nullptr, "CreateSystemSaveData"}, - {0x08110040, nullptr, "DeleteSystemSaveData"}, - {0x08120080, GetFreeBytes, "GetFreeBytes"}, - {0x08130000, nullptr, "GetCardType"}, - {0x08140000, nullptr, "GetSdmcArchiveResource"}, - {0x08150000, nullptr, "GetNandArchiveResource"}, - {0x08160000, nullptr, "GetSdmcFatfsErro"}, - {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, - {0x08180000, IsSdmcWriteable, "IsSdmcWritable"}, - {0x08190042, nullptr, "GetSdmcCid"}, - {0x081A0042, nullptr, "GetNandCid"}, - {0x081B0000, nullptr, "GetSdmcSpeedInfo"}, - {0x081C0000, nullptr, "GetNandSpeedInfo"}, - {0x081D0042, nullptr, "GetSdmcLog"}, - {0x081E0042, nullptr, "GetNandLog"}, - {0x081F0000, nullptr, "ClearSdmcLog"}, - {0x08200000, nullptr, "ClearNandLog"}, - {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, - {0x08220000, nullptr, "CardSlotPowerOn"}, - {0x08230000, nullptr, "CardSlotPowerOff"}, - {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"}, - {0x08250040, nullptr, "CardNorDirectCommand"}, - {0x08260080, nullptr, "CardNorDirectCommandWithAddress"}, - {0x08270082, nullptr, "CardNorDirectRead"}, - {0x082800C2, nullptr, "CardNorDirectReadWithAddress"}, - {0x08290082, nullptr, "CardNorDirectWrite"}, - {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"}, - {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"}, - {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, - {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, - {0x082E0040, nullptr, "GetProductInfo"}, - {0x082F0040, nullptr, "GetProgramLaunchInfo"}, - {0x08300182, nullptr, "CreateExtSaveData"}, - {0x08310180, nullptr, "CreateSharedExtSaveData"}, - {0x08320102, nullptr, "ReadExtSaveDataIcon"}, - {0x08330082, nullptr, "EnumerateExtSaveData"}, - {0x08340082, nullptr, "EnumerateSharedExtSaveData"}, - {0x08350080, nullptr, "DeleteExtSaveData"}, - {0x08360080, nullptr, "DeleteSharedExtSaveData"}, - {0x08370040, nullptr, "SetCardSpiBaudRate"}, - {0x08380040, nullptr, "SetCardSpiBusMode"}, - {0x08390000, nullptr, "SendInitializeInfoTo9"}, - {0x083A0100, nullptr, "GetSpecialContentIndex"}, - {0x083B00C2, nullptr, "GetLegacyRomHeader"}, - {0x083C00C2, nullptr, "GetLegacyBannerData"}, - {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"}, - {0x083E00C2, nullptr, "QueryTotalQuotaSize"}, - {0x083F00C0, nullptr, "GetExtDataBlockSize"}, - {0x08400040, nullptr, "AbnegateAccessRight"}, - {0x08410000, nullptr, "DeleteSdmcRoot"}, - {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"}, - {0x08430000, nullptr, "InitializeCtrFileSystem"}, - {0x08440000, nullptr, "CreateSeed"}, - {0x084500C2, nullptr, "GetFormatInfo"}, - {0x08460102, nullptr, "GetLegacyRomHeader2"}, - {0x08470180, nullptr, "FormatCtrCardUserSaveData"}, - {0x08480042, nullptr, "GetSdmcCtrRootPath"}, - {0x08490040, nullptr, "GetArchiveResource"}, - {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"}, - {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"}, - {0x084C0242, FormatSaveData, "FormatSaveData"}, - {0x084D0102, nullptr, "GetLegacySubBannerData"}, - {0x084E0342, nullptr, "UpdateSha256Context"}, - {0x084F0102, nullptr, "ReadSpecialFile"}, - {0x08500040, nullptr, "GetSpecialFileSize"}, - {0x08510242, CreateExtSaveData, "CreateExtSaveData"}, - {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"}, - {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"}, - {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"}, - {0x08580000, nullptr, "GetMovableSedHashedKeyYRandomData"}, + {0x000100C6, nullptr, "Dummy1"}, + {0x040100C4, nullptr, "Control"}, + {0x08010002, Initialize, "Initialize"}, + {0x080201C2, OpenFile, "OpenFile"}, + {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, + {0x08040142, DeleteFile, "DeleteFile"}, + {0x08050244, RenameFile, "RenameFile"}, + {0x08060142, DeleteDirectory, "DeleteDirectory"}, + {0x08070142, nullptr, "DeleteDirectoryRecursively"}, + {0x08080202, CreateFile, "CreateFile"}, + {0x08090182, CreateDirectory, "CreateDirectory"}, + {0x080A0244, RenameDirectory, "RenameDirectory"}, + {0x080B0102, OpenDirectory, "OpenDirectory"}, + {0x080C00C2, OpenArchive, "OpenArchive"}, + {0x080D0144, nullptr, "ControlArchive"}, + {0x080E0080, CloseArchive, "CloseArchive"}, + {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, + {0x08100200, nullptr, "CreateSystemSaveData"}, + {0x08110040, nullptr, "DeleteSystemSaveData"}, + {0x08120080, GetFreeBytes, "GetFreeBytes"}, + {0x08130000, nullptr, "GetCardType"}, + {0x08140000, nullptr, "GetSdmcArchiveResource"}, + {0x08150000, nullptr, "GetNandArchiveResource"}, + {0x08160000, nullptr, "GetSdmcFatfsError"}, + {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, + {0x08180000, IsSdmcWriteable, "IsSdmcWritable"}, + {0x08190042, nullptr, "GetSdmcCid"}, + {0x081A0042, nullptr, "GetNandCid"}, + {0x081B0000, nullptr, "GetSdmcSpeedInfo"}, + {0x081C0000, nullptr, "GetNandSpeedInfo"}, + {0x081D0042, nullptr, "GetSdmcLog"}, + {0x081E0042, nullptr, "GetNandLog"}, + {0x081F0000, nullptr, "ClearSdmcLog"}, + {0x08200000, nullptr, "ClearNandLog"}, + {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, + {0x08220000, nullptr, "CardSlotPowerOn"}, + {0x08230000, nullptr, "CardSlotPowerOff"}, + {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"}, + {0x08250040, nullptr, "CardNorDirectCommand"}, + {0x08260080, nullptr, "CardNorDirectCommandWithAddress"}, + {0x08270082, nullptr, "CardNorDirectRead"}, + {0x082800C2, nullptr, "CardNorDirectReadWithAddress"}, + {0x08290082, nullptr, "CardNorDirectWrite"}, + {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"}, + {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"}, + {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, + {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, + {0x082E0040, nullptr, "GetProductInfo"}, + {0x082F0040, nullptr, "GetProgramLaunchInfo"}, + {0x08300182, nullptr, "CreateExtSaveData"}, + {0x08310180, nullptr, "CreateSharedExtSaveData"}, + {0x08320102, nullptr, "ReadExtSaveDataIcon"}, + {0x08330082, nullptr, "EnumerateExtSaveData"}, + {0x08340082, nullptr, "EnumerateSharedExtSaveData"}, + {0x08350080, nullptr, "DeleteExtSaveData"}, + {0x08360080, nullptr, "DeleteSharedExtSaveData"}, + {0x08370040, nullptr, "SetCardSpiBaudRate"}, + {0x08380040, nullptr, "SetCardSpiBusMode"}, + {0x08390000, nullptr, "SendInitializeInfoTo9"}, + {0x083A0100, nullptr, "GetSpecialContentIndex"}, + {0x083B00C2, nullptr, "GetLegacyRomHeader"}, + {0x083C00C2, nullptr, "GetLegacyBannerData"}, + {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"}, + {0x083E00C2, nullptr, "QueryTotalQuotaSize"}, + {0x083F00C0, nullptr, "GetExtDataBlockSize"}, + {0x08400040, nullptr, "AbnegateAccessRight"}, + {0x08410000, nullptr, "DeleteSdmcRoot"}, + {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"}, + {0x08430000, nullptr, "InitializeCtrFileSystem"}, + {0x08440000, nullptr, "CreateSeed"}, + {0x084500C2, nullptr, "GetFormatInfo"}, + {0x08460102, nullptr, "GetLegacyRomHeader2"}, + {0x08470180, nullptr, "FormatCtrCardUserSaveData"}, + {0x08480042, nullptr, "GetSdmcCtrRootPath"}, + {0x08490040, nullptr, "GetArchiveResource"}, + {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"}, + {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"}, + {0x084C0242, FormatSaveData, "FormatSaveData"}, + {0x084D0102, nullptr, "GetLegacySubBannerData"}, + {0x084E0342, nullptr, "UpdateSha256Context"}, + {0x084F0102, nullptr, "ReadSpecialFile"}, + {0x08500040, nullptr, "GetSpecialFileSize"}, + {0x08510242, CreateExtSaveData, "CreateExtSaveData"}, + {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"}, + {0x08530142, nullptr, "ReadExtSaveDataIcon"}, + {0x085400C0, nullptr, "GetExtDataBlockSize"}, + {0x08550102, nullptr, "EnumerateExtSaveData"}, + {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"}, + {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"}, + {0x08580000, nullptr, "StartDeviceMoveAsSource"}, + {0x08590200, nullptr, "StartDeviceMoveAsDestination"}, + {0x085A00C0, nullptr, "SetArchivePriority"}, + {0x085B0080, nullptr, "GetArchivePriority"}, + {0x085C00C0, nullptr, "SetCtrCardLatencyParameter"}, + {0x085D01C0, nullptr, "SetFsCompatibilityInfo"}, + {0x085E0040, nullptr, "ResetCardCompatibilityParameter"}, + {0x085F0040, nullptr, "SwitchCleanupInvalidSaveData"}, + {0x08600042, nullptr, "EnumerateSystemSaveData"}, {0x08610042, InitializeWithSdkVersion, "InitializeWithSdkVersion"}, - {0x08620040, SetPriority, "SetPriority"}, - {0x08630000, GetPriority, "GetPriority"}, + {0x08620040, SetPriority, "SetPriority"}, + {0x08630000, GetPriority, "GetPriority"}, + {0x08640000, nullptr, "GetNandInfo"}, + {0x08650140, nullptr, "SetSaveDataSecureValue"}, + {0x086600C0, nullptr, "GetSaveDataSecureValue"}, + {0x086700C4, nullptr, "ControlSecureSave"}, + {0x08680000, nullptr, "GetMediaType"}, + {0x08690000, nullptr, "GetNandEraseCount"}, + {0x086A0082, nullptr, "ReadNandReport"} }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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 @@ namespace GSP_LCD { -/*const Interface::FunctionInfo FunctionTable[] = { -};*/ +const Interface::FunctionInfo FunctionTable[] = { + {0x000F0000, nullptr, "PowerOnAllBacklights"}, + {0x00100000, nullptr, "PowerOffAllBacklights"}, + {0x00110040, nullptr, "PowerOnBacklight"}, + {0x00120040, nullptr, "PowerOffBacklight"}, +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class Interface::Interface() { - //Register(FunctionTable); + Register(FunctionTable); } } // 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 { const Interface::FunctionInfo FunctionTable[] = { {0x000A0000, GetIPCHandles, "GetIPCHandles"}, + {0x000B0000, nullptr, "StartAnalogStickCalibration"}, + {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"}, {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, {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[] = { {0x00220040, nullptr, "GetResponseStatusCode"}, {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"}, {0x00240082, nullptr, "AddTrustedRootCA"}, + {0x00250080, nullptr, "AddDefaultCert"}, + {0x00260080, nullptr, "SelectRootCertChain"}, + {0x002700C4, nullptr, "SetClientCert"}, + {0x002D0000, nullptr, "CreateRootCertChain"}, + {0x002E0040, nullptr, "DestroyRootCertChain"}, + {0x002F0082, nullptr, "RootCertChainAddCert"}, + {0x00300080, nullptr, "RootCertChainAddDefaultCert"}, {0x00350186, nullptr, "SetDefaultProxy"}, {0x00360000, nullptr, "ClearDNSCache"}, {0x00370080, nullptr, "SetKeepAlive"}, - {0x003800C0, nullptr, "Finalize"}, + {0x003800C0, nullptr, "SetPostDataTypeSize"}, + {0x00390000, nullptr, "Finalize"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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[] = { {0x00050000, nullptr, "StopSampling"}, {0x00060000, nullptr, "IsSampling"}, {0x00070000, nullptr, "GetEventHandle"}, - {0x00080040, nullptr, "SetControl"}, - {0x00090000, nullptr, "GetControl"}, - {0x000A0040, nullptr, "SetBias"}, - {0x000B0000, nullptr, "GetBias"}, + {0x00080040, nullptr, "SetGain"}, + {0x00090000, nullptr, "GetGain"}, + {0x000A0040, nullptr, "SetPower"}, + {0x000B0000, nullptr, "GetPower"}, {0x000C0042, nullptr, "size"}, {0x000D0040, nullptr, "SetClamp"}, {0x000E0000, nullptr, "GetClamp"}, - {0x000F0040, nullptr, "unknown_input1"}, + {0x000F0040, nullptr, "SetAllowShellClosed"}, {0x00100040, nullptr, "unknown_input2"}, }; 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[] = { {0x00010042, nullptr, "EnterExclusiveState"}, {0x00020002, nullptr, "LeaveExclusiveState"}, {0x00030000, nullptr, "QueryExclusiveMode"}, + {0x00040002, nullptr, "LockState"}, + {0x00050002, nullptr, "UnlockState"}, {0x00060040, nullptr, "SuspendDaemons"}, + {0x00070040, nullptr, "ResumeDaemons"}, {0x00080040, nullptr, "DisableWifiUsage"}, {0x00090000, nullptr, "EnableWifiUsage"}, + {0x000A0000, nullptr, "GetCurrentState"}, + {0x000B0000, nullptr, "GetTargetState"}, + {0x000C0000, nullptr, "<Stubbed>"}, + {0x000D0040, nullptr, "QueryStatus"}, + {0x000E0040, nullptr, "GetDaemonDisableCount"}, + {0x000F0000, nullptr, "GetSchedulerDisableCount"}, + {0x00100040, nullptr, "SetScanInterval"}, + {0x00110000, nullptr, "GetScanInterval"}, + {0x00120040, nullptr, "SetRetryInterval"}, + {0x00130000, nullptr, "GetRetryInterval"}, {0x00140040, nullptr, "OverrideDefaultDaemons"}, + {0x00150000, nullptr, "ResetDefaultDaemons"}, + {0x00160000, nullptr, "GetDefaultDaemons"}, + {0x00170000, nullptr, "ClearHalfAwakeMacFilter"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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 { const Interface::FunctionInfo FunctionTable[] = { {0x000100C6, nullptr, "AddNotification"}, + {0x00050000, nullptr, "GetTotalNotifications"}, + {0x00060042, nullptr, "SetNewsDBHeader"}, + {0x00070082, nullptr, "SetNotificationHeader"}, + {0x00080082, nullptr, "SetNotificationMessage"}, + {0x00090082, nullptr, "SetNotificationImage"}, + {0x000A0042, nullptr, "GetNewsDBHeader"}, + {0x000B0082, nullptr, "GetNotificationHeader"}, + {0x000C0082, nullptr, "GetNotificationMessage"}, + {0x000D0082, nullptr, "GetNotificationImage"}, + {0x000E0040, nullptr, "SetInfoLEDPattern"}, + {0x00120082, nullptr, "GetNotificationHeaderOther"}, + {0x00130000, nullptr, "WriteNewsDBSavedata"}, }; NEWS_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 { const Interface::FunctionInfo FunctionTable[] = { {0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"}, + {0x0016020A, nullptr, "ListTitles"}, + {0x002D0042, nullptr, "DownloadTickets"}, + {0x00420240, nullptr, "StartDownload"}, }; NIM_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 @@ namespace NS_S { const Interface::FunctionInfo FunctionTable[] = { + {0x000100C0, nullptr, "LaunchFIRM"}, {0x000200C0, nullptr, "LaunchTitle"}, + {0x000500C0, nullptr, "LaunchApplicationFIRM"}, + {0x00060042, nullptr, "SetFIRMParams4A0"}, + {0x00070042, nullptr, "CardUpdateInitialize"}, + {0x000D0140, nullptr, "SetFIRMParams4B0"}, + {0x000E0000, nullptr, "ShutdownAsync"}, + {0x00100180, nullptr, "RebootSystem"}, + {0x00150140, nullptr, "LaunchApplication"}, + {0x00160000, nullptr, "HardRebootSystem"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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) { } const Interface::FunctionInfo FunctionTable[] = { + {0x00020000, nullptr, "Scrap"}, {0x00030000, Shutdown, "Shutdown"}, + {0x00040402, nullptr, "CreateNetwork"}, + {0x00050040, nullptr, "EjectClient"}, + {0x00060000, nullptr, "EjectSpectator"}, + {0x00070080, nullptr, "UpdateNetworkAttribute"}, + {0x00080000, nullptr, "DestroyNetwork"}, + {0x000A0000, nullptr, "DisconnectNetwork"}, + {0x000B0000, nullptr, "GetConnectionStatus"}, + {0x000D0040, nullptr, "GetNodeInformation"}, {0x000F0404, RecvBeaconBroadcastData, "RecvBeaconBroadcastData"}, {0x00100042, nullptr, "SetBeaconAdditionalData"}, + {0x00110040, nullptr, "GetApplicationData"}, + {0x00120100, nullptr, "Bind"}, + {0x00130040, nullptr, "Unbind"}, {0x001400C0, nullptr, "RecvBroadcastDataFrame"}, + {0x00150080, nullptr, "SetMaxSendDelay"}, + {0x00170182, nullptr, "SendTo"}, + {0x001A0000, nullptr, "GetChannel"}, {0x001B0302, Initialize, "Initialize"}, {0x001D0044, nullptr, "BeginHostingNetwork"}, {0x001E0084, nullptr, "ConnectToNetwork"}, {0x001F0006, nullptr, "DecryptBeaconData"}, + {0x00200040, nullptr, "Flush"}, + {0x00210080, nullptr, "SetProbeResponseParam"}, + {0x00220402, nullptr, "ScanOnConnection"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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[] = { {0x00070042, nullptr, "GetFIRMLaunchParams"}, {0x00080100, nullptr, "GetTitleExheaderFlags"}, {0x00090042, nullptr, "SetFIRMLaunchParams"}, + {0x000A0140, nullptr, "SetResourceLimit"}, + {0x000B0140, nullptr, "GetResourceLimitMax"}, + {0x000C0080, nullptr, "UnregisterProcess"}, + {0x000D0240, nullptr, "LaunchTitleUpdate"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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[] = { {0x08110000, nullptr, "GetShellStatus"}, {0x08120000, nullptr, "IsShutdownByBatteryEmpty"}, {0x08130000, nullptr, "FormatSavedata"}, - {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"} + {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"}, + {0x08180040, nullptr, "ConfigureNew3DSCPU"}, }; PTM_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) { const Interface::FunctionInfo FunctionTable[] = { {0x00010002, Initialize, "Initialize"}, {0x000200C2, nullptr, "CreateContext"}, + {0x00030000, nullptr, "CreateRootCertChain"}, + {0x00040040, nullptr, "DestroyRootCertChain"}, {0x00050082, nullptr, "AddTrustedRootCA"}, + {0x00060080, nullptr, "RootCertChainAddDefaultCert"}, {0x00110042, GenerateRandomData, "GenerateRandomData"}, {0x00150082, nullptr, "Read"}, {0x00170082, nullptr, "Write"}, + {0x00180080, nullptr, "ContextSetRootCertChain"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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) { const Interface::FunctionInfo FunctionTable[] = { {0x00010040, SetInputFormat, "SetInputFormat"}, + {0x00020000, nullptr, "GetInputFormat"}, {0x00030040, SetOutputFormat, "SetOutputFormat"}, + {0x00040000, nullptr, "GetOutputFormat"}, {0x00050040, SetRotation, "SetRotation"}, + {0x00060000, nullptr, "GetRotation"}, {0x00070040, SetBlockAlignment, "SetBlockAlignment"}, + {0x00080000, nullptr, "GetBlockAlignment"}, + {0x00090040, nullptr, "SetSpacialDithering"}, + {0x000A0000, nullptr, "GetSpacialDithering"}, + {0x000B0040, nullptr, "SetTemporalDithering"}, + {0x000C0000, nullptr, "GetTemporalDithering"}, {0x000D0040, SetTransferEndInterrupt, "SetTransferEndInterrupt"}, {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"}, {0x00100102, SetSendingY, "SetSendingY"}, {0x00110102, SetSendingU, "SetSendingU"}, {0x00120102, SetSendingV, "SetSendingV"}, {0x00130102, SetSendingYUYV, "SetSendingYUYV"}, + {0x00140000, nullptr, "IsFinishedSendingYuv"}, + {0x00150000, nullptr, "IsFinishedSendingY"}, + {0x00160000, nullptr, "IsFinishedSendingU"}, + {0x00170000, nullptr, "IsFinishedSendingV"}, {0x00180102, SetReceiving, "SetReceiving"}, + {0x00190000, nullptr, "IsFinishedReceiving"}, {0x001A0040, SetInputLineWidth, "SetInputLineWidth"}, + {0x001B0000, nullptr, "GetInputLineWidth"}, {0x001C0040, SetInputLines, "SetInputLines"}, + {0x001D0000, nullptr, "GetInputLines"}, {0x001E0100, SetCoefficient, "SetCoefficient"}, + {0x001F0000, nullptr, "GetCoefficient"}, {0x00200040, SetStandardCoefficient, "SetStandardCoefficient"}, + {0x00210040, nullptr, "GetStandardCoefficientParams"}, {0x00220040, SetAlpha, "SetAlpha"}, + {0x00230000, nullptr, "GetAlpha"}, + {0x00240200, nullptr, "SetDitheringWeightParams"}, + {0x00250000, nullptr, "GetDitheringWeightParams"}, {0x00260000, StartConversion, "StartConversion"}, {0x00270000, StopConversion, "StopConversion"}, {0x00280000, IsBusyConversion, "IsBusyConversion"}, @@ -397,6 +417,7 @@ const Interface::FunctionInfo FunctionTable[] = { {0x002A0000, PingProcess, "PingProcess"}, {0x002B0000, DriverInitialize, "DriverInitialize"}, {0x002C0000, DriverFinalize, "DriverFinalize"}, + {0x002D0000, nullptr, "GetPackageParameter"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// 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 static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { using Kernel::MemoryRegion; - LOG_TRACE(Kernel_SVC, "called process=0x%08X type=%u param=%d", process_handle, type, param); + LOG_TRACE(Kernel_SVC, "called type=%u param=%d", type, param); switch ((SystemInfoType)type) { case SystemInfoType::REGION_MEMORY_USAGE: @@ -807,7 +807,7 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { } break; case SystemInfoType::KERNEL_ALLOCATED_PAGES: - LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", type, param); + LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", param); *out = 0; break; 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() { rasterizer = Common::make_unique<VideoCore::SWRasterizer>(); } rasterizer->InitObjects(); + rasterizer->Reset(); } } 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 { void Reset() override {} void AddTriangle(const Pica::Shader::OutputVertex& v0, const Pica::Shader::OutputVertex& v1, - const Pica::Shader::OutputVertex& v2); + const Pica::Shader::OutputVertex& v2) override; void DrawTriangles() override {} void FlushFramebuffer() override {} 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 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <memory> + #include "common/emu_window.h" +#include "common/make_unique.h" #include "common/logging/log.h" #include "core/core.h" @@ -18,8 +21,8 @@ namespace VideoCore { -EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window -RendererBase* g_renderer = nullptr; ///< Renderer plugin +EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window +std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin std::atomic<bool> g_hw_renderer_enabled; std::atomic<bool> g_shader_jit_enabled; @@ -29,7 +32,7 @@ void Init(EmuWindow* emu_window) { Pica::Init(); g_emu_window = emu_window; - g_renderer = new RendererOpenGL(); + g_renderer = Common::make_unique<RendererOpenGL>(); g_renderer->SetWindow(g_emu_window); g_renderer->Init(); @@ -40,7 +43,7 @@ void Init(EmuWindow* emu_window) { void Shutdown() { Pica::Shutdown(); - delete g_renderer; + g_renderer.reset(); LOG_DEBUG(Render, "shutdown OK"); } 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 @@ #pragma once #include <atomic> +#include <memory> class EmuWindow; class RendererBase; @@ -29,8 +30,8 @@ static const int kScreenBottomHeight = 240; ///< 3DS bottom screen height // Video core renderer // --------------------- -extern RendererBase* g_renderer; ///< Renderer plugin -extern EmuWindow* g_emu_window; ///< Emu window +extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin +extern EmuWindow* g_emu_window; ///< Emu window // TODO: Wrap these in a user settings struct along with any other graphics settings (often set from qt ui) extern std::atomic<bool> g_hw_renderer_enabled; |