diff options
| -rw-r--r-- | src/citra_qt/debugger/callstack.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/disassembler.cpp | 8 | ||||
| -rw-r--r-- | src/citra_qt/debugger/registers.cpp | 14 | ||||
| -rw-r--r-- | src/core/core.cpp | 14 | ||||
| -rw-r--r-- | src/core/core.h | 18 | ||||
| -rw-r--r-- | src/core/core_timing.cpp | 26 | ||||
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 39 | ||||
| -rw-r--r-- | src/core/hle/function_wrappers.h | 60 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/ldr_ro/ldr_ro.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 13 |
11 files changed, 103 insertions, 105 deletions
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 5e176be48..c1db93583 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp | |||
| @@ -25,7 +25,7 @@ CallstackWidget::CallstackWidget(QWidget* parent) : QDockWidget(parent) { | |||
| 25 | 25 | ||
| 26 | void CallstackWidget::OnDebugModeEntered() { | 26 | void CallstackWidget::OnDebugModeEntered() { |
| 27 | // Stack pointer | 27 | // Stack pointer |
| 28 | const u32 sp = Core::AppCore().GetReg(13); | 28 | const u32 sp = Core::CPU().GetReg(13); |
| 29 | 29 | ||
| 30 | Clear(); | 30 | Clear(); |
| 31 | 31 | ||
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 712e35f7f..e9c8ad858 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp | |||
| @@ -185,13 +185,13 @@ DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread* emu_thread) | |||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | void DisassemblerWidget::Init() { | 187 | void DisassemblerWidget::Init() { |
| 188 | model->ParseFromAddress(Core::AppCore().GetPC()); | 188 | model->ParseFromAddress(Core::CPU().GetPC()); |
| 189 | 189 | ||
| 190 | disasm_ui.treeView->resizeColumnToContents(0); | 190 | disasm_ui.treeView->resizeColumnToContents(0); |
| 191 | disasm_ui.treeView->resizeColumnToContents(1); | 191 | disasm_ui.treeView->resizeColumnToContents(1); |
| 192 | disasm_ui.treeView->resizeColumnToContents(2); | 192 | disasm_ui.treeView->resizeColumnToContents(2); |
| 193 | 193 | ||
| 194 | QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::AppCore().GetPC()); | 194 | QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::CPU().GetPC()); |
| 195 | disasm_ui.treeView->scrollTo(model_index); | 195 | disasm_ui.treeView->scrollTo(model_index); |
| 196 | disasm_ui.treeView->selectionModel()->setCurrentIndex( | 196 | disasm_ui.treeView->selectionModel()->setCurrentIndex( |
| 197 | model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | 197 | model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); |
| @@ -215,7 +215,7 @@ void DisassemblerWidget::OnPause() { | |||
| 215 | 215 | ||
| 216 | // TODO: By now, the CPU might not have actually stopped... | 216 | // TODO: By now, the CPU might not have actually stopped... |
| 217 | if (Core::System::GetInstance().IsPoweredOn()) { | 217 | if (Core::System::GetInstance().IsPoweredOn()) { |
| 218 | model->SetNextInstruction(Core::AppCore().GetPC()); | 218 | model->SetNextInstruction(Core::CPU().GetPC()); |
| 219 | } | 219 | } |
| 220 | } | 220 | } |
| 221 | 221 | ||
| @@ -224,7 +224,7 @@ void DisassemblerWidget::OnToggleStartStop() { | |||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | void DisassemblerWidget::OnDebugModeEntered() { | 226 | void DisassemblerWidget::OnDebugModeEntered() { |
| 227 | u32 next_instr = Core::AppCore().GetPC(); | 227 | u32 next_instr = Core::CPU().GetPC(); |
| 228 | 228 | ||
| 229 | if (model->GetBreakPoints().IsAddressBreakPoint(next_instr)) | 229 | if (model->GetBreakPoints().IsAddressBreakPoint(next_instr)) |
| 230 | emu_thread->SetRunning(false); | 230 | emu_thread->SetRunning(false); |
diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp index d5b6542bd..b982bc58b 100644 --- a/src/citra_qt/debugger/registers.cpp +++ b/src/citra_qt/debugger/registers.cpp | |||
| @@ -63,11 +63,11 @@ void RegistersWidget::OnDebugModeEntered() { | |||
| 63 | 63 | ||
| 64 | for (int i = 0; i < core_registers->childCount(); ++i) | 64 | for (int i = 0; i < core_registers->childCount(); ++i) |
| 65 | core_registers->child(i)->setText( | 65 | core_registers->child(i)->setText( |
| 66 | 1, QString("0x%1").arg(Core::AppCore().GetReg(i), 8, 16, QLatin1Char('0'))); | 66 | 1, QString("0x%1").arg(Core::CPU().GetReg(i), 8, 16, QLatin1Char('0'))); |
| 67 | 67 | ||
| 68 | for (int i = 0; i < vfp_registers->childCount(); ++i) | 68 | for (int i = 0; i < vfp_registers->childCount(); ++i) |
| 69 | vfp_registers->child(i)->setText( | 69 | vfp_registers->child(i)->setText( |
| 70 | 1, QString("0x%1").arg(Core::AppCore().GetVFPReg(i), 8, 16, QLatin1Char('0'))); | 70 | 1, QString("0x%1").arg(Core::CPU().GetVFPReg(i), 8, 16, QLatin1Char('0'))); |
| 71 | 71 | ||
| 72 | UpdateCPSRValues(); | 72 | UpdateCPSRValues(); |
| 73 | UpdateVFPSystemRegisterValues(); | 73 | UpdateVFPSystemRegisterValues(); |
| @@ -127,7 +127,7 @@ void RegistersWidget::CreateCPSRChildren() { | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | void RegistersWidget::UpdateCPSRValues() { | 129 | void RegistersWidget::UpdateCPSRValues() { |
| 130 | const u32 cpsr_val = Core::AppCore().GetCPSR(); | 130 | const u32 cpsr_val = Core::CPU().GetCPSR(); |
| 131 | 131 | ||
| 132 | cpsr->setText(1, QString("0x%1").arg(cpsr_val, 8, 16, QLatin1Char('0'))); | 132 | cpsr->setText(1, QString("0x%1").arg(cpsr_val, 8, 16, QLatin1Char('0'))); |
| 133 | cpsr->child(0)->setText( | 133 | cpsr->child(0)->setText( |
| @@ -191,10 +191,10 @@ void RegistersWidget::CreateVFPSystemRegisterChildren() { | |||
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | void RegistersWidget::UpdateVFPSystemRegisterValues() { | 193 | void RegistersWidget::UpdateVFPSystemRegisterValues() { |
| 194 | const u32 fpscr_val = Core::AppCore().GetVFPSystemReg(VFP_FPSCR); | 194 | const u32 fpscr_val = Core::CPU().GetVFPSystemReg(VFP_FPSCR); |
| 195 | const u32 fpexc_val = Core::AppCore().GetVFPSystemReg(VFP_FPEXC); | 195 | const u32 fpexc_val = Core::CPU().GetVFPSystemReg(VFP_FPEXC); |
| 196 | const u32 fpinst_val = Core::AppCore().GetVFPSystemReg(VFP_FPINST); | 196 | const u32 fpinst_val = Core::CPU().GetVFPSystemReg(VFP_FPINST); |
| 197 | const u32 fpinst2_val = Core::AppCore().GetVFPSystemReg(VFP_FPINST2); | 197 | const u32 fpinst2_val = Core::CPU().GetVFPSystemReg(VFP_FPINST2); |
| 198 | 198 | ||
| 199 | QTreeWidgetItem* const fpscr = vfp_system_registers->child(0); | 199 | QTreeWidgetItem* const fpscr = vfp_system_registers->child(0); |
| 200 | fpscr->setText(1, QString("0x%1").arg(fpscr_val, 8, 16, QLatin1Char('0'))); | 200 | fpscr->setText(1, QString("0x%1").arg(fpscr_val, 8, 16, QLatin1Char('0'))); |
diff --git a/src/core/core.cpp b/src/core/core.cpp index fabd3f42a..ee5237096 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -26,7 +26,7 @@ namespace Core { | |||
| 26 | /*static*/ System System::s_instance; | 26 | /*static*/ System System::s_instance; |
| 27 | 27 | ||
| 28 | System::ResultStatus System::RunLoop(int tight_loop) { | 28 | System::ResultStatus System::RunLoop(int tight_loop) { |
| 29 | if (!app_core) { | 29 | if (!cpu_core) { |
| 30 | return ResultStatus::ErrorNotInitialized; | 30 | return ResultStatus::ErrorNotInitialized; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| @@ -53,7 +53,7 @@ System::ResultStatus System::RunLoop(int tight_loop) { | |||
| 53 | CoreTiming::Advance(); | 53 | CoreTiming::Advance(); |
| 54 | PrepareReschedule(); | 54 | PrepareReschedule(); |
| 55 | } else { | 55 | } else { |
| 56 | app_core->Run(tight_loop); | 56 | cpu_core->Run(tight_loop); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | HW::Update(); | 59 | HW::Update(); |
| @@ -109,7 +109,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | void System::PrepareReschedule() { | 111 | void System::PrepareReschedule() { |
| 112 | app_core->PrepareReschedule(); | 112 | cpu_core->PrepareReschedule(); |
| 113 | reschedule_pending = true; | 113 | reschedule_pending = true; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| @@ -123,16 +123,16 @@ void System::Reschedule() { | |||
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { | 125 | System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { |
| 126 | if (app_core) { | 126 | if (cpu_core) { |
| 127 | app_core.reset(); | 127 | cpu_core.reset(); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | Memory::Init(); | 130 | Memory::Init(); |
| 131 | 131 | ||
| 132 | if (Settings::values.use_cpu_jit) { | 132 | if (Settings::values.use_cpu_jit) { |
| 133 | app_core = std::make_unique<ARM_Dynarmic>(USER32MODE); | 133 | cpu_core = std::make_unique<ARM_Dynarmic>(USER32MODE); |
| 134 | } else { | 134 | } else { |
| 135 | app_core = std::make_unique<ARM_DynCom>(USER32MODE); | 135 | cpu_core = std::make_unique<ARM_DynCom>(USER32MODE); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | CoreTiming::Init(); | 138 | CoreTiming::Init(); |
diff --git a/src/core/core.h b/src/core/core.h index 728c24c1c..b0f8df441 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -88,18 +88,18 @@ public: | |||
| 88 | * @returns True if the emulated system is powered on, otherwise false. | 88 | * @returns True if the emulated system is powered on, otherwise false. |
| 89 | */ | 89 | */ |
| 90 | bool IsPoweredOn() const { | 90 | bool IsPoweredOn() const { |
| 91 | return app_core != nullptr; | 91 | return cpu_core != nullptr; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | /// Prepare the core emulation for a reschedule | 94 | /// Prepare the core emulation for a reschedule |
| 95 | void PrepareReschedule(); | 95 | void PrepareReschedule(); |
| 96 | 96 | ||
| 97 | /** | 97 | /** |
| 98 | * Gets a reference to the emulated AppCore CPU. | 98 | * Gets a reference to the emulated CPU. |
| 99 | * @returns A reference to the emulated AppCore CPU. | 99 | * @returns A reference to the emulated CPU. |
| 100 | */ | 100 | */ |
| 101 | ARM_Interface& AppCore() { | 101 | ARM_Interface& CPU() { |
| 102 | return *app_core; | 102 | return *cpu_core; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | private: | 105 | private: |
| @@ -117,8 +117,8 @@ private: | |||
| 117 | /// AppLoader used to load the current executing application | 117 | /// AppLoader used to load the current executing application |
| 118 | std::unique_ptr<Loader::AppLoader> app_loader; | 118 | std::unique_ptr<Loader::AppLoader> app_loader; |
| 119 | 119 | ||
| 120 | ///< ARM11 application core | 120 | ///< ARM11 CPU core |
| 121 | std::unique_ptr<ARM_Interface> app_core; | 121 | std::unique_ptr<ARM_Interface> cpu_core; |
| 122 | 122 | ||
| 123 | /// When true, signals that a reschedule should happen | 123 | /// When true, signals that a reschedule should happen |
| 124 | bool reschedule_pending{}; | 124 | bool reschedule_pending{}; |
| @@ -126,8 +126,8 @@ private: | |||
| 126 | static System s_instance; | 126 | static System s_instance; |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | static ARM_Interface& AppCore() { | 129 | static ARM_Interface& CPU() { |
| 130 | return System::GetInstance().AppCore(); | 130 | return System::GetInstance().CPU(); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | } // namespace Core | 133 | } // namespace Core |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 9fe374795..a437d0823 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -146,7 +146,7 @@ void UnregisterAllEvents() { | |||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | void Init() { | 148 | void Init() { |
| 149 | Core::AppCore().down_count = INITIAL_SLICE_LENGTH; | 149 | Core::CPU().down_count = INITIAL_SLICE_LENGTH; |
| 150 | g_slice_length = INITIAL_SLICE_LENGTH; | 150 | g_slice_length = INITIAL_SLICE_LENGTH; |
| 151 | global_timer = 0; | 151 | global_timer = 0; |
| 152 | idled_cycles = 0; | 152 | idled_cycles = 0; |
| @@ -186,7 +186,7 @@ void Shutdown() { | |||
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | u64 GetTicks() { | 188 | u64 GetTicks() { |
| 189 | return (u64)global_timer + g_slice_length - Core::AppCore().down_count; | 189 | return (u64)global_timer + g_slice_length - Core::CPU().down_count; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | u64 GetIdleTicks() { | 192 | u64 GetIdleTicks() { |
| @@ -460,18 +460,18 @@ void MoveEvents() { | |||
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | void ForceCheck() { | 462 | void ForceCheck() { |
| 463 | s64 cycles_executed = g_slice_length - Core::AppCore().down_count; | 463 | s64 cycles_executed = g_slice_length - Core::CPU().down_count; |
| 464 | global_timer += cycles_executed; | 464 | global_timer += cycles_executed; |
| 465 | // This will cause us to check for new events immediately. | 465 | // This will cause us to check for new events immediately. |
| 466 | Core::AppCore().down_count = 0; | 466 | Core::CPU().down_count = 0; |
| 467 | // But let's not eat a bunch more time in Advance() because of this. | 467 | // But let's not eat a bunch more time in Advance() because of this. |
| 468 | g_slice_length = 0; | 468 | g_slice_length = 0; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | void Advance() { | 471 | void Advance() { |
| 472 | s64 cycles_executed = g_slice_length - Core::AppCore().down_count; | 472 | s64 cycles_executed = g_slice_length - Core::CPU().down_count; |
| 473 | global_timer += cycles_executed; | 473 | global_timer += cycles_executed; |
| 474 | Core::AppCore().down_count = g_slice_length; | 474 | Core::CPU().down_count = g_slice_length; |
| 475 | 475 | ||
| 476 | if (has_ts_events) | 476 | if (has_ts_events) |
| 477 | MoveEvents(); | 477 | MoveEvents(); |
| @@ -480,7 +480,7 @@ void Advance() { | |||
| 480 | if (!first) { | 480 | if (!first) { |
| 481 | if (g_slice_length < 10000) { | 481 | if (g_slice_length < 10000) { |
| 482 | g_slice_length += 10000; | 482 | g_slice_length += 10000; |
| 483 | Core::AppCore().down_count += g_slice_length; | 483 | Core::CPU().down_count += g_slice_length; |
| 484 | } | 484 | } |
| 485 | } else { | 485 | } else { |
| 486 | // Note that events can eat cycles as well. | 486 | // Note that events can eat cycles as well. |
| @@ -490,7 +490,7 @@ void Advance() { | |||
| 490 | 490 | ||
| 491 | const int diff = target - g_slice_length; | 491 | const int diff = target - g_slice_length; |
| 492 | g_slice_length += diff; | 492 | g_slice_length += diff; |
| 493 | Core::AppCore().down_count += diff; | 493 | Core::CPU().down_count += diff; |
| 494 | } | 494 | } |
| 495 | if (advance_callback) | 495 | if (advance_callback) |
| 496 | advance_callback(static_cast<int>(cycles_executed)); | 496 | advance_callback(static_cast<int>(cycles_executed)); |
| @@ -506,12 +506,12 @@ void LogPendingEvents() { | |||
| 506 | } | 506 | } |
| 507 | 507 | ||
| 508 | void Idle(int max_idle) { | 508 | void Idle(int max_idle) { |
| 509 | s64 cycles_down = Core::AppCore().down_count; | 509 | s64 cycles_down = Core::CPU().down_count; |
| 510 | if (max_idle != 0 && cycles_down > max_idle) | 510 | if (max_idle != 0 && cycles_down > max_idle) |
| 511 | cycles_down = max_idle; | 511 | cycles_down = max_idle; |
| 512 | 512 | ||
| 513 | if (first && cycles_down > 0) { | 513 | if (first && cycles_down > 0) { |
| 514 | s64 cycles_executed = g_slice_length - Core::AppCore().down_count; | 514 | s64 cycles_executed = g_slice_length - Core::CPU().down_count; |
| 515 | s64 cycles_next_event = first->time - global_timer; | 515 | s64 cycles_next_event = first->time - global_timer; |
| 516 | 516 | ||
| 517 | if (cycles_next_event < cycles_executed + cycles_down) { | 517 | if (cycles_next_event < cycles_executed + cycles_down) { |
| @@ -526,9 +526,9 @@ void Idle(int max_idle) { | |||
| 526 | cycles_down / (float)(g_clock_rate_arm11 * 0.001f)); | 526 | cycles_down / (float)(g_clock_rate_arm11 * 0.001f)); |
| 527 | 527 | ||
| 528 | idled_cycles += cycles_down; | 528 | idled_cycles += cycles_down; |
| 529 | Core::AppCore().down_count -= cycles_down; | 529 | Core::CPU().down_count -= cycles_down; |
| 530 | if (Core::AppCore().down_count == 0) | 530 | if (Core::CPU().down_count == 0) |
| 531 | Core::AppCore().down_count = -1; | 531 | Core::CPU().down_count = -1; |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | std::string GetScheduledEventsSummary() { | 534 | std::string GetScheduledEventsSummary() { |
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index c75d5fc5e..d88e25073 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -450,9 +450,9 @@ static void SendSignal(u32 signal) { | |||
| 450 | 450 | ||
| 451 | latest_signal = signal; | 451 | latest_signal = signal; |
| 452 | 452 | ||
| 453 | std::string buffer = Common::StringFromFormat("T%02x%02x:%08x;%02x:%08x;", latest_signal, 15, | 453 | std::string buffer = |
| 454 | htonl(Core::AppCore().GetPC()), 13, | 454 | Common::StringFromFormat("T%02x%02x:%08x;%02x:%08x;", latest_signal, 15, |
| 455 | htonl(Core::AppCore().GetReg(13))); | 455 | htonl(Core::CPU().GetPC()), 13, htonl(Core::CPU().GetReg(13))); |
| 456 | LOG_DEBUG(Debug_GDBStub, "Response: %s", buffer.c_str()); | 456 | LOG_DEBUG(Debug_GDBStub, "Response: %s", buffer.c_str()); |
| 457 | SendReply(buffer.c_str()); | 457 | SendReply(buffer.c_str()); |
| 458 | } | 458 | } |
| @@ -539,15 +539,15 @@ static void ReadRegister() { | |||
| 539 | } | 539 | } |
| 540 | 540 | ||
| 541 | if (id <= R15_REGISTER) { | 541 | if (id <= R15_REGISTER) { |
| 542 | IntToGdbHex(reply, Core::AppCore().GetReg(id)); | 542 | IntToGdbHex(reply, Core::CPU().GetReg(id)); |
| 543 | } else if (id == CPSR_REGISTER) { | 543 | } else if (id == CPSR_REGISTER) { |
| 544 | IntToGdbHex(reply, Core::AppCore().GetCPSR()); | 544 | IntToGdbHex(reply, Core::CPU().GetCPSR()); |
| 545 | } else if (id > CPSR_REGISTER && id < FPSCR_REGISTER) { | 545 | } else if (id > CPSR_REGISTER && id < FPSCR_REGISTER) { |
| 546 | IntToGdbHex(reply, Core::AppCore().GetVFPReg( | 546 | IntToGdbHex(reply, Core::CPU().GetVFPReg( |
| 547 | id - CPSR_REGISTER - | 547 | id - CPSR_REGISTER - |
| 548 | 1)); // VFP registers should start at 26, so one after CSPR_REGISTER | 548 | 1)); // VFP registers should start at 26, so one after CSPR_REGISTER |
| 549 | } else if (id == FPSCR_REGISTER) { | 549 | } else if (id == FPSCR_REGISTER) { |
| 550 | IntToGdbHex(reply, Core::AppCore().GetVFPSystemReg(VFP_FPSCR)); // Get FPSCR | 550 | IntToGdbHex(reply, Core::CPU().GetVFPSystemReg(VFP_FPSCR)); // Get FPSCR |
| 551 | IntToGdbHex(reply + 8, 0); | 551 | IntToGdbHex(reply + 8, 0); |
| 552 | } else { | 552 | } else { |
| 553 | return SendReply("E01"); | 553 | return SendReply("E01"); |
| @@ -564,22 +564,22 @@ static void ReadRegisters() { | |||
| 564 | u8* bufptr = buffer; | 564 | u8* bufptr = buffer; |
| 565 | 565 | ||
| 566 | for (int reg = 0; reg <= R15_REGISTER; reg++) { | 566 | for (int reg = 0; reg <= R15_REGISTER; reg++) { |
| 567 | IntToGdbHex(bufptr + reg * CHAR_BIT, Core::AppCore().GetReg(reg)); | 567 | IntToGdbHex(bufptr + reg * CHAR_BIT, Core::CPU().GetReg(reg)); |
| 568 | } | 568 | } |
| 569 | 569 | ||
| 570 | bufptr += (16 * CHAR_BIT); | 570 | bufptr += (16 * CHAR_BIT); |
| 571 | 571 | ||
| 572 | IntToGdbHex(bufptr, Core::AppCore().GetCPSR()); | 572 | IntToGdbHex(bufptr, Core::CPU().GetCPSR()); |
| 573 | 573 | ||
| 574 | bufptr += CHAR_BIT; | 574 | bufptr += CHAR_BIT; |
| 575 | 575 | ||
| 576 | for (int reg = 0; reg <= 31; reg++) { | 576 | for (int reg = 0; reg <= 31; reg++) { |
| 577 | IntToGdbHex(bufptr + reg * CHAR_BIT, Core::AppCore().GetVFPReg(reg)); | 577 | IntToGdbHex(bufptr + reg * CHAR_BIT, Core::CPU().GetVFPReg(reg)); |
| 578 | } | 578 | } |
| 579 | 579 | ||
| 580 | bufptr += (32 * CHAR_BIT); | 580 | bufptr += (32 * CHAR_BIT); |
| 581 | 581 | ||
| 582 | IntToGdbHex(bufptr, Core::AppCore().GetVFPSystemReg(VFP_FPSCR)); | 582 | IntToGdbHex(bufptr, Core::CPU().GetVFPSystemReg(VFP_FPSCR)); |
| 583 | 583 | ||
| 584 | SendReply(reinterpret_cast<char*>(buffer)); | 584 | SendReply(reinterpret_cast<char*>(buffer)); |
| 585 | } | 585 | } |
| @@ -596,13 +596,13 @@ static void WriteRegister() { | |||
| 596 | } | 596 | } |
| 597 | 597 | ||
| 598 | if (id <= R15_REGISTER) { | 598 | if (id <= R15_REGISTER) { |
| 599 | Core::AppCore().SetReg(id, GdbHexToInt(buffer_ptr)); | 599 | Core::CPU().SetReg(id, GdbHexToInt(buffer_ptr)); |
| 600 | } else if (id == CPSR_REGISTER) { | 600 | } else if (id == CPSR_REGISTER) { |
| 601 | Core::AppCore().SetCPSR(GdbHexToInt(buffer_ptr)); | 601 | Core::CPU().SetCPSR(GdbHexToInt(buffer_ptr)); |
| 602 | } else if (id > CPSR_REGISTER && id < FPSCR_REGISTER) { | 602 | } else if (id > CPSR_REGISTER && id < FPSCR_REGISTER) { |
| 603 | Core::AppCore().SetVFPReg(id - CPSR_REGISTER - 1, GdbHexToInt(buffer_ptr)); | 603 | Core::CPU().SetVFPReg(id - CPSR_REGISTER - 1, GdbHexToInt(buffer_ptr)); |
| 604 | } else if (id == FPSCR_REGISTER) { | 604 | } else if (id == FPSCR_REGISTER) { |
| 605 | Core::AppCore().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr)); | 605 | Core::CPU().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr)); |
| 606 | } else { | 606 | } else { |
| 607 | return SendReply("E01"); | 607 | return SendReply("E01"); |
| 608 | } | 608 | } |
| @@ -619,20 +619,19 @@ static void WriteRegisters() { | |||
| 619 | 619 | ||
| 620 | for (int i = 0, reg = 0; reg <= FPSCR_REGISTER; i++, reg++) { | 620 | for (int i = 0, reg = 0; reg <= FPSCR_REGISTER; i++, reg++) { |
| 621 | if (reg <= R15_REGISTER) { | 621 | if (reg <= R15_REGISTER) { |
| 622 | Core::AppCore().SetReg(reg, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | 622 | Core::CPU().SetReg(reg, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
| 623 | } else if (reg == CPSR_REGISTER) { | 623 | } else if (reg == CPSR_REGISTER) { |
| 624 | Core::AppCore().SetCPSR(GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | 624 | Core::CPU().SetCPSR(GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
| 625 | } else if (reg == CPSR_REGISTER - 1) { | 625 | } else if (reg == CPSR_REGISTER - 1) { |
| 626 | // Dummy FPA register, ignore | 626 | // Dummy FPA register, ignore |
| 627 | } else if (reg < CPSR_REGISTER) { | 627 | } else if (reg < CPSR_REGISTER) { |
| 628 | // Dummy FPA registers, ignore | 628 | // Dummy FPA registers, ignore |
| 629 | i += 2; | 629 | i += 2; |
| 630 | } else if (reg > CPSR_REGISTER && reg < FPSCR_REGISTER) { | 630 | } else if (reg > CPSR_REGISTER && reg < FPSCR_REGISTER) { |
| 631 | Core::AppCore().SetVFPReg(reg - CPSR_REGISTER - 1, | 631 | Core::CPU().SetVFPReg(reg - CPSR_REGISTER - 1, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
| 632 | GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | ||
| 633 | i++; // Skip padding | 632 | i++; // Skip padding |
| 634 | } else if (reg == FPSCR_REGISTER) { | 633 | } else if (reg == FPSCR_REGISTER) { |
| 635 | Core::AppCore().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); | 634 | Core::CPU().SetVFPSystemReg(VFP_FPSCR, GdbHexToInt(buffer_ptr + i * CHAR_BIT)); |
| 636 | } | 635 | } |
| 637 | } | 636 | } |
| 638 | 637 | ||
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index cafc7fe62..7875971ce 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | namespace HLE { | 15 | namespace HLE { |
| 16 | 16 | ||
| 17 | #define PARAM(n) Core::AppCore().GetReg(n) | 17 | #define PARAM(n) Core::CPU().GetReg(n) |
| 18 | 18 | ||
| 19 | /// An invalid result code that is meant to be overwritten when a thread resumes from waiting | 19 | /// An invalid result code that is meant to be overwritten when a thread resumes from waiting |
| 20 | static const ResultCode RESULT_INVALID(0xDEADC0DE); | 20 | static const ResultCode RESULT_INVALID(0xDEADC0DE); |
| @@ -24,7 +24,7 @@ static const ResultCode RESULT_INVALID(0xDEADC0DE); | |||
| 24 | * @param res Result to return | 24 | * @param res Result to return |
| 25 | */ | 25 | */ |
| 26 | static inline void FuncReturn(u32 res) { | 26 | static inline void FuncReturn(u32 res) { |
| 27 | Core::AppCore().SetReg(0, res); | 27 | Core::CPU().SetReg(0, res); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| @@ -33,8 +33,8 @@ static inline void FuncReturn(u32 res) { | |||
| 33 | * @todo Verify that this function is correct | 33 | * @todo Verify that this function is correct |
| 34 | */ | 34 | */ |
| 35 | static inline void FuncReturn64(u64 res) { | 35 | static inline void FuncReturn64(u64 res) { |
| 36 | Core::AppCore().SetReg(0, (u32)(res & 0xFFFFFFFF)); | 36 | Core::CPU().SetReg(0, (u32)(res & 0xFFFFFFFF)); |
| 37 | Core::AppCore().SetReg(1, (u32)((res >> 32) & 0xFFFFFFFF)); | 37 | Core::CPU().SetReg(1, (u32)((res >> 32) & 0xFFFFFFFF)); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 40 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -49,7 +49,7 @@ template <ResultCode func(u32*, u32, u32, u32, u32, u32)> | |||
| 49 | void Wrap() { | 49 | void Wrap() { |
| 50 | u32 param_1 = 0; | 50 | u32 param_1 = 0; |
| 51 | u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; | 51 | u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; |
| 52 | Core::AppCore().SetReg(1, param_1); | 52 | Core::CPU().SetReg(1, param_1); |
| 53 | FuncReturn(retval); | 53 | FuncReturn(retval); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| @@ -57,7 +57,7 @@ template <ResultCode func(u32*, s32, u32, u32, u32, s32)> | |||
| 57 | void Wrap() { | 57 | void Wrap() { |
| 58 | u32 param_1 = 0; | 58 | u32 param_1 = 0; |
| 59 | u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; | 59 | u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; |
| 60 | Core::AppCore().SetReg(1, param_1); | 60 | Core::CPU().SetReg(1, param_1); |
| 61 | FuncReturn(retval); | 61 | FuncReturn(retval); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -69,7 +69,7 @@ void Wrap() { | |||
| 69 | .raw; | 69 | .raw; |
| 70 | 70 | ||
| 71 | if (retval != RESULT_INVALID.raw) { | 71 | if (retval != RESULT_INVALID.raw) { |
| 72 | Core::AppCore().SetReg(1, (u32)param_1); | 72 | Core::CPU().SetReg(1, (u32)param_1); |
| 73 | FuncReturn(retval); | 73 | FuncReturn(retval); |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| @@ -84,7 +84,7 @@ template <ResultCode func(u32*)> | |||
| 84 | void Wrap() { | 84 | void Wrap() { |
| 85 | u32 param_1 = 0; | 85 | u32 param_1 = 0; |
| 86 | u32 retval = func(¶m_1).raw; | 86 | u32 retval = func(¶m_1).raw; |
| 87 | Core::AppCore().SetReg(1, param_1); | 87 | Core::CPU().SetReg(1, param_1); |
| 88 | FuncReturn(retval); | 88 | FuncReturn(retval); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| @@ -102,11 +102,11 @@ void Wrap() { | |||
| 102 | MemoryInfo memory_info = {}; | 102 | MemoryInfo memory_info = {}; |
| 103 | PageInfo page_info = {}; | 103 | PageInfo page_info = {}; |
| 104 | u32 retval = func(&memory_info, &page_info, PARAM(2)).raw; | 104 | u32 retval = func(&memory_info, &page_info, PARAM(2)).raw; |
| 105 | Core::AppCore().SetReg(1, memory_info.base_address); | 105 | Core::CPU().SetReg(1, memory_info.base_address); |
| 106 | Core::AppCore().SetReg(2, memory_info.size); | 106 | Core::CPU().SetReg(2, memory_info.size); |
| 107 | Core::AppCore().SetReg(3, memory_info.permission); | 107 | Core::CPU().SetReg(3, memory_info.permission); |
| 108 | Core::AppCore().SetReg(4, memory_info.state); | 108 | Core::CPU().SetReg(4, memory_info.state); |
| 109 | Core::AppCore().SetReg(5, page_info.flags); | 109 | Core::CPU().SetReg(5, page_info.flags); |
| 110 | FuncReturn(retval); | 110 | FuncReturn(retval); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| @@ -115,11 +115,11 @@ void Wrap() { | |||
| 115 | MemoryInfo memory_info = {}; | 115 | MemoryInfo memory_info = {}; |
| 116 | PageInfo page_info = {}; | 116 | PageInfo page_info = {}; |
| 117 | u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw; | 117 | u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw; |
| 118 | Core::AppCore().SetReg(1, memory_info.base_address); | 118 | Core::CPU().SetReg(1, memory_info.base_address); |
| 119 | Core::AppCore().SetReg(2, memory_info.size); | 119 | Core::CPU().SetReg(2, memory_info.size); |
| 120 | Core::AppCore().SetReg(3, memory_info.permission); | 120 | Core::CPU().SetReg(3, memory_info.permission); |
| 121 | Core::AppCore().SetReg(4, memory_info.state); | 121 | Core::CPU().SetReg(4, memory_info.state); |
| 122 | Core::AppCore().SetReg(5, page_info.flags); | 122 | Core::CPU().SetReg(5, page_info.flags); |
| 123 | FuncReturn(retval); | 123 | FuncReturn(retval); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| @@ -127,7 +127,7 @@ template <ResultCode func(s32*, u32)> | |||
| 127 | void Wrap() { | 127 | void Wrap() { |
| 128 | s32 param_1 = 0; | 128 | s32 param_1 = 0; |
| 129 | u32 retval = func(¶m_1, PARAM(1)).raw; | 129 | u32 retval = func(¶m_1, PARAM(1)).raw; |
| 130 | Core::AppCore().SetReg(1, param_1); | 130 | Core::CPU().SetReg(1, param_1); |
| 131 | FuncReturn(retval); | 131 | FuncReturn(retval); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| @@ -140,7 +140,7 @@ template <ResultCode func(u32*, u32)> | |||
| 140 | void Wrap() { | 140 | void Wrap() { |
| 141 | u32 param_1 = 0; | 141 | u32 param_1 = 0; |
| 142 | u32 retval = func(¶m_1, PARAM(1)).raw; | 142 | u32 retval = func(¶m_1, PARAM(1)).raw; |
| 143 | Core::AppCore().SetReg(1, param_1); | 143 | Core::CPU().SetReg(1, param_1); |
| 144 | FuncReturn(retval); | 144 | FuncReturn(retval); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| @@ -160,7 +160,7 @@ template <ResultCode func(u32*, const char*)> | |||
| 160 | void Wrap() { | 160 | void Wrap() { |
| 161 | u32 param_1 = 0; | 161 | u32 param_1 = 0; |
| 162 | u32 retval = func(¶m_1, (char*)Memory::GetPointer(PARAM(1))).raw; | 162 | u32 retval = func(¶m_1, (char*)Memory::GetPointer(PARAM(1))).raw; |
| 163 | Core::AppCore().SetReg(1, param_1); | 163 | Core::CPU().SetReg(1, param_1); |
| 164 | FuncReturn(retval); | 164 | FuncReturn(retval); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| @@ -168,7 +168,7 @@ template <ResultCode func(u32*, s32, s32)> | |||
| 168 | void Wrap() { | 168 | void Wrap() { |
| 169 | u32 param_1 = 0; | 169 | u32 param_1 = 0; |
| 170 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; | 170 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; |
| 171 | Core::AppCore().SetReg(1, param_1); | 171 | Core::CPU().SetReg(1, param_1); |
| 172 | FuncReturn(retval); | 172 | FuncReturn(retval); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| @@ -176,7 +176,7 @@ template <ResultCode func(s32*, u32, s32)> | |||
| 176 | void Wrap() { | 176 | void Wrap() { |
| 177 | s32 param_1 = 0; | 177 | s32 param_1 = 0; |
| 178 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; | 178 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; |
| 179 | Core::AppCore().SetReg(1, param_1); | 179 | Core::CPU().SetReg(1, param_1); |
| 180 | FuncReturn(retval); | 180 | FuncReturn(retval); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| @@ -184,8 +184,8 @@ template <ResultCode func(s64*, u32, s32)> | |||
| 184 | void Wrap() { | 184 | void Wrap() { |
| 185 | s64 param_1 = 0; | 185 | s64 param_1 = 0; |
| 186 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; | 186 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; |
| 187 | Core::AppCore().SetReg(1, (u32)param_1); | 187 | Core::CPU().SetReg(1, (u32)param_1); |
| 188 | Core::AppCore().SetReg(2, (u32)(param_1 >> 32)); | 188 | Core::CPU().SetReg(2, (u32)(param_1 >> 32)); |
| 189 | FuncReturn(retval); | 189 | FuncReturn(retval); |
| 190 | } | 190 | } |
| 191 | 191 | ||
| @@ -194,7 +194,7 @@ void Wrap() { | |||
| 194 | u32 param_1 = 0; | 194 | u32 param_1 = 0; |
| 195 | // The last parameter is passed in R0 instead of R4 | 195 | // The last parameter is passed in R0 instead of R4 |
| 196 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw; | 196 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw; |
| 197 | Core::AppCore().SetReg(1, param_1); | 197 | Core::CPU().SetReg(1, param_1); |
| 198 | FuncReturn(retval); | 198 | FuncReturn(retval); |
| 199 | } | 199 | } |
| 200 | 200 | ||
| @@ -209,8 +209,8 @@ template <ResultCode func(s64*, Kernel::Handle, u32)> | |||
| 209 | void Wrap() { | 209 | void Wrap() { |
| 210 | s64 param_1 = 0; | 210 | s64 param_1 = 0; |
| 211 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; | 211 | u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; |
| 212 | Core::AppCore().SetReg(1, (u32)param_1); | 212 | Core::CPU().SetReg(1, (u32)param_1); |
| 213 | Core::AppCore().SetReg(2, (u32)(param_1 >> 32)); | 213 | Core::CPU().SetReg(2, (u32)(param_1 >> 32)); |
| 214 | FuncReturn(retval); | 214 | FuncReturn(retval); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| @@ -227,8 +227,8 @@ void Wrap() { | |||
| 227 | reinterpret_cast<const char*>(Memory::GetPointer(PARAM(2))), PARAM(3)) | 227 | reinterpret_cast<const char*>(Memory::GetPointer(PARAM(2))), PARAM(3)) |
| 228 | .raw; | 228 | .raw; |
| 229 | // The first out parameter is moved into R2 and the second is moved into R1. | 229 | // The first out parameter is moved into R2 and the second is moved into R1. |
| 230 | Core::AppCore().SetReg(1, param_2); | 230 | Core::CPU().SetReg(1, param_2); |
| 231 | Core::AppCore().SetReg(2, param_1); | 231 | Core::CPU().SetReg(2, param_1); |
| 232 | FuncReturn(retval); | 232 | FuncReturn(retval); |
| 233 | } | 233 | } |
| 234 | 234 | ||
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index c964b35d4..60b7bea70 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -187,7 +187,7 @@ static void SwitchContext(Thread* new_thread) { | |||
| 187 | // Save context for previous thread | 187 | // Save context for previous thread |
| 188 | if (previous_thread) { | 188 | if (previous_thread) { |
| 189 | previous_thread->last_running_ticks = CoreTiming::GetTicks(); | 189 | previous_thread->last_running_ticks = CoreTiming::GetTicks(); |
| 190 | Core::AppCore().SaveContext(previous_thread->context); | 190 | Core::CPU().SaveContext(previous_thread->context); |
| 191 | 191 | ||
| 192 | if (previous_thread->status == THREADSTATUS_RUNNING) { | 192 | if (previous_thread->status == THREADSTATUS_RUNNING) { |
| 193 | // This is only the case when a reschedule is triggered without the current thread | 193 | // This is only the case when a reschedule is triggered without the current thread |
| @@ -213,8 +213,8 @@ static void SwitchContext(Thread* new_thread) { | |||
| 213 | // Restores thread to its nominal priority if it has been temporarily changed | 213 | // Restores thread to its nominal priority if it has been temporarily changed |
| 214 | new_thread->current_priority = new_thread->nominal_priority; | 214 | new_thread->current_priority = new_thread->nominal_priority; |
| 215 | 215 | ||
| 216 | Core::AppCore().LoadContext(new_thread->context); | 216 | Core::CPU().LoadContext(new_thread->context); |
| 217 | Core::AppCore().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); | 217 | Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); |
| 218 | } else { | 218 | } else { |
| 219 | current_thread = nullptr; | 219 | current_thread = nullptr; |
| 220 | } | 220 | } |
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 614f16d44..8d00a7577 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp | |||
| @@ -457,7 +457,7 @@ static void LoadCRO(Interface* self, bool link_on_load_bug_fix) { | |||
| 457 | } | 457 | } |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | Core::AppCore().ClearInstructionCache(); | 460 | Core::CPU().ClearInstructionCache(); |
| 461 | 461 | ||
| 462 | LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), | 462 | LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), |
| 463 | cro_address, cro_address + fix_size); | 463 | cro_address, cro_address + fix_size); |
| @@ -562,7 +562,7 @@ static void UnloadCRO(Interface* self) { | |||
| 562 | memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); | 562 | memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); |
| 563 | } | 563 | } |
| 564 | 564 | ||
| 565 | Core::AppCore().ClearInstructionCache(); | 565 | Core::CPU().ClearInstructionCache(); |
| 566 | 566 | ||
| 567 | cmd_buff[1] = result.raw; | 567 | cmd_buff[1] = result.raw; |
| 568 | } | 568 | } |
| @@ -624,7 +624,7 @@ static void LinkCRO(Interface* self) { | |||
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | memory_synchronizer.SynchronizeOriginalMemory(); | 626 | memory_synchronizer.SynchronizeOriginalMemory(); |
| 627 | Core::AppCore().ClearInstructionCache(); | 627 | Core::CPU().ClearInstructionCache(); |
| 628 | 628 | ||
| 629 | cmd_buff[1] = result.raw; | 629 | cmd_buff[1] = result.raw; |
| 630 | } | 630 | } |
| @@ -686,7 +686,7 @@ static void UnlinkCRO(Interface* self) { | |||
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | memory_synchronizer.SynchronizeOriginalMemory(); | 688 | memory_synchronizer.SynchronizeOriginalMemory(); |
| 689 | Core::AppCore().ClearInstructionCache(); | 689 | Core::CPU().ClearInstructionCache(); |
| 690 | 690 | ||
| 691 | cmd_buff[1] = result.raw; | 691 | cmd_buff[1] = result.raw; |
| 692 | } | 692 | } |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 1f89ccfd5..2ca270de3 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -583,7 +583,7 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, s32 priority, u32 ent | |||
| 583 | 583 | ||
| 584 | /// Called when a thread exits | 584 | /// Called when a thread exits |
| 585 | static void ExitThread() { | 585 | static void ExitThread() { |
| 586 | LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::AppCore().GetPC()); | 586 | LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::CPU().GetPC()); |
| 587 | 587 | ||
| 588 | Kernel::ExitCurrentThread(); | 588 | Kernel::ExitCurrentThread(); |
| 589 | } | 589 | } |
| @@ -613,7 +613,7 @@ static ResultCode CreateMutex(Kernel::Handle* out_handle, u32 initial_locked) { | |||
| 613 | using Kernel::Mutex; | 613 | using Kernel::Mutex; |
| 614 | 614 | ||
| 615 | SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0); | 615 | SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0); |
| 616 | mutex->name = Common::StringFromFormat("mutex-%08x", Core::AppCore().GetReg(14)); | 616 | mutex->name = Common::StringFromFormat("mutex-%08x", Core::CPU().GetReg(14)); |
| 617 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); | 617 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); |
| 618 | 618 | ||
| 619 | LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", | 619 | LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", |
| @@ -684,7 +684,7 @@ static ResultCode CreateSemaphore(Kernel::Handle* out_handle, s32 initial_count, | |||
| 684 | using Kernel::Semaphore; | 684 | using Kernel::Semaphore; |
| 685 | 685 | ||
| 686 | CASCADE_RESULT(SharedPtr<Semaphore> semaphore, Semaphore::Create(initial_count, max_count)); | 686 | CASCADE_RESULT(SharedPtr<Semaphore> semaphore, Semaphore::Create(initial_count, max_count)); |
| 687 | semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::AppCore().GetReg(14)); | 687 | semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::CPU().GetReg(14)); |
| 688 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(semaphore))); | 688 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(semaphore))); |
| 689 | 689 | ||
| 690 | LOG_TRACE(Kernel_SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X", | 690 | LOG_TRACE(Kernel_SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X", |
| @@ -741,7 +741,7 @@ static ResultCode CreateEvent(Kernel::Handle* out_handle, u32 reset_type) { | |||
| 741 | using Kernel::Event; | 741 | using Kernel::Event; |
| 742 | 742 | ||
| 743 | SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type)); | 743 | SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type)); |
| 744 | evt->name = Common::StringFromFormat("event-%08x", Core::AppCore().GetReg(14)); | 744 | evt->name = Common::StringFromFormat("event-%08x", Core::CPU().GetReg(14)); |
| 745 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); | 745 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); |
| 746 | 746 | ||
| 747 | LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, | 747 | LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, |
| @@ -788,7 +788,7 @@ static ResultCode CreateTimer(Kernel::Handle* out_handle, u32 reset_type) { | |||
| 788 | using Kernel::Timer; | 788 | using Kernel::Timer; |
| 789 | 789 | ||
| 790 | SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type)); | 790 | SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type)); |
| 791 | timer->name = Common::StringFromFormat("timer-%08x", Core::AppCore().GetReg(14)); | 791 | timer->name = Common::StringFromFormat("timer-%08x", Core::CPU().GetReg(14)); |
| 792 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); | 792 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); |
| 793 | 793 | ||
| 794 | LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, | 794 | LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, |
| @@ -855,8 +855,7 @@ static void SleepThread(s64 nanoseconds) { | |||
| 855 | static s64 GetSystemTick() { | 855 | static s64 GetSystemTick() { |
| 856 | s64 result = CoreTiming::GetTicks(); | 856 | s64 result = CoreTiming::GetTicks(); |
| 857 | // Advance time to defeat dumb games (like Cubic Ninja) that busy-wait for the frame to end. | 857 | // Advance time to defeat dumb games (like Cubic Ninja) that busy-wait for the frame to end. |
| 858 | Core::AppCore().AddTicks( | 858 | Core::CPU().AddTicks(150); // Measured time between two calls on a 9.2 o3DS with Ninjhax 1.1b |
| 859 | 150); // Measured time between two calls on a 9.2 o3DS with Ninjhax 1.1b | ||
| 860 | return result; | 859 | return result; |
| 861 | } | 860 | } |
| 862 | 861 | ||