diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 218508126..6cc4a0812 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include "core/file_sys/sdmc_factory.h" | 24 | #include "core/file_sys/sdmc_factory.h" |
| 25 | #include "core/file_sys/vfs_concat.h" | 25 | #include "core/file_sys/vfs_concat.h" |
| 26 | #include "core/file_sys/vfs_real.h" | 26 | #include "core/file_sys/vfs_real.h" |
| 27 | #include "core/frontend/scope_acquire_context.h" | ||
| 28 | #include "core/gdbstub/gdbstub.h" | 27 | #include "core/gdbstub/gdbstub.h" |
| 29 | #include "core/hardware_interrupt_manager.h" | 28 | #include "core/hardware_interrupt_manager.h" |
| 30 | #include "core/hle/kernel/client_port.h" | 29 | #include "core/hle/kernel/client_port.h" |
| @@ -168,13 +167,9 @@ struct System::Impl { | |||
| 168 | Service::Init(service_manager, system); | 167 | Service::Init(service_manager, system); |
| 169 | GDBStub::Init(); | 168 | GDBStub::Init(); |
| 170 | 169 | ||
| 171 | renderer = VideoCore::CreateRenderer(emu_window, system); | ||
| 172 | if (!renderer->Init()) { | ||
| 173 | return ResultStatus::ErrorVideoCore; | ||
| 174 | } | ||
| 175 | interrupt_manager = std::make_unique<Core::Hardware::InterruptManager>(system); | 170 | interrupt_manager = std::make_unique<Core::Hardware::InterruptManager>(system); |
| 176 | gpu_core = VideoCore::CreateGPU(system); | 171 | gpu_core = VideoCore::CreateGPU(emu_window, system); |
| 177 | renderer->Rasterizer().SetupDirtyFlags(); | 172 | gpu_core->Renderer().Rasterizer().SetupDirtyFlags(); |
| 178 | 173 | ||
| 179 | is_powered_on = true; | 174 | is_powered_on = true; |
| 180 | exit_lock = false; | 175 | exit_lock = false; |
| @@ -186,7 +181,6 @@ struct System::Impl { | |||
| 186 | 181 | ||
| 187 | ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, | 182 | ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, |
| 188 | const std::string& filepath) { | 183 | const std::string& filepath) { |
| 189 | Core::Frontend::ScopeAcquireContext acquire_context{emu_window}; | ||
| 190 | 184 | ||
| 191 | app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath)); | 185 | app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath)); |
| 192 | if (!app_loader) { | 186 | if (!app_loader) { |
| @@ -216,10 +210,6 @@ struct System::Impl { | |||
| 216 | AddGlueRegistrationForProcess(*app_loader, *main_process); | 210 | AddGlueRegistrationForProcess(*app_loader, *main_process); |
| 217 | kernel.MakeCurrentProcess(main_process.get()); | 211 | kernel.MakeCurrentProcess(main_process.get()); |
| 218 | 212 | ||
| 219 | // Main process has been loaded and been made current. | ||
| 220 | // Begin GPU and CPU execution. | ||
| 221 | gpu_core->Start(); | ||
| 222 | |||
| 223 | // Initialize cheat engine | 213 | // Initialize cheat engine |
| 224 | if (cheat_engine) { | 214 | if (cheat_engine) { |
| 225 | cheat_engine->Initialize(); | 215 | cheat_engine->Initialize(); |
| @@ -277,7 +267,6 @@ struct System::Impl { | |||
| 277 | } | 267 | } |
| 278 | 268 | ||
| 279 | // Shutdown emulation session | 269 | // Shutdown emulation session |
| 280 | renderer.reset(); | ||
| 281 | GDBStub::Shutdown(); | 270 | GDBStub::Shutdown(); |
| 282 | Service::Shutdown(); | 271 | Service::Shutdown(); |
| 283 | service_manager.reset(); | 272 | service_manager.reset(); |
| @@ -353,7 +342,6 @@ struct System::Impl { | |||
| 353 | Service::FileSystem::FileSystemController fs_controller; | 342 | Service::FileSystem::FileSystemController fs_controller; |
| 354 | /// AppLoader used to load the current executing application | 343 | /// AppLoader used to load the current executing application |
| 355 | std::unique_ptr<Loader::AppLoader> app_loader; | 344 | std::unique_ptr<Loader::AppLoader> app_loader; |
| 356 | std::unique_ptr<VideoCore::RendererBase> renderer; | ||
| 357 | std::unique_ptr<Tegra::GPU> gpu_core; | 345 | std::unique_ptr<Tegra::GPU> gpu_core; |
| 358 | std::unique_ptr<Hardware::InterruptManager> interrupt_manager; | 346 | std::unique_ptr<Hardware::InterruptManager> interrupt_manager; |
| 359 | Memory::Memory memory; | 347 | Memory::Memory memory; |
| @@ -536,11 +524,11 @@ const Core::Hardware::InterruptManager& System::InterruptManager() const { | |||
| 536 | } | 524 | } |
| 537 | 525 | ||
| 538 | VideoCore::RendererBase& System::Renderer() { | 526 | VideoCore::RendererBase& System::Renderer() { |
| 539 | return *impl->renderer; | 527 | return impl->gpu_core->Renderer(); |
| 540 | } | 528 | } |
| 541 | 529 | ||
| 542 | const VideoCore::RendererBase& System::Renderer() const { | 530 | const VideoCore::RendererBase& System::Renderer() const { |
| 543 | return *impl->renderer; | 531 | return impl->gpu_core->Renderer(); |
| 544 | } | 532 | } |
| 545 | 533 | ||
| 546 | Kernel::KernelCore& System::Kernel() { | 534 | Kernel::KernelCore& System::Kernel() { |