Core: remove usage of g_RecompPos

This commit is contained in:
zilmar 2024-05-16 16:08:23 +09:30
parent 7f18773b5b
commit a1f46356fb
6 changed files with 7 additions and 7 deletions

View File

@ -971,7 +971,6 @@ bool CN64System::SetActiveSystem(bool bActive)
g_Plugins = m_Plugins;
g_TLBLoadAddress = &m_TLBLoadAddress;
g_TLBStoreAddress = &m_TLBStoreAddress;
g_RecompPos = m_Recomp ? m_Recomp->RecompPos() : nullptr;
g_Random = &m_Random;
}
else

View File

@ -4,6 +4,7 @@
#include <Project64-core/N64System/N64System.h>
#include <Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.h>
#include <Project64-core/N64System/Recompiler/CodeBlock.h>
#include <Project64-core/N64System/Recompiler/Recompiler.h>
#include <Project64-core/N64System/Recompiler/x86/x86RecompilerOps.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <string.h>
@ -14,6 +15,7 @@ extern "C" void __clear_cache_android(uint8_t * begin, uint8_t * end);
#endif
CCodeBlock::CCodeBlock(CN64System & System, uint32_t VAddrEnter) :
m_Recompiler(*System.m_Recomp),
m_MMU(System.m_MMU_VM),
m_Reg(System.m_Reg),
m_VAddrEnter(VAddrEnter),
@ -908,7 +910,7 @@ uint32_t CCodeBlock::Finilize(uint8_t * CompiledLocation)
m_CodeHolder.relocateToBase((uint64_t)m_CompiledLocation);
size_t codeSize = m_CodeHolder.codeSize();
m_CodeHolder.copyFlattenedData(m_CompiledLocation, codeSize, asmjit::CopySectionFlags::kPadSectionBuffer);
*g_RecompPos += codeSize;
*m_Recompiler.RecompPos() += codeSize;
#if defined(ANDROID) && (defined(__arm__) || defined(_M_ARM))
__clear_cache((uint8_t *)((uint32_t)m_CompiledLocation & ~1), m_CompiledLocation + codeSize);

View File

@ -8,6 +8,7 @@
#endif
class CMipsMemoryVM;
class CRecompiler;
class CCodeBlock :
public asmjit::ErrorHandler
@ -119,6 +120,7 @@ private:
typedef std::map<uint32_t, CCodeSection *> SectionMap;
typedef std::list<CCodeSection *> SectionList;
CRecompiler & m_Recompiler;
CMipsMemoryVM & m_MMU;
CRegisters & m_Reg;
SectionMap m_SectionMap;

View File

@ -370,8 +370,8 @@ CCompiledFunc * CRecompiler::CompileCode()
ShowMemUsed();
}
uint32_t CodeLen = CodeBlock.Finilize(*g_RecompPos);
*g_RecompPos += CodeLen;
uint32_t CodeLen = CodeBlock.Finilize(*RecompPos());
*RecompPos() += CodeLen;
LogCodeBlock(CodeBlock);
if (bSMM_StoreInstruc())

View File

@ -17,7 +17,6 @@ CSystemTimer * g_SystemTimer = nullptr;
uint32_t * g_TLBLoadAddress = nullptr;
uint32_t * g_TLBStoreAddress = nullptr;
CDebugger * g_Debugger = nullptr;
uint8_t ** g_RecompPos = nullptr;
CMempak * g_Mempak = nullptr;
CRandom * g_Random = nullptr;
CEnhancements * g_Enhancements = nullptr;

View File

@ -37,8 +37,6 @@ extern uint32_t * g_TLBStoreAddress;
__interface CDebugger;
extern CDebugger * g_Debugger;
extern uint8_t ** g_RecompPos;
class CMempak;
extern CMempak * g_Mempak;