2010-05-30 01:54:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class CCodeBlock;
|
|
|
|
|
|
|
|
class CCodeSection :
|
|
|
|
private CRecompilerOps
|
|
|
|
{
|
2010-07-23 10:45:35 +00:00
|
|
|
typedef std::list<CCodeSection *> SECTION_LIST;
|
|
|
|
|
2010-05-30 01:54:42 +00:00
|
|
|
public:
|
|
|
|
CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID);
|
|
|
|
~CCodeSection( void );
|
|
|
|
|
2010-07-23 10:45:35 +00:00
|
|
|
void CompileCop1Test ( void );
|
|
|
|
bool CreateSectionLinkage ( void );
|
|
|
|
bool GenerateX86Code ( DWORD Test );
|
|
|
|
void GenerateSectionLinkage ( void );
|
|
|
|
void CompileSystemCheck ( DWORD TargetPC, const CRegInfo &RegSet );
|
|
|
|
void CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(const char * Label, DWORD Value));
|
|
|
|
void DetermineLoop ( DWORD Test, DWORD Test2, DWORD TestID );
|
|
|
|
bool FixConstants ( DWORD Test );
|
|
|
|
CCodeSection * ExistingSection ( DWORD Addr, DWORD Test );
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
/* Block Connection info */
|
2010-07-23 10:45:35 +00:00
|
|
|
SECTION_LIST m_ParentSection;
|
2010-05-30 01:54:42 +00:00
|
|
|
CCodeBlock * const m_BlockInfo;
|
|
|
|
const DWORD m_EnterPC;
|
|
|
|
const DWORD m_SectionID;
|
|
|
|
CCodeSection * m_ContinueSection;
|
|
|
|
CCodeSection * m_JumpSection;
|
|
|
|
bool m_LinkAllowed; // are other sections allowed to find block to link to it
|
|
|
|
DWORD m_Test;
|
2010-07-23 10:45:35 +00:00
|
|
|
DWORD m_Test2;
|
2010-05-30 01:54:42 +00:00
|
|
|
BYTE * m_CompiledLocation;
|
2010-06-07 02:23:58 +00:00
|
|
|
bool m_DelaySlotSection;
|
2010-07-23 10:45:35 +00:00
|
|
|
bool m_InLoop;
|
2010-05-30 01:54:42 +00:00
|
|
|
|
2010-07-23 10:45:35 +00:00
|
|
|
/*
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Register Info */
|
|
|
|
CRegInfo m_RegEnter;
|
|
|
|
|
|
|
|
/* Jump Info */
|
|
|
|
CJumpInfo m_Jump;
|
|
|
|
CJumpInfo m_Cont;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2010-07-23 10:45:35 +00:00
|
|
|
void AddParent ( CCodeSection * Parent );
|
|
|
|
void InheritConstants ( void );
|
|
|
|
bool FillSectionInfo ( STEP_TYPE StartStepType );
|
|
|
|
void TestRegConstantStates ( CRegInfo & Base, CRegInfo & Reg );
|
|
|
|
void SyncRegState ( const CRegInfo & SyncTo );
|
2010-05-30 01:54:42 +00:00
|
|
|
};
|
|
|
|
|