diff options
| author | 2019-11-26 12:33:20 -0500 | |
|---|---|---|
| committer | 2019-11-26 21:53:34 -0500 | |
| commit | 4c2ed2706e3579ec1304907dad0d45673768e1fc (patch) | |
| tree | 89f72c13ad6ab374a4e2d2d475b1e03320de7066 /src/core/core.cpp | |
| parent | Merge pull request #3143 from ReinUsesLisp/indexing-bug (diff) | |
| download | yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.gz yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.xz yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.zip | |
core/memory: Introduce skeleton of Memory class
Currently, the main memory management code is one of the remaining
places where we have global state. The next series of changes will aim
to rectify this.
This change simply introduces the main skeleton of the class that will
contain all the necessary state.
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index eba17218a..c45fb960c 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include "core/hle/service/service.h" | 39 | #include "core/hle/service/service.h" |
| 40 | #include "core/hle/service/sm/sm.h" | 40 | #include "core/hle/service/sm/sm.h" |
| 41 | #include "core/loader/loader.h" | 41 | #include "core/loader/loader.h" |
| 42 | #include "core/memory.h" | ||
| 42 | #include "core/memory/cheat_engine.h" | 43 | #include "core/memory/cheat_engine.h" |
| 43 | #include "core/perf_stats.h" | 44 | #include "core/perf_stats.h" |
| 44 | #include "core/reporter.h" | 45 | #include "core/reporter.h" |
| @@ -112,8 +113,8 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | |||
| 112 | } | 113 | } |
| 113 | struct System::Impl { | 114 | struct System::Impl { |
| 114 | explicit Impl(System& system) | 115 | explicit Impl(System& system) |
| 115 | : kernel{system}, fs_controller{system}, cpu_core_manager{system}, reporter{system}, | 116 | : kernel{system}, fs_controller{system}, memory{system}, |
| 116 | applet_manager{system} {} | 117 | cpu_core_manager{system}, reporter{system}, applet_manager{system} {} |
| 117 | 118 | ||
| 118 | Cpu& CurrentCpuCore() { | 119 | Cpu& CurrentCpuCore() { |
| 119 | return cpu_core_manager.GetCurrentCore(); | 120 | return cpu_core_manager.GetCurrentCore(); |
| @@ -341,7 +342,8 @@ struct System::Impl { | |||
| 341 | std::unique_ptr<VideoCore::RendererBase> renderer; | 342 | std::unique_ptr<VideoCore::RendererBase> renderer; |
| 342 | std::unique_ptr<Tegra::GPU> gpu_core; | 343 | std::unique_ptr<Tegra::GPU> gpu_core; |
| 343 | std::shared_ptr<Tegra::DebugContext> debug_context; | 344 | std::shared_ptr<Tegra::DebugContext> debug_context; |
| 344 | std::unique_ptr<Core::Hardware::InterruptManager> interrupt_manager; | 345 | std::unique_ptr<Hardware::InterruptManager> interrupt_manager; |
| 346 | Memory::Memory memory; | ||
| 345 | CpuCoreManager cpu_core_manager; | 347 | CpuCoreManager cpu_core_manager; |
| 346 | bool is_powered_on = false; | 348 | bool is_powered_on = false; |
| 347 | bool exit_lock = false; | 349 | bool exit_lock = false; |
| @@ -498,6 +500,14 @@ const ExclusiveMonitor& System::Monitor() const { | |||
| 498 | return impl->cpu_core_manager.GetExclusiveMonitor(); | 500 | return impl->cpu_core_manager.GetExclusiveMonitor(); |
| 499 | } | 501 | } |
| 500 | 502 | ||
| 503 | Memory::Memory& System::Memory() { | ||
| 504 | return impl->memory; | ||
| 505 | } | ||
| 506 | |||
| 507 | const Memory::Memory& System::Memory() const { | ||
| 508 | return impl->memory; | ||
| 509 | } | ||
| 510 | |||
| 501 | Tegra::GPU& System::GPU() { | 511 | Tegra::GPU& System::GPU() { |
| 502 | return *impl->gpu_core; | 512 | return *impl->gpu_core; |
| 503 | } | 513 | } |