summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index b4df90efd..67d7cf7b2 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -12,10 +12,10 @@
12#include "core/core.h" 12#include "core/core.h"
13#include "core/core_timing.h" 13#include "core/core_timing.h"
14#include "core/gdbstub/gdbstub.h" 14#include "core/gdbstub/gdbstub.h"
15#include "core/hle/hle.h"
16#include "core/hle/kernel/kernel.h" 15#include "core/hle/kernel/kernel.h"
17#include "core/hle/kernel/memory.h" 16#include "core/hle/kernel/memory.h"
18#include "core/hle/kernel/thread.h" 17#include "core/hle/kernel/thread.h"
18#include "core/hle/service/service.h"
19#include "core/hw/hw.h" 19#include "core/hw/hw.h"
20#include "core/loader/loader.h" 20#include "core/loader/loader.h"
21#include "core/settings.h" 21#include "core/settings.h"
@@ -51,15 +51,13 @@ System::ResultStatus System::RunLoop(int tight_loop) {
51 LOG_TRACE(Core_ARM11, "Idling"); 51 LOG_TRACE(Core_ARM11, "Idling");
52 CoreTiming::Idle(); 52 CoreTiming::Idle();
53 CoreTiming::Advance(); 53 CoreTiming::Advance();
54 HLE::Reschedule(__func__); 54 PrepareReschedule();
55 } else { 55 } else {
56 app_core->Run(tight_loop); 56 app_core->Run(tight_loop);
57 } 57 }
58 58
59 HW::Update(); 59 HW::Update();
60 if (HLE::IsReschedulePending()) { 60 Reschedule();
61 Kernel::Reschedule();
62 }
63 61
64 return ResultStatus::Success; 62 return ResultStatus::Success;
65} 63}
@@ -110,6 +108,20 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
110 return ResultStatus::Success; 108 return ResultStatus::Success;
111} 109}
112 110
111void System::PrepareReschedule() {
112 app_core->PrepareReschedule();
113 reschedule_pending = true;
114}
115
116void System::Reschedule() {
117 if (!reschedule_pending) {
118 return;
119 }
120
121 reschedule_pending = false;
122 Kernel::Reschedule();
123}
124
113System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { 125System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
114 if (app_core) { 126 if (app_core) {
115 app_core.reset(); 127 app_core.reset();
@@ -126,7 +138,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
126 CoreTiming::Init(); 138 CoreTiming::Init();
127 HW::Init(); 139 HW::Init();
128 Kernel::Init(system_mode); 140 Kernel::Init(system_mode);
129 HLE::Init(); 141 Service::Init();
130 AudioCore::Init(); 142 AudioCore::Init();
131 GDBStub::Init(); 143 GDBStub::Init();
132 144
@@ -143,7 +155,7 @@ void System::Shutdown() {
143 GDBStub::Shutdown(); 155 GDBStub::Shutdown();
144 AudioCore::Shutdown(); 156 AudioCore::Shutdown();
145 VideoCore::Shutdown(); 157 VideoCore::Shutdown();
146 HLE::Shutdown(); 158 Service::Shutdown();
147 Kernel::Shutdown(); 159 Kernel::Shutdown();
148 HW::Shutdown(); 160 HW::Shutdown();
149 CoreTiming::Shutdown(); 161 CoreTiming::Shutdown();