diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-12-02 20:07:30 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-12-03 13:27:02 +0100 |
| commit | 839db591d9daa388c1b6eb944a9f34a9aa41c871 (patch) | |
| tree | 38ea0e3d41b297c6adf6fba87c35d7a7a36a12e6 /Source/Core/VideoCommon/VertexLoaderManager.cpp | |
| parent | 7cd9a78ebf6e49b21a5a5eee99858822a8946faa (diff) | |
HW/Memmap: Refactor Memory to class, move to Core::System.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index c37b4a4fa2..e788f8e3db 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -18,6 +18,7 @@ #include "Core/DolphinAnalytics.h" #include "Core/HW/Memmap.h" +#include "Core/System.h" #include "VideoCommon/BPMemory.h" #include "VideoCommon/CPMemory.h" @@ -81,6 +82,9 @@ void UpdateVertexArrayPointers() if (!g_bases_dirty) [[likely]] return; + auto& system = Core::System::GetInstance(); + auto& memory = system.GetMemory(); + // Some games such as Burnout 2 can put invalid addresses into // the array base registers. (see issue 8591) // But the vertex arrays with invalid addresses aren't actually enabled. @@ -89,24 +93,24 @@ void UpdateVertexArrayPointers() // We also only update the array base if the vertex description states we are going to use it. if (IsIndexed(g_main_cp_state.vtx_desc.low.Position)) cached_arraybases[CPArray::Position] = - Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Position]); + memory.GetPointer(g_main_cp_state.array_bases[CPArray::Position]); if (IsIndexed(g_main_cp_state.vtx_desc.low.Normal)) cached_arraybases[CPArray::Normal] = - Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Normal]); + memory.GetPointer(g_main_cp_state.array_bases[CPArray::Normal]); for (u8 i = 0; i < g_main_cp_state.vtx_desc.low.Color.Size(); i++) { if (IsIndexed(g_main_cp_state.vtx_desc.low.Color[i])) cached_arraybases[CPArray::Color0 + i] = - Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Color0 + i]); + memory.GetPointer(g_main_cp_state.array_bases[CPArray::Color0 + i]); } for (u8 i = 0; i < g_main_cp_state.vtx_desc.high.TexCoord.Size(); i++) { if (IsIndexed(g_main_cp_state.vtx_desc.high.TexCoord[i])) cached_arraybases[CPArray::TexCoord0 + i] = - Memory::GetPointer(g_main_cp_state.array_bases[CPArray::TexCoord0 + i]); + memory.GetPointer(g_main_cp_state.array_bases[CPArray::TexCoord0 + i]); } g_bases_dirty = false; |
