From 8bb404c82a59a9cf8529339ea413603d80bd9e05 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Wed, 21 Nov 2018 11:20:20 -0500 Subject: [PATCH] VideoCore: pass in memory system currently set as global. Will change when videocore itself is wrapped as a class --- src/core/core.cpp | 2 +- src/video_core/video_core.cpp | 5 ++++- src/video_core/video_core.h | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 032cf2a909..37c3d1ac3b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -206,7 +206,7 @@ System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) { Service::Init(*this); GDBStub::Init(); - ResultStatus result = VideoCore::Init(emu_window); + ResultStatus result = VideoCore::Init(emu_window, *memory); if (result != ResultStatus::Success) { return result; } diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index e9bc65f6ec..fa68e1d1fe 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -29,8 +29,11 @@ void* g_screenshot_bits; std::function g_screenshot_complete_callback; Layout::FramebufferLayout g_screenshot_framebuffer_layout; +Memory::MemorySystem* g_memory; + /// Initialize the video core -Core::System::ResultStatus Init(EmuWindow& emu_window) { +Core::System::ResultStatus Init(EmuWindow& emu_window, Memory::MemorySystem& memory) { + g_memory = &memory; Pica::Init(); g_renderer = std::make_unique(emu_window); diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index 0c582f1fc0..782557090e 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h @@ -12,6 +12,10 @@ class EmuWindow; class RendererBase; +namespace Memory{ +class MemorySystem; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // Video Core namespace @@ -33,8 +37,10 @@ extern void* g_screenshot_bits; extern std::function g_screenshot_complete_callback; extern Layout::FramebufferLayout g_screenshot_framebuffer_layout; +extern Memory::MemorySystem* g_memory; + /// Initialize the video core -Core::System::ResultStatus Init(EmuWindow& emu_window); +Core::System::ResultStatus Init(EmuWindow& emu_window, Memory::MemorySystem& memory); /// Shutdown the video core void Shutdown();