diff --git a/src/core/core.cpp b/src/core/core.cpp index 032cf2a90..37c3d1ac3 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 e9bc65f6e..fa68e1d1f 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 0c582f1fc..782557090 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();