VideoCore: pass in memory system

currently set as global. Will change when videocore itself is wrapped as a class
This commit is contained in:
Weiyi Wang 2018-11-21 11:20:20 -05:00
parent 8c618c3fc3
commit 8bb404c82a
3 changed files with 12 additions and 3 deletions

View file

@ -206,7 +206,7 @@ System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) {
Service::Init(*this); Service::Init(*this);
GDBStub::Init(); GDBStub::Init();
ResultStatus result = VideoCore::Init(emu_window); ResultStatus result = VideoCore::Init(emu_window, *memory);
if (result != ResultStatus::Success) { if (result != ResultStatus::Success) {
return result; return result;
} }

View file

@ -29,8 +29,11 @@ void* g_screenshot_bits;
std::function<void()> g_screenshot_complete_callback; std::function<void()> g_screenshot_complete_callback;
Layout::FramebufferLayout g_screenshot_framebuffer_layout; Layout::FramebufferLayout g_screenshot_framebuffer_layout;
Memory::MemorySystem* g_memory;
/// Initialize the video core /// 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(); Pica::Init();
g_renderer = std::make_unique<OpenGL::RendererOpenGL>(emu_window); g_renderer = std::make_unique<OpenGL::RendererOpenGL>(emu_window);

View file

@ -12,6 +12,10 @@
class EmuWindow; class EmuWindow;
class RendererBase; class RendererBase;
namespace Memory{
class MemorySystem;
}
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Video Core namespace // Video Core namespace
@ -33,8 +37,10 @@ extern void* g_screenshot_bits;
extern std::function<void()> g_screenshot_complete_callback; extern std::function<void()> g_screenshot_complete_callback;
extern Layout::FramebufferLayout g_screenshot_framebuffer_layout; extern Layout::FramebufferLayout g_screenshot_framebuffer_layout;
extern Memory::MemorySystem* g_memory;
/// Initialize the video core /// 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 /// Shutdown the video core
void Shutdown(); void Shutdown();