From 3e47480470d7757cd76976fe80b7eaf77936ad56 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Wed, 29 Oct 2014 23:51:27 +1300 Subject: [PATCH] Remove dumb getPointers that actually want the whole memory block. The whole memory block is accessable globally anyway. Much cleaner! --- Source/Core/Core/HW/DSP.cpp | 2 +- Source/Core/Core/HW/DSPLLE/DSPLLE.cpp | 2 +- Source/Core/Core/HW/MemmapFunctions.cpp | 4 +++- Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index 9bbb998f15..422e20fba5 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -241,7 +241,7 @@ void Init(bool hle) g_ARAM.wii_mode = true; g_ARAM.size = Memory::EXRAM_SIZE; g_ARAM.mask = Memory::EXRAM_MASK; - g_ARAM.ptr = Memory::GetPointer(0x10000000); + g_ARAM.ptr = Memory::m_pEXRAM; } else { diff --git a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp index d9484b85c4..ebfb32eef1 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp @@ -168,7 +168,7 @@ bool DSPLLE::Initialize(bool bWii, bool bDSPThread) if (!DSPCore_Init(opts)) return false; - g_dsp.cpu_ram = Memory::GetPointer(0); + g_dsp.cpu_ram = Memory::m_pRAM; DSPCore_Reset(); m_bIsRunning = true; diff --git a/Source/Core/Core/HW/MemmapFunctions.cpp b/Source/Core/Core/HW/MemmapFunctions.cpp index 93d5e020de..194555004c 100644 --- a/Source/Core/Core/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/HW/MemmapFunctions.cpp @@ -811,7 +811,9 @@ static u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag) u32 VSID = SR_VSID(sr); // 24 bit u32 api = EA_API(_Address); // 6 bit (part of page_index) - u8* pRAM = GetPointer(0); + // Direct access to the fastmem Arena + // FIXME: is this the best idea for clean code? + u8* pRAM = Memory::base; // hash function no 1 "xor" .360 u32 hash1 = (VSID ^ page_index); diff --git a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp index 2e78799195..78b8971865 100644 --- a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp +++ b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp @@ -126,7 +126,7 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) void CheatSearchTab::StartNewSearch(wxCommandEvent& WXUNUSED (event)) { - const u8* const memptr = Memory::GetPointer(0); + const u8* const memptr = Memory::m_pRAM; if (memptr == nullptr) { WxUtils::ShowErrorDialog(_("A game is not currently running.")); @@ -158,7 +158,7 @@ void CheatSearchTab::StartNewSearch(wxCommandEvent& WXUNUSED (event)) void CheatSearchTab::FilterCheatSearchResults(wxCommandEvent&) { - const u8* const memptr = Memory::GetPointer(0); + const u8* const memptr = Memory::m_pRAM; if (memptr == nullptr) { WxUtils::ShowErrorDialog(_("A game is not currently running."));