diff options
| author | 2018-05-01 22:21:38 -0400 | |
|---|---|---|
| committer | 2018-05-10 19:34:46 -0400 | |
| commit | 559024593086d04e24a99a9f77490a3f97cf952d (patch) | |
| tree | 0b9163a33ae973bd69cb3883bea1e91a3581f527 /src/core/core.h | |
| parent | Stubs for QLaunch (#428) (diff) | |
| download | yuzu-559024593086d04e24a99a9f77490a3f97cf952d.tar.gz yuzu-559024593086d04e24a99a9f77490a3f97cf952d.tar.xz yuzu-559024593086d04e24a99a9f77490a3f97cf952d.zip | |
core: Move common CPU core things to its own class.
Diffstat (limited to 'src/core/core.h')
| -rw-r--r-- | src/core/core.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/core.h b/src/core/core.h index f81cbfb3c..6e6cc7579 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -4,9 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | #include <string> | 9 | #include <string> |
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "core/core_cpu.h" | ||
| 10 | #include "core/hle/kernel/kernel.h" | 12 | #include "core/hle/kernel/kernel.h" |
| 11 | #include "core/hle/kernel/scheduler.h" | 13 | #include "core/hle/kernel/scheduler.h" |
| 12 | #include "core/loader/loader.h" | 14 | #include "core/loader/loader.h" |
| @@ -89,7 +91,7 @@ public: | |||
| 89 | * @returns True if the emulated system is powered on, otherwise false. | 91 | * @returns True if the emulated system is powered on, otherwise false. |
| 90 | */ | 92 | */ |
| 91 | bool IsPoweredOn() const { | 93 | bool IsPoweredOn() const { |
| 92 | return cpu_core != nullptr; | 94 | return cpu_cores[0] != nullptr; |
| 93 | } | 95 | } |
| 94 | 96 | ||
| 95 | /** | 97 | /** |
| @@ -110,7 +112,7 @@ public: | |||
| 110 | * @returns A reference to the emulated CPU. | 112 | * @returns A reference to the emulated CPU. |
| 111 | */ | 113 | */ |
| 112 | ARM_Interface& CPU() { | 114 | ARM_Interface& CPU() { |
| 113 | return *cpu_core; | 115 | return cpu_cores[0]->CPU(); |
| 114 | } | 116 | } |
| 115 | 117 | ||
| 116 | Tegra::GPU& GPU() { | 118 | Tegra::GPU& GPU() { |
| @@ -118,7 +120,7 @@ public: | |||
| 118 | } | 120 | } |
| 119 | 121 | ||
| 120 | Kernel::Scheduler& Scheduler() { | 122 | Kernel::Scheduler& Scheduler() { |
| 121 | return *scheduler; | 123 | return cpu_cores[0]->Scheduler(); |
| 122 | } | 124 | } |
| 123 | 125 | ||
| 124 | Kernel::SharedPtr<Kernel::Process>& CurrentProcess() { | 126 | Kernel::SharedPtr<Kernel::Process>& CurrentProcess() { |
| @@ -163,18 +165,12 @@ private: | |||
| 163 | */ | 165 | */ |
| 164 | ResultStatus Init(EmuWindow* emu_window, u32 system_mode); | 166 | ResultStatus Init(EmuWindow* emu_window, u32 system_mode); |
| 165 | 167 | ||
| 166 | /// Reschedule the core emulation | ||
| 167 | void Reschedule(); | ||
| 168 | |||
| 169 | /// AppLoader used to load the current executing application | 168 | /// AppLoader used to load the current executing application |
| 170 | std::unique_ptr<Loader::AppLoader> app_loader; | 169 | std::unique_ptr<Loader::AppLoader> app_loader; |
| 171 | 170 | ||
| 172 | std::shared_ptr<ARM_Interface> cpu_core; | 171 | std::array<std::unique_ptr<Cpu>, 4> cpu_cores; |
| 173 | std::unique_ptr<Kernel::Scheduler> scheduler; | ||
| 174 | std::unique_ptr<Tegra::GPU> gpu_core; | 172 | std::unique_ptr<Tegra::GPU> gpu_core; |
| 175 | |||
| 176 | std::shared_ptr<Tegra::DebugContext> debug_context; | 173 | std::shared_ptr<Tegra::DebugContext> debug_context; |
| 177 | |||
| 178 | Kernel::SharedPtr<Kernel::Process> current_process; | 174 | Kernel::SharedPtr<Kernel::Process> current_process; |
| 179 | 175 | ||
| 180 | /// When true, signals that a reschedule should happen | 176 | /// When true, signals that a reschedule should happen |