2010-06-04 06:25:07 +00:00
|
|
|
#include "stdafx.h"
|
2016-01-13 11:15:30 +00:00
|
|
|
#include <Project64-core/N64System/Recompiler/FunctionInfo.h>
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-05-30 01:54:42 +00:00
|
|
|
CCompiledFunc::CCompiledFunc( const CCodeBlock & CodeBlock ) :
|
2015-11-09 20:07:54 +00:00
|
|
|
m_EnterPC(CodeBlock.VAddrEnter()),
|
|
|
|
m_MinPC(CodeBlock.VAddrFirst()),
|
|
|
|
m_MaxPC(CodeBlock.VAddrLast()),
|
|
|
|
m_Hash(CodeBlock.Hash()),
|
|
|
|
m_Function((Func)CodeBlock.CompiledLocation()),
|
2017-01-10 07:01:59 +00:00
|
|
|
m_FunctionEnd(CodeBlock.CompiledLocationEnd()),
|
2021-04-12 11:35:39 +00:00
|
|
|
m_Next(nullptr)
|
2010-05-30 01:54:42 +00:00
|
|
|
{
|
2015-11-09 20:07:54 +00:00
|
|
|
m_MemContents[0] = CodeBlock.MemContents(0);
|
|
|
|
m_MemContents[1] = CodeBlock.MemContents(1);
|
|
|
|
m_MemLocation[0] = CodeBlock.MemLocation(0);
|
|
|
|
m_MemLocation[1] = CodeBlock.MemLocation(1);
|
2016-08-07 09:03:16 +00:00
|
|
|
|
|
|
|
#if defined(__arm__) || defined(_M_ARM)
|
2021-05-18 11:51:36 +00:00
|
|
|
// Make sure function starts at an odd address so that the system knows it is in thumb mode
|
2016-08-07 09:03:16 +00:00
|
|
|
if ((((uint32_t)m_Function) % 2) == 0)
|
|
|
|
{
|
|
|
|
m_Function = (Func)(((uint32_t)m_Function) + 1);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|