diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 8ac4481cc..98f8a7dff 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 6 | 6 | ||
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/core_timing.h" | ||
| 8 | 9 | ||
| 9 | #include "core/settings.h" | 10 | #include "core/settings.h" |
| 10 | #include "core/arm/disassembler/arm_disasm.h" | 11 | #include "core/arm/disassembler/arm_disasm.h" |
| @@ -23,7 +24,17 @@ ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core | |||
| 23 | 24 | ||
| 24 | /// Run the core CPU loop | 25 | /// Run the core CPU loop |
| 25 | void RunLoop(int tight_loop) { | 26 | void RunLoop(int tight_loop) { |
| 26 | g_app_core->Run(tight_loop); | 27 | // If the current thread is an idle thread, then don't execute instructions, |
| 28 | // instead advance to the next event and try to yield to the next thread | ||
| 29 | if (Kernel::IsIdleThread(Kernel::GetCurrentThreadHandle())) { | ||
| 30 | LOG_TRACE(Core_ARM11, "Idling"); | ||
| 31 | CoreTiming::Idle(); | ||
| 32 | CoreTiming::Advance(); | ||
| 33 | HLE::Reschedule(__func__); | ||
| 34 | } else { | ||
| 35 | g_app_core->Run(tight_loop); | ||
| 36 | } | ||
| 37 | |||
| 27 | HW::Update(); | 38 | HW::Update(); |
| 28 | if (HLE::g_reschedule) { | 39 | if (HLE::g_reschedule) { |
| 29 | Kernel::Reschedule(); | 40 | Kernel::Reschedule(); |