diff options
Diffstat (limited to 'Source/Core/VideoCommon/MainBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/MainBase.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index 6b2e3c91c3..a084e0cc09 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -9,12 +9,22 @@ #include "Common/Event.h" #include "Common/Flag.h" #include "Common/Logging/Log.h" +#include "Core/Host.h" #include "VideoCommon/AsyncRequests.h" #include "VideoCommon/BPStructs.h" +#include "VideoCommon/CPMemory.h" +#include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" +#include "VideoCommon/GeometryShaderManager.h" +#include "VideoCommon/IndexGenerator.h" +#include "VideoCommon/OnScreenDisplay.h" +#include "VideoCommon/OpcodeDecoding.h" +#include "VideoCommon/PixelEngine.h" +#include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/RenderBase.h" #include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/VertexLoaderManager.h" +#include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoState.h" @@ -149,11 +159,58 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) void VideoBackendBase::InitializeShared() { - VideoCommon_Init(); + memset(&g_main_cp_state, 0, sizeof(g_main_cp_state)); + memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state)); + memset(texMem, 0, TMEM_SIZE); + + // Do our OSD callbacks + OSD::DoCallbacks(OSD::CallbackType::Initialization); + + // do not initialize again for the config window + m_initialized = true; s_FifoShuttingDown.Clear(); memset((void*)&s_beginFieldArgs, 0, sizeof(s_beginFieldArgs)); m_invalid = false; + frameCount = 0; + + CommandProcessor::Init(); + Fifo::Init(); + OpcodeDecoder::Init(); + PixelEngine::Init(); + BPInit(); + VertexLoaderManager::Init(); + IndexGenerator::Init(); + VertexShaderManager::Init(); + GeometryShaderManager::Init(); + PixelShaderManager::Init(); + + if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini")) + g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini"); + else + g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini"); + g_Config.GameIniLoad(); + g_Config.UpdateProjectionHack(); + g_Config.VerifyValidity(); + UpdateActiveConfig(); + + // Notify the core that the video backend is ready + Host_Message(WM_USER_CREATE); +} + +void VideoBackendBase::ShutdownShared() +{ + // Do our OSD callbacks + OSD::DoCallbacks(OSD::CallbackType::Shutdown); + + m_initialized = false; + + Fifo::Shutdown(); +} + +void VideoBackendBase::CleanupShared() +{ + VertexLoaderManager::Clear(); } // Run from the CPU thread |
