Merge pull request #423 from lioncash/void

Remove superfluous void parameter usages.
This commit is contained in:
zilmar 2015-04-30 10:43:32 +10:00
commit f75a6e489c
66 changed files with 1515 additions and 1504 deletions

View File

@ -29,7 +29,8 @@ CCheats::CCheats (const CN64Rom * Rom ) :
m_hCheatTree = NULL; m_hCheatTree = NULL;
} }
CCheats::~CCheats(void) { CCheats::~CCheats()
{
delete m_rcList; delete m_rcList;
delete m_rcAdd; delete m_rcAdd;
} }
@ -613,7 +614,7 @@ bool CCheats::CheatUsesCodeExtensions (const stdstr &LineEntry) {
return CodeExtension; return CodeExtension;
} }
void CCheats::RefreshCheatManager(void) void CCheats::RefreshCheatManager()
{ {
if (m_Window == NULL) { return; } if (m_Window == NULL) { return; }

View File

@ -64,7 +64,7 @@ private:
bool LoadCode ( int CheatNo, LPCSTR CheatString ); bool LoadCode ( int CheatNo, LPCSTR CheatString );
void AddCodeLayers ( int CheatNumber, const stdstr &CheatName, HWND hParent, bool CheatActive ); void AddCodeLayers ( int CheatNumber, const stdstr &CheatName, HWND hParent, bool CheatActive );
//Reload the cheats from the ini file to the select gui //Reload the cheats from the ini file to the select gui
void RefreshCheatManager ( void ); void RefreshCheatManager ();
void ChangeChildrenStatus ( HWND hParent, bool Checked ); void ChangeChildrenStatus ( HWND hParent, bool Checked );
void CheckParentStatus ( HWND hParent ); void CheckParentStatus ( HWND hParent );
static stdstr ReadCodeString ( HWND hDlg, bool &validcodes, bool &validoption, bool &nooptions, int &codeformat ); static stdstr ReadCodeString ( HWND hDlg, bool &validcodes, bool &validoption, bool &nooptions, int &codeformat );

View File

@ -227,7 +227,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2)
return FALSE; return FALSE;
} }
void CInterpreterCPU::BuildCPU (void) void CInterpreterCPU::BuildCPU()
{ {
R4300iOp::m_TestTimer = FALSE; R4300iOp::m_TestTimer = FALSE;
R4300iOp::m_NextInstruction = NORMAL; R4300iOp::m_NextInstruction = NORMAL;
@ -243,7 +243,7 @@ void CInterpreterCPU::BuildCPU (void)
} }
} }
void CInterpreterCPU::InPermLoop (void) void CInterpreterCPU::InPermLoop()
{ {
// *** Changed ***/ // *** Changed ***/
//if (CPU_Type == CPU_SyncCores) //if (CPU_Type == CPU_SyncCores)
@ -277,7 +277,7 @@ void CInterpreterCPU::InPermLoop (void)
} }
} }
void CInterpreterCPU::ExecuteCPU (void) void CInterpreterCPU::ExecuteCPU()
{ {
bool & Done = g_System->m_EndEmulation; bool & Done = g_System->m_EndEmulation;
DWORD & PROGRAM_COUNTER = *_PROGRAM_COUNTER; DWORD & PROGRAM_COUNTER = *_PROGRAM_COUNTER;
@ -363,7 +363,7 @@ void CInterpreterCPU::ExecuteCPU (void)
} }
void CInterpreterCPU::ExecuteOps ( int Cycles ) void CInterpreterCPU::ExecuteOps(int Cycles)
{ {
bool & Done = g_System->m_EndEmulation; bool & Done = g_System->m_EndEmulation;
DWORD & PROGRAM_COUNTER = *_PROGRAM_COUNTER; DWORD & PROGRAM_COUNTER = *_PROGRAM_COUNTER;

View File

@ -14,13 +14,13 @@ class CInterpreterCPU :
private R4300iOp private R4300iOp
{ {
public: public:
static void BuildCPU ( void ); static void BuildCPU();
static void ExecuteCPU ( void ); static void ExecuteCPU();
static void ExecuteOps ( int Cycles ); static void ExecuteOps(int Cycles);
static void InPermLoop ( void ); static void InPermLoop();
private: private:
CInterpreterCPU(void); // Disable default constructor CInterpreterCPU(); // Disable default constructor
CInterpreterCPU(const CInterpreterCPU&); // Disable copy constructor CInterpreterCPU(const CInterpreterCPU&); // Disable copy constructor
CInterpreterCPU& operator=(const CInterpreterCPU&); // Disable assignment CInterpreterCPU& operator=(const CInterpreterCPU&); // Disable assignment

View File

@ -34,7 +34,7 @@ bool DelaySlotEffectsCompare ( DWORD PC, DWORD Reg1, DWORD Reg2 );
m_JumpToLocation = (*_PROGRAM_COUNTER);\ m_JumpToLocation = (*_PROGRAM_COUNTER);\
return; return;
R4300iOp32::Func * R4300iOp32::BuildInterpreter (void ) R4300iOp32::Func * R4300iOp32::BuildInterpreter()
{ {
Jump_Opcode[ 0] = SPECIAL; Jump_Opcode[ 0] = SPECIAL;
Jump_Opcode[ 1] = REGIMM; Jump_Opcode[ 1] = REGIMM;
@ -628,7 +628,7 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter (void )
/************************* Opcode functions *************************/ /************************* Opcode functions *************************/
void R4300iOp32::JAL (void) void R4300iOp32::JAL()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
m_JumpToLocation = ((*_PROGRAM_COUNTER) & 0xF0000000) + (m_Opcode.target << 2); m_JumpToLocation = ((*_PROGRAM_COUNTER) & 0xF0000000) + (m_Opcode.target << 2);
@ -640,7 +640,7 @@ void R4300iOp32::JAL (void)
} }
} }
void R4300iOp32::BEQ (void) void R4300iOp32::BEQ()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0]) if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0])
@ -660,7 +660,7 @@ void R4300iOp32::BEQ (void)
} }
} }
void R4300iOp32::BNE (void) void R4300iOp32::BNE()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] != _GPR[m_Opcode.rt].W[0]) if (_GPR[m_Opcode.rs].W[0] != _GPR[m_Opcode.rt].W[0])
@ -680,7 +680,7 @@ void R4300iOp32::BNE (void)
} }
} }
void R4300iOp32::BLEZ (void) { void R4300iOp32::BLEZ() {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] <= 0) if (_GPR[m_Opcode.rs].W[0] <= 0)
{ {
@ -699,7 +699,7 @@ void R4300iOp32::BLEZ (void) {
} }
} }
void R4300iOp32::BGTZ (void) void R4300iOp32::BGTZ()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] > 0) if (_GPR[m_Opcode.rs].W[0] > 0)
@ -719,7 +719,7 @@ void R4300iOp32::BGTZ (void)
} }
} }
void R4300iOp32::ADDI (void) void R4300iOp32::ADDI()
{ {
#ifdef Interpreter_StackTest #ifdef Interpreter_StackTest
if (m_Opcode.rs == 29 && m_Opcode.rt == 29) if (m_Opcode.rs == 29 && m_Opcode.rt == 29)
@ -736,7 +736,7 @@ void R4300iOp32::ADDI (void)
#endif #endif
} }
void R4300iOp32::ADDIU (void) void R4300iOp32::ADDIU()
{ {
#ifdef Interpreter_StackTest #ifdef Interpreter_StackTest
if (m_Opcode.rs == 29 && m_Opcode.rt == 29) if (m_Opcode.rs == 29 && m_Opcode.rt == 29)
@ -753,7 +753,7 @@ void R4300iOp32::ADDIU (void)
#endif #endif
} }
void R4300iOp32::SLTI (void) void R4300iOp32::SLTI()
{ {
if (_GPR[m_Opcode.rs].W[0] < (__int64)((short)m_Opcode.immediate)) if (_GPR[m_Opcode.rs].W[0] < (__int64)((short)m_Opcode.immediate))
{ {
@ -765,7 +765,7 @@ void R4300iOp32::SLTI (void)
} }
} }
void R4300iOp32::SLTIU (void) void R4300iOp32::SLTIU()
{ {
int imm32 = (short)m_Opcode.immediate; int imm32 = (short)m_Opcode.immediate;
__int64 imm64; __int64 imm64;
@ -774,22 +774,22 @@ void R4300iOp32::SLTIU (void)
_GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].UW[0] < (unsigned __int64)imm64?1:0; _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].UW[0] < (unsigned __int64)imm64?1:0;
} }
void R4300iOp32::ANDI (void) void R4300iOp32::ANDI()
{ {
_GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] & m_Opcode.immediate; _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] & m_Opcode.immediate;
} }
void R4300iOp32::ORI (void) void R4300iOp32::ORI()
{ {
_GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] | m_Opcode.immediate; _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] | m_Opcode.immediate;
} }
void R4300iOp32::XORI (void) void R4300iOp32::XORI()
{ {
_GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] ^ m_Opcode.immediate; _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].W[0] ^ m_Opcode.immediate;
} }
void R4300iOp32::LUI (void) void R4300iOp32::LUI()
{ {
_GPR[m_Opcode.rt].W[0] = (long)((short)m_Opcode.offset << 16); _GPR[m_Opcode.rt].W[0] = (long)((short)m_Opcode.offset << 16);
#ifdef Interpreter_StackTest #ifdef Interpreter_StackTest
@ -800,7 +800,7 @@ void R4300iOp32::LUI (void)
#endif #endif
} }
void R4300iOp32::BEQL (void) void R4300iOp32::BEQL()
{ {
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0]) if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0])
{ {
@ -821,7 +821,7 @@ void R4300iOp32::BEQL (void)
} }
} }
void R4300iOp32::BNEL (void) void R4300iOp32::BNEL()
{ {
if (_GPR[m_Opcode.rs].W[0] != _GPR[m_Opcode.rt].W[0]) if (_GPR[m_Opcode.rs].W[0] != _GPR[m_Opcode.rt].W[0])
{ {
@ -842,7 +842,7 @@ void R4300iOp32::BNEL (void)
} }
} }
void R4300iOp32::BLEZL (void) void R4300iOp32::BLEZL()
{ {
if (_GPR[m_Opcode.rs].W[0] <= 0) if (_GPR[m_Opcode.rs].W[0] <= 0)
{ {
@ -863,7 +863,7 @@ void R4300iOp32::BLEZL (void)
} }
} }
void R4300iOp32::BGTZL (void) void R4300iOp32::BGTZL()
{ {
if (_GPR[m_Opcode.rs].W[0] > 0) if (_GPR[m_Opcode.rs].W[0] > 0)
{ {
@ -884,7 +884,7 @@ void R4300iOp32::BGTZL (void)
} }
} }
void R4300iOp32::LB (void) void R4300iOp32::LB()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0]))
@ -901,7 +901,7 @@ void R4300iOp32::LB (void)
} }
} }
void R4300iOp32::LH (void) void R4300iOp32::LH()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if ((Address & 1) != 0) if ((Address & 1) != 0)
@ -922,7 +922,7 @@ void R4300iOp32::LH (void)
} }
} }
void R4300iOp32::LWL (void) void R4300iOp32::LWL()
{ {
DWORD Offset, Address, Value; DWORD Offset, Address, Value;
@ -943,7 +943,7 @@ void R4300iOp32::LWL (void)
_GPR[m_Opcode.rt].W[0] += (int)(Value << LWL_SHIFT[Offset]); _GPR[m_Opcode.rt].W[0] += (int)(Value << LWL_SHIFT[Offset]);
} }
void R4300iOp32::LW (void) void R4300iOp32::LW()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if ((Address & 3) != 0) if ((Address & 3) != 0)
@ -970,7 +970,7 @@ void R4300iOp32::LW (void)
} }
} }
void R4300iOp32::LBU (void) void R4300iOp32::LBU()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0]))
@ -987,7 +987,7 @@ void R4300iOp32::LBU (void)
} }
} }
void R4300iOp32::LHU (void) void R4300iOp32::LHU()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if ((Address & 1) != 0) if ((Address & 1) != 0)
@ -1008,7 +1008,7 @@ void R4300iOp32::LHU (void)
} }
} }
void R4300iOp32::LWR (void) void R4300iOp32::LWR()
{ {
DWORD Offset, Address, Value; DWORD Offset, Address, Value;
@ -1029,7 +1029,7 @@ void R4300iOp32::LWR (void)
_GPR[m_Opcode.rt].W[0] += (int)(Value >> LWR_SHIFT[Offset]); _GPR[m_Opcode.rt].W[0] += (int)(Value >> LWR_SHIFT[Offset]);
} }
void R4300iOp32::LWU (void) void R4300iOp32::LWU()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if ((Address & 3) != 0) if ((Address & 3) != 0)
@ -1052,7 +1052,7 @@ void R4300iOp32::LWU (void)
} }
void R4300iOp32::LL (void) void R4300iOp32::LL()
{ {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if ((Address & 3) != 0) if ((Address & 3) != 0)
@ -1076,37 +1076,37 @@ void R4300iOp32::LL (void)
} }
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
void R4300iOp32::SPECIAL_SLL (void) void R4300iOp32::SPECIAL_SLL()
{ {
_GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] << m_Opcode.sa); _GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] << m_Opcode.sa);
} }
void R4300iOp32::SPECIAL_SRL (void) void R4300iOp32::SPECIAL_SRL()
{ {
_GPR[m_Opcode.rd].W[0] = (int)(_GPR[m_Opcode.rt].UW[0] >> m_Opcode.sa); _GPR[m_Opcode.rd].W[0] = (int)(_GPR[m_Opcode.rt].UW[0] >> m_Opcode.sa);
} }
void R4300iOp32::SPECIAL_SRA (void) void R4300iOp32::SPECIAL_SRA()
{ {
_GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] >> m_Opcode.sa); _GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] >> m_Opcode.sa);
} }
void R4300iOp32::SPECIAL_SLLV (void) void R4300iOp32::SPECIAL_SLLV()
{ {
_GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] << (_GPR[m_Opcode.rs].UW[0] & 0x1F)); _GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] << (_GPR[m_Opcode.rs].UW[0] & 0x1F));
} }
void R4300iOp32::SPECIAL_SRLV (void) void R4300iOp32::SPECIAL_SRLV()
{ {
_GPR[m_Opcode.rd].W[0] = (int)(_GPR[m_Opcode.rt].UW[0] >> (_GPR[m_Opcode.rs].UW[0] & 0x1F)); _GPR[m_Opcode.rd].W[0] = (int)(_GPR[m_Opcode.rt].UW[0] >> (_GPR[m_Opcode.rs].UW[0] & 0x1F));
} }
void R4300iOp32::SPECIAL_SRAV (void) void R4300iOp32::SPECIAL_SRAV()
{ {
_GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] >> (_GPR[m_Opcode.rs].UW[0] & 0x1F)); _GPR[m_Opcode.rd].W[0] = (_GPR[m_Opcode.rt].W[0] >> (_GPR[m_Opcode.rs].UW[0] & 0x1F));
} }
void R4300iOp32::SPECIAL_JALR (void) void R4300iOp32::SPECIAL_JALR()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
m_JumpToLocation = _GPR[m_Opcode.rs].UW[0]; m_JumpToLocation = _GPR[m_Opcode.rs].UW[0];
@ -1114,32 +1114,32 @@ void R4300iOp32::SPECIAL_JALR (void)
m_TestTimer = TRUE; m_TestTimer = TRUE;
} }
void R4300iOp32::SPECIAL_ADD (void) void R4300iOp32::SPECIAL_ADD()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] + _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] + _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp32::SPECIAL_ADDU (void) void R4300iOp32::SPECIAL_ADDU()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] + _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] + _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp32::SPECIAL_SUB (void) void R4300iOp32::SPECIAL_SUB()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] - _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] - _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp32::SPECIAL_SUBU (void) void R4300iOp32::SPECIAL_SUBU()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] - _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] - _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp32::SPECIAL_AND (void) void R4300iOp32::SPECIAL_AND()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] & _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] & _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp32::SPECIAL_OR (void) void R4300iOp32::SPECIAL_OR()
{ {
_GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] | _GPR[m_Opcode.rt].W[0]; _GPR[m_Opcode.rd].W[0] = _GPR[m_Opcode.rs].W[0] | _GPR[m_Opcode.rt].W[0];
#ifdef Interpreter_StackTest #ifdef Interpreter_StackTest
@ -1150,12 +1150,12 @@ void R4300iOp32::SPECIAL_OR (void)
#endif #endif
} }
void R4300iOp32::SPECIAL_NOR (void) void R4300iOp32::SPECIAL_NOR()
{ {
_GPR[m_Opcode.rd].W[0] = ~(_GPR[m_Opcode.rs].W[0] | _GPR[m_Opcode.rt].W[0]); _GPR[m_Opcode.rd].W[0] = ~(_GPR[m_Opcode.rs].W[0] | _GPR[m_Opcode.rt].W[0]);
} }
void R4300iOp32::SPECIAL_SLT (void) void R4300iOp32::SPECIAL_SLT()
{ {
if (_GPR[m_Opcode.rs].W[0] < _GPR[m_Opcode.rt].W[0]) if (_GPR[m_Opcode.rs].W[0] < _GPR[m_Opcode.rt].W[0])
{ {
@ -1167,7 +1167,7 @@ void R4300iOp32::SPECIAL_SLT (void)
} }
} }
void R4300iOp32::SPECIAL_SLTU (void) void R4300iOp32::SPECIAL_SLTU()
{ {
if (_GPR[m_Opcode.rs].UW[0] < _GPR[m_Opcode.rt].UW[0]) if (_GPR[m_Opcode.rs].UW[0] < _GPR[m_Opcode.rt].UW[0])
{ {
@ -1179,7 +1179,7 @@ void R4300iOp32::SPECIAL_SLTU (void)
} }
} }
void R4300iOp32::SPECIAL_TEQ (void) void R4300iOp32::SPECIAL_TEQ()
{ {
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled)) if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled))
{ {
@ -1187,18 +1187,18 @@ void R4300iOp32::SPECIAL_TEQ (void)
} }
} }
void R4300iOp32::SPECIAL_DSRL32 (void) void R4300iOp32::SPECIAL_DSRL32()
{ {
_GPR[m_Opcode.rd].UW[0] = (DWORD)(_GPR[m_Opcode.rt].UDW >> (m_Opcode.sa + 32)); _GPR[m_Opcode.rd].UW[0] = (DWORD)(_GPR[m_Opcode.rt].UDW >> (m_Opcode.sa + 32));
} }
void R4300iOp32::SPECIAL_DSRA32 (void) void R4300iOp32::SPECIAL_DSRA32()
{ {
_GPR[m_Opcode.rd].W[0] = (long)(_GPR[m_Opcode.rt].DW >> (m_Opcode.sa + 32)); _GPR[m_Opcode.rd].W[0] = (long)(_GPR[m_Opcode.rt].DW >> (m_Opcode.sa + 32));
} }
/********************** R4300i OpCodes: RegImm **********************/ /********************** R4300i OpCodes: RegImm **********************/
void R4300iOp32::REGIMM_BLTZ (void) void R4300iOp32::REGIMM_BLTZ()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] < 0) if (_GPR[m_Opcode.rs].W[0] < 0)
@ -1218,7 +1218,7 @@ void R4300iOp32::REGIMM_BLTZ (void)
} }
} }
void R4300iOp32::REGIMM_BGEZ (void) void R4300iOp32::REGIMM_BGEZ()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] >= 0) if (_GPR[m_Opcode.rs].W[0] >= 0)
@ -1238,7 +1238,7 @@ void R4300iOp32::REGIMM_BGEZ (void)
} }
} }
void R4300iOp32::REGIMM_BLTZL (void) void R4300iOp32::REGIMM_BLTZL()
{ {
if (_GPR[m_Opcode.rs].W[0] < 0) if (_GPR[m_Opcode.rs].W[0] < 0)
{ {
@ -1259,7 +1259,7 @@ void R4300iOp32::REGIMM_BLTZL (void)
} }
} }
void R4300iOp32::REGIMM_BGEZL (void) void R4300iOp32::REGIMM_BGEZL()
{ {
if (_GPR[m_Opcode.rs].W[0] >= 0) if (_GPR[m_Opcode.rs].W[0] >= 0)
{ {
@ -1280,7 +1280,7 @@ void R4300iOp32::REGIMM_BGEZL (void)
} }
} }
void R4300iOp32::REGIMM_BLTZAL (void) void R4300iOp32::REGIMM_BLTZAL()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] < 0) if (_GPR[m_Opcode.rs].W[0] < 0)
@ -1301,7 +1301,7 @@ void R4300iOp32::REGIMM_BLTZAL (void)
_GPR[31].W[0]= (long)((*_PROGRAM_COUNTER) + 8); _GPR[31].W[0]= (long)((*_PROGRAM_COUNTER) + 8);
} }
void R4300iOp32::REGIMM_BGEZAL (void) void R4300iOp32::REGIMM_BGEZAL()
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if (_GPR[m_Opcode.rs].W[0] >= 0) if (_GPR[m_Opcode.rs].W[0] >= 0)
@ -1322,7 +1322,7 @@ void R4300iOp32::REGIMM_BGEZAL (void)
_GPR[31].W[0] = (long)((*_PROGRAM_COUNTER) + 8); _GPR[31].W[0] = (long)((*_PROGRAM_COUNTER) + 8);
} }
/************************** COP0 functions **************************/ /************************** COP0 functions **************************/
void R4300iOp32::COP0_MF (void) { void R4300iOp32::COP0_MF() {
if (LogOptions.LogCP0reads) if (LogOptions.LogCP0reads)
{ {
LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]);
@ -1335,7 +1335,7 @@ void R4300iOp32::COP0_MF (void) {
_GPR[m_Opcode.rt].W[0] = (int)_CP0[m_Opcode.rd]; _GPR[m_Opcode.rt].W[0] = (int)_CP0[m_Opcode.rd];
} }
void R4300iOp32::COP0_MT (void) void R4300iOp32::COP0_MT()
{ {
if (LogOptions.LogCP0changes) if (LogOptions.LogCP0changes)
{ {
@ -1409,13 +1409,13 @@ void R4300iOp32::COP0_MT (void)
} }
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
void R4300iOp32::COP1_MF (void) void R4300iOp32::COP1_MF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION
_GPR[m_Opcode.rt].W[0] = *(int *)_FPR_S[m_Opcode.fs]; _GPR[m_Opcode.rt].W[0] = *(int *)_FPR_S[m_Opcode.fs];
} }
void R4300iOp32::COP1_CF (void) void R4300iOp32::COP1_CF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION
if (m_Opcode.fs != 31 && m_Opcode.fs != 0) if (m_Opcode.fs != 31 && m_Opcode.fs != 0)
@ -1426,7 +1426,7 @@ void R4300iOp32::COP1_CF (void)
_GPR[m_Opcode.rt].W[0] = (int)_FPCR[m_Opcode.fs]; _GPR[m_Opcode.rt].W[0] = (int)_FPCR[m_Opcode.fs];
} }
void R4300iOp32::COP1_DMT (void) void R4300iOp32::COP1_DMT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION
*(__int64 *)_FPR_D[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0]; *(__int64 *)_FPR_D[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0];

View File

@ -15,70 +15,70 @@ class R4300iOp32 :
{ {
public: public:
/************************* OpCode functions *************************/ /************************* OpCode functions *************************/
static void JAL ( void ); static void JAL();
static void BEQ ( void ); static void BEQ();
static void BNE ( void ); static void BNE();
static void BLEZ ( void ); static void BLEZ();
static void BGTZ ( void ); static void BGTZ();
static void ADDI ( void ); static void ADDI();
static void ADDIU ( void ); static void ADDIU();
static void SLTI ( void ); static void SLTI();
static void SLTIU ( void ); static void SLTIU();
static void ANDI ( void ); static void ANDI();
static void ORI ( void ); static void ORI();
static void XORI ( void ); static void XORI();
static void LUI ( void ); static void LUI();
static void BEQL ( void ); static void BEQL();
static void BNEL ( void ); static void BNEL();
static void BLEZL ( void ); static void BLEZL();
static void BGTZL ( void ); static void BGTZL();
static void LB ( void ); static void LB();
static void LH ( void ); static void LH();
static void LWL ( void ); static void LWL();
static void LW ( void ); static void LW();
static void LBU ( void ); static void LBU();
static void LHU ( void ); static void LHU();
static void LWR ( void ); static void LWR();
static void LWU ( void ); static void LWU();
static void LL ( void ); static void LL();
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
static void SPECIAL_SLL ( void ); static void SPECIAL_SLL();
static void SPECIAL_SRL ( void ); static void SPECIAL_SRL();
static void SPECIAL_SRA ( void ); static void SPECIAL_SRA();
static void SPECIAL_SLLV ( void ); static void SPECIAL_SLLV();
static void SPECIAL_SRLV ( void ); static void SPECIAL_SRLV();
static void SPECIAL_SRAV ( void ); static void SPECIAL_SRAV();
static void SPECIAL_JALR ( void ); static void SPECIAL_JALR();
static void SPECIAL_ADD ( void ); static void SPECIAL_ADD();
static void SPECIAL_ADDU ( void ); static void SPECIAL_ADDU();
static void SPECIAL_SUB ( void ); static void SPECIAL_SUB();
static void SPECIAL_SUBU ( void ); static void SPECIAL_SUBU();
static void SPECIAL_AND ( void ); static void SPECIAL_AND();
static void SPECIAL_OR ( void ); static void SPECIAL_OR();
static void SPECIAL_NOR ( void ); static void SPECIAL_NOR();
static void SPECIAL_SLT ( void ); static void SPECIAL_SLT();
static void SPECIAL_SLTU ( void ); static void SPECIAL_SLTU();
static void SPECIAL_TEQ ( void ); static void SPECIAL_TEQ();
static void SPECIAL_DSRL32 ( void ); static void SPECIAL_DSRL32();
static void SPECIAL_DSRA32 ( void ); static void SPECIAL_DSRA32();
/********************** R4300i OpCodes: RegImm **********************/ /********************** R4300i OpCodes: RegImm **********************/
static void REGIMM_BLTZ ( void ); static void REGIMM_BLTZ();
static void REGIMM_BGEZ ( void ); static void REGIMM_BGEZ();
static void REGIMM_BLTZL ( void ); static void REGIMM_BLTZL();
static void REGIMM_BGEZL ( void ); static void REGIMM_BGEZL();
static void REGIMM_BLTZAL ( void ); static void REGIMM_BLTZAL();
static void REGIMM_BGEZAL ( void ); static void REGIMM_BGEZAL();
/************************** COP0 functions **************************/ /************************** COP0 functions **************************/
static void COP0_MF ( void ); static void COP0_MF();
static void COP0_MT ( void ); static void COP0_MT();
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
static void COP1_MF ( void ); static void COP1_MF();
static void COP1_CF ( void ); static void COP1_CF();
static void COP1_DMT ( void ); static void COP1_DMT();
static Func * BuildInterpreter (void ); static Func* BuildInterpreter();
}; };

File diff suppressed because it is too large Load Diff

View File

@ -15,192 +15,193 @@ class R4300iOp :
protected CSystemRegisters protected CSystemRegisters
{ {
public: public:
typedef void ( * Func )(); typedef void(*Func)();
/************************* OpCode functions *************************/ /************************* OpCode functions *************************/
static void J ( void ); static void J();
static void JAL ( void ); static void JAL();
static void BNE ( void ); static void BNE();
static void BEQ ( void ); static void BEQ();
static void BLEZ ( void ); static void BLEZ();
static void BGTZ ( void ); static void BGTZ();
static void ADDI ( void ); static void ADDI();
static void ADDIU ( void ); static void ADDIU();
static void SLTI ( void ); static void SLTI();
static void SLTIU ( void ); static void SLTIU();
static void ANDI ( void ); static void ANDI();
static void ORI ( void ); static void ORI();
static void XORI ( void ); static void XORI();
static void LUI ( void ); static void LUI();
static void BEQL ( void ); static void BEQL();
static void BNEL ( void ); static void BNEL();
static void BLEZL ( void ); static void BLEZL();
static void BGTZL ( void ); static void BGTZL();
static void DADDIU ( void ); static void DADDIU();
static void LDL ( void ); static void LDL();
static void LDR ( void ); static void LDR();
static void LB ( void ); static void LB();
static void LH ( void ); static void LH();
static void LWL ( void ); static void LWL();
static void LW ( void ); static void LW();
static void LBU ( void ); static void LBU();
static void LHU ( void ); static void LHU();
static void LWR ( void ); static void LWR();
static void LWU ( void ); static void LWU();
static void SB ( void ); static void SB();
static void SH ( void ); static void SH();
static void SWL ( void ); static void SWL();
static void SW ( void ); static void SW();
static void SDL ( void ); static void SDL();
static void SDR ( void ); static void SDR();
static void SWR ( void ); static void SWR();
static void CACHE ( void ); static void CACHE();
static void LL ( void ); static void LL();
static void LWC1 ( void ); static void LWC1();
static void LDC1 ( void ); static void LDC1();
static void LD ( void ); static void LD();
static void SC ( void ); static void SC();
static void SWC1 ( void ); static void SWC1();
static void SDC1 ( void ); static void SDC1();
static void SD ( void ); static void SD();
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
static void SPECIAL_SLL ( void ); static void SPECIAL_SLL();
static void SPECIAL_SRL ( void ); static void SPECIAL_SRL();
static void SPECIAL_SRA ( void ); static void SPECIAL_SRA();
static void SPECIAL_SLLV ( void ); static void SPECIAL_SLLV();
static void SPECIAL_SRLV ( void ); static void SPECIAL_SRLV();
static void SPECIAL_SRAV ( void ); static void SPECIAL_SRAV();
static void SPECIAL_JR ( void ); static void SPECIAL_JR();
static void SPECIAL_JALR ( void ); static void SPECIAL_JALR();
static void SPECIAL_SYSCALL ( void ); static void SPECIAL_SYSCALL();
static void SPECIAL_BREAK ( void ); static void SPECIAL_BREAK();
static void SPECIAL_SYNC ( void ); static void SPECIAL_SYNC();
static void SPECIAL_MFHI ( void ); static void SPECIAL_MFHI();
static void SPECIAL_MTHI ( void ); static void SPECIAL_MTHI();
static void SPECIAL_MFLO ( void ); static void SPECIAL_MFLO();
static void SPECIAL_MTLO ( void ); static void SPECIAL_MTLO();
static void SPECIAL_DSLLV ( void ); static void SPECIAL_DSLLV();
static void SPECIAL_DSRLV ( void ); static void SPECIAL_DSRLV();
static void SPECIAL_DSRAV ( void ); static void SPECIAL_DSRAV();
static void SPECIAL_MULT ( void ); static void SPECIAL_MULT();
static void SPECIAL_MULTU ( void ); static void SPECIAL_MULTU();
static void SPECIAL_DIV ( void ); static void SPECIAL_DIV();
static void SPECIAL_DIVU ( void ); static void SPECIAL_DIVU();
static void SPECIAL_DMULT ( void ); static void SPECIAL_DMULT();
static void SPECIAL_DMULTU ( void ); static void SPECIAL_DMULTU();
static void SPECIAL_DDIV ( void ); static void SPECIAL_DDIV();
static void SPECIAL_DDIVU ( void ); static void SPECIAL_DDIVU();
static void SPECIAL_ADD ( void ); static void SPECIAL_ADD();
static void SPECIAL_ADDU ( void ); static void SPECIAL_ADDU();
static void SPECIAL_SUB ( void ); static void SPECIAL_SUB();
static void SPECIAL_SUBU ( void ); static void SPECIAL_SUBU();
static void SPECIAL_AND ( void ); static void SPECIAL_AND();
static void SPECIAL_OR ( void ); static void SPECIAL_OR();
static void SPECIAL_XOR ( void ); static void SPECIAL_XOR();
static void SPECIAL_NOR ( void ); static void SPECIAL_NOR();
static void SPECIAL_SLT ( void ); static void SPECIAL_SLT();
static void SPECIAL_SLTU ( void ); static void SPECIAL_SLTU();
static void SPECIAL_DADD ( void ); static void SPECIAL_DADD();
static void SPECIAL_DADDU ( void ); static void SPECIAL_DADDU();
static void SPECIAL_DSUB ( void ); static void SPECIAL_DSUB();
static void SPECIAL_DSUBU ( void ); static void SPECIAL_DSUBU();
static void SPECIAL_TEQ ( void ); static void SPECIAL_TEQ();
static void SPECIAL_DSLL ( void ); static void SPECIAL_DSLL();
static void SPECIAL_DSRL ( void ); static void SPECIAL_DSRL();
static void SPECIAL_DSRA ( void ); static void SPECIAL_DSRA();
static void SPECIAL_DSLL32 ( void ); static void SPECIAL_DSLL32();
static void SPECIAL_DSRL32 ( void ); static void SPECIAL_DSRL32();
static void SPECIAL_DSRA32 ( void ); static void SPECIAL_DSRA32();
/********************** R4300i OpCodes: RegImm **********************/ /********************** R4300i OpCodes: RegImm **********************/
static void REGIMM_BLTZ ( void ); static void REGIMM_BLTZ();
static void REGIMM_BGEZ ( void ); static void REGIMM_BGEZ();
static void REGIMM_BLTZL ( void ); static void REGIMM_BLTZL();
static void REGIMM_BGEZL ( void ); static void REGIMM_BGEZL();
static void REGIMM_BLTZAL ( void ); static void REGIMM_BLTZAL();
static void REGIMM_BGEZAL ( void ); static void REGIMM_BGEZAL();
/************************** COP0 functions **************************/ /************************** COP0 functions **************************/
static void COP0_MF ( void ); static void COP0_MF();
static void COP0_MT ( void ); static void COP0_MT();
/************************** COP0 CO functions ***********************/ /************************** COP0 CO functions ***********************/
static void COP0_CO_TLBR ( void ); static void COP0_CO_TLBR();
static void COP0_CO_TLBWI ( void ); static void COP0_CO_TLBWI();
static void COP0_CO_TLBWR ( void ); static void COP0_CO_TLBWR();
static void COP0_CO_TLBP ( void ); static void COP0_CO_TLBP();
static void COP0_CO_ERET ( void ); static void COP0_CO_ERET();
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
static void COP1_MF ( void ); static void COP1_MF();
static void COP1_DMF ( void ); static void COP1_DMF();
static void COP1_CF ( void ); static void COP1_CF();
static void COP1_MT ( void ); static void COP1_MT();
static void COP1_DMT ( void ); static void COP1_DMT();
static void COP1_CT ( void ); static void COP1_CT();
/************************* COP1: BC1 functions ***********************/ /************************* COP1: BC1 functions ***********************/
static void COP1_BCF ( void ); static void COP1_BCF();
static void COP1_BCT ( void ); static void COP1_BCT();
static void COP1_BCFL ( void ); static void COP1_BCFL();
static void COP1_BCTL ( void ); static void COP1_BCTL();
/************************** COP1: S functions ************************/ /************************** COP1: S functions ************************/
static void COP1_S_ADD ( void ); static void COP1_S_ADD();
static void COP1_S_SUB ( void ); static void COP1_S_SUB();
static void COP1_S_MUL ( void ); static void COP1_S_MUL();
static void COP1_S_DIV ( void ); static void COP1_S_DIV();
static void COP1_S_SQRT ( void ); static void COP1_S_SQRT();
static void COP1_S_ABS ( void ); static void COP1_S_ABS();
static void COP1_S_MOV ( void ); static void COP1_S_MOV();
static void COP1_S_NEG ( void ); static void COP1_S_NEG();
static void COP1_S_TRUNC_L ( void ); static void COP1_S_TRUNC_L();
static void COP1_S_CEIL_L ( void ); //added by Witten static void COP1_S_CEIL_L(); //added by Witten
static void COP1_S_FLOOR_L ( void ); //added by Witten static void COP1_S_FLOOR_L(); //added by Witten
static void COP1_S_ROUND_W ( void ); static void COP1_S_ROUND_W();
static void COP1_S_TRUNC_W ( void ); static void COP1_S_TRUNC_W();
static void COP1_S_CEIL_W ( void ); //added by Witten static void COP1_S_CEIL_W(); //added by Witten
static void COP1_S_FLOOR_W ( void ); static void COP1_S_FLOOR_W();
static void COP1_S_CVT_D ( void ); static void COP1_S_CVT_D();
static void COP1_S_CVT_W ( void ); static void COP1_S_CVT_W();
static void COP1_S_CVT_L ( void ); static void COP1_S_CVT_L();
static void COP1_S_CMP ( void ); static void COP1_S_CMP();
/************************** COP1: D functions ************************/ /************************** COP1: D functions ************************/
static void COP1_D_ADD ( void ); static void COP1_D_ADD();
static void COP1_D_SUB ( void ); static void COP1_D_SUB();
static void COP1_D_MUL ( void ); static void COP1_D_MUL();
static void COP1_D_DIV ( void ); static void COP1_D_DIV();
static void COP1_D_SQRT ( void ); static void COP1_D_SQRT();
static void COP1_D_ABS ( void ); static void COP1_D_ABS();
static void COP1_D_MOV ( void ); static void COP1_D_MOV();
static void COP1_D_NEG ( void ); static void COP1_D_NEG();
static void COP1_D_TRUNC_L ( void ); //added by Witten static void COP1_D_TRUNC_L(); //added by Witten
static void COP1_D_CEIL_L ( void ); //added by Witten static void COP1_D_CEIL_L(); //added by Witten
static void COP1_D_FLOOR_L ( void ); //added by Witten static void COP1_D_FLOOR_L(); //added by Witten
static void COP1_D_ROUND_W ( void ); static void COP1_D_ROUND_W();
static void COP1_D_TRUNC_W ( void ); static void COP1_D_TRUNC_W();
static void COP1_D_CEIL_W ( void ); //added by Witten static void COP1_D_CEIL_W(); //added by Witten
static void COP1_D_FLOOR_W ( void ); //added by Witten static void COP1_D_FLOOR_W(); //added by Witten
static void COP1_D_CVT_S ( void ); static void COP1_D_CVT_S();
static void COP1_D_CVT_W ( void ); static void COP1_D_CVT_W();
static void COP1_D_CVT_L ( void ); static void COP1_D_CVT_L();
static void COP1_D_CMP ( void ); static void COP1_D_CMP();
/************************** COP1: W functions ************************/ /************************** COP1: W functions ************************/
static void COP1_W_CVT_S ( void ); static void COP1_W_CVT_S();
static void COP1_W_CVT_D ( void ); static void COP1_W_CVT_D();
/************************** COP1: L functions ************************/ /************************** COP1: L functions ************************/
static void COP1_L_CVT_S ( void ); static void COP1_L_CVT_S();
static void COP1_L_CVT_D ( void ); static void COP1_L_CVT_D();
/************************** Other functions **************************/ /************************** Other functions **************************/
static void UnknownOpcode ( void ); static void UnknownOpcode();
static Func * BuildInterpreter (void ); static Func* BuildInterpreter();
static BOOL m_TestTimer; static BOOL m_TestTimer;
static DWORD m_NextInstruction; static DWORD m_NextInstruction;
@ -208,16 +209,16 @@ public:
static DWORD m_JumpToLocation; static DWORD m_JumpToLocation;
protected: protected:
static void SPECIAL (void); static void SPECIAL();
static void REGIMM (void); static void REGIMM();
static void COP0 (void); static void COP0();
static void COP0_CO (void); static void COP0_CO();
static void COP1 (void); static void COP1();
static void COP1_BC (void); static void COP1_BC();
static void COP1_S (void); static void COP1_S();
static void COP1_D (void); static void COP1_D();
static void COP1_W (void); static void COP1_W();
static void COP1_L (void); static void COP1_L();
static Func Jump_Opcode[64]; static Func Jump_Opcode[64];
static Func Jump_Special[64]; static Func Jump_Special[64];

View File

@ -10,17 +10,17 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
CAudio::CAudio (void) CAudio::CAudio()
{ {
Reset(); Reset();
} }
CAudio::~CAudio (void) CAudio::~CAudio()
{ {
} }
void CAudio::Reset ( void ) void CAudio::Reset()
{ {
m_SecondBuff = 0; m_SecondBuff = 0;
m_Status = 0; m_Status = 0;
@ -29,7 +29,7 @@ void CAudio::Reset ( void )
m_FramesPerSecond = 60; m_FramesPerSecond = 60;
} }
DWORD CAudio::GetLength ( void ) DWORD CAudio::GetLength()
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff); WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff);
DWORD TimeLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt), Res = 0; DWORD TimeLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt), Res = 0;
@ -41,13 +41,13 @@ DWORD CAudio::GetLength ( void )
return Res; return Res;
} }
DWORD CAudio::GetStatus ( void ) DWORD CAudio::GetStatus()
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": m_Status = %X",m_Status); WriteTraceF(TraceAudio,__FUNCTION__ ": m_Status = %X",m_Status);
return m_Status; return m_Status;
} }
void CAudio::LenChanged ( void ) void CAudio::LenChanged()
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (g_Reg->AI_LEN_REG = %d)",g_Reg->AI_LEN_REG); WriteTraceF(TraceAudio,__FUNCTION__ ": Start (g_Reg->AI_LEN_REG = %d)",g_Reg->AI_LEN_REG);
if (g_Reg->AI_LEN_REG != 0) if (g_Reg->AI_LEN_REG != 0)
@ -90,7 +90,7 @@ void CAudio::LenChanged ( void )
WriteTraceF(TraceAudio,__FUNCTION__ ": Done"); WriteTraceF(TraceAudio,__FUNCTION__ ": Done");
} }
void CAudio::InterruptTimerDone ( void ) void CAudio::InterruptTimerDone()
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff); WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff);
if (m_SecondBuff != 0) if (m_SecondBuff != 0)
@ -111,7 +111,7 @@ void CAudio::InterruptTimerDone ( void )
WriteTrace(TraceAudio,__FUNCTION__ ": Done"); WriteTrace(TraceAudio,__FUNCTION__ ": Done");
} }
void CAudio::BusyTimerDone ( void ) void CAudio::BusyTimerDone()
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff); WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff);
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);

View File

@ -18,15 +18,15 @@ class CAudio
ai_busy = 0x40000000, ai_busy = 0x40000000,
}; };
public: public:
CAudio (void); CAudio();
~CAudio (void); ~CAudio();
DWORD GetLength ( void ); DWORD GetLength ();
DWORD GetStatus ( void ); DWORD GetStatus ();
void LenChanged ( void ); void LenChanged ();
void InterruptTimerDone( void ); void InterruptTimerDone();
void BusyTimerDone ( void ); void BusyTimerDone ();
void Reset ( void ); void Reset ();
void SetViIntr ( DWORD VI_INTR_TIME ); void SetViIntr ( DWORD VI_INTR_TIME );
void SetFrequency ( DWORD Dacrate, DWORD System ); void SetFrequency ( DWORD Dacrate, DWORD System );

View File

@ -17,7 +17,7 @@ CDMA::CDMA(CFlashram & FlashRam, CSram & Sram) :
} }
void CDMA::OnFirstDMA (void) void CDMA::OnFirstDMA()
{ {
switch (g_Rom->CicChipID()) switch (g_Rom->CicChipID())
{ {
@ -31,7 +31,7 @@ void CDMA::OnFirstDMA (void)
} }
} }
void CDMA::PI_DMA_READ (void) void CDMA::PI_DMA_READ()
{ {
// PI_STATUS_REG |= PI_STATUS_DMA_BUSY; // PI_STATUS_REG |= PI_STATUS_DMA_BUSY;
@ -96,7 +96,7 @@ void CDMA::PI_DMA_READ (void)
return; return;
} }
void CDMA::PI_DMA_WRITE (void) void CDMA::PI_DMA_WRITE()
{ {
DWORD PI_WR_LEN_REG = ((g_Reg->PI_WR_LEN_REG) & 0x00FFFFFFul) + 1; DWORD PI_WR_LEN_REG = ((g_Reg->PI_WR_LEN_REG) & 0x00FFFFFFul) + 1;
@ -208,7 +208,7 @@ void CDMA::PI_DMA_WRITE (void)
} }
void CDMA::SP_DMA_READ (void) void CDMA::SP_DMA_READ()
{ {
g_Reg->SP_DRAM_ADDR_REG &= 0x1FFFFFFF; g_Reg->SP_DRAM_ADDR_REG &= 0x1FFFFFFF;
@ -252,7 +252,7 @@ void CDMA::SP_DMA_READ (void)
g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY; g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY;
} }
void CDMA::SP_DMA_WRITE (void) void CDMA::SP_DMA_WRITE()
{ {
if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize())
{ {

View File

@ -16,20 +16,20 @@ class CDMA :
CDMA(); CDMA();
public: public:
void SP_DMA_READ ( void ); void SP_DMA_READ();
void SP_DMA_WRITE ( void ); void SP_DMA_WRITE();
void PI_DMA_READ ( void ); void PI_DMA_READ();
void PI_DMA_WRITE ( void ); void PI_DMA_WRITE();
protected: protected:
CDMA (CFlashram & FlashRam, CSram & Sram); CDMA (CFlashram & FlashRam, CSram & Sram);
//void SI_DMA_READ ( void ); //void SI_DMA_READ();
//void SI_DMA_WRITE ( void ); //void SI_DMA_WRITE();
private: private:
CFlashram & m_FlashRam; CFlashram & m_FlashRam;
CSram & m_Sram; CSram & m_Sram;
void OnFirstDMA ( void ); void OnFirstDMA();
}; };

View File

@ -11,14 +11,14 @@
#include "stdafx.h" #include "stdafx.h"
#include <time.h> #include <time.h>
CEeprom::CEeprom (bool ReadOnly): CEeprom::CEeprom(bool ReadOnly):
m_ReadOnly(ReadOnly), m_ReadOnly(ReadOnly),
m_hFile(NULL) m_hFile(NULL)
{ {
memset(m_EEPROM,0xFF,sizeof(m_EEPROM)); memset(m_EEPROM,0xFF,sizeof(m_EEPROM));
} }
CEeprom::~CEeprom (void) CEeprom::~CEeprom()
{ {
if (m_hFile) if (m_hFile)
{ {
@ -136,7 +136,7 @@ void CEeprom::EepromCommand ( BYTE * Command)
} }
} }
void CEeprom::LoadEeprom (void) void CEeprom::LoadEeprom()
{ {
CPath FileName; CPath FileName;
DWORD dwRead; DWORD dwRead;

View File

@ -15,12 +15,12 @@ class CEeprom :
{ {
public: public:
CEeprom ( bool ReadOnly ); CEeprom ( bool ReadOnly );
~CEeprom ( void ); ~CEeprom();
void EepromCommand ( BYTE * Command ); void EepromCommand ( BYTE * Command );
private: private:
void LoadEeprom ( void ); void LoadEeprom ();
void ReadFrom ( BYTE * Buffer, int line ); void ReadFrom ( BYTE * Buffer, int line );
void WriteTo ( BYTE * Buffer, int line ); void WriteTo ( BYTE * Buffer, int line );

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
CFlashram::CFlashram (bool ReadOnly): CFlashram::CFlashram(bool ReadOnly):
m_FlashFlag(FLASHRAM_MODE_NOPES), m_FlashFlag(FLASHRAM_MODE_NOPES),
m_FlashStatus(0), m_FlashStatus(0),
m_FlashRamPointer(NULL), m_FlashRamPointer(NULL),
@ -21,7 +21,7 @@ CFlashram::CFlashram (bool ReadOnly):
} }
CFlashram::~CFlashram (void) CFlashram::~CFlashram()
{ {
if (m_hFile) if (m_hFile)
{ {
@ -135,7 +135,7 @@ DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr)
return (DWORD)(m_FlashStatus >> 32); return (DWORD)(m_FlashStatus >> 32);
} }
bool CFlashram::LoadFlashram (void) bool CFlashram::LoadFlashram()
{ {
CPath FileName; CPath FileName;

View File

@ -23,8 +23,8 @@ class CFlashram :
}; };
public: public:
CFlashram ( bool ReadOnly ); CFlashram(bool ReadOnly);
~CFlashram ( void ); ~CFlashram();
void DmaFromFlashram ( BYTE * dest, int StartOffset, int len ); void DmaFromFlashram ( BYTE * dest, int StartOffset, int len );
void DmaToFlashram ( BYTE * Source, int StartOffset, int len ); void DmaToFlashram ( BYTE * Source, int StartOffset, int len );
@ -32,7 +32,7 @@ public:
void WriteToFlashCommand ( DWORD Value ); void WriteToFlashCommand ( DWORD Value );
private: private:
bool LoadFlashram ( void ); bool LoadFlashram();
BYTE * m_FlashRamPointer; BYTE * m_FlashRamPointer;
Modes m_FlashFlag; Modes m_FlashFlag;

View File

@ -19,11 +19,11 @@ interface CMipsMemory_CallBack
class CMipsMemory class CMipsMemory
{ {
public: public:
virtual BYTE * Rdram ( void ) = 0; virtual BYTE * Rdram () = 0;
virtual DWORD RdramSize ( void ) = 0; virtual DWORD RdramSize() = 0;
virtual BYTE * Dmem ( void ) = 0; virtual BYTE * Dmem () = 0;
virtual BYTE * Imem ( void ) = 0; virtual BYTE * Imem () = 0;
virtual BYTE * PifRam ( void ) = 0; virtual BYTE * PifRam () = 0;
virtual BOOL LB_VAddr ( DWORD VAddr, BYTE & Value ) = 0; virtual BOOL LB_VAddr ( DWORD VAddr, BYTE & Value ) = 0;
virtual BOOL LH_VAddr ( DWORD VAddr, WORD & Value ) = 0; virtual BOOL LH_VAddr ( DWORD VAddr, WORD & Value ) = 0;
@ -55,31 +55,31 @@ public:
virtual void UnProtectMemory ( DWORD StartVaddr, DWORD EndVaddr ) = 0; virtual void UnProtectMemory ( DWORD StartVaddr, DWORD EndVaddr ) = 0;
//Compilation Functions //Compilation Functions
virtual void ResetMemoryStack ( void ) = 0; virtual void ResetMemoryStack () = 0;
virtual void Compile_LB ( void ) = 0; virtual void Compile_LB () = 0;
virtual void Compile_LBU ( void ) = 0; virtual void Compile_LBU () = 0;
virtual void Compile_LH ( void ) = 0; virtual void Compile_LH () = 0;
virtual void Compile_LHU ( void ) = 0; virtual void Compile_LHU () = 0;
virtual void Compile_LW ( void ) = 0; virtual void Compile_LW () = 0;
virtual void Compile_LL ( void ) = 0; virtual void Compile_LL () = 0;
virtual void Compile_LWC1 ( void ) = 0; virtual void Compile_LWC1 () = 0;
virtual void Compile_LWU ( void ) = 0; virtual void Compile_LWU () = 0;
virtual void Compile_LWL ( void ) = 0; virtual void Compile_LWL () = 0;
virtual void Compile_LWR ( void ) = 0; virtual void Compile_LWR () = 0;
virtual void Compile_LD ( void ) = 0; virtual void Compile_LD () = 0;
virtual void Compile_LDC1 ( void ) = 0; virtual void Compile_LDC1 () = 0;
virtual void Compile_LDL ( void ) = 0; virtual void Compile_LDL () = 0;
virtual void Compile_LDR ( void ) = 0; virtual void Compile_LDR () = 0;
virtual void Compile_SB ( void ) = 0; virtual void Compile_SB () = 0;
virtual void Compile_SH ( void ) = 0; virtual void Compile_SH () = 0;
virtual void Compile_SW ( void ) = 0; virtual void Compile_SW () = 0;
virtual void Compile_SWL ( void ) = 0; virtual void Compile_SWL () = 0;
virtual void Compile_SWR ( void ) = 0; virtual void Compile_SWR () = 0;
virtual void Compile_SD ( void ) = 0; virtual void Compile_SD () = 0;
virtual void Compile_SDL ( void ) = 0; virtual void Compile_SDL () = 0;
virtual void Compile_SDR ( void ) = 0; virtual void Compile_SDR () = 0;
virtual void Compile_SC ( void ) = 0; virtual void Compile_SC () = 0;
virtual void Compile_SWC1 ( void ) = 0; virtual void Compile_SWC1 () = 0;
virtual void Compile_SDC1 ( void ) = 0; virtual void Compile_SDC1 () = 0;
}; };

View File

@ -135,12 +135,12 @@ void CMemoryLabel::LoadLabelList ( char * file )
} }
// How many new labels been added since loading/saving label file // How many new labels been added since loading/saving label file
int CMemoryLabel::NewLabels ( void ) int CMemoryLabel::NewLabels()
{ {
return m_NewLabels; return m_NewLabels;
} }
void CMemoryLabel::SaveLabelList ( void ) void CMemoryLabel::SaveLabelList()
{ {
m_NewLabels = 0; m_NewLabels = 0;

View File

@ -28,6 +28,6 @@ public:
stdstr LabelName ( DWORD Address ) const; stdstr LabelName ( DWORD Address ) const;
stdstr StoredLabelName ( DWORD Address ); stdstr StoredLabelName ( DWORD Address );
void LoadLabelList ( char * file ); void LoadLabelList ( char * file );
int NewLabels ( void ); // How many new labels been added since loading/saveing label file int NewLabels (); // How many new labels been added since loading/saving label file
void SaveLabelList ( void ); void SaveLabelList ();
}; };

View File

@ -15,7 +15,7 @@ DWORD RegModValue;
BYTE * CMipsMemoryVM::m_Reserve1 = NULL; BYTE * CMipsMemoryVM::m_Reserve1 = NULL;
BYTE * CMipsMemoryVM::m_Reserve2 = NULL; BYTE * CMipsMemoryVM::m_Reserve2 = NULL;
CMipsMemoryVM::CMipsMemoryVM ( CMipsMemory_CallBack * CallBack, bool SavesReadOnly ) : CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnly ) :
CPifRam(SavesReadOnly), CPifRam(SavesReadOnly),
CFlashram(SavesReadOnly), CFlashram(SavesReadOnly),
@ -40,7 +40,7 @@ CMipsMemoryVM::CMipsMemoryVM ( CMipsMemory_CallBack * CallBack, bool SavesReadOn
m_IMEM = NULL; m_IMEM = NULL;
} }
CMipsMemoryVM::~CMipsMemoryVM (void) CMipsMemoryVM::~CMipsMemoryVM()
{ {
g_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); g_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged);
FreeMemory(); FreeMemory();
@ -73,7 +73,7 @@ void CMipsMemoryVM::Reset( bool /*EraseMemory*/ )
} }
} }
void CMipsMemoryVM::ReserveMemory ( void ) void CMipsMemoryVM::ReserveMemory()
{ {
m_Reserve1 = (unsigned char *) VirtualAlloc( NULL, 0x20000000, MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE ); m_Reserve1 = (unsigned char *) VirtualAlloc( NULL, 0x20000000, MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE );
if (g_Settings->LoadBool(Debugger_Enabled)) if (g_Settings->LoadBool(Debugger_Enabled))
@ -82,7 +82,7 @@ void CMipsMemoryVM::ReserveMemory ( void )
} }
} }
void CMipsMemoryVM::FreeReservedMemory ( void ) void CMipsMemoryVM::FreeReservedMemory()
{ {
if (m_Reserve1) if (m_Reserve1)
{ {
@ -96,7 +96,7 @@ void CMipsMemoryVM::FreeReservedMemory ( void )
} }
} }
BOOL CMipsMemoryVM::Initialize ( void ) BOOL CMipsMemoryVM::Initialize()
{ {
if (m_RDRAM != NULL) if (m_RDRAM != NULL)
{ {
@ -183,7 +183,7 @@ BOOL CMipsMemoryVM::Initialize ( void )
return true; return true;
} }
void CMipsMemoryVM::FreeMemory ( void ) void CMipsMemoryVM::FreeMemory()
{ {
if (m_RDRAM) if (m_RDRAM)
{ {
@ -221,27 +221,27 @@ void CMipsMemoryVM::FreeMemory ( void )
CPifRam::Reset(); CPifRam::Reset();
} }
BYTE * CMipsMemoryVM::Rdram ( void ) BYTE * CMipsMemoryVM::Rdram()
{ {
return m_RDRAM; return m_RDRAM;
} }
DWORD CMipsMemoryVM::RdramSize ( void ) DWORD CMipsMemoryVM::RdramSize()
{ {
return m_AllocatedRdramSize; return m_AllocatedRdramSize;
} }
BYTE * CMipsMemoryVM::Dmem ( void ) BYTE * CMipsMemoryVM::Dmem()
{ {
return m_DMEM; return m_DMEM;
} }
BYTE * CMipsMemoryVM::Imem ( void ) BYTE * CMipsMemoryVM::Imem()
{ {
return m_IMEM; return m_IMEM;
} }
BYTE * CMipsMemoryVM::PifRam ( void ) BYTE * CMipsMemoryVM::PifRam()
{ {
return m_PifRam; return m_PifRam;
} }
@ -1863,7 +1863,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
} }
} }
void CMipsMemoryVM::ResetMemoryStack ( void) void CMipsMemoryVM::ResetMemoryStack()
{ {
x86Reg Reg, TempReg; x86Reg Reg, TempReg;
@ -3305,7 +3305,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value )
return TRUE; return TRUE;
} }
void CMipsMemoryVM::UpdateHalfLine (void) void CMipsMemoryVM::UpdateHalfLine()
{ {
DWORD NextViTimer = g_SystemTimer->GetTimer(CSystemTimer::ViTimer); DWORD NextViTimer = g_SystemTimer->GetTimer(CSystemTimer::ViTimer);
@ -3402,7 +3402,7 @@ void CMipsMemoryVM::UnProtectMemory( DWORD StartVaddr, DWORD EndVaddr )
VirtualProtect(MemLoc, Length, PAGE_READWRITE, &OldProtect); VirtualProtect(MemLoc, Length, PAGE_READWRITE, &OldProtect);
} }
void CMipsMemoryVM::Compile_LB (void) void CMipsMemoryVM::Compile_LB()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -3463,7 +3463,7 @@ void CMipsMemoryVM::Compile_LB (void)
} }
} }
void CMipsMemoryVM::Compile_LBU (void) void CMipsMemoryVM::Compile_LBU()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -3524,7 +3524,7 @@ void CMipsMemoryVM::Compile_LBU (void)
} }
} }
void CMipsMemoryVM::Compile_LH (void) void CMipsMemoryVM::Compile_LH()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -3582,7 +3582,7 @@ void CMipsMemoryVM::Compile_LH (void)
} }
} }
void CMipsMemoryVM::Compile_LHU (void) void CMipsMemoryVM::Compile_LHU()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -3643,12 +3643,12 @@ void CMipsMemoryVM::Compile_LHU (void)
} }
} }
void CMipsMemoryVM::Compile_LW (void) void CMipsMemoryVM::Compile_LW()
{ {
Compile_LW(true,false); Compile_LW(true,false);
} }
void CMipsMemoryVM::Compile_LL (void) void CMipsMemoryVM::Compile_LL()
{ {
Compile_LW(true,true); Compile_LW(true,true);
} }
@ -3767,7 +3767,7 @@ void CMipsMemoryVM::Compile_LW (bool ResultSigned, bool bRecordLLBit)
} }
} }
void CMipsMemoryVM::Compile_LWC1 (void) void CMipsMemoryVM::Compile_LWC1()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, TempReg3; x86Reg TempReg1, TempReg2, TempReg3;
@ -3875,7 +3875,7 @@ void CMipsMemoryVM::Compile_LWC1 (void)
MoveX86regToX86Pointer(TempReg3,TempReg2); MoveX86regToX86Pointer(TempReg3,TempReg2);
} }
void CMipsMemoryVM::Compile_LWL (void) void CMipsMemoryVM::Compile_LWL()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown; x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown;
@ -3955,7 +3955,7 @@ void CMipsMemoryVM::Compile_LWL (void)
AddX86RegToX86Reg(GetMipsRegMapLo(Opcode.rt),TempReg1); AddX86RegToX86Reg(GetMipsRegMapLo(Opcode.rt),TempReg1);
} }
void CMipsMemoryVM::Compile_LWR (void) void CMipsMemoryVM::Compile_LWR()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown; x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown;
@ -4036,12 +4036,12 @@ void CMipsMemoryVM::Compile_LWR (void)
AddX86RegToX86Reg(GetMipsRegMapLo(Opcode.rt),TempReg1); AddX86RegToX86Reg(GetMipsRegMapLo(Opcode.rt),TempReg1);
} }
void CMipsMemoryVM::Compile_LWU (void) void CMipsMemoryVM::Compile_LWU()
{ {
Compile_LW(false,false); Compile_LW(false,false);
} }
void CMipsMemoryVM::Compile_LD (void) void CMipsMemoryVM::Compile_LD()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
@ -4127,7 +4127,7 @@ void CMipsMemoryVM::Compile_LD (void)
} }
} }
void CMipsMemoryVM::Compile_LDC1 (void) void CMipsMemoryVM::Compile_LDC1()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, TempReg3; x86Reg TempReg1, TempReg2, TempReg3;
@ -4243,7 +4243,7 @@ void CMipsMemoryVM::Compile_LDC1 (void)
} }
} }
void CMipsMemoryVM::Compile_LDL (void) void CMipsMemoryVM::Compile_LDL()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
@ -4262,7 +4262,7 @@ void CMipsMemoryVM::Compile_LDL (void)
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CMipsMemoryVM::Compile_LDR (void) void CMipsMemoryVM::Compile_LDR()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
@ -4281,7 +4281,7 @@ void CMipsMemoryVM::Compile_LDR (void)
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CMipsMemoryVM::Compile_SB (void) void CMipsMemoryVM::Compile_SB()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -4371,7 +4371,7 @@ void CMipsMemoryVM::Compile_SB (void)
} }
} }
void CMipsMemoryVM::Compile_SH (void) void CMipsMemoryVM::Compile_SH()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -4459,12 +4459,12 @@ void CMipsMemoryVM::Compile_SH (void)
} }
} }
void CMipsMemoryVM::Compile_SW (void) void CMipsMemoryVM::Compile_SW()
{ {
Compile_SW(false); Compile_SW(false);
} }
void CMipsMemoryVM::Compile_SC (void) void CMipsMemoryVM::Compile_SC()
{ {
Compile_SW(true); Compile_SW(true);
} }
@ -4612,7 +4612,7 @@ void CMipsMemoryVM::Compile_SW (bool bCheckLLbit)
} }
} }
void CMipsMemoryVM::Compile_SWC1 (void) void CMipsMemoryVM::Compile_SWC1()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, TempReg3; x86Reg TempReg1, TempReg2, TempReg3;
@ -4694,7 +4694,7 @@ void CMipsMemoryVM::Compile_SWC1 (void)
} }
} }
void CMipsMemoryVM::Compile_SWL (void) void CMipsMemoryVM::Compile_SWL()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown, x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown,
@ -4797,7 +4797,7 @@ void CMipsMemoryVM::Compile_SWL (void)
} }
} }
void CMipsMemoryVM::Compile_SWR (void) void CMipsMemoryVM::Compile_SWR()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown, x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown,
@ -4950,7 +4950,7 @@ void CMipsMemoryVM::Compile_StoreInstructClean (x86Reg AddressReg, int Length )
X86Protected(StoreTemp1) = false;*/ X86Protected(StoreTemp1) = false;*/
} }
void CMipsMemoryVM::Compile_SD (void) void CMipsMemoryVM::Compile_SD()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2; x86Reg TempReg1, TempReg2;
@ -5093,7 +5093,7 @@ void CMipsMemoryVM::Compile_SD (void)
} }
} }
void CMipsMemoryVM::Compile_SDC1 (void) void CMipsMemoryVM::Compile_SDC1()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, TempReg3; x86Reg TempReg1, TempReg2, TempReg3;
@ -5190,7 +5190,7 @@ void CMipsMemoryVM::Compile_SDC1 (void)
} }
} }
void CMipsMemoryVM::Compile_SDL (void) void CMipsMemoryVM::Compile_SDL()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
@ -5209,7 +5209,7 @@ void CMipsMemoryVM::Compile_SDL (void)
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CMipsMemoryVM::Compile_SDR (void) void CMipsMemoryVM::Compile_SDR()
{ {
OPCODE & Opcode = CRecompilerOps::m_Opcode; OPCODE & Opcode = CRecompilerOps::m_Opcode;
@ -5286,7 +5286,7 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this )
} }
void CMipsMemoryVM::ChangeSpStatus (void) void CMipsMemoryVM::ChangeSpStatus()
{ {
if ( ( RegModValue & SP_CLR_HALT ) != 0) if ( ( RegModValue & SP_CLR_HALT ) != 0)
{ {
@ -5413,7 +5413,7 @@ void CMipsMemoryVM::ChangeSpStatus (void)
//} //}
} }
void CMipsMemoryVM::ChangeMiIntrMask (void) void CMipsMemoryVM::ChangeMiIntrMask()
{ {
if ( ( RegModValue & MI_INTR_MASK_CLR_SP ) != 0 ) if ( ( RegModValue & MI_INTR_MASK_CLR_SP ) != 0 )
{ {

View File

@ -21,20 +21,20 @@ class CMipsMemoryVM :
private CDMA private CDMA
{ {
public: public:
CMipsMemoryVM ( CMipsMemory_CallBack * CallBack, bool SavesReadOnly ); CMipsMemoryVM(CMipsMemory_CallBack * CallBack, bool SavesReadOnly);
~CMipsMemoryVM ( void ); ~CMipsMemoryVM();
static void ReserveMemory ( void ); static void ReserveMemory();
static void FreeReservedMemory ( void ); static void FreeReservedMemory();
BOOL Initialize ( void ); BOOL Initialize ();
void Reset ( bool EraseMemory ); void Reset ( bool EraseMemory );
BYTE * Rdram ( void ); BYTE * Rdram ();
DWORD RdramSize ( void ); DWORD RdramSize ();
BYTE * Dmem ( void ); BYTE * Dmem ();
BYTE * Imem ( void ); BYTE * Imem ();
BYTE * PifRam ( void ); BYTE * PifRam ();
BOOL LB_VAddr ( DWORD VAddr, BYTE & Value ); BOOL LB_VAddr ( DWORD VAddr, BYTE & Value );
BOOL LH_VAddr ( DWORD VAddr, WORD & Value ); BOOL LH_VAddr ( DWORD VAddr, WORD & Value );
@ -56,44 +56,44 @@ public:
BOOL SW_PAddr ( DWORD PAddr, DWORD Value ); BOOL SW_PAddr ( DWORD PAddr, DWORD Value );
BOOL SD_PAddr ( DWORD PAddr, QWORD Value ); BOOL SD_PAddr ( DWORD PAddr, QWORD Value );
int MemoryFilter ( DWORD dwExptCode, void * lpExceptionPointer ); int MemoryFilter(DWORD dwExptCode, void * lpExceptionPointer);
void UpdateFieldSerration (unsigned int interlaced); void UpdateFieldSerration(unsigned int interlaced);
//Protect the Memory from being written to //Protect the Memory from being written to
void ProtectMemory ( DWORD StartVaddr, DWORD EndVaddr ); void ProtectMemory(DWORD StartVaddr, DWORD EndVaddr);
void UnProtectMemory ( DWORD StartVaddr, DWORD EndVaddr ); void UnProtectMemory(DWORD StartVaddr, DWORD EndVaddr);
//Compilation Functions //Compilation Functions
void ResetMemoryStack ( void ); void ResetMemoryStack();
void ResetTLB ( void ); void ResetTLB();
void Compile_LB ( void ); void Compile_LB();
void Compile_LBU ( void ); void Compile_LBU();
void Compile_LH ( void ); void Compile_LH();
void Compile_LHU ( void ); void Compile_LHU();
void Compile_LW ( void ); void Compile_LW();
void Compile_LL ( void ); void Compile_LL();
void Compile_LWC1 ( void ); void Compile_LWC1();
void Compile_LWU ( void ); void Compile_LWU();
void Compile_LWL ( void ); void Compile_LWL();
void Compile_LWR ( void ); void Compile_LWR();
void Compile_LD ( void ); void Compile_LD();
void Compile_LDC1 ( void ); void Compile_LDC1();
void Compile_LDL ( void ); void Compile_LDL();
void Compile_LDR ( void ); void Compile_LDR();
void Compile_SB ( void ); void Compile_SB();
void Compile_SH ( void ); void Compile_SH();
void Compile_SW ( void ); void Compile_SW();
void Compile_SWL ( void ); void Compile_SWL();
void Compile_SWR ( void ); void Compile_SWR();
void Compile_SD ( void ); void Compile_SD();
void Compile_SDL ( void ); void Compile_SDL();
void Compile_SDR ( void ); void Compile_SDR();
void Compile_SC ( void ); void Compile_SC();
void Compile_SWC1 ( void ); void Compile_SWC1();
void Compile_SDC1 ( void ); void Compile_SDC1();
void ResetMemoryStack ( CRegInfo & RegInfo ); void ResetMemoryStack ( CRegInfo& RegInfo );
void Compile_LB ( CX86Ops::x86Reg Reg, DWORD Addr, BOOL SignExtend ); void Compile_LB ( CX86Ops::x86Reg Reg, DWORD Addr, BOOL SignExtend );
void Compile_LH ( CX86Ops::x86Reg Reg, DWORD Addr, BOOL SignExtend ); void Compile_LH ( CX86Ops::x86Reg Reg, DWORD Addr, BOOL SignExtend );
void Compile_LW ( CX86Ops::x86Reg Reg, DWORD Addr ); void Compile_LW ( CX86Ops::x86Reg Reg, DWORD Addr );
@ -106,19 +106,19 @@ public:
void Compile_SW_Register ( CX86Ops::x86Reg Reg, DWORD Addr ); void Compile_SW_Register ( CX86Ops::x86Reg Reg, DWORD Addr );
//Functions for TLB notification //Functions for TLB notification
void TLB_Mapped ( DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly ); void TLB_Mapped(DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly);
void TLB_Unmaped ( DWORD Vaddr, DWORD Len ); void TLB_Unmaped(DWORD Vaddr, DWORD Len);
// CTransVaddr interface // CTransVaddr interface
bool TranslateVaddr ( DWORD VAddr, DWORD &PAddr) const; bool TranslateVaddr(DWORD VAddr, DWORD &PAddr) const;
bool ValidVaddr ( DWORD VAddr ) const; bool ValidVaddr(DWORD VAddr) const;
bool VAddrToRealAddr ( DWORD VAddr, void * &RealAddress ) const; bool VAddrToRealAddr(DWORD VAddr, void * &RealAddress) const;
// Labels // Labels
LPCTSTR LabelName ( DWORD Address ) const; LPCTSTR LabelName(DWORD Address) const;
private: private:
CMipsMemoryVM(void); // Disable default constructor CMipsMemoryVM(); // Disable default constructor
CMipsMemoryVM(const CMipsMemoryVM&); // Disable copy constructor CMipsMemoryVM(const CMipsMemoryVM&); // Disable copy constructor
CMipsMemoryVM& operator=(const CMipsMemoryVM&); // Disable assignment CMipsMemoryVM& operator=(const CMipsMemoryVM&); // Disable assignment
@ -126,8 +126,8 @@ private:
void Compile_SW ( bool bCheckLLbit ); void Compile_SW ( bool bCheckLLbit );
static void RdramChanged ( CMipsMemoryVM * _this ); static void RdramChanged ( CMipsMemoryVM * _this );
static void ChangeSpStatus ( void ); static void ChangeSpStatus ();
static void ChangeMiIntrMask ( void ); static void ChangeMiIntrMask();
int LB_NonMemory ( DWORD PAddr, DWORD * Value, BOOL SignExtend ); int LB_NonMemory ( DWORD PAddr, DWORD * Value, BOOL SignExtend );
int LH_NonMemory ( DWORD PAddr, DWORD * Value, int SignExtend ); int LH_NonMemory ( DWORD PAddr, DWORD * Value, int SignExtend );
@ -154,14 +154,14 @@ private:
DWORD m_RomWroteValue; DWORD m_RomWroteValue;
//Current Half line //Current Half line
void UpdateHalfLine ( void ); void UpdateHalfLine();
DWORD m_HalfLine; DWORD m_HalfLine;
DWORD m_HalfLineCheck; DWORD m_HalfLineCheck;
DWORD m_FieldSerration; DWORD m_FieldSerration;
DWORD m_TempValue; DWORD m_TempValue;
//Initializing and resetting information about the memory system //Initializing and resetting information about the memory system
void FreeMemory ( void ); void FreeMemory();
mutable char m_strLabelName[100]; mutable char m_strLabelName[100];

View File

@ -13,9 +13,9 @@
class Mempak class Mempak
{ {
public: public:
static void Close ( void ); static void Close();
static BYTE CalculateCrc ( BYTE * DataToCrc ); static BYTE CalculateCrc(BYTE * DataToCrc);
static void ReadFrom ( int Control, int Address, BYTE * Buffer ); static void ReadFrom(int Control, int Address, BYTE * Buffer);
static void WriteTo ( int Control, int Address, BYTE * Buffer ); static void WriteTo(int Control, int Address, BYTE * Buffer);
}; };

View File

@ -12,7 +12,7 @@
static BYTE Mempaks[4][0x8000]; static BYTE Mempaks[4][0x8000];
HANDLE hMempakFile[4]; HANDLE hMempakFile[4];
void Mempak::Close(void) void Mempak::Close()
{ {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {

View File

@ -43,12 +43,12 @@ CPifRam::CPifRam( bool SavesReadOnly ) :
Reset(); Reset();
} }
CPifRam::~CPifRam( void ) CPifRam::~CPifRam()
{ {
} }
void CPifRam::Reset ( void ) void CPifRam::Reset()
{ {
memset(m_PifRam,0,sizeof(m_PifRam)); memset(m_PifRam,0,sizeof(m_PifRam));
memset(m_PifRom,0,sizeof(m_PifRom)); memset(m_PifRom,0,sizeof(m_PifRom));
@ -87,7 +87,7 @@ void CPifRam::n64_cic_nus_6105(char challenge[], char respone[], int length)
} }
void CPifRam::PifRamRead (void) void CPifRam::PifRamRead()
{ {
if (m_PifRam[0x3F] == 0x2) if (m_PifRam[0x3F] == 0x2)
{ {
@ -148,7 +148,7 @@ void CPifRam::PifRamRead (void)
} }
} }
void CPifRam::PifRamWrite (void) void CPifRam::PifRamWrite()
{ {
CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
int Channel = 0, CurPos; int Channel = 0, CurPos;
@ -269,7 +269,7 @@ void CPifRam::PifRamWrite (void)
} }
} }
void CPifRam::SI_DMA_READ (void) void CPifRam::SI_DMA_READ()
{ {
BYTE * PifRamPos = m_PifRam; BYTE * PifRamPos = m_PifRam;
BYTE * RDRAM = g_MMU->Rdram(); BYTE * RDRAM = g_MMU->Rdram();
@ -376,7 +376,7 @@ void CPifRam::SI_DMA_READ (void)
} }
} }
void CPifRam::SI_DMA_WRITE (void) void CPifRam::SI_DMA_WRITE()
{ {
BYTE * PifRamPos = m_PifRam; BYTE * PifRamPos = m_PifRam;

View File

@ -16,13 +16,13 @@ protected:
CPifRamSettings(); CPifRamSettings();
virtual ~CPifRamSettings(); virtual ~CPifRamSettings();
inline bool bShowPifRamErrors ( void ) const bool bShowPifRamErrors() const
{ {
return m_bShowPifRamErrors; return m_bShowPifRamErrors;
} }
private: private:
static void RefreshSettings ( void * ); static void RefreshSettings(void*);
static bool m_bShowPifRamErrors; static bool m_bShowPifRamErrors;
@ -35,17 +35,16 @@ class CPifRam :
private CEeprom private CEeprom
{ {
public: public:
public: CPifRam(bool SavesReadOnly);
CPifRam ( bool SavesReadOnly ); ~CPifRam();
~CPifRam ( void );
void Reset ( void ); void Reset();
void PifRamWrite ( void ); void PifRamWrite();
void PifRamRead ( void ); void PifRamRead();
void SI_DMA_READ ( void ); void SI_DMA_READ();
void SI_DMA_WRITE ( void ); void SI_DMA_WRITE();
protected: protected:
BYTE m_PifRom[0x7C0]; BYTE m_PifRom[0x7C0];

View File

@ -269,7 +269,7 @@ void CRegisters::Reset()
FixFpuLocations(); FixFpuLocations();
} }
void CRegisters::SetAsCurrentSystem ( void ) void CRegisters::SetAsCurrentSystem()
{ {
_PROGRAM_COUNTER = &m_PROGRAM_COUNTER; _PROGRAM_COUNTER = &m_PROGRAM_COUNTER;
_GPR = m_GPR; _GPR = m_GPR;
@ -284,7 +284,7 @@ void CRegisters::SetAsCurrentSystem ( void )
_RoundingModel = &m_RoundingModel; _RoundingModel = &m_RoundingModel;
} }
void CRegisters::CheckInterrupts ( void ) void CRegisters::CheckInterrupts()
{ {
if (!m_System->bFixedAudio() && CpuType() != CPU_SyncCores) if (!m_System->bFixedAudio() && CpuType() != CPU_SyncCores)
{ {
@ -366,7 +366,7 @@ void CRegisters::DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead)
m_PROGRAM_COUNTER = 0x80000180; m_PROGRAM_COUNTER = 0x80000180;
} }
void CRegisters::FixFpuLocations ( void ) void CRegisters::FixFpuLocations()
{ {
if ((STATUS_REGISTER & STATUS_FR) == 0) if ((STATUS_REGISTER & STATUS_FR) == 0)
{ {

View File

@ -13,7 +13,7 @@
//CPO registers by name //CPO registers by name
class CP0registers class CP0registers
{ {
CP0registers (void); CP0registers();
protected: protected:
CP0registers (DWORD * _CP0); CP0registers (DWORD * _CP0);
@ -114,7 +114,7 @@ enum
//Rdram Registers //Rdram Registers
class Rdram_InterfaceReg class Rdram_InterfaceReg
{ {
Rdram_InterfaceReg (void); Rdram_InterfaceReg();
protected: protected:
Rdram_InterfaceReg (DWORD * _RdramInterface); Rdram_InterfaceReg (DWORD * _RdramInterface);
@ -198,7 +198,7 @@ enum
//Mips interface registers //Mips interface registers
class Video_InterfaceReg class Video_InterfaceReg
{ {
Video_InterfaceReg (void); Video_InterfaceReg();
protected: protected:
Video_InterfaceReg (DWORD * _VideoInterface); Video_InterfaceReg (DWORD * _VideoInterface);
@ -232,7 +232,7 @@ public:
//Display Processor Control Registers //Display Processor Control Registers
class DisplayControlReg class DisplayControlReg
{ {
DisplayControlReg (void); DisplayControlReg();
protected: protected:
DisplayControlReg (DWORD * _DisplayProcessor); DisplayControlReg (DWORD * _DisplayProcessor);
@ -279,7 +279,7 @@ enum
*/ */
class AudioInterfaceReg class AudioInterfaceReg
{ {
AudioInterfaceReg (void); AudioInterfaceReg();
protected: protected:
AudioInterfaceReg (DWORD * _AudioInterface); AudioInterfaceReg (DWORD * _AudioInterface);
@ -303,7 +303,7 @@ enum
class PeripheralInterfaceReg class PeripheralInterfaceReg
{ {
PeripheralInterfaceReg (void); PeripheralInterfaceReg();
protected: protected:
PeripheralInterfaceReg (DWORD * PeripheralInterface); PeripheralInterfaceReg (DWORD * PeripheralInterface);
@ -328,7 +328,7 @@ public:
class RDRAMInt_InterfaceReg class RDRAMInt_InterfaceReg
{ {
RDRAMInt_InterfaceReg (void); RDRAMInt_InterfaceReg();
protected: protected:
RDRAMInt_InterfaceReg (DWORD * RdramInterface); RDRAMInt_InterfaceReg (DWORD * RdramInterface);
@ -424,7 +424,7 @@ enum
class Serial_InterfaceReg class Serial_InterfaceReg
{ {
Serial_InterfaceReg (void); Serial_InterfaceReg();
protected: protected:
Serial_InterfaceReg (DWORD * SerialInterface); Serial_InterfaceReg (DWORD * SerialInterface);
@ -531,19 +531,19 @@ public:
DWORD m_RspIntrReg; DWORD m_RspIntrReg;
void CheckInterrupts ( void ); void CheckInterrupts ();
void DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead ); void DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead );
void DoBreakException ( BOOL DelaySlot ); void DoBreakException ( BOOL DelaySlot );
void DoCopUnusableException ( BOOL DelaySlot, int Coprocessor ); void DoCopUnusableException ( BOOL DelaySlot, int Coprocessor );
BOOL DoIntrException ( BOOL DelaySlot ); BOOL DoIntrException ( BOOL DelaySlot );
void DoTLBReadMiss ( BOOL DelaySlot, DWORD BadVaddr ); void DoTLBReadMiss ( BOOL DelaySlot, DWORD BadVaddr );
void DoSysCallException ( BOOL DelaySlot); void DoSysCallException ( BOOL DelaySlot);
void FixFpuLocations ( void ); void FixFpuLocations ();
void Reset ( void ); void Reset ();
void SetAsCurrentSystem ( void ); void SetAsCurrentSystem ();
private: private:
CRegisters(void); // Disable default constructor CRegisters(); // Disable default constructor
CRegisters(const CRegisters&); // Disable copy constructor CRegisters(const CRegisters&); // Disable copy constructor
CRegisters& operator=(const CRegisters&); // Disable assignment CRegisters& operator=(const CRegisters&); // Disable assignment

View File

@ -17,7 +17,7 @@ CSram::CSram ( bool ReadOnly ) :
} }
CSram::~CSram (void) CSram::~CSram()
{ {
if (m_hFile) if (m_hFile)
{ {
@ -26,7 +26,7 @@ CSram::~CSram (void)
} }
} }
BOOL CSram::LoadSram (void) BOOL CSram::LoadSram()
{ {
CPath FileName; CPath FileName;

View File

@ -13,14 +13,14 @@
class CSram class CSram
{ {
public: public:
CSram ( bool ReadOnly ); CSram(bool ReadOnly);
~CSram ( void ); ~CSram();
void DmaFromSram ( BYTE * dest, int StartOffset, int len); void DmaFromSram(BYTE * dest, int StartOffset, int len);
void DmaToSram ( BYTE * Source, int StartOffset, int len); void DmaToSram(BYTE * Source, int StartOffset, int len);
private: private:
BOOL LoadSram ( void ); BOOL LoadSram();
bool m_ReadOnly; bool m_ReadOnly;
HANDLE m_hFile; HANDLE m_hFile;

View File

@ -38,7 +38,7 @@ void CSystemEvents::QueueEvent(SystemEvent action)
m_Events.push_back(action); m_Events.push_back(action);
} }
void CSystemEvents::ExecuteEvents ( void ) void CSystemEvents::ExecuteEvents()
{ {
EventList Events; EventList Events;
{ {
@ -207,7 +207,7 @@ void CSystemEvents::ExecuteEvents ( void )
} }
} }
void CSystemEvents::ChangePluginFunc ( void ) void CSystemEvents::ChangePluginFunc()
{ {
g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT); g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT);
m_System->PluginReset(); m_System->PluginReset();

View File

@ -59,20 +59,20 @@ protected:
virtual ~CSystemEvents(); virtual ~CSystemEvents();
public: public:
void ExecuteEvents ( void ); void ExecuteEvents();
void QueueEvent ( SystemEvent action); void QueueEvent(SystemEvent action);
inline const BOOL & DoSomething ( void ) const const BOOL& DoSomething() const
{ {
return m_bDoSomething; return m_bDoSomething;
} }
private: private:
CSystemEvents(void); // Disable default constructor CSystemEvents(); // Disable default constructor
CSystemEvents(const CSystemEvents&); // Disable copy constructor CSystemEvents(const CSystemEvents&); // Disable copy constructor
CSystemEvents& operator=(const CSystemEvents&); // Disable assignment CSystemEvents& operator=(const CSystemEvents&); // Disable assignment
void ChangePluginFunc( void ); void ChangePluginFunc();
CN64System * m_System; CN64System * m_System;
CPlugins * m_Plugins; CPlugins * m_Plugins;

View File

@ -17,7 +17,7 @@ CSystemTimer::CSystemTimer( int & NextTimer ) :
} }
void CSystemTimer::Reset ( void ) void CSystemTimer::Reset()
{ {
//initialise Structure //initialise Structure
for (int i = 0; i < MaxTimer; i++) for (int i = 0; i < MaxTimer; i++)
@ -96,7 +96,7 @@ void CSystemTimer::StopTimer ( TimerType Type )
} }
void CSystemTimer::FixTimers (void) void CSystemTimer::FixTimers()
{ {
if (m_inFixTimer) if (m_inFixTimer)
@ -153,7 +153,7 @@ void CSystemTimer::FixTimers (void)
m_inFixTimer = false; m_inFixTimer = false;
} }
void CSystemTimer::UpdateTimers ( void ) void CSystemTimer::UpdateTimers()
{ {
int TimeTaken = m_LastUpdate - m_NextTimer; int TimeTaken = m_LastUpdate - m_NextTimer;
if (TimeTaken != 0) if (TimeTaken != 0)
@ -168,7 +168,7 @@ void CSystemTimer::UpdateTimers ( void )
} }
} }
void CSystemTimer::TimerDone (void) void CSystemTimer::TimerDone()
{ {
UpdateTimers(); UpdateTimers();
@ -251,7 +251,7 @@ void CSystemTimer::TimerDone (void)
}*/ }*/
} }
void CSystemTimer::SetCompareTimer ( void ) void CSystemTimer::SetCompareTimer()
{ {
DWORD NextCompare = 0x7FFFFFFF; DWORD NextCompare = 0x7FFFFFFF;
if (g_Reg) if (g_Reg)

View File

@ -42,18 +42,18 @@ public:
void SetTimer ( TimerType Type, DWORD Cycles, bool bRelative ); void SetTimer ( TimerType Type, DWORD Cycles, bool bRelative );
DWORD GetTimer ( TimerType Type ); DWORD GetTimer ( TimerType Type );
void StopTimer ( TimerType Type ); void StopTimer ( TimerType Type );
void UpdateTimers ( void ); void UpdateTimers ();
void TimerDone ( void ); void TimerDone ();
void Reset ( void ); void Reset ();
void UpdateCompareTimer ( void ); void UpdateCompareTimer ();
bool SaveAllowed ( void ); bool SaveAllowed ();
void SaveData ( void * file ) const; void SaveData ( void * file ) const;
void LoadData ( void * file ); void LoadData ( void * file );
void RecordDifference( CLog &LogFile, const CSystemTimer& rSystemTimer); void RecordDifference( CLog &LogFile, const CSystemTimer& rSystemTimer);
inline TimerType CurrentType ( void ) const { return m_Current; } TimerType CurrentType() const { return m_Current; }
bool operator == (const CSystemTimer& rSystemTimer) const; bool operator == (const CSystemTimer& rSystemTimer) const;
bool operator != (const CSystemTimer& rSystemTimer) const; bool operator != (const CSystemTimer& rSystemTimer) const;
@ -65,6 +65,6 @@ private:
TimerType m_Current; TimerType m_Current;
bool m_inFixTimer; bool m_inFixTimer;
void SetCompareTimer ( void ); void SetCompareTimer();
void FixTimers ( void ); void FixTimers();
}; };

View File

@ -15,9 +15,9 @@ class CDebugTlb;
class CTLB_CB class CTLB_CB
{ {
public: public:
virtual void TLB_Mapped ( DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly ) = 0; virtual void TLB_Mapped(DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly) = 0;
virtual void TLB_Unmaped ( DWORD VAddr, DWORD Len ) = 0; virtual void TLB_Unmaped(DWORD VAddr, DWORD Len) = 0;
virtual void TLB_Changed ( void ) = 0; virtual void TLB_Changed() = 0;
}; };
class CTLB : class CTLB :
@ -92,27 +92,27 @@ public:
} TLB_ENTRY; } TLB_ENTRY;
public: public:
CTLB ( CTLB_CB * CallBack ); CTLB(CTLB_CB * CallBack);
~CTLB ( void ); ~CTLB();
void Reset ( bool InvalidateTLB ); void Reset(bool InvalidateTLB);
//Used by opcodes of the same name to manipulate the tlb (reads the registers) //Used by opcodes of the same name to manipulate the tlb (reads the registers)
void Probe ( void ); void Probe();
void ReadEntry ( void ); void ReadEntry();
void WriteEntry ( int index, bool Random ); void WriteEntry(int index, bool Random);
//See if a VAddr has an entry to translate to a PAddr //See if a VAddr has an entry to translate to a PAddr
bool AddressDefined ( DWORD VAddr ); bool AddressDefined(DWORD VAddr);
const TLB_ENTRY & TlbEntry ( int Entry) const const TLB_ENTRY & TlbEntry(int Entry) const
{ {
return m_tlb[Entry]; return m_tlb[Entry];
} }
bool PAddrToVAddr ( DWORD PAddr, DWORD & VAddr, DWORD & Index ); bool PAddrToVAddr(DWORD PAddr, DWORD & VAddr, DWORD & Index);
void RecordDifference ( CLog &LogFile, const CTLB& rTLB); void RecordDifference(CLog &LogFile, const CTLB& rTLB);
bool operator == (const CTLB& rTLB) const; bool operator == (const CTLB& rTLB) const;
bool operator != (const CTLB& rTLB) const; bool operator != (const CTLB& rTLB) const;
@ -140,5 +140,5 @@ private:
TLB_ENTRY m_tlb[32]; TLB_ENTRY m_tlb[32];
FASTTLB m_FastTlb[64]; FASTTLB m_FastTlb[64];
void SetupTLB_Entry ( int index, bool Random ); void SetupTLB_Entry(int index, bool Random);
}; };

View File

@ -20,7 +20,7 @@ CTLB::CTLB(CTLB_CB * CallBack ):
WriteTrace(TraceTLB,__FUNCTION__ ": Done"); WriteTrace(TraceTLB,__FUNCTION__ ": Done");
} }
CTLB::~CTLB (void) CTLB::~CTLB()
{ {
WriteTrace(TraceTLB,__FUNCTION__ ": Start"); WriteTrace(TraceTLB,__FUNCTION__ ": Start");
WriteTrace(TraceTLB,__FUNCTION__ ": Done"); WriteTrace(TraceTLB,__FUNCTION__ ": Done");
@ -72,7 +72,7 @@ bool CTLB::AddressDefined ( DWORD VAddr)
return false; return false;
} }
void CTLB::Probe (void) void CTLB::Probe()
{ {
int Counter; int Counter;
@ -106,7 +106,8 @@ void CTLB::Probe (void)
WriteTrace(TraceTLB,__FUNCTION__ ": Done"); WriteTrace(TraceTLB,__FUNCTION__ ": Done");
} }
void CTLB::ReadEntry (void) { void CTLB::ReadEntry()
{
DWORD index = g_Reg->INDEX_REGISTER & 0x1F; DWORD index = g_Reg->INDEX_REGISTER & 0x1F;
g_Reg->PAGE_MASK_REGISTER = m_tlb[index].PageMask.Value ; g_Reg->PAGE_MASK_REGISTER = m_tlb[index].PageMask.Value ;

View File

@ -55,7 +55,7 @@ CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) :
m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins);
} }
CN64System::~CN64System ( void ) CN64System::~CN64System()
{ {
SetActiveSystem(false); SetActiveSystem(false);
Mempak::Close(); Mempak::Close();
@ -231,7 +231,7 @@ bool CN64System::RunFileImage ( const char * FileLoc )
return true; return true;
} }
void CN64System::CloseSystem ( void ) void CN64System::CloseSystem()
{ {
if (g_BaseSystem) if (g_BaseSystem)
{ {
@ -398,7 +398,7 @@ void CN64System::StartEmulationThread ( ThreadInfo * Info )
CoUninitialize(); CoUninitialize();
} }
void CN64System::CloseCpu ( void ) void CN64System::CloseCpu()
{ {
if (m_CPU_Handle == NULL) if (m_CPU_Handle == NULL)
{ {
@ -461,7 +461,7 @@ void CN64System::DisplayRomInfo ( HWND hParent )
Info.DisplayInformation(hParent); Info.DisplayInformation(hParent);
} }
void CN64System::Pause(void) void CN64System::Pause()
{ {
if (m_EndEmulation) if (m_EndEmulation)
{ {
@ -512,7 +512,7 @@ bool CN64System::IsDialogMsg( MSG * msg )
return false; return false;
} }
void CN64System::GameReset (void) void CN64System::GameReset()
{ {
m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer,0x3000000,false); m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer,0x3000000,false);
m_Plugins->Gfx()->ShowCFB(); m_Plugins->Gfx()->ShowCFB();
@ -524,7 +524,7 @@ void CN64System::GameReset (void)
} }
} }
void CN64System::PluginReset ( void ) void CN64System::PluginReset()
{ {
if (!m_Plugins->ResetInUiThread(this)) if (!m_Plugins->ResetInUiThread(this))
{ {
@ -880,7 +880,7 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU )
} }
} }
void CN64System::ExecuteCPU ( void ) void CN64System::ExecuteCPU()
{ {
//reset code //reset code
g_Settings->SaveBool(GameRunning_CPU_Running,true); g_Settings->SaveBool(GameRunning_CPU_Running,true);
@ -911,24 +911,24 @@ void CN64System::ExecuteCPU ( void )
} }
} }
void CN64System::ExecuteInterpret () void CN64System::ExecuteInterpret()
{ {
SetActiveSystem(); SetActiveSystem();
CInterpreterCPU::ExecuteCPU(); CInterpreterCPU::ExecuteCPU();
} }
void CN64System::ExecuteRecompiler () void CN64System::ExecuteRecompiler()
{ {
m_Recomp->Run(); m_Recomp->Run();
} }
void CN64System::ExecuteSyncCPU () void CN64System::ExecuteSyncCPU()
{ {
g_Notify->BringToTop(); g_Notify->BringToTop();
m_Recomp->Run(); m_Recomp->Run();
} }
void CN64System::CpuStopped ( void ) void CN64System::CpuStopped()
{ {
g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false); g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false);
g_Notify->WindowMode(); g_Notify->WindowMode();
@ -1376,7 +1376,7 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU)
// AddEvent(CloseCPU); // AddEvent(CloseCPU);
} }
bool CN64System::SaveState(void) bool CN64System::SaveState()
{ {
WriteTrace(TraceDebug,__FUNCTION__ ": Start"); WriteTrace(TraceDebug,__FUNCTION__ ": Start");
@ -1525,7 +1525,7 @@ bool CN64System::SaveState(void)
return true; return true;
} }
bool CN64System::LoadState(void) bool CN64System::LoadState()
{ {
stdstr InstantFileName = g_Settings->LoadString(GameRunning_InstantSaveFile); stdstr InstantFileName = g_Settings->LoadString(GameRunning_InstantSaveFile);
if (!InstantFileName.empty()) if (!InstantFileName.empty())
@ -1787,7 +1787,7 @@ bool CN64System::LoadState(LPCSTR FileName)
return true; return true;
} }
void CN64System::RunRSP ( void ) void CN64System::RunRSP()
{ {
WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG); WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG);
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0) if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0)
@ -1877,7 +1877,7 @@ void CN64System::RunRSP ( void )
WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)",m_Reg.SP_STATUS_REG); WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)",m_Reg.SP_STATUS_REG);
} }
void CN64System::SyncToAudio ( void ) void CN64System::SyncToAudio()
{ {
if (!bSyncToAudio() || !bLimitFPS()) if (!bSyncToAudio() || !bLimitFPS())
{ {
@ -1902,7 +1902,7 @@ void CN64System::SyncToAudio ( void )
} }
} }
void CN64System::RefreshScreen ( void ) void CN64System::RefreshScreen()
{ {
SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/; SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/;
DWORD VI_INTR_TIME = 500000; DWORD VI_INTR_TIME = 500000;
@ -2028,7 +2028,7 @@ void CN64System::TLB_Unmaped ( DWORD VAddr, DWORD Len )
} }
} }
void CN64System::TLB_Changed ( void ) void CN64System::TLB_Changed()
{ {
Debug_RefreshTLBWindow(); Debug_RefreshTLBWindow();
} }

View File

@ -46,29 +46,29 @@ public:
static bool RunFileImage ( const char * FileLoc ); static bool RunFileImage ( const char * FileLoc );
static void CloseSystem ( void ); static void CloseSystem ( void );
void CloseCpu ( void ); void CloseCpu ();
void ExternalEvent ( SystemEvent action ); //covers gui interacting and timers etc.. void ExternalEvent ( SystemEvent action ); //covers gui interacting and timers etc..
stdstr ChooseFileToOpen ( HWND hParent ); stdstr ChooseFileToOpen ( HWND hParent );
void DisplayRomInfo ( HWND hParent ); void DisplayRomInfo ( HWND hParent );
void SelectCheats ( HWND hParent ); void SelectCheats ( HWND hParent );
void StartEmulation ( bool NewThread ); void StartEmulation ( bool NewThread );
void SyncToAudio ( void ); void SyncToAudio ();
bool IsDialogMsg ( MSG * msg ); bool IsDialogMsg ( MSG * msg );
void IncreaseSpeed ( void ) { m_Limitor.IncreaseSpeed(); } void IncreaseSpeed () { m_Limitor.IncreaseSpeed(); }
void DecreaseSpeed ( void ) { m_Limitor.DecreaseSpeed(); } void DecreaseSpeed () { m_Limitor.DecreaseSpeed(); }
void Reset ( bool bInitReg, bool ClearMenory ); void Reset ( bool bInitReg, bool ClearMenory );
void GameReset ( void ); void GameReset ();
void PluginReset ( void ); void PluginReset ();
void Pause ( void ); void Pause ();
void RunRSP ( void ); void RunRSP ();
bool SaveState ( void ); bool SaveState ();
bool LoadState ( LPCSTR FileName ); bool LoadState ( LPCSTR FileName );
bool LoadState ( void ); bool LoadState ();
inline bool DmaUsed ( void ) const { return m_DMAUsed; } bool DmaUsed() const { return m_DMAUsed; }
inline void SetDmaUsed ( bool DMAUsed) { m_DMAUsed = DMAUsed; } void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; }
inline DWORD GetButtons ( int Control ) { return m_Buttons[Control]; } DWORD GetButtons(int Control) const { return m_Buttons[Control]; }
//Variable used to track that the SP is being handled and stays the same as the real SP in sync core //Variable used to track that the SP is being handled and stays the same as the real SP in sync core
#ifdef TEST_SP_TRACKING #ifdef TEST_SP_TRACKING
@ -78,8 +78,8 @@ public:
void UpdateSyncCPU ( CN64System * const SecondCPU, DWORD const Cycles ); void UpdateSyncCPU ( CN64System * const SecondCPU, DWORD const Cycles );
void SyncCPU ( CN64System * const SecondCPU ); void SyncCPU ( CN64System * const SecondCPU );
void SyncCPUPC ( CN64System * const SecondCPU ); void SyncCPUPC ( CN64System * const SecondCPU );
void SyncSystem ( void ); void SyncSystem ();
void SyncSystemPC ( void ); void SyncSystemPC ();
private: private:
//Make sure plugins can directly access this information //Make sure plugins can directly access this information
friend CGfxPlugin; friend CGfxPlugin;
@ -90,39 +90,39 @@ private:
//Recompiler has access to manipulate and call functions //Recompiler has access to manipulate and call functions
friend CSystemTimer; friend CSystemTimer;
//Used for loading and potentialy executing the CPU in its own thread. //Used for loading and potentially executing the CPU in its own thread.
static void StartEmulationThread ( ThreadInfo * Info ); static void StartEmulationThread ( ThreadInfo * Info );
static bool EmulationStarting ( HANDLE hThread, DWORD ThreadId ); static bool EmulationStarting ( HANDLE hThread, DWORD ThreadId );
void ExecuteCPU ( void ); void ExecuteCPU ();
void RefreshScreen ( void ); void RefreshScreen ();
bool InternalEvent ( void ); bool InternalEvent ();
void DumpSyncErrors ( CN64System * SecondCPU ); void DumpSyncErrors ( CN64System * SecondCPU );
void StartEmulation2 ( bool NewThread ); void StartEmulation2 ( bool NewThread );
bool SetActiveSystem ( bool bActive = true ); bool SetActiveSystem ( bool bActive = true );
void InitRegisters ( bool bPostPif, CMipsMemory & MMU ); void InitRegisters ( bool bPostPif, CMipsMemory & MMU );
//CPU Methods //CPU Methods
void ExecuteRecompiler ( ); void ExecuteRecompiler();
void ExecuteInterpret ( ); void ExecuteInterpret();
void ExecuteSyncCPU (); void ExecuteSyncCPU();
void AddEvent ( SystemEvent Event); void AddEvent(SystemEvent Event);
//Notification of changing conditions //Notification of changing conditions
void FunctionStarted ( DWORD NewFuncAddress, DWORD OldFuncAddress, DWORD ReturnAddress ); void FunctionStarted(DWORD NewFuncAddress, DWORD OldFuncAddress, DWORD ReturnAddress);
void FunctionEnded ( DWORD ReturnAddress, DWORD StackPos ); void FunctionEnded(DWORD ReturnAddress, DWORD StackPos);
//Mark information saying that the CPU has stoped //Mark information saying that the CPU has stopped
void CpuStopped ( void ); void CpuStopped();
//Function in CMipsMemory_CallBack //Function in CMipsMemory_CallBack
virtual bool WriteToProtectedMemory (DWORD Address, int length); virtual bool WriteToProtectedMemory(DWORD Address, int length);
//Functions in CTLB_CB //Functions in CTLB_CB
void TLB_Mapped ( DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly ); void TLB_Mapped(DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly);
void TLB_Unmaped ( DWORD VAddr, DWORD Len ); void TLB_Unmaped(DWORD VAddr, DWORD Len);
void TLB_Changed ( void ); void TLB_Changed();
CPlugins * const m_Plugins; //The plugin container CPlugins * const m_Plugins; //The plugin container
CN64System * m_SyncCPU; CN64System * m_SyncCPU;

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
CN64Rom::CN64Rom ( void ) CN64Rom::CN64Rom()
{ {
m_hRomFile = NULL; m_hRomFile = NULL;
m_hRomFileMapping = NULL; m_hRomFileMapping = NULL;
@ -23,7 +23,8 @@ CN64Rom::CN64Rom ( void )
m_CicChip = CIC_UNKNOWN; m_CicChip = CIC_UNKNOWN;
} }
CN64Rom::~CN64Rom ( void ) { CN64Rom::~CN64Rom()
{
UnallocateRomImage(); UnallocateRomImage();
} }
@ -193,7 +194,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
return FoundRom; return FoundRom;
} }
void CN64Rom::ByteSwapRom (void) { void CN64Rom::ByteSwapRom() {
DWORD count; DWORD count;
switch (*((DWORD *)&m_ROMImage[0])) { switch (*((DWORD *)&m_ROMImage[0])) {
@ -223,7 +224,7 @@ void CN64Rom::ByteSwapRom (void) {
} }
} }
void CN64Rom::CalculateCicChip ( void ) void CN64Rom::CalculateCicChip()
{ {
__int64 CRC = 0; __int64 CRC = 0;
@ -251,7 +252,8 @@ void CN64Rom::CalculateCicChip ( void )
} }
CICChip CN64Rom::CicChipID ( void ) { CICChip CN64Rom::CicChipID()
{
return m_CicChip; return m_CicChip;
} }
@ -483,17 +485,19 @@ void CN64Rom::SaveRomSettingID ( bool temp )
} }
} }
void CN64Rom::ClearRomSettingID ( void ) void CN64Rom::ClearRomSettingID()
{ {
g_Settings->SaveString(Game_GameName,""); g_Settings->SaveString(Game_GameName,"");
g_Settings->SaveString(Game_IniKey,""); g_Settings->SaveString(Game_IniKey,"");
} }
void CN64Rom::SetError ( LanguageStringID ErrorMsg ) { void CN64Rom::SetError(LanguageStringID ErrorMsg)
{
m_ErrorMsg = ErrorMsg; m_ErrorMsg = ErrorMsg;
} }
void CN64Rom::UnallocateRomImage ( void ) { void CN64Rom::UnallocateRomImage()
{
if (m_hRomFileMapping) { if (m_hRomFileMapping) {
UnmapViewOfFile (m_ROMImage); UnmapViewOfFile (m_ROMImage);
CloseHandle(m_hRomFileMapping); CloseHandle(m_hRomFileMapping);

View File

@ -29,27 +29,28 @@ class CN64Rom :
bool AllocateAndLoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly ); bool AllocateAndLoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly );
bool AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeOnly ); bool AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeOnly );
void ByteSwapRom ( void ); void ByteSwapRom ();
void SetError ( LanguageStringID ErrorMsg ); void SetError ( LanguageStringID ErrorMsg );
static void __stdcall NotificationCB ( LPCWSTR Status, CN64Rom * _this ); static void __stdcall NotificationCB ( LPCWSTR Status, CN64Rom * _this );
void CalculateCicChip ( void ); void CalculateCicChip ();
public: public:
CN64Rom ( void ); CN64Rom();
~CN64Rom ( void ); ~CN64Rom();
bool LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly = false ); bool LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly = false );
static bool IsValidRomImage( BYTE Test[4] ); static bool IsValidRomImage( BYTE Test[4] );
void SaveRomSettingID ( bool temp ); void SaveRomSettingID ( bool temp );
void ClearRomSettingID ( void ); void ClearRomSettingID ();
CICChip CicChipID ( void ); CICChip CicChipID ();
BYTE * GetRomAddress ( void ) { return m_ROMImage; } BYTE * GetRomAddress () { return m_ROMImage; }
DWORD GetRomSize ( void ) { return m_RomFileSize; } DWORD GetRomSize () const { return m_RomFileSize; }
stdstr GetRomMD5 ( void ) { return m_MD5; } stdstr GetRomMD5 () const { return m_MD5; }
stdstr GetRomName ( void ) { return m_RomName; } stdstr GetRomName () const { return m_RomName; }
stdstr GetFileName ( void ) { return m_FileName; } stdstr GetFileName () const { return m_FileName; }
Country GetCountry ( void ) { return m_Country; } Country GetCountry () const { return m_Country; }
void UnallocateRomImage ( void ); void UnallocateRomImage ();
//Get a message id for the reason that you failed to load the rom //Get a message id for the reason that you failed to load the rom
LanguageStringID GetError ( void ) { return m_ErrorMsg; } LanguageStringID GetError () const { return m_ErrorMsg; }
}; };

View File

@ -38,7 +38,7 @@ SPECIAL_TIMERS CProfiling::StartTimer(SPECIAL_TIMERS Address)
return OldTimerAddr; return OldTimerAddr;
} }
SPECIAL_TIMERS CProfiling::StopTimer(void) { SPECIAL_TIMERS CProfiling::StopTimer() {
DWORD HiValue, LoValue; DWORD HiValue, LoValue;
if (m_CurrentTimerAddr == Timer_None) { return m_CurrentTimerAddr; } if (m_CurrentTimerAddr == Timer_None) { return m_CurrentTimerAddr; }
@ -67,7 +67,7 @@ SPECIAL_TIMERS CProfiling::StopTimer(void) {
return OldTimerAddr; return OldTimerAddr;
} }
void CProfiling::ShowCPU_Usage (void) { void CProfiling::ShowCPU_Usage() {
__int64 TotalTime, CPU = 0, Alist = 0, Dlist = 0, Idle = 0; __int64 TotalTime, CPU = 0, Alist = 0, Dlist = 0, Idle = 0;
PROFILE_ENRTY Entry; PROFILE_ENRTY Entry;
@ -104,13 +104,13 @@ void CProfiling::ShowCPU_Usage (void) {
ResetCounters(); ResetCounters();
} }
void CProfiling::ResetCounters (void) { void CProfiling::ResetCounters() {
m_Entries.clear(); m_Entries.clear();
} }
typedef struct { SPECIAL_TIMERS Timer; char * Name; } TIMER_NAME; typedef struct { SPECIAL_TIMERS Timer; char * Name; } TIMER_NAME;
void CProfiling::GenerateLog(void) { void CProfiling::GenerateLog() {
stdstr LogFileName; stdstr LogFileName;
{ {
CLog Log; CLog Log;

View File

@ -17,20 +17,20 @@ typedef PROFILE_ENRTIES::value_type PROFILE_VALUE;
class CProfiling class CProfiling
{ {
public: public:
CProfiling (void); CProfiling();
//recording timing against current timer, returns the address of the timer stoped //recording timing against current timer, returns the address of the timer stopped
SPECIAL_TIMERS StartTimer ( SPECIAL_TIMERS Address ); SPECIAL_TIMERS StartTimer(SPECIAL_TIMERS Address);
SPECIAL_TIMERS StopTimer ( void ); SPECIAL_TIMERS StopTimer();
//Display the CPU Usage //Display the CPU Usage
void ShowCPU_Usage ( void ); void ShowCPU_Usage();
//Reset all the counters back to 0 //Reset all the counters back to 0
void ResetCounters ( void ); void ResetCounters();
//Generate a log file with the current results, this will also reset the counters //Generate a log file with the current results, this will also reset the counters
void GenerateLog ( void ); void GenerateLog();
private: private:
CProfiling(const CProfiling&); // Disable copy constructor CProfiling(const CProfiling&); // Disable copy constructor

View File

@ -352,7 +352,7 @@ bool CCodeBlock::CreateBlockLinkage ( CCodeSection * EnterSection )
return true; return true;
} }
void CCodeBlock::DetermineLoops ( void ) void CCodeBlock::DetermineLoops()
{ {
for (SectionMap::iterator itr = m_SectionMap.begin(); itr != m_SectionMap.end(); itr++) for (SectionMap::iterator itr = m_SectionMap.begin(); itr != m_SectionMap.end(); itr++)
{ {
@ -363,7 +363,7 @@ void CCodeBlock::DetermineLoops ( void )
} }
} }
void CCodeBlock::LogSectionInfo ( void ) void CCodeBlock::LogSectionInfo()
{ {
for (SectionList::iterator itr = m_Sections.begin(); itr != m_Sections.end(); itr++) for (SectionList::iterator itr = m_Sections.begin(); itr != m_Sections.end(); itr++)
{ {
@ -372,7 +372,7 @@ void CCodeBlock::LogSectionInfo ( void )
} }
} }
bool CCodeBlock::AnalyseBlock ( void ) bool CCodeBlock::AnalyseBlock()
{ {
if (!g_System->bLinkBlocks()) if (!g_System->bLinkBlocks())
{ {
@ -738,7 +738,7 @@ bool CCodeBlock::Compile()
} }
void CCodeBlock::CompileExitCode ( void ) void CCodeBlock::CompileExitCode()
{ {
for (EXIT_LIST::iterator ExitIter = m_ExitInfo.begin(); ExitIter != m_ExitInfo.end(); ExitIter++) for (EXIT_LIST::iterator ExitIter = m_ExitInfo.begin(); ExitIter != m_ExitInfo.end(); ExitIter++)
{ {
@ -750,7 +750,7 @@ void CCodeBlock::CompileExitCode ( void )
} }
} }
DWORD CCodeBlock::NextTest ( void ) DWORD CCodeBlock::NextTest()
{ {
return InterlockedIncrement(&m_Test); return InterlockedIncrement(&m_Test);
} }

View File

@ -17,39 +17,40 @@ public:
CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos ); CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos );
~CCodeBlock(); ~CCodeBlock();
bool Compile ( void ); bool Compile();
inline DWORD VAddrEnter ( void ) const { return m_VAddrEnter; } DWORD VAddrEnter() const { return m_VAddrEnter; }
inline DWORD VAddrFirst ( void ) const { return m_VAddrFirst; } DWORD VAddrFirst() const { return m_VAddrFirst; }
inline DWORD VAddrLast ( void ) const { return m_VAddrLast; } DWORD VAddrLast() const { return m_VAddrLast; }
inline BYTE * CompiledLocation ( void ) const { return m_CompiledLocation; } BYTE * CompiledLocation() const { return m_CompiledLocation; }
inline int NoOfSections ( void ) const { return m_Sections.size(); } int NoOfSections() const { return m_Sections.size(); }
inline const CCodeSection & EnterSection ( void ) const { return *m_EnterSection; } const CCodeSection & EnterSection() const { return *m_EnterSection; }
inline const MD5Digest & Hash ( void ) const { return m_Hash; } const MD5Digest & Hash() const { return m_Hash; }
inline void SetVAddrFirst ( DWORD VAddr ) { m_VAddrFirst = VAddr; } void SetVAddrFirst(DWORD VAddr) { m_VAddrFirst = VAddr; }
inline void SetVAddrLast ( DWORD VAddr ) { m_VAddrLast = VAddr; } void SetVAddrLast(DWORD VAddr) { m_VAddrLast = VAddr; }
CCodeSection * ExistingSection ( DWORD Addr ) { return m_EnterSection->ExistingSection(Addr,NextTest()); } CCodeSection * ExistingSection(DWORD Addr) { return m_EnterSection->ExistingSection(Addr, NextTest()); }
bool SectionAccessible ( DWORD m_SectionID ) { return m_EnterSection->SectionAccessible(m_SectionID,NextTest()); } bool SectionAccessible(DWORD m_SectionID) { return m_EnterSection->SectionAccessible(m_SectionID, NextTest()); }
inline QWORD MemContents(int i) const { return m_MemContents[i]; } QWORD MemContents(int i) const { return m_MemContents[i]; }
inline QWORD * MemLocation(int i) const { return m_MemLocation[i]; } QWORD * MemLocation(int i) const { return m_MemLocation[i]; }
DWORD NextTest();
EXIT_LIST m_ExitInfo; EXIT_LIST m_ExitInfo;
DWORD NextTest ( void );
private: private:
CCodeBlock(void); // Disable default constructor CCodeBlock(); // Disable default constructor
CCodeBlock(const CCodeBlock&); // Disable copy constructor CCodeBlock(const CCodeBlock&); // Disable copy constructor
CCodeBlock& operator=(const CCodeBlock&); // Disable assignment CCodeBlock& operator=(const CCodeBlock&); // Disable assignment
bool AnalyseBlock ( void ); bool AnalyseBlock();
void CompileExitCode ( void ); void CompileExitCode();
bool CreateBlockLinkage ( CCodeSection * EnterSection ) ; bool CreateBlockLinkage ( CCodeSection * EnterSection );
void DetermineLoops ( void ) ; void DetermineLoops ();
void LogSectionInfo ( void ) ; void LogSectionInfo ();
bool SetSection ( CCodeSection * & Section, CCodeSection * CurrentSection, DWORD TargetPC, bool LinkAllowed, DWORD CurrentPC ); bool SetSection ( CCodeSection * & Section, CCodeSection * CurrentSection, DWORD TargetPC, bool LinkAllowed, DWORD CurrentPC );
bool SetJumpInfo ( CCodeSection * & Section, DWORD TargetPC, DWORD CurrentPC ); bool SetJumpInfo ( CCodeSection * & Section, DWORD TargetPC, DWORD CurrentPC );
bool AnalyzeInstruction ( DWORD PC, DWORD & TargetPC, DWORD & ContinuePC, bool & LikelyBranch, bool & IncludeDelaySlot, bool AnalyzeInstruction ( DWORD PC, DWORD & TargetPC, DWORD & ContinuePC, bool & LikelyBranch, bool & IncludeDelaySlot,
@ -58,7 +59,7 @@ private:
DWORD m_VAddrEnter; DWORD m_VAddrEnter;
DWORD m_VAddrFirst; // the address of the first opcode in the block DWORD m_VAddrFirst; // the address of the first opcode in the block
DWORD m_VAddrLast; // the address of the first opcode in the block DWORD m_VAddrLast; // the address of the first opcode in the block
BYTE * m_CompiledLocation; // What address is this compiled at BYTE* m_CompiledLocation; // What address is this compiled at
typedef std::map<DWORD,CCodeSection *> SectionMap; typedef std::map<DWORD,CCodeSection *> SectionMap;
typedef std::list<CCodeSection *> SectionList; typedef std::list<CCodeSection *> SectionList;

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
void InPermLoop ( void ); void InPermLoop();
bool DelaySlotEffectsCompare ( DWORD PC, DWORD Reg1, DWORD Reg2 ); bool DelaySlotEffectsCompare ( DWORD PC, DWORD Reg1, DWORD Reg2 );
@ -102,7 +102,7 @@ CCodeSection::CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID, boo
CPU_Message(__FUNCTION__ ": ID %d EnterPC 0x%08X",ID,EnterPC); CPU_Message(__FUNCTION__ ": ID %d EnterPC 0x%08X",ID,EnterPC);
} }
CCodeSection::~CCodeSection( void ) CCodeSection::~CCodeSection()
{ {
} }
@ -341,7 +341,7 @@ void CCodeSection::CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitReg
} }
} }
void CCodeSection::GenerateSectionLinkage (void) void CCodeSection::GenerateSectionLinkage()
{ {
CCodeSection * TargetSection[] = { m_ContinueSection, m_JumpSection }; CCodeSection * TargetSection[] = { m_ContinueSection, m_JumpSection };
CJumpInfo * JumpInfo[] = { &m_Cont, &m_Jump }; CJumpInfo * JumpInfo[] = { &m_Cont, &m_Jump };
@ -837,7 +837,7 @@ void CCodeSection::SyncRegState ( const CRegInfo & SyncTo )
} }
} }
void CCodeSection::SetDelaySlot (void) void CCodeSection::SetDelaySlot()
{ {
m_DelaySlot = true; m_DelaySlot = true;
} }
@ -857,14 +857,15 @@ void CCodeSection::SetContinueAddress (DWORD JumpPC, DWORD TargetPC)
m_Cont.BranchLabel.Format("0x%08X",TargetPC); m_Cont.BranchLabel.Format("0x%08X",TargetPC);
} }
void CCodeSection::CompileCop1Test (void) { void CCodeSection::CompileCop1Test()
{
if (m_RegWorkingSet.FpuBeenUsed()) { return; } if (m_RegWorkingSet.FpuBeenUsed()) { return; }
TestVariable(STATUS_CU1,&g_Reg->STATUS_REGISTER,"STATUS_REGISTER"); TestVariable(STATUS_CU1,&g_Reg->STATUS_REGISTER,"STATUS_REGISTER");
CompileExit(m_CompilePC,m_CompilePC,m_RegWorkingSet,CExitInfo::COP1_Unuseable,FALSE,JeLabel32); CompileExit(m_CompilePC,m_CompilePC,m_RegWorkingSet,CExitInfo::COP1_Unuseable,FALSE,JeLabel32);
m_RegWorkingSet.FpuBeenUsed() = TRUE; m_RegWorkingSet.FpuBeenUsed() = TRUE;
} }
bool CCodeSection::ParentContinue ( void ) bool CCodeSection::ParentContinue()
{ {
if (m_ParentSection.size() > 0) if (m_ParentSection.size() > 0)
{ {
@ -884,7 +885,7 @@ bool CCodeSection::ParentContinue ( void )
} }
/*int TestValue = 0; /*int TestValue = 0;
void TestFunc ( void ) void TestFunc()
{ {
TestValue += 1; TestValue += 1;
if (TestValue >= 4) if (TestValue >= 4)
@ -1607,7 +1608,7 @@ bool CCodeSection::IsAllParentLoops(CCodeSection * Parent, bool IgnoreIfCompiled
return true; return true;
} }
bool CCodeSection::SetupRegisterForLoop ( void ) bool CCodeSection::SetupRegisterForLoop()
{ {
CRegInfo OriginalReg = m_RegWorkingSet; CRegInfo OriginalReg = m_RegWorkingSet;
if (!LoopAnalysis(m_BlockInfo, this).SetupRegisterForLoop()) if (!LoopAnalysis(m_BlockInfo, this).SetupRegisterForLoop())
@ -1624,7 +1625,7 @@ bool CCodeSection::SetupRegisterForLoop ( void )
return true; return true;
} }
bool CCodeSection::InheritParentInfo ( void ) bool CCodeSection::InheritParentInfo()
{ {
if (m_CompiledLocation == NULL) if (m_CompiledLocation == NULL)
{ {
@ -2037,7 +2038,7 @@ bool CCodeSection::DisplaySectionInformation (DWORD ID, DWORD Test)
return true; return true;
} }
void CCodeSection::DisplaySectionInformation (void) void CCodeSection::DisplaySectionInformation()
{ {
if (m_SectionID == 0) if (m_SectionID == 0)
{ {

View File

@ -19,22 +19,22 @@ public:
typedef std::list<CCodeSection *> SECTION_LIST; typedef std::list<CCodeSection *> SECTION_LIST;
CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID, bool LinkAllowed); CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID, bool LinkAllowed);
~CCodeSection( void ); ~CCodeSection();
void SetDelaySlot ( void ); void SetDelaySlot ();
void SetJumpAddress ( DWORD JumpPC, DWORD TargetPC, bool PermLoop ); void SetJumpAddress ( DWORD JumpPC, DWORD TargetPC, bool PermLoop );
void SetContinueAddress ( DWORD JumpPC, DWORD TargetPC ); void SetContinueAddress ( DWORD JumpPC, DWORD TargetPC );
void CompileCop1Test ( void ); void CompileCop1Test ();
bool CreateSectionLinkage ( void ); bool CreateSectionLinkage ();
bool GenerateX86Code ( DWORD Test ); bool GenerateX86Code ( DWORD Test );
void GenerateSectionLinkage ( void ); void GenerateSectionLinkage ();
void CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(const char * Label, DWORD Value)); 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 ); void DetermineLoop ( DWORD Test, DWORD Test2, DWORD TestID );
bool FixConstants ( DWORD Test ); bool FixConstants ( DWORD Test );
CCodeSection * ExistingSection ( DWORD Addr, DWORD Test ); CCodeSection * ExistingSection ( DWORD Addr, DWORD Test );
bool SectionAccessible ( DWORD SectionId, DWORD Test ); bool SectionAccessible ( DWORD SectionId, DWORD Test );
bool DisplaySectionInformation ( DWORD ID, DWORD Test ); bool DisplaySectionInformation ( DWORD ID, DWORD Test );
void DisplaySectionInformation ( void ); void DisplaySectionInformation ();
void AddParent ( CCodeSection * Parent ); void AddParent ( CCodeSection * Parent );
void SwitchParent ( CCodeSection * OldParent, CCodeSection * NewParent ); void SwitchParent ( CCodeSection * OldParent, CCodeSection * NewParent );
@ -63,12 +63,12 @@ public:
private: private:
void UnlinkParent ( CCodeSection * Parent, bool ContinueSection ); void UnlinkParent ( CCodeSection * Parent, bool ContinueSection );
void InheritConstants ( void ); void InheritConstants ();
void TestRegConstantStates ( CRegInfo & Base, CRegInfo & Reg ); void TestRegConstantStates ( CRegInfo & Base, CRegInfo & Reg );
void SyncRegState ( const CRegInfo & SyncTo ); void SyncRegState ( const CRegInfo & SyncTo );
bool IsAllParentLoops ( CCodeSection * Parent, bool IgnoreIfCompiled, DWORD Test ); bool IsAllParentLoops ( CCodeSection * Parent, bool IgnoreIfCompiled, DWORD Test );
bool ParentContinue ( void ); bool ParentContinue ();
bool InheritParentInfo ( void ); bool InheritParentInfo ();
bool SetupRegisterForLoop ( void ); bool SetupRegisterForLoop ();
}; };

View File

@ -17,13 +17,13 @@ class CDelaySlotFunctionMap
FUNCTION_MAP FunctionMap; FUNCTION_MAP FunctionMap;
public: public:
CDelaySlotFunctionMap ( void ); CDelaySlotFunctionMap();
~CDelaySlotFunctionMap ( void ); ~CDelaySlotFunctionMap();
CCompiledFunc * AddFunctionInfo ( DWORD vAddr, DWORD pAddr ); CCompiledFunc* AddFunctionInfo(DWORD vAddr, DWORD pAddr);
CCompiledFunc * FindFunction ( DWORD vAddr, int Length ); CCompiledFunc* FindFunction(DWORD vAddr, int Length);
CCompiledFunc * FindFunction ( DWORD vAddr ) const; CCompiledFunc* FindFunction(DWORD vAddr) const;
void Remove ( CCompiledFunc * info ); void Remove(CCompiledFunc* info);
void Reset ( void ); void Reset();
}; };

View File

@ -13,25 +13,25 @@
class CCompiledFunc class CCompiledFunc
{ {
//constructor //constructor
CCompiledFunc ( void ); // not implemented CCompiledFunc(); // not implemented
public: public:
CCompiledFunc ( const CCodeBlock & CodeBlock ); CCompiledFunc(const CCodeBlock & CodeBlock);
typedef void (* Func)(void); typedef void (*Func)();
//Get Private Information //Get Private Information
inline const DWORD EnterPC ( void ) const { return m_EnterPC; } const DWORD EnterPC () const { return m_EnterPC; }
inline const DWORD MinPC ( void ) const { return m_MinPC; } const DWORD MinPC () const { return m_MinPC; }
inline const DWORD MaxPC ( void ) const { return m_MaxPC; } const DWORD MaxPC () const { return m_MaxPC; }
inline const Func Function ( void ) const { return m_Function; } const Func Function () const { return m_Function; }
inline const MD5Digest & Hash ( void ) const { return m_Hash; } const MD5Digest& Hash () const { return m_Hash; }
inline CCompiledFunc * Next ( void ) const { return m_Next; } CCompiledFunc* Next () const { return m_Next; }
inline void SetNext ( CCompiledFunc * Next ) { m_Next = Next; } void SetNext(CCompiledFunc* Next) { m_Next = Next; }
inline QWORD MemContents(int i) { return m_MemContents[i]; } QWORD MemContents(int i) { return m_MemContents[i]; }
inline QWORD * MemLocation(int i) { return m_MemLocation[i]; } QWORD* MemLocation(int i) { return m_MemLocation[i]; }
private: private:
//Information //Information
@ -43,7 +43,7 @@ private:
//From querying the recompiler get information about the function //From querying the recompiler get information about the function
Func m_Function; Func m_Function;
CCompiledFunc * m_Next; CCompiledFunc* m_Next;
//Validation //Validation
QWORD m_MemContents[2], * m_MemLocation[2]; QWORD m_MemContents[2], * m_MemLocation[2];

View File

@ -47,7 +47,7 @@ bool CFunctionMap::AllocateMemory()
return true; return true;
} }
void CFunctionMap::CleanBuffers ( void ) void CFunctionMap::CleanBuffers()
{ {
if (m_FunctionTable) if (m_FunctionTable)
{ {

View File

@ -19,15 +19,15 @@ protected:
CFunctionMap(); CFunctionMap();
~CFunctionMap(); ~CFunctionMap();
bool AllocateMemory ( void ); bool AllocateMemory();
void Reset ( bool bAllocate); void Reset(bool bAllocate);
public: public:
inline PCCompiledFunc_TABLE * FunctionTable ( void ) const { return m_FunctionTable; } PCCompiledFunc_TABLE * FunctionTable() const { return m_FunctionTable; }
inline PCCompiledFunc * JumpTable ( void ) const { return m_JumpTable; } PCCompiledFunc * JumpTable() const { return m_JumpTable; }
private: private:
void CleanBuffers ( void ); void CleanBuffers();
PCCompiledFunc * m_JumpTable; PCCompiledFunc * m_JumpTable;
PCCompiledFunc_TABLE * m_FunctionTable; PCCompiledFunc_TABLE * m_FunctionTable;

View File

@ -47,7 +47,7 @@ LoopAnalysis::~LoopAnalysis()
m_JumpRegisters.clear(); m_JumpRegisters.clear();
} }
bool LoopAnalysis::SetupRegisterForLoop ( void ) bool LoopAnalysis::SetupRegisterForLoop()
{ {
if (!m_EnterSection->m_InLoop) if (!m_EnterSection->m_InLoop)
{ {
@ -808,25 +808,25 @@ void LoopAnalysis::SetContinueRegSet ( CCodeSection * Section, const CRegInfo &R
} }
} }
void LoopAnalysis::SPECIAL_SLL ( void ) void LoopAnalysis::SPECIAL_SLL()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SRL ( void ) void LoopAnalysis::SPECIAL_SRL()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SRA ( void ) void LoopAnalysis::SPECIAL_SRA()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SLLV ( void ) void LoopAnalysis::SPECIAL_SLLV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) { if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) {
@ -840,7 +840,7 @@ void LoopAnalysis::SPECIAL_SLLV ( void )
} }
} }
void LoopAnalysis::SPECIAL_SRLV ( void ) void LoopAnalysis::SPECIAL_SRLV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -855,7 +855,7 @@ void LoopAnalysis::SPECIAL_SRLV ( void )
} }
} }
void LoopAnalysis::SPECIAL_SRAV ( void ) void LoopAnalysis::SPECIAL_SRAV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -870,7 +870,7 @@ void LoopAnalysis::SPECIAL_SRAV ( void )
} }
} }
void LoopAnalysis::SPECIAL_JR ( void ) void LoopAnalysis::SPECIAL_JR()
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
#ifdef tofix #ifdef tofix
@ -883,7 +883,7 @@ void LoopAnalysis::SPECIAL_JR ( void )
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
} }
void LoopAnalysis::SPECIAL_JALR ( void ) void LoopAnalysis::SPECIAL_JALR()
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
#ifdef tofix #ifdef tofix
@ -938,27 +938,27 @@ void LoopAnalysis::SPECIAL_BREAK ( CCodeSection * Section )
m_PC -= 4; m_PC -= 4;
} }
void LoopAnalysis::SPECIAL_MFHI ( void ) void LoopAnalysis::SPECIAL_MFHI()
{ {
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_MTHI ( void ) void LoopAnalysis::SPECIAL_MTHI()
{ {
} }
void LoopAnalysis::SPECIAL_MFLO ( void ) void LoopAnalysis::SPECIAL_MFLO()
{ {
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_MTLO ( void ) void LoopAnalysis::SPECIAL_MTLO()
{ {
} }
void LoopAnalysis::SPECIAL_DSLLV ( void ) void LoopAnalysis::SPECIAL_DSLLV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -973,7 +973,7 @@ void LoopAnalysis::SPECIAL_DSLLV ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSRLV ( void ) void LoopAnalysis::SPECIAL_DSRLV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -989,7 +989,7 @@ void LoopAnalysis::SPECIAL_DSRLV ( void )
} }
void LoopAnalysis::SPECIAL_DSRAV ( void ) void LoopAnalysis::SPECIAL_DSRAV()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -1004,67 +1004,67 @@ void LoopAnalysis::SPECIAL_DSRAV ( void )
} }
} }
void LoopAnalysis::SPECIAL_ADD ( void ) void LoopAnalysis::SPECIAL_ADD()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_ADDU ( void ) void LoopAnalysis::SPECIAL_ADDU()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SUB ( void ) void LoopAnalysis::SPECIAL_SUB()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SUBU ( void ) void LoopAnalysis::SPECIAL_SUBU()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_AND ( void ) void LoopAnalysis::SPECIAL_AND()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_OR ( void ) void LoopAnalysis::SPECIAL_OR()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_XOR ( void ) void LoopAnalysis::SPECIAL_XOR()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_NOR ( void ) void LoopAnalysis::SPECIAL_NOR()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SLT ( void ) void LoopAnalysis::SPECIAL_SLT()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_SLTU ( void ) void LoopAnalysis::SPECIAL_SLTU()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED); m_Reg.SetMipsRegState(m_Command.rd,CRegInfo::STATE_MODIFIED);
} }
void LoopAnalysis::SPECIAL_DADD ( void ) void LoopAnalysis::SPECIAL_DADD()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -1082,7 +1082,7 @@ void LoopAnalysis::SPECIAL_DADD ( void )
} }
} }
void LoopAnalysis::SPECIAL_DADDU ( void ) void LoopAnalysis::SPECIAL_DADDU()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -1100,7 +1100,7 @@ void LoopAnalysis::SPECIAL_DADDU ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSUB ( void ) void LoopAnalysis::SPECIAL_DSUB()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -1118,7 +1118,7 @@ void LoopAnalysis::SPECIAL_DSUB ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSUBU ( void ) void LoopAnalysis::SPECIAL_DSUBU()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd) if (m_Command.rt == m_Command.rd || m_Command.rs == m_Command.rd)
@ -1136,7 +1136,7 @@ void LoopAnalysis::SPECIAL_DSUBU ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSLL ( void ) void LoopAnalysis::SPECIAL_DSLL()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)
@ -1151,7 +1151,7 @@ void LoopAnalysis::SPECIAL_DSLL ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSRL ( void ) void LoopAnalysis::SPECIAL_DSRL()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)
@ -1166,7 +1166,7 @@ void LoopAnalysis::SPECIAL_DSRL ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSRA ( void ) void LoopAnalysis::SPECIAL_DSRA()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)
@ -1181,7 +1181,7 @@ void LoopAnalysis::SPECIAL_DSRA ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSLL32 ( void ) void LoopAnalysis::SPECIAL_DSLL32()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)
@ -1196,7 +1196,7 @@ void LoopAnalysis::SPECIAL_DSLL32 ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSRL32 ( void ) void LoopAnalysis::SPECIAL_DSRL32()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)
@ -1211,7 +1211,7 @@ void LoopAnalysis::SPECIAL_DSRL32 ( void )
} }
} }
void LoopAnalysis::SPECIAL_DSRA32 ( void ) void LoopAnalysis::SPECIAL_DSRA32()
{ {
if (m_Command.rd == 0) { return; } if (m_Command.rd == 0) { return; }
if (m_Command.rt == m_Command.rd) if (m_Command.rt == m_Command.rd)

View File

@ -19,10 +19,10 @@ public:
LoopAnalysis(CCodeBlock * CodeBlock, CCodeSection * Section); LoopAnalysis(CCodeBlock * CodeBlock, CCodeSection * Section);
~LoopAnalysis(); ~LoopAnalysis();
bool SetupRegisterForLoop ( void ); bool SetupRegisterForLoop();
private: private:
LoopAnalysis(void); // Disable default constructor LoopAnalysis(); // Disable default constructor
LoopAnalysis(const LoopAnalysis&); // Disable copy constructor LoopAnalysis(const LoopAnalysis&); // Disable copy constructor
LoopAnalysis& operator=(const LoopAnalysis&); // Disable assignment LoopAnalysis& operator=(const LoopAnalysis&); // Disable assignment
@ -30,46 +30,46 @@ private:
bool CheckLoopRegisterUsage ( CCodeSection * Section ); bool CheckLoopRegisterUsage ( CCodeSection * Section );
bool SyncRegState ( CRegInfo & RegSet, const CRegInfo& SyncReg ); bool SyncRegState ( CRegInfo & RegSet, const CRegInfo& SyncReg );
void SetJumpRegSet ( CCodeSection * Section, const CRegInfo &Reg ); void SetJumpRegSet ( CCodeSection * Section, const CRegInfo &Reg );
void SetContinueRegSet ( CCodeSection * Section, const CRegInfo &Reg ); void SetContinueRegSet(CCodeSection * Section, const CRegInfo &Reg);
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
void SPECIAL_SLL ( void ); void SPECIAL_SLL();
void SPECIAL_SRL ( void ); void SPECIAL_SRL();
void SPECIAL_SRA ( void ); void SPECIAL_SRA();
void SPECIAL_SLLV ( void ); void SPECIAL_SLLV();
void SPECIAL_SRLV ( void ); void SPECIAL_SRLV();
void SPECIAL_SRAV ( void ); void SPECIAL_SRAV();
void SPECIAL_JR ( void ); void SPECIAL_JR();
void SPECIAL_JALR ( void ); void SPECIAL_JALR();
void SPECIAL_SYSCALL ( CCodeSection * Section ); void SPECIAL_SYSCALL(CCodeSection * Section);
void SPECIAL_BREAK ( CCodeSection * Section ); void SPECIAL_BREAK(CCodeSection * Section);
void SPECIAL_MFHI ( void ); void SPECIAL_MFHI();
void SPECIAL_MTHI ( void ); void SPECIAL_MTHI();
void SPECIAL_MFLO ( void ); void SPECIAL_MFLO();
void SPECIAL_MTLO ( void ); void SPECIAL_MTLO();
void SPECIAL_DSLLV ( void ); void SPECIAL_DSLLV();
void SPECIAL_DSRLV ( void ); void SPECIAL_DSRLV();
void SPECIAL_DSRAV ( void ); void SPECIAL_DSRAV();
void SPECIAL_ADD ( void ); void SPECIAL_ADD();
void SPECIAL_ADDU ( void ); void SPECIAL_ADDU();
void SPECIAL_SUB ( void ); void SPECIAL_SUB();
void SPECIAL_SUBU ( void ); void SPECIAL_SUBU();
void SPECIAL_AND ( void ); void SPECIAL_AND();
void SPECIAL_OR ( void ); void SPECIAL_OR();
void SPECIAL_XOR ( void ); void SPECIAL_XOR();
void SPECIAL_NOR ( void ); void SPECIAL_NOR();
void SPECIAL_SLT ( void ); void SPECIAL_SLT();
void SPECIAL_SLTU ( void ); void SPECIAL_SLTU();
void SPECIAL_DADD ( void ); void SPECIAL_DADD();
void SPECIAL_DADDU ( void ); void SPECIAL_DADDU();
void SPECIAL_DSUB ( void ); void SPECIAL_DSUB();
void SPECIAL_DSUBU ( void ); void SPECIAL_DSUBU();
void SPECIAL_DSLL ( void ); void SPECIAL_DSLL();
void SPECIAL_DSRL ( void ); void SPECIAL_DSRL();
void SPECIAL_DSRA ( void ); void SPECIAL_DSRA();
void SPECIAL_DSLL32 ( void ); void SPECIAL_DSLL32();
void SPECIAL_DSRL32 ( void ); void SPECIAL_DSRL32();
void SPECIAL_DSRA32 ( void ); void SPECIAL_DSRA32();
typedef std::map<int,CRegInfo *> RegisterMap; typedef std::map<int,CRegInfo *> RegisterMap;

View File

@ -90,7 +90,7 @@ void CRecompiler::Run()
} }
} }
void CRecompiler::RecompilerMain_VirtualTable ( void ) void CRecompiler::RecompilerMain_VirtualTable()
{ {
bool & Done = m_EndEmulation; bool & Done = m_EndEmulation;
DWORD & PC = PROGRAM_COUNTER; DWORD & PC = PROGRAM_COUNTER;
@ -146,7 +146,7 @@ void CRecompiler::RecompilerMain_VirtualTable ( void )
} }
} }
void CRecompiler::RecompilerMain_VirtualTable_validate ( void ) void CRecompiler::RecompilerMain_VirtualTable_validate()
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
/* PCCompiledFunc_TABLE * m_FunctionTable = m_Functions.GetFunctionTable(); /* PCCompiledFunc_TABLE * m_FunctionTable = m_Functions.GetFunctionTable();
@ -320,7 +320,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
*/ */
} }
void CRecompiler::RecompilerMain_Lookup( void ) void CRecompiler::RecompilerMain_Lookup()
{ {
while(!m_EndEmulation) while(!m_EndEmulation)
{ {
@ -510,7 +510,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
}*/ }*/
} }
void CRecompiler::RecompilerMain_Lookup_TLB( void ) void CRecompiler::RecompilerMain_Lookup_TLB()
{ {
DWORD PhysicalAddr; DWORD PhysicalAddr;
@ -562,7 +562,7 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void )
} }
} }
void CRecompiler::RecompilerMain_Lookup_validate( void ) void CRecompiler::RecompilerMain_Lookup_validate()
{ {
while(!m_EndEmulation) while(!m_EndEmulation)
{ {
@ -610,7 +610,7 @@ void CRecompiler::RecompilerMain_Lookup_validate( void )
} }
} }
void CRecompiler::RecompilerMain_Lookup_validate_TLB( void ) void CRecompiler::RecompilerMain_Lookup_validate_TLB()
{ {
DWORD PhysicalAddr; DWORD PhysicalAddr;
@ -705,7 +705,7 @@ void CRecompiler::ResetRecompCode( bool bAllocate )
m_Functions.clear(); m_Functions.clear();
} }
void CRecompiler::RecompilerMain_ChangeMemory ( void ) void CRecompiler::RecompilerMain_ChangeMemory()
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
#ifdef tofix #ifdef tofix
@ -842,7 +842,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
#endif #endif
} }
CCompiledFunc * CRecompiler::CompilerCode ( void ) CCompiledFunc * CRecompiler::CompilerCode()
{ {
DWORD pAddr = 0; DWORD pAddr = 0;
if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER,pAddr)) if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER,pAddr))
@ -979,7 +979,7 @@ void CRecompiler::ClearRecompCode_Virt(DWORD Address, int length,REMOVE_REASON R
} }
} }
void CRecompiler::ResetMemoryStackPos( void ) void CRecompiler::ResetMemoryStackPos()
{ {
if (g_MMU == NULL) if (g_MMU == NULL)
{ {

View File

@ -29,15 +29,15 @@ public:
Remove_StoreInstruc, Remove_StoreInstruc,
}; };
typedef void (* DelayFunc)(void); typedef void (*DelayFunc)();
public: public:
CRecompiler (CRegisters & Registers, CProfiling & Profile, bool & EndEmulation ); CRecompiler(CRegisters & Registers, CProfiling & Profile, bool & EndEmulation);
~CRecompiler (void); ~CRecompiler();
void Run ( void ); void Run();
void Reset ( void ); void Reset();
void ResetRecompCode ( bool bAllocate ); void ResetRecompCode(bool bAllocate);
bool GenerateX86Code (CCodeBlock & BlockInfo, CCodeSection * Section, DWORD Test ); bool GenerateX86Code (CCodeBlock & BlockInfo, CCodeSection * Section, DWORD Test );
@ -45,16 +45,16 @@ public:
void ClearRecompCode_Virt ( DWORD VirtualAddress, int length, REMOVE_REASON Reason ); void ClearRecompCode_Virt ( DWORD VirtualAddress, int length, REMOVE_REASON Reason );
void ClearRecompCode_Phys ( DWORD PhysicalAddress, int length, REMOVE_REASON Reason ); void ClearRecompCode_Phys ( DWORD PhysicalAddress, int length, REMOVE_REASON Reason );
void ResetMemoryStackPos ( void ); void ResetMemoryStackPos();
inline DWORD & MemoryStackPos ( void ) { return m_MemoryStack; } DWORD& MemoryStackPos() { return m_MemoryStack; }
private: private:
CRecompiler(void); // Disable default constructor CRecompiler(); // Disable default constructor
CRecompiler(const CRecompiler&); // Disable copy constructor CRecompiler(const CRecompiler&); // Disable copy constructor
CRecompiler& operator=(const CRecompiler&); // Disable assignment CRecompiler& operator=(const CRecompiler&); // Disable assignment
CCompiledFunc * CompilerCode ( void ); CCompiledFunc * CompilerCode();
bool Compiler4300iBlock ( CCompiledFunc * info ); bool Compiler4300iBlock ( CCompiledFunc * info );
// Compiling code // Compiling code
@ -62,13 +62,13 @@ private:
bool DisplaySectionInformation (CCodeSection * Section, DWORD ID, DWORD Test); bool DisplaySectionInformation (CCodeSection * Section, DWORD ID, DWORD Test);
// Main loops for the different look up methods // Main loops for the different look up methods
void RecompilerMain_VirtualTable ( void ); void RecompilerMain_VirtualTable();
void RecompilerMain_VirtualTable_validate ( void ); void RecompilerMain_VirtualTable_validate();
void RecompilerMain_ChangeMemory ( void ); void RecompilerMain_ChangeMemory();
void RecompilerMain_Lookup ( void ); void RecompilerMain_Lookup();
void RecompilerMain_Lookup_TLB ( void ); void RecompilerMain_Lookup_TLB();
void RecompilerMain_Lookup_validate ( void ); void RecompilerMain_Lookup_validate();
void RecompilerMain_Lookup_validate_TLB ( void ); void RecompilerMain_Lookup_validate_TLB();
void RemoveFunction (CCompiledFunc * FunInfo, bool DelaySlot, REMOVE_REASON Reason ); void RemoveFunction (CCompiledFunc * FunInfo, bool DelaySlot, REMOVE_REASON Reason );

View File

@ -51,7 +51,7 @@ bool CRecompMemory::AllocateMemory()
return true; return true;
} }
void CRecompMemory::CheckRecompMem ( void ) void CRecompMemory::CheckRecompMem()
{ {
DWORD Size = (DWORD)((BYTE *)m_RecompPos - (BYTE *)m_RecompCode); DWORD Size = (DWORD)((BYTE *)m_RecompPos - (BYTE *)m_RecompCode);
if ((Size + 0x20000) < m_RecompSize) if ((Size + 0x20000) < m_RecompSize)

View File

@ -17,12 +17,12 @@ protected:
CRecompMemory(); CRecompMemory();
~CRecompMemory(); ~CRecompMemory();
bool AllocateMemory ( void ); bool AllocateMemory();
void CheckRecompMem ( void ); void CheckRecompMem();
void Reset ( void ); void Reset();
void ShowMemUsed ( void ); void ShowMemUsed();
inline BYTE * RecompPos ( void ) const { return m_RecompPos; } BYTE* RecompPos() const { return m_RecompPos; }
private: private:
BYTE * m_RecompCode; BYTE * m_RecompCode;

View File

@ -423,7 +423,7 @@ void CRecompilerOps::Compile_BranchLikely (BranchFunction CompareFunc, BOOL Link
} }
} }
void CRecompilerOps::BNE_Compare (void) void CRecompilerOps::BNE_Compare()
{ {
BYTE *Jump = NULL; BYTE *Jump = NULL;
@ -656,7 +656,7 @@ void CRecompilerOps::BNE_Compare (void)
} }
} }
void CRecompilerOps::BEQ_Compare (void) { void CRecompilerOps::BEQ_Compare() {
BYTE *Jump = NULL; BYTE *Jump = NULL;
if (IsKnown(m_Opcode.rs) && IsKnown(m_Opcode.rt)) { if (IsKnown(m_Opcode.rs) && IsKnown(m_Opcode.rt)) {
@ -880,7 +880,7 @@ void CRecompilerOps::BEQ_Compare (void) {
} }
} }
void CRecompilerOps::BGTZ_Compare (void) { void CRecompilerOps::BGTZ_Compare() {
if (IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rs)) {
if (GetMipsReg_S(m_Opcode.rs) > 0) { if (GetMipsReg_S(m_Opcode.rs) > 0) {
@ -976,7 +976,7 @@ void CRecompilerOps::BGTZ_Compare (void) {
} }
} }
void CRecompilerOps::BLEZ_Compare (void) { void CRecompilerOps::BLEZ_Compare() {
if (IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rs)) {
if (GetMipsReg_S(m_Opcode.rs) <= 0) { if (GetMipsReg_S(m_Opcode.rs) <= 0) {
@ -1134,7 +1134,7 @@ void CRecompilerOps::BLEZ_Compare (void) {
} }
} }
void CRecompilerOps::BLTZ_Compare (void) { void CRecompilerOps::BLTZ_Compare() {
if (IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rs)) {
if (GetMipsReg_S(m_Opcode.rs) < 0) { if (GetMipsReg_S(m_Opcode.rs) < 0) {
@ -1211,7 +1211,7 @@ void CRecompilerOps::BLTZ_Compare (void) {
} }
} }
void CRecompilerOps::BGEZ_Compare (void) { void CRecompilerOps::BGEZ_Compare() {
if (IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rs)) {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
@ -1283,7 +1283,7 @@ void CRecompilerOps::BGEZ_Compare (void) {
} }
} }
void CRecompilerOps::COP1_BCF_Compare (void) { void CRecompilerOps::COP1_BCF_Compare() {
TestVariable(FPCSR_C,&_FPCR[31],"_FPCR[31]"); TestVariable(FPCSR_C,&_FPCR[31],"_FPCR[31]");
if (m_Section->m_Cont.FallThrough) { if (m_Section->m_Cont.FallThrough) {
JeLabel32 ( m_Section->m_Jump.BranchLabel.c_str(), 0 ); JeLabel32 ( m_Section->m_Jump.BranchLabel.c_str(), 0 );
@ -1299,7 +1299,7 @@ void CRecompilerOps::COP1_BCF_Compare (void) {
} }
} }
void CRecompilerOps::COP1_BCT_Compare (void) { void CRecompilerOps::COP1_BCT_Compare() {
TestVariable(FPCSR_C,&_FPCR[31],"_FPCR[31]"); TestVariable(FPCSR_C,&_FPCR[31],"_FPCR[31]");
if (m_Section->m_Cont.FallThrough) { if (m_Section->m_Cont.FallThrough) {
JneLabel32 ( m_Section->m_Jump.BranchLabel.c_str(), 0 ); JneLabel32 ( m_Section->m_Jump.BranchLabel.c_str(), 0 );
@ -1316,7 +1316,7 @@ void CRecompilerOps::COP1_BCT_Compare (void) {
} }
/************************* OpCode functions *************************/ /************************* OpCode functions *************************/
void CRecompilerOps::J (void) { void CRecompilerOps::J() {
if ( m_NextInstruction == NORMAL ) { if ( m_NextInstruction == NORMAL ) {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if ((m_CompilePC & 0xFFC) == 0xFFC) if ((m_CompilePC & 0xFFC) == 0xFFC)
@ -1346,7 +1346,7 @@ void CRecompilerOps::J (void) {
} }
} }
void CRecompilerOps::JAL (void) { void CRecompilerOps::JAL() {
if ( m_NextInstruction == NORMAL ) if ( m_NextInstruction == NORMAL )
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -1398,7 +1398,7 @@ void CRecompilerOps::JAL (void) {
return; return;
} }
void CRecompilerOps::ADDI (void) { void CRecompilerOps::ADDI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return; } if (m_Opcode.rt == 0) { return; }
@ -1421,7 +1421,7 @@ void CRecompilerOps::ADDI (void) {
} }
} }
void CRecompilerOps::ADDIU (void) { void CRecompilerOps::ADDIU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0 || (m_Opcode.immediate == 0 && m_Opcode.rs == m_Opcode.rt)) { return; } if (m_Opcode.rt == 0 || (m_Opcode.immediate == 0 && m_Opcode.rs == m_Opcode.rt)) { return; }
@ -1449,7 +1449,7 @@ void CRecompilerOps::ADDIU (void) {
} }
} }
void CRecompilerOps::SLTIU (void) { void CRecompilerOps::SLTIU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return; } if (m_Opcode.rt == 0) { return; }
@ -1507,7 +1507,7 @@ void CRecompilerOps::SLTIU (void) {
} }
} }
void CRecompilerOps::SLTI (void) void CRecompilerOps::SLTI()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return; } if (m_Opcode.rt == 0) { return; }
@ -1593,7 +1593,7 @@ void CRecompilerOps::SLTI (void)
} }
} }
void CRecompilerOps::ANDI (void) { void CRecompilerOps::ANDI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return;} if (m_Opcode.rt == 0) { return;}
@ -1610,7 +1610,7 @@ void CRecompilerOps::ANDI (void) {
} }
} }
void CRecompilerOps::ORI (void) { void CRecompilerOps::ORI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return;} if (m_Opcode.rt == 0) { return;}
@ -1651,7 +1651,7 @@ void CRecompilerOps::ORI (void) {
} }
} }
void CRecompilerOps::XORI (void) { void CRecompilerOps::XORI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return;} if (m_Opcode.rt == 0) { return;}
@ -1672,7 +1672,7 @@ void CRecompilerOps::XORI (void) {
} }
} }
void CRecompilerOps::LUI (void) { void CRecompilerOps::LUI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rt == 0) { return;} if (m_Opcode.rt == 0) { return;}
@ -1693,7 +1693,7 @@ void CRecompilerOps::LUI (void) {
m_RegWorkingSet.SetMipsRegState(m_Opcode.rt,CRegInfo::STATE_CONST_32_SIGN); m_RegWorkingSet.SetMipsRegState(m_Opcode.rt,CRegInfo::STATE_CONST_32_SIGN);
} }
void CRecompilerOps::DADDIU (void) { void CRecompilerOps::DADDIU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs,TRUE); } if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs,TRUE); }
@ -1704,7 +1704,7 @@ void CRecompilerOps::DADDIU (void) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CRecompilerOps::CACHE (void){ void CRecompilerOps::CACHE(){
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (g_Settings->LoadDword(Game_SMM_Cache) == 0) if (g_Settings->LoadDword(Game_SMM_Cache) == 0)
@ -1752,7 +1752,7 @@ void CRecompilerOps::CACHE (void){
} }
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
void CRecompilerOps::SPECIAL_SLL (void) { void CRecompilerOps::SPECIAL_SLL() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1793,7 +1793,7 @@ void CRecompilerOps::SPECIAL_SLL (void) {
} }
} }
void CRecompilerOps::SPECIAL_SRL (void) { void CRecompilerOps::SPECIAL_SRL() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1807,7 +1807,7 @@ void CRecompilerOps::SPECIAL_SRL (void) {
ShiftRightUnsignImmed(GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa); ShiftRightUnsignImmed(GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa);
} }
void CRecompilerOps::SPECIAL_SRA (void) { void CRecompilerOps::SPECIAL_SRA() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1821,7 +1821,7 @@ void CRecompilerOps::SPECIAL_SRA (void) {
ShiftRightSignImmed(GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa); ShiftRightSignImmed(GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa);
} }
void CRecompilerOps::SPECIAL_SLLV (void) { void CRecompilerOps::SPECIAL_SLLV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1843,7 +1843,7 @@ void CRecompilerOps::SPECIAL_SLLV (void) {
ShiftLeftSign(GetMipsRegMapLo(m_Opcode.rd)); ShiftLeftSign(GetMipsRegMapLo(m_Opcode.rd));
} }
void CRecompilerOps::SPECIAL_SRLV (void) { void CRecompilerOps::SPECIAL_SRLV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1865,7 +1865,7 @@ void CRecompilerOps::SPECIAL_SRLV (void) {
ShiftRightUnsign(GetMipsRegMapLo(m_Opcode.rd)); ShiftRightUnsign(GetMipsRegMapLo(m_Opcode.rd));
} }
void CRecompilerOps::SPECIAL_SRAV (void) { void CRecompilerOps::SPECIAL_SRAV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -1887,7 +1887,7 @@ void CRecompilerOps::SPECIAL_SRAV (void) {
ShiftRightSign(GetMipsRegMapLo(m_Opcode.rd)); ShiftRightSign(GetMipsRegMapLo(m_Opcode.rd));
} }
void CRecompilerOps::SPECIAL_JR (void) { void CRecompilerOps::SPECIAL_JR() {
if ( m_NextInstruction == NORMAL ) if ( m_NextInstruction == NORMAL )
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -1945,7 +1945,7 @@ void CRecompilerOps::SPECIAL_JR (void) {
} }
} }
void CRecompilerOps::SPECIAL_JALR (void) void CRecompilerOps::SPECIAL_JALR()
{ {
if ( m_NextInstruction == NORMAL ) if ( m_NextInstruction == NORMAL )
{ {
@ -2008,13 +2008,13 @@ void CRecompilerOps::SPECIAL_JALR (void)
} }
} }
void CRecompilerOps::SPECIAL_SYSCALL (void) { void CRecompilerOps::SPECIAL_SYSCALL() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileExit(m_CompilePC,(DWORD)-1,m_RegWorkingSet,CExitInfo::DoSysCall,TRUE,NULL); m_Section->CompileExit(m_CompilePC,(DWORD)-1,m_RegWorkingSet,CExitInfo::DoSysCall,TRUE,NULL);
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
} }
void CRecompilerOps::SPECIAL_MFLO (void) { void CRecompilerOps::SPECIAL_MFLO() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -2023,7 +2023,7 @@ void CRecompilerOps::SPECIAL_MFLO (void) {
MoveVariableToX86reg(&_RegLO->UW[1],"_RegLO->UW[1]",GetMipsRegMapHi(m_Opcode.rd)); MoveVariableToX86reg(&_RegLO->UW[1],"_RegLO->UW[1]",GetMipsRegMapHi(m_Opcode.rd));
} }
void CRecompilerOps::SPECIAL_MTLO (void) { void CRecompilerOps::SPECIAL_MTLO() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsKnown(m_Opcode.rs) && IsConst(m_Opcode.rs)) { if (IsKnown(m_Opcode.rs) && IsConst(m_Opcode.rs)) {
@ -2051,7 +2051,7 @@ void CRecompilerOps::SPECIAL_MTLO (void) {
} }
} }
void CRecompilerOps::SPECIAL_MFHI (void) { void CRecompilerOps::SPECIAL_MFHI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -2060,7 +2060,7 @@ void CRecompilerOps::SPECIAL_MFHI (void) {
MoveVariableToX86reg(&_RegHI->UW[1],"_RegHI->UW[1]",GetMipsRegMapHi(m_Opcode.rd)); MoveVariableToX86reg(&_RegHI->UW[1],"_RegHI->UW[1]",GetMipsRegMapHi(m_Opcode.rd));
} }
void CRecompilerOps::SPECIAL_MTHI (void) { void CRecompilerOps::SPECIAL_MTHI() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsKnown(m_Opcode.rs) && IsConst(m_Opcode.rs)) { if (IsKnown(m_Opcode.rs) && IsConst(m_Opcode.rs)) {
@ -2088,7 +2088,7 @@ void CRecompilerOps::SPECIAL_MTHI (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSLLV (void) { void CRecompilerOps::SPECIAL_DSLLV() {
BYTE * Jump[2]; BYTE * Jump[2];
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2126,7 +2126,7 @@ void CRecompilerOps::SPECIAL_DSLLV (void) {
SetJump8(Jump[1],m_RecompPos); SetJump8(Jump[1],m_RecompPos);
} }
void CRecompilerOps::SPECIAL_DSRLV (void) { void CRecompilerOps::SPECIAL_DSRLV() {
BYTE * Jump[2]; BYTE * Jump[2];
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2194,7 +2194,7 @@ void CRecompilerOps::SPECIAL_DSRLV (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSRAV (void) void CRecompilerOps::SPECIAL_DSRAV()
{ {
BYTE * Jump[2]; BYTE * Jump[2];
@ -2233,7 +2233,7 @@ void CRecompilerOps::SPECIAL_DSRAV (void)
SetJump8(Jump[1],m_RecompPos); SetJump8(Jump[1],m_RecompPos);
} }
void CRecompilerOps::SPECIAL_MULT ( void) { void CRecompilerOps::SPECIAL_MULT() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_RegWorkingSet.SetX86Protected(x86_EDX,TRUE); m_RegWorkingSet.SetX86Protected(x86_EDX,TRUE);
@ -2251,7 +2251,7 @@ void CRecompilerOps::SPECIAL_MULT ( void) {
MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]"); MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]");
} }
void CRecompilerOps::SPECIAL_MULTU (void) { void CRecompilerOps::SPECIAL_MULTU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_RegWorkingSet.SetX86Protected(x86_EDX, TRUE); m_RegWorkingSet.SetX86Protected(x86_EDX, TRUE);
@ -2269,7 +2269,7 @@ void CRecompilerOps::SPECIAL_MULTU (void) {
MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]"); MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]");
} }
void CRecompilerOps::SPECIAL_DIV (void) void CRecompilerOps::SPECIAL_DIV()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2317,7 +2317,7 @@ void CRecompilerOps::SPECIAL_DIV (void)
MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]"); MoveX86regToVariable(x86_EDX,&_RegHI->UW[1],"_RegHI->UW[1]");
} }
void CRecompilerOps::SPECIAL_DIVU ( void) { void CRecompilerOps::SPECIAL_DIVU() {
BYTE *Jump[2]; BYTE *Jump[2];
x86Reg Reg; x86Reg Reg;
@ -2384,7 +2384,7 @@ void CRecompilerOps::SPECIAL_DIVU ( void) {
} }
} }
void CRecompilerOps::SPECIAL_DMULT (void) void CRecompilerOps::SPECIAL_DMULT()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2396,7 +2396,7 @@ void CRecompilerOps::SPECIAL_DMULT (void)
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CRecompilerOps::SPECIAL_DMULTU (void) { void CRecompilerOps::SPECIAL_DMULTU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
UnMap_GPR(m_Opcode.rs,TRUE); UnMap_GPR(m_Opcode.rs,TRUE);
@ -2474,7 +2474,7 @@ void CRecompilerOps::SPECIAL_DMULTU (void) {
#endif #endif
} }
void CRecompilerOps::SPECIAL_DDIV (void) { void CRecompilerOps::SPECIAL_DDIV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
UnMap_GPR(m_Opcode.rs,TRUE); UnMap_GPR(m_Opcode.rs,TRUE);
@ -2485,7 +2485,7 @@ void CRecompilerOps::SPECIAL_DDIV (void) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CRecompilerOps::SPECIAL_DDIVU (void) void CRecompilerOps::SPECIAL_DDIVU()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2497,7 +2497,7 @@ void CRecompilerOps::SPECIAL_DDIVU (void)
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void CRecompilerOps::SPECIAL_ADD (void) { void CRecompilerOps::SPECIAL_ADD() {
int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs; int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs;
int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt; int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt;
@ -2526,7 +2526,7 @@ void CRecompilerOps::SPECIAL_ADD (void) {
} }
} }
void CRecompilerOps::SPECIAL_ADDU (void) { void CRecompilerOps::SPECIAL_ADDU() {
int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs; int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs;
int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt; int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt;
@ -2555,7 +2555,7 @@ void CRecompilerOps::SPECIAL_ADDU (void) {
} }
} }
void CRecompilerOps::SPECIAL_SUB (void) { void CRecompilerOps::SPECIAL_SUB() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -2586,7 +2586,7 @@ void CRecompilerOps::SPECIAL_SUB (void) {
} }
} }
void CRecompilerOps::SPECIAL_SUBU (void) { void CRecompilerOps::SPECIAL_SUBU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -2618,7 +2618,7 @@ void CRecompilerOps::SPECIAL_SUBU (void) {
} }
} }
void CRecompilerOps::SPECIAL_AND (void) void CRecompilerOps::SPECIAL_AND()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -2757,7 +2757,7 @@ void CRecompilerOps::SPECIAL_AND (void)
} }
} }
void CRecompilerOps::SPECIAL_OR (void) { void CRecompilerOps::SPECIAL_OR() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) { if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
@ -2875,7 +2875,7 @@ void CRecompilerOps::SPECIAL_OR (void) {
} }
} }
void CRecompilerOps::SPECIAL_XOR (void) { void CRecompilerOps::SPECIAL_XOR() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -2985,7 +2985,7 @@ void CRecompilerOps::SPECIAL_XOR (void) {
} }
} }
void CRecompilerOps::SPECIAL_NOR (void) { void CRecompilerOps::SPECIAL_NOR() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) { if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
@ -3107,7 +3107,7 @@ void CRecompilerOps::SPECIAL_NOR (void) {
} }
} }
void CRecompilerOps::SPECIAL_SLT (void) { void CRecompilerOps::SPECIAL_SLT() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3340,7 +3340,7 @@ void CRecompilerOps::SPECIAL_SLT (void) {
} }
} }
void CRecompilerOps::SPECIAL_SLTU (void) { void CRecompilerOps::SPECIAL_SLTU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3556,7 +3556,7 @@ void CRecompilerOps::SPECIAL_SLTU (void) {
} }
} }
void CRecompilerOps::SPECIAL_DADD (void) { void CRecompilerOps::SPECIAL_DADD() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3593,7 +3593,7 @@ void CRecompilerOps::SPECIAL_DADD (void) {
} }
} }
void CRecompilerOps::SPECIAL_DADDU (void) { void CRecompilerOps::SPECIAL_DADDU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3629,7 +3629,7 @@ void CRecompilerOps::SPECIAL_DADDU (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSUB (void) { void CRecompilerOps::SPECIAL_DSUB() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3672,7 +3672,7 @@ void CRecompilerOps::SPECIAL_DSUB (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSUBU (void) { void CRecompilerOps::SPECIAL_DSUBU() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3714,7 +3714,7 @@ void CRecompilerOps::SPECIAL_DSUBU (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSLL (void) { void CRecompilerOps::SPECIAL_DSLL() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3740,7 +3740,7 @@ void CRecompilerOps::SPECIAL_DSLL (void) {
ShiftLeftSignImmed( GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa); ShiftLeftSignImmed( GetMipsRegMapLo(m_Opcode.rd),(BYTE)m_Opcode.sa);
} }
void CRecompilerOps::SPECIAL_DSRL (void) { void CRecompilerOps::SPECIAL_DSRL() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3764,7 +3764,7 @@ void CRecompilerOps::SPECIAL_DSRL (void) {
ShiftRightUnsignImmed(GetMipsRegMapHi(m_Opcode.rd),(BYTE)m_Opcode.sa); ShiftRightUnsignImmed(GetMipsRegMapHi(m_Opcode.rd),(BYTE)m_Opcode.sa);
} }
void CRecompilerOps::SPECIAL_DSRA (void) { void CRecompilerOps::SPECIAL_DSRA() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3788,7 +3788,7 @@ void CRecompilerOps::SPECIAL_DSRA (void) {
ShiftRightSignImmed(GetMipsRegMapHi(m_Opcode.rd),(BYTE)m_Opcode.sa); ShiftRightSignImmed(GetMipsRegMapHi(m_Opcode.rd),(BYTE)m_Opcode.sa);
} }
void CRecompilerOps::SPECIAL_DSLL32 (void) { void CRecompilerOps::SPECIAL_DSLL32() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; } if (m_Opcode.rd == 0) { return; }
@ -3829,7 +3829,7 @@ void CRecompilerOps::SPECIAL_DSLL32 (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSRL32 (void) { void CRecompilerOps::SPECIAL_DSRL32() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsConst(m_Opcode.rt)) { if (IsConst(m_Opcode.rt)) {
@ -3864,7 +3864,7 @@ void CRecompilerOps::SPECIAL_DSRL32 (void) {
} }
} }
void CRecompilerOps::SPECIAL_DSRA32 (void) { void CRecompilerOps::SPECIAL_DSRA32() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (IsConst(m_Opcode.rt)) { if (IsConst(m_Opcode.rt)) {
@ -3917,7 +3917,7 @@ void CRecompilerOps::COP0_MF(void) {
MoveVariableToX86reg(&_CP0[m_Opcode.rd],CRegName::Cop0[m_Opcode.rd],GetMipsRegMapLo(m_Opcode.rt)); MoveVariableToX86reg(&_CP0[m_Opcode.rd],CRegName::Cop0[m_Opcode.rd],GetMipsRegMapLo(m_Opcode.rt));
} }
void CRecompilerOps::COP0_MT (void) { void CRecompilerOps::COP0_MT() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
BYTE *Jump; BYTE *Jump;
@ -4107,7 +4107,7 @@ void CRecompilerOps::COP0_CO_TLBP( void) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
} }
void compiler_COP0_CO_ERET (void) { void compiler_COP0_CO_ERET() {
if ((g_Reg->STATUS_REGISTER & STATUS_ERL) != 0) { if ((g_Reg->STATUS_REGISTER & STATUS_ERL) != 0) {
g_Reg->m_PROGRAM_COUNTER = g_Reg->ERROREPC_REGISTER; g_Reg->m_PROGRAM_COUNTER = g_Reg->ERROREPC_REGISTER;
g_Reg->STATUS_REGISTER &= ~STATUS_ERL; g_Reg->STATUS_REGISTER &= ~STATUS_ERL;
@ -4131,7 +4131,7 @@ void CRecompilerOps::COP0_CO_ERET( void) {
} }
/************************** FPU Options **************************/ /************************** FPU Options **************************/
void CRecompilerOps::ChangeDefaultRoundingModel (void) { void CRecompilerOps::ChangeDefaultRoundingModel() {
switch((_FPCR[31] & 3)) { switch((_FPCR[31] & 3)) {
case 0: *_RoundingModel = ROUND_NEAR; break; case 0: *_RoundingModel = ROUND_NEAR; break;
case 1: *_RoundingModel = ROUND_CHOP; break; case 1: *_RoundingModel = ROUND_CHOP; break;
@ -4141,7 +4141,7 @@ void CRecompilerOps::ChangeDefaultRoundingModel (void) {
} }
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
void CRecompilerOps::COP1_MF (void) { void CRecompilerOps::COP1_MF() {
x86Reg TempReg; x86Reg TempReg;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -4156,7 +4156,7 @@ void CRecompilerOps::COP1_MF (void) {
MoveX86PointerToX86reg(GetMipsRegMapLo(m_Opcode.rt),TempReg); MoveX86PointerToX86reg(GetMipsRegMapLo(m_Opcode.rt),TempReg);
} }
void CRecompilerOps::COP1_DMF (void) { void CRecompilerOps::COP1_DMF() {
x86Reg TempReg; x86Reg TempReg;
char Name[50]; char Name[50];
@ -4272,7 +4272,7 @@ void CRecompilerOps::COP1_CT(void) {
} }
/************************** COP1: S functions ************************/ /************************** COP1: S functions ************************/
void CRecompilerOps::COP1_S_ADD (void) { void CRecompilerOps::COP1_S_ADD() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
@ -4298,7 +4298,7 @@ void CRecompilerOps::COP1_S_ADD (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_SUB (void) { void CRecompilerOps::COP1_S_SUB() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4334,7 +4334,7 @@ void CRecompilerOps::COP1_S_SUB (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_MUL (void) { void CRecompilerOps::COP1_S_MUL() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4360,7 +4360,7 @@ void CRecompilerOps::COP1_S_MUL (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_DIV (void) { void CRecompilerOps::COP1_S_DIV() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4397,7 +4397,7 @@ void CRecompilerOps::COP1_S_DIV (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_ABS (void) { void CRecompilerOps::COP1_S_ABS() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
FixRoundModel(CRegInfo::RoundDefault); FixRoundModel(CRegInfo::RoundDefault);
@ -4406,7 +4406,7 @@ void CRecompilerOps::COP1_S_ABS (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_NEG (void) { void CRecompilerOps::COP1_S_NEG() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
FixRoundModel(CRegInfo::RoundDefault); FixRoundModel(CRegInfo::RoundDefault);
@ -4415,7 +4415,7 @@ void CRecompilerOps::COP1_S_NEG (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_SQRT (void) { void CRecompilerOps::COP1_S_SQRT() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
FixRoundModel(CRegInfo::RoundDefault); FixRoundModel(CRegInfo::RoundDefault);
@ -4424,14 +4424,14 @@ void CRecompilerOps::COP1_S_SQRT (void) {
UnMap_FPR(m_Opcode.fd,TRUE); UnMap_FPR(m_Opcode.fd,TRUE);
} }
void CRecompilerOps::COP1_S_MOV (void) { void CRecompilerOps::COP1_S_MOV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
FixRoundModel(CRegInfo::RoundDefault); FixRoundModel(CRegInfo::RoundDefault);
Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Float); Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Float);
} }
void CRecompilerOps::COP1_S_TRUNC_L (void) { void CRecompilerOps::COP1_S_TRUNC_L() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4441,7 +4441,7 @@ void CRecompilerOps::COP1_S_TRUNC_L (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundTruncate); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundTruncate);
} }
void CRecompilerOps::COP1_S_CEIL_L (void) { //added by Witten void CRecompilerOps::COP1_S_CEIL_L() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4451,7 +4451,7 @@ void CRecompilerOps::COP1_S_CEIL_L (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundUp); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundUp);
} }
void CRecompilerOps::COP1_S_FLOOR_L (void) { //added by Witten void CRecompilerOps::COP1_S_FLOOR_L() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4461,7 +4461,7 @@ void CRecompilerOps::COP1_S_FLOOR_L (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundDown); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundDown);
} }
void CRecompilerOps::COP1_S_ROUND_W (void) void CRecompilerOps::COP1_S_ROUND_W()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -4472,7 +4472,7 @@ void CRecompilerOps::COP1_S_ROUND_W (void)
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundNearest); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundNearest);
} }
void CRecompilerOps::COP1_S_TRUNC_W (void) { void CRecompilerOps::COP1_S_TRUNC_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4482,7 +4482,7 @@ void CRecompilerOps::COP1_S_TRUNC_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundTruncate); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundTruncate);
} }
void CRecompilerOps::COP1_S_CEIL_W (void) { // added by Witten void CRecompilerOps::COP1_S_CEIL_W() { // added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4492,7 +4492,7 @@ void CRecompilerOps::COP1_S_CEIL_W (void) { // added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundUp); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundUp);
} }
void CRecompilerOps::COP1_S_FLOOR_W (void) { void CRecompilerOps::COP1_S_FLOOR_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4502,7 +4502,7 @@ void CRecompilerOps::COP1_S_FLOOR_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundDown); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundDown);
} }
void CRecompilerOps::COP1_S_CVT_D (void) void CRecompilerOps::COP1_S_CVT_D()
{ {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
@ -4513,7 +4513,7 @@ void CRecompilerOps::COP1_S_CVT_D (void)
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Double,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Double,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_S_CVT_W (void) { void CRecompilerOps::COP1_S_CVT_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4523,7 +4523,7 @@ void CRecompilerOps::COP1_S_CVT_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_S_CVT_L (void) { void CRecompilerOps::COP1_S_CVT_L() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4533,7 +4533,7 @@ void CRecompilerOps::COP1_S_CVT_L (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_S_CMP (void) { void CRecompilerOps::COP1_S_CMP() {
DWORD Reg1 = m_Opcode.fs; DWORD Reg1 = m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft; DWORD Reg2 = m_Opcode.ft;
DWORD cmp = 0; DWORD cmp = 0;
@ -4593,7 +4593,7 @@ void CRecompilerOps::COP1_S_CMP (void) {
} }
/************************** COP1: D functions ************************/ /************************** COP1: D functions ************************/
void CRecompilerOps::COP1_D_ADD (void) { void CRecompilerOps::COP1_D_ADD() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
char Name[50]; char Name[50];
@ -4617,7 +4617,7 @@ void CRecompilerOps::COP1_D_ADD (void) {
} }
} }
void CRecompilerOps::COP1_D_SUB (void) { void CRecompilerOps::COP1_D_SUB() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4650,7 +4650,7 @@ void CRecompilerOps::COP1_D_SUB (void) {
} }
} }
void CRecompilerOps::COP1_D_MUL (void) { void CRecompilerOps::COP1_D_MUL() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4674,7 +4674,7 @@ void CRecompilerOps::COP1_D_MUL (void) {
} }
} }
void CRecompilerOps::COP1_D_DIV (void) { void CRecompilerOps::COP1_D_DIV() {
DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs; DWORD Reg1 = m_Opcode.ft == m_Opcode.fd?m_Opcode.ft:m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft; DWORD Reg2 = m_Opcode.ft == m_Opcode.fd?m_Opcode.fs:m_Opcode.ft;
x86Reg TempReg; x86Reg TempReg;
@ -4706,30 +4706,30 @@ void CRecompilerOps::COP1_D_DIV (void) {
} }
} }
void CRecompilerOps::COP1_D_ABS (void) { void CRecompilerOps::COP1_D_ABS() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double);
fpuAbs(); fpuAbs();
} }
void CRecompilerOps::COP1_D_NEG (void) { void CRecompilerOps::COP1_D_NEG() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double);
fpuNeg(); fpuNeg();
} }
void CRecompilerOps::COP1_D_SQRT (void) { void CRecompilerOps::COP1_D_SQRT() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double);
fpuSqrt(); fpuSqrt();
} }
void CRecompilerOps::COP1_D_MOV (void) { void CRecompilerOps::COP1_D_MOV() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double);
} }
void CRecompilerOps::COP1_D_TRUNC_L (void) { //added by Witten void CRecompilerOps::COP1_D_TRUNC_L() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4742,7 +4742,7 @@ void CRecompilerOps::COP1_D_TRUNC_L (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundTruncate); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundTruncate);
} }
void CRecompilerOps::COP1_D_CEIL_L (void) { //added by Witten void CRecompilerOps::COP1_D_CEIL_L() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4755,7 +4755,7 @@ void CRecompilerOps::COP1_D_CEIL_L (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundUp); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundUp);
} }
void CRecompilerOps::COP1_D_FLOOR_L (void) { //added by Witten void CRecompilerOps::COP1_D_FLOOR_L() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4768,7 +4768,7 @@ void CRecompilerOps::COP1_D_FLOOR_L (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDown); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDown);
} }
void CRecompilerOps::COP1_D_ROUND_W (void) { void CRecompilerOps::COP1_D_ROUND_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4781,7 +4781,7 @@ void CRecompilerOps::COP1_D_ROUND_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundNearest); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundNearest);
} }
void CRecompilerOps::COP1_D_TRUNC_W (void) { void CRecompilerOps::COP1_D_TRUNC_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4794,7 +4794,7 @@ void CRecompilerOps::COP1_D_TRUNC_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundTruncate); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundTruncate);
} }
void CRecompilerOps::COP1_D_CEIL_W (void) { // added by Witten void CRecompilerOps::COP1_D_CEIL_W() { // added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4807,7 +4807,7 @@ void CRecompilerOps::COP1_D_CEIL_W (void) { // added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundUp); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundUp);
} }
void CRecompilerOps::COP1_D_FLOOR_W (void) { //added by Witten void CRecompilerOps::COP1_D_FLOOR_W() { //added by Witten
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4820,7 +4820,7 @@ void CRecompilerOps::COP1_D_FLOOR_W (void) { //added by Witten
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundDown); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundDown);
} }
void CRecompilerOps::COP1_D_CVT_S (void) { void CRecompilerOps::COP1_D_CVT_S() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4833,7 +4833,7 @@ void CRecompilerOps::COP1_D_CVT_S (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Float,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Float,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_D_CVT_W (void) { void CRecompilerOps::COP1_D_CVT_W() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4846,7 +4846,7 @@ void CRecompilerOps::COP1_D_CVT_W (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_D_CVT_L (void) { void CRecompilerOps::COP1_D_CVT_L() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4859,7 +4859,7 @@ void CRecompilerOps::COP1_D_CVT_L (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_D_CMP (void) { void CRecompilerOps::COP1_D_CMP() {
DWORD Reg1 = m_Opcode.fs; DWORD Reg1 = m_Opcode.fs;
DWORD Reg2 = m_Opcode.ft; DWORD Reg2 = m_Opcode.ft;
DWORD cmp = 0; DWORD cmp = 0;
@ -4917,7 +4917,7 @@ void CRecompilerOps::COP1_D_CMP (void) {
} }
/************************** COP1: W functions ************************/ /************************** COP1: W functions ************************/
void CRecompilerOps::COP1_W_CVT_S (void) { void CRecompilerOps::COP1_W_CVT_S() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4927,7 +4927,7 @@ void CRecompilerOps::COP1_W_CVT_S (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Dword,CRegInfo::FPU_Float,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Dword,CRegInfo::FPU_Float,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_W_CVT_D (void) { void CRecompilerOps::COP1_W_CVT_D() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4938,7 +4938,7 @@ void CRecompilerOps::COP1_W_CVT_D (void) {
} }
/************************** COP1: L functions ************************/ /************************** COP1: L functions ************************/
void CRecompilerOps::COP1_L_CVT_S (void) { void CRecompilerOps::COP1_L_CVT_S() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4948,7 +4948,7 @@ void CRecompilerOps::COP1_L_CVT_S (void) {
ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Qword,CRegInfo::FPU_Float,CRegInfo::RoundDefault); ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Qword,CRegInfo::FPU_Float,CRegInfo::RoundDefault);
} }
void CRecompilerOps::COP1_L_CVT_D (void) { void CRecompilerOps::COP1_L_CVT_D() {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileCop1Test(); m_Section->CompileCop1Test();
@ -4959,7 +4959,7 @@ void CRecompilerOps::COP1_L_CVT_D (void) {
} }
/************************** Other functions **************************/ /************************** Other functions **************************/
void CRecompilerOps::UnknownOpcode (void) { void CRecompilerOps::UnknownOpcode() {
CPU_Message(" %X Unhandled Opcode: %s",m_CompilePC, R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); CPU_Message(" %X Unhandled Opcode: %s",m_CompilePC, R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_RegWorkingSet.WriteBackRegisters(); m_RegWorkingSet.WriteBackRegisters();
@ -4989,7 +4989,7 @@ void CRecompilerOps::AfterCallDirect ( CRegInfo & RegSet )
RegSet.SetRoundingModel(CRegInfo::RoundUnknown); RegSet.SetRoundingModel(CRegInfo::RoundUnknown);
} }
void CRecompilerOps::EnterCodeBlock ( void ) void CRecompilerOps::EnterCodeBlock()
{ {
#ifdef _DEBUG #ifdef _DEBUG
Push(x86_ESI); Push(x86_ESI);
@ -5000,7 +5000,7 @@ void CRecompilerOps::EnterCodeBlock ( void )
#endif #endif
} }
void CRecompilerOps::ExitCodeBlock ( void ) void CRecompilerOps::ExitCodeBlock()
{ {
#ifdef _DEBUG #ifdef _DEBUG
Pop(x86_ESI); Pop(x86_ESI);

View File

@ -30,186 +30,186 @@ protected:
/************************** Branch functions ************************/ /************************** Branch functions ************************/
static void Compile_Branch ( BranchFunction CompareFunc, BRANCH_TYPE BranchType, BOOL Link); static void Compile_Branch ( BranchFunction CompareFunc, BRANCH_TYPE BranchType, BOOL Link);
static void Compile_BranchLikely ( BranchFunction CompareFunc, BOOL Link); static void Compile_BranchLikely ( BranchFunction CompareFunc, BOOL Link);
static void BNE_Compare ( void ); static void BNE_Compare();
static void BEQ_Compare ( void ); static void BEQ_Compare();
static void BGTZ_Compare ( void ); static void BGTZ_Compare();
static void BLEZ_Compare ( void ); static void BLEZ_Compare();
static void BLTZ_Compare ( void ); static void BLTZ_Compare();
static void BGEZ_Compare ( void ); static void BGEZ_Compare();
static void COP1_BCF_Compare ( void ); static void COP1_BCF_Compare();
static void COP1_BCT_Compare ( void ); static void COP1_BCT_Compare();
/************************* OpCode functions *************************/ /************************* OpCode functions *************************/
static void J ( void ); static void J ();
static void JAL ( void ); static void JAL ();
static void ADDI ( void ); static void ADDI ();
static void ADDIU ( void ); static void ADDIU ();
static void SLTI ( void ); static void SLTI ();
static void SLTIU ( void ); static void SLTIU ();
static void ANDI ( void ); static void ANDI ();
static void ORI ( void ); static void ORI ();
static void XORI ( void ); static void XORI ();
static void LUI ( void ); static void LUI ();
static void DADDIU ( void ); static void DADDIU ();
// static void LDL ( void ); // static void LDL ();
// static void LDR ( void ); // static void LDR ();
// static void LB ( void ); // static void LB ();
// static void LH ( void ); // static void LH ();
// static void LWL ( void ); // static void LWL ();
// static void LW ( void ); // static void LW ();
// static void LBU ( void ); // static void LBU ();
// static void LHU ( void ); // static void LHU ();
// static void LWR ( void ); // static void LWR ();
// static void LWU ( void ); //added by Witten // static void LWU (); //added by Witten
// static void SB ( void ); // static void SB ();
// static void SH ( void ); // static void SH ();
// static void SWL ( void ); // static void SWL ();
// static void SW ( void ); // static void SW ();
// static void SWR ( void ); // static void SWR ();
// static void SDL ( void ); // static void SDL ();
// static void SDR ( void ); // static void SDR ();
static void CACHE ( void ); static void CACHE ();
// static void LL ( void ); // static void LL ();
// static void LWC1 ( void ); // static void LWC1 ();
// static void LDC1 ( void ); // static void LDC1 ();
// static void LD ( void ); // static void LD ();
// static void SC ( void ); // static void SC ();
// static void SWC1 ( void ); // static void SWC1 ();
// static void SDC1 ( void ); // static void SDC1 ();
// static void SD ( void ); // static void SD ();
/********************** R4300i OpCodes: Special **********************/ /********************** R4300i OpCodes: Special **********************/
static void SPECIAL_SLL ( void ); static void SPECIAL_SLL ();
static void SPECIAL_SRL ( void ); static void SPECIAL_SRL ();
static void SPECIAL_SRA ( void ); static void SPECIAL_SRA ();
static void SPECIAL_SLLV ( void ); static void SPECIAL_SLLV ();
static void SPECIAL_SRLV ( void ); static void SPECIAL_SRLV ();
static void SPECIAL_SRAV ( void ); static void SPECIAL_SRAV ();
static void SPECIAL_JR ( void ); static void SPECIAL_JR ();
static void SPECIAL_JALR ( void ); static void SPECIAL_JALR ();
static void SPECIAL_SYSCALL( void ); static void SPECIAL_SYSCALL();
static void SPECIAL_MFLO ( void ); static void SPECIAL_MFLO ();
static void SPECIAL_MTLO ( void ); static void SPECIAL_MTLO ();
static void SPECIAL_MFHI ( void ); static void SPECIAL_MFHI ();
static void SPECIAL_MTHI ( void ); static void SPECIAL_MTHI ();
static void SPECIAL_DSLLV ( void ); static void SPECIAL_DSLLV ();
static void SPECIAL_DSRLV ( void ); static void SPECIAL_DSRLV ();
static void SPECIAL_DSRAV ( void ); static void SPECIAL_DSRAV ();
static void SPECIAL_MULT ( void ); static void SPECIAL_MULT ();
static void SPECIAL_MULTU ( void ); static void SPECIAL_MULTU ();
static void SPECIAL_DIV ( void ); static void SPECIAL_DIV ();
static void SPECIAL_DIVU ( void ); static void SPECIAL_DIVU ();
static void SPECIAL_DMULT ( void ); static void SPECIAL_DMULT ();
static void SPECIAL_DMULTU ( void ); static void SPECIAL_DMULTU ();
static void SPECIAL_DDIV ( void ); static void SPECIAL_DDIV ();
static void SPECIAL_DDIVU ( void ); static void SPECIAL_DDIVU ();
static void SPECIAL_ADD ( void ); static void SPECIAL_ADD ();
static void SPECIAL_ADDU ( void ); static void SPECIAL_ADDU ();
static void SPECIAL_SUB ( void ); static void SPECIAL_SUB ();
static void SPECIAL_SUBU ( void ); static void SPECIAL_SUBU ();
static void SPECIAL_AND ( void ); static void SPECIAL_AND ();
static void SPECIAL_OR ( void ); static void SPECIAL_OR ();
static void SPECIAL_XOR ( void ); static void SPECIAL_XOR ();
static void SPECIAL_NOR ( void ); static void SPECIAL_NOR ();
static void SPECIAL_SLT ( void ); static void SPECIAL_SLT ();
static void SPECIAL_SLTU ( void ); static void SPECIAL_SLTU ();
static void SPECIAL_DADD ( void ); static void SPECIAL_DADD ();
static void SPECIAL_DADDU ( void ); static void SPECIAL_DADDU ();
static void SPECIAL_DSUB ( void ); static void SPECIAL_DSUB ();
static void SPECIAL_DSUBU ( void ); static void SPECIAL_DSUBU ();
static void SPECIAL_DSLL ( void ); static void SPECIAL_DSLL ();
static void SPECIAL_DSRL ( void ); static void SPECIAL_DSRL ();
static void SPECIAL_DSRA ( void ); static void SPECIAL_DSRA ();
static void SPECIAL_DSLL32 ( void ); static void SPECIAL_DSLL32 ();
static void SPECIAL_DSRL32 ( void ); static void SPECIAL_DSRL32 ();
static void SPECIAL_DSRA32 ( void ); static void SPECIAL_DSRA32 ();
/************************** COP0 functions **************************/ /************************** COP0 functions **************************/
static void COP0_MF ( void ); static void COP0_MF ();
static void COP0_MT ( void ); static void COP0_MT ();
/************************** COP0 CO functions ***********************/ /************************** COP0 CO functions ***********************/
static void COP0_CO_TLBR ( void ); static void COP0_CO_TLBR ();
static void COP0_CO_TLBWI ( void ); static void COP0_CO_TLBWI ();
static void COP0_CO_TLBWR ( void ); static void COP0_CO_TLBWR ();
static void COP0_CO_TLBP ( void ); static void COP0_CO_TLBP ();
static void COP0_CO_ERET ( void ); static void COP0_CO_ERET ();
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
static void COP1_MF ( void ); static void COP1_MF ();
static void COP1_DMF ( void ); static void COP1_DMF ();
static void COP1_CF ( void ); static void COP1_CF ();
static void COP1_MT ( void ); static void COP1_MT ();
static void COP1_DMT ( void ); static void COP1_DMT ();
static void COP1_CT ( void ); static void COP1_CT ();
/************************** COP1: S functions ************************/ /************************** COP1: S functions ************************/
static void COP1_S_ADD ( void ); static void COP1_S_ADD ();
static void COP1_S_SUB ( void ); static void COP1_S_SUB ();
static void COP1_S_MUL ( void ); static void COP1_S_MUL ();
static void COP1_S_DIV ( void ); static void COP1_S_DIV ();
static void COP1_S_ABS ( void ); static void COP1_S_ABS ();
static void COP1_S_NEG ( void ); static void COP1_S_NEG ();
static void COP1_S_SQRT ( void ); static void COP1_S_SQRT ();
static void COP1_S_MOV ( void ); static void COP1_S_MOV ();
static void COP1_S_TRUNC_L ( void ); static void COP1_S_TRUNC_L ();
static void COP1_S_CEIL_L ( void ); //added by Witten static void COP1_S_CEIL_L (); //added by Witten
static void COP1_S_FLOOR_L ( void ); //added by Witten static void COP1_S_FLOOR_L (); //added by Witten
static void COP1_S_ROUND_W ( void ); static void COP1_S_ROUND_W ();
static void COP1_S_TRUNC_W ( void ); static void COP1_S_TRUNC_W ();
static void COP1_S_CEIL_W ( void ); //added by Witten static void COP1_S_CEIL_W (); //added by Witten
static void COP1_S_FLOOR_W ( void ); static void COP1_S_FLOOR_W ();
static void COP1_S_CVT_D ( void ); static void COP1_S_CVT_D ();
static void COP1_S_CVT_W ( void ); static void COP1_S_CVT_W ();
static void COP1_S_CVT_L ( void ); static void COP1_S_CVT_L ();
static void COP1_S_CMP ( void ); static void COP1_S_CMP ();
/************************** COP1: D functions ************************/ /************************** COP1: D functions ************************/
static void COP1_D_ADD ( void ); static void COP1_D_ADD ();
static void COP1_D_SUB ( void ); static void COP1_D_SUB ();
static void COP1_D_MUL ( void ); static void COP1_D_MUL ();
static void COP1_D_DIV ( void ); static void COP1_D_DIV ();
static void COP1_D_ABS ( void ); static void COP1_D_ABS ();
static void COP1_D_NEG ( void ); static void COP1_D_NEG ();
static void COP1_D_SQRT ( void ); static void COP1_D_SQRT ();
static void COP1_D_MOV ( void ); static void COP1_D_MOV ();
static void COP1_D_TRUNC_L ( void ); //added by Witten static void COP1_D_TRUNC_L (); //added by Witten
static void COP1_D_CEIL_L ( void ); //added by Witten static void COP1_D_CEIL_L (); //added by Witten
static void COP1_D_FLOOR_L ( void ); //added by Witten static void COP1_D_FLOOR_L (); //added by Witten
static void COP1_D_ROUND_W ( void ); static void COP1_D_ROUND_W ();
static void COP1_D_TRUNC_W ( void ); static void COP1_D_TRUNC_W ();
static void COP1_D_CEIL_W ( void ); //added by Witten static void COP1_D_CEIL_W (); //added by Witten
static void COP1_D_FLOOR_W ( void ); //added by Witten static void COP1_D_FLOOR_W (); //added by Witten
static void COP1_D_CVT_S ( void ); static void COP1_D_CVT_S ();
static void COP1_D_CVT_W ( void ); static void COP1_D_CVT_W ();
static void COP1_D_CVT_L ( void ); static void COP1_D_CVT_L ();
static void COP1_D_CMP ( void ); static void COP1_D_CMP ();
/************************** COP1: W functions ************************/ /************************** COP1: W functions ************************/
static void COP1_W_CVT_S ( void ); static void COP1_W_CVT_S ();
static void COP1_W_CVT_D ( void ); static void COP1_W_CVT_D ();
/************************** COP1: L functions ************************/ /************************** COP1: L functions ************************/
static void COP1_L_CVT_S ( void ); static void COP1_L_CVT_S ();
static void COP1_L_CVT_D ( void ); static void COP1_L_CVT_D ();
/************************** Other functions **************************/ /************************** Other functions **************************/
static void UnknownOpcode ( void ); static void UnknownOpcode ();
static void BeforeCallDirect ( CRegInfo & RegSet ); static void BeforeCallDirect(CRegInfo & RegSet);
static void AfterCallDirect ( CRegInfo & RegSet ); static void AfterCallDirect(CRegInfo & RegSet);
static void EnterCodeBlock ( void ); static void EnterCodeBlock();
static void ExitCodeBlock ( void ); static void ExitCodeBlock();
static void CompileReadTLBMiss (DWORD VirtualAddress, x86Reg LookUpReg ); static void CompileReadTLBMiss(DWORD VirtualAddress, x86Reg LookUpReg);
static void CompileReadTLBMiss (x86Reg AddressReg, x86Reg LookUpReg ); static void CompileReadTLBMiss(x86Reg AddressReg, x86Reg LookUpReg);
static void CompileWriteTLBMiss (DWORD VirtualAddress, x86Reg LookUpReg ); static void CompileWriteTLBMiss(DWORD VirtualAddress, x86Reg LookUpReg);
static void CompileWriteTLBMiss (x86Reg AddressReg, x86Reg LookUpReg ); static void CompileWriteTLBMiss(x86Reg AddressReg, x86Reg LookUpReg);
static void UpdateSyncCPU (CRegInfo & RegSet, DWORD Cycles); static void UpdateSyncCPU(CRegInfo & RegSet, DWORD Cycles);
static void UpdateCounters (CRegInfo & RegSet, bool CheckTimer, bool ClearValues = false ); static void UpdateCounters(CRegInfo & RegSet, bool CheckTimer, bool ClearValues = false);
static void CompileSystemCheck ( DWORD TargetPC, const CRegInfo & RegSet ); static void CompileSystemCheck(DWORD TargetPC, const CRegInfo & RegSet);
static void ChangeDefaultRoundingModel ( void ); static void ChangeDefaultRoundingModel();
static void OverflowDelaySlot ( BOOL TestTimer ); static void OverflowDelaySlot(BOOL TestTimer);
@ -223,109 +223,109 @@ protected:
/********* Helper Functions *********/ /********* Helper Functions *********/
typedef CRegInfo::REG_STATE REG_STATE; typedef CRegInfo::REG_STATE REG_STATE;
static inline REG_STATE GetMipsRegState ( int Reg ) { return m_RegWorkingSet.GetMipsRegState(Reg); } static REG_STATE GetMipsRegState ( int Reg ) { return m_RegWorkingSet.GetMipsRegState(Reg); }
static inline unsigned __int64 GetMipsReg ( int Reg ) { return m_RegWorkingSet.GetMipsReg(Reg); } static unsigned __int64 GetMipsReg ( int Reg ) { return m_RegWorkingSet.GetMipsReg(Reg); }
static inline __int64 GetMipsReg_S ( int Reg ) { return m_RegWorkingSet.GetMipsReg_S(Reg); } static __int64 GetMipsReg_S ( int Reg ) { return m_RegWorkingSet.GetMipsReg_S(Reg); }
static inline DWORD GetMipsRegLo ( int Reg ) { return m_RegWorkingSet.GetMipsRegLo(Reg); } static DWORD GetMipsRegLo ( int Reg ) { return m_RegWorkingSet.GetMipsRegLo(Reg); }
static inline long GetMipsRegLo_S ( int Reg ) { return m_RegWorkingSet.GetMipsRegLo_S(Reg); } static long GetMipsRegLo_S ( int Reg ) { return m_RegWorkingSet.GetMipsRegLo_S(Reg); }
static inline DWORD GetMipsRegHi ( int Reg ) { return m_RegWorkingSet.GetMipsRegHi(Reg); } static DWORD GetMipsRegHi ( int Reg ) { return m_RegWorkingSet.GetMipsRegHi(Reg); }
static inline long GetMipsRegHi_S ( int Reg ) { return m_RegWorkingSet.GetMipsRegHi_S(Reg); } static long GetMipsRegHi_S ( int Reg ) { return m_RegWorkingSet.GetMipsRegHi_S(Reg); }
static inline CX86Ops::x86Reg GetMipsRegMapLo ( int Reg ) { return m_RegWorkingSet.GetMipsRegMapLo(Reg); } static CX86Ops::x86Reg GetMipsRegMapLo ( int Reg ) { return m_RegWorkingSet.GetMipsRegMapLo(Reg); }
static inline CX86Ops::x86Reg GetMipsRegMapHi ( int Reg ) { return m_RegWorkingSet.GetMipsRegMapHi(Reg); } static CX86Ops::x86Reg GetMipsRegMapHi ( int Reg ) { return m_RegWorkingSet.GetMipsRegMapHi(Reg); }
static inline bool IsKnown ( int Reg ) { return m_RegWorkingSet.IsKnown(Reg); } static bool IsKnown ( int Reg ) { return m_RegWorkingSet.IsKnown(Reg); }
static inline bool IsUnknown ( int Reg ) { return m_RegWorkingSet.IsUnknown(Reg); } static bool IsUnknown ( int Reg ) { return m_RegWorkingSet.IsUnknown(Reg); }
static inline bool IsMapped ( int Reg ) { return m_RegWorkingSet.IsMapped(Reg); } static bool IsMapped ( int Reg ) { return m_RegWorkingSet.IsMapped(Reg); }
static inline bool IsConst ( int Reg ) { return m_RegWorkingSet.IsConst(Reg); } static bool IsConst ( int Reg ) { return m_RegWorkingSet.IsConst(Reg); }
static inline bool IsSigned ( int Reg ) { return m_RegWorkingSet.IsSigned(Reg); } static bool IsSigned ( int Reg ) { return m_RegWorkingSet.IsSigned(Reg); }
static inline bool IsUnsigned ( int Reg ) { return m_RegWorkingSet.IsUnsigned(Reg); } static bool IsUnsigned ( int Reg ) { return m_RegWorkingSet.IsUnsigned(Reg); }
static inline bool Is32Bit ( int Reg ) { return m_RegWorkingSet.Is32Bit(Reg); } static bool Is32Bit ( int Reg ) { return m_RegWorkingSet.Is32Bit(Reg); }
static inline bool Is64Bit ( int Reg ) { return m_RegWorkingSet.Is64Bit(Reg); } static bool Is64Bit ( int Reg ) { return m_RegWorkingSet.Is64Bit(Reg); }
static inline bool Is32BitMapped ( int Reg ) { return m_RegWorkingSet.Is32BitMapped(Reg); } static bool Is32BitMapped ( int Reg ) { return m_RegWorkingSet.Is32BitMapped(Reg); }
static inline bool Is64BitMapped ( int Reg ) { return m_RegWorkingSet.Is64BitMapped(Reg); } static bool Is64BitMapped ( int Reg ) { return m_RegWorkingSet.Is64BitMapped(Reg); }
static inline void FixRoundModel ( CRegInfo::FPU_ROUND RoundMethod ) static void FixRoundModel ( CRegInfo::FPU_ROUND RoundMethod )
{ {
m_RegWorkingSet.FixRoundModel(RoundMethod); m_RegWorkingSet.FixRoundModel(RoundMethod);
} }
static inline void ChangeFPURegFormat ( int Reg, CRegInfo::FPU_STATE OldFormat, CRegInfo::FPU_STATE NewFormat, CRegInfo::FPU_ROUND RoundingModel ) static void ChangeFPURegFormat ( int Reg, CRegInfo::FPU_STATE OldFormat, CRegInfo::FPU_STATE NewFormat, CRegInfo::FPU_ROUND RoundingModel )
{ {
m_RegWorkingSet.ChangeFPURegFormat(Reg,OldFormat,NewFormat,RoundingModel); m_RegWorkingSet.ChangeFPURegFormat(Reg,OldFormat,NewFormat,RoundingModel);
} }
static inline void Load_FPR_ToTop ( int Reg, int RegToLoad, CRegInfo::FPU_STATE Format) static void Load_FPR_ToTop ( int Reg, int RegToLoad, CRegInfo::FPU_STATE Format)
{ {
m_RegWorkingSet.Load_FPR_ToTop(Reg,RegToLoad,Format); m_RegWorkingSet.Load_FPR_ToTop(Reg,RegToLoad,Format);
} }
static inline BOOL RegInStack ( int Reg, CRegInfo::FPU_STATE Format ) static BOOL RegInStack ( int Reg, CRegInfo::FPU_STATE Format )
{ {
return m_RegWorkingSet.RegInStack(Reg,Format); return m_RegWorkingSet.RegInStack(Reg,Format);
} }
static inline x86FpuValues StackPosition ( int Reg ) static x86FpuValues StackPosition ( int Reg )
{ {
return m_RegWorkingSet.StackPosition(Reg); return m_RegWorkingSet.StackPosition(Reg);
} }
static inline void UnMap_AllFPRs ( void ) static void UnMap_AllFPRs()
{ {
m_RegWorkingSet.UnMap_AllFPRs(); m_RegWorkingSet.UnMap_AllFPRs();
} }
static inline void UnMap_FPR ( DWORD Reg, bool WriteBackValue ) static void UnMap_FPR ( DWORD Reg, bool WriteBackValue )
{ {
m_RegWorkingSet.UnMap_FPR(Reg,WriteBackValue); m_RegWorkingSet.UnMap_FPR(Reg,WriteBackValue);
} }
static inline x86Reg FreeX86Reg ( void ) static x86Reg FreeX86Reg()
{ {
return m_RegWorkingSet.FreeX86Reg(); return m_RegWorkingSet.FreeX86Reg();
} }
static inline x86Reg Free8BitX86Reg ( void ) static x86Reg Free8BitX86Reg()
{ {
return m_RegWorkingSet.Free8BitX86Reg(); return m_RegWorkingSet.Free8BitX86Reg();
} }
static inline void Map_GPR_32bit ( int Reg, bool SignValue, int MipsRegToLoad ) static void Map_GPR_32bit ( int Reg, bool SignValue, int MipsRegToLoad )
{ {
m_RegWorkingSet.Map_GPR_32bit(Reg,SignValue,MipsRegToLoad); m_RegWorkingSet.Map_GPR_32bit(Reg,SignValue,MipsRegToLoad);
} }
static inline void Map_GPR_64bit ( int Reg, int MipsRegToLoad ) static void Map_GPR_64bit ( int Reg, int MipsRegToLoad )
{ {
m_RegWorkingSet.Map_GPR_64bit(Reg,MipsRegToLoad); m_RegWorkingSet.Map_GPR_64bit(Reg,MipsRegToLoad);
} }
static inline x86Reg Get_MemoryStack ( void ) static x86Reg Get_MemoryStack()
{ {
return m_RegWorkingSet.Get_MemoryStack(); return m_RegWorkingSet.Get_MemoryStack();
} }
static inline x86Reg Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool LoadValue = true ) static x86Reg Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool LoadValue = true )
{ {
return m_RegWorkingSet.Map_MemoryStack(Reg,bMapRegister,LoadValue); return m_RegWorkingSet.Map_MemoryStack(Reg,bMapRegister,LoadValue);
} }
static inline x86Reg Map_TempReg ( x86Reg Reg, int MipsReg, BOOL LoadHiWord ) static x86Reg Map_TempReg ( x86Reg Reg, int MipsReg, BOOL LoadHiWord )
{ {
return m_RegWorkingSet.Map_TempReg(Reg,MipsReg,LoadHiWord); return m_RegWorkingSet.Map_TempReg(Reg,MipsReg,LoadHiWord);
} }
static inline void ProtectGPR ( DWORD Reg ) static void ProtectGPR ( DWORD Reg )
{ {
m_RegWorkingSet.ProtectGPR(Reg); m_RegWorkingSet.ProtectGPR(Reg);
} }
static inline void UnProtectGPR ( DWORD Reg ) static void UnProtectGPR ( DWORD Reg )
{ {
m_RegWorkingSet.UnProtectGPR(Reg); m_RegWorkingSet.UnProtectGPR(Reg);
} }
static inline void ResetX86Protection ( void ) static void ResetX86Protection()
{ {
m_RegWorkingSet.ResetX86Protection(); m_RegWorkingSet.ResetX86Protection();
} }
static inline x86Reg UnMap_TempReg ( void ) static x86Reg UnMap_TempReg()
{ {
return m_RegWorkingSet.UnMap_TempReg(); return m_RegWorkingSet.UnMap_TempReg();
} }
static inline void UnMap_GPR ( DWORD Reg, bool WriteBackValue ) static void UnMap_GPR ( DWORD Reg, bool WriteBackValue )
{ {
m_RegWorkingSet.UnMap_GPR(Reg,WriteBackValue); m_RegWorkingSet.UnMap_GPR(Reg,WriteBackValue);
} }
static inline bool UnMap_X86reg ( x86Reg Reg ) static bool UnMap_X86reg ( x86Reg Reg )
{ {
return m_RegWorkingSet.UnMap_X86reg(Reg); return m_RegWorkingSet.UnMap_X86reg(Reg);
} }
public: public:
static DWORD CompilePC ( void ) { return m_CompilePC; } static DWORD CompilePC() { return m_CompilePC; }
}; };

View File

@ -14,7 +14,7 @@ unsigned int CRegInfo::m_fpuControl = 0;
char *Format_Name[] = {"Unknown","dword","qword","float","double"}; char *Format_Name[] = {"Unknown","dword","qword","float","double"};
CRegInfo::CRegInfo ( void ) : CRegInfo::CRegInfo() :
m_CycleCount(0), m_CycleCount(0),
m_Stack_TopPos(0), m_Stack_TopPos(0),
m_Fpu_Used(false), m_Fpu_Used(false),
@ -359,7 +359,7 @@ CRegInfo::x86FpuValues CRegInfo::StackPosition (int Reg)
return x86_ST_Unknown; return x86_ST_Unknown;
} }
CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void ) CX86Ops::x86Reg CRegInfo::FreeX86Reg()
{ {
if (GetX86Mapped(x86_EDI) == NotMapped && !GetX86Protected(x86_EDI)) { return x86_EDI; } if (GetX86Mapped(x86_EDI) == NotMapped && !GetX86Protected(x86_EDI)) { return x86_EDI; }
if (GetX86Mapped(x86_ESI) == NotMapped && !GetX86Protected(x86_ESI)) { return x86_ESI; } if (GetX86Mapped(x86_ESI) == NotMapped && !GetX86Protected(x86_ESI)) { return x86_ESI; }
@ -418,7 +418,7 @@ CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
return x86_Unknown; return x86_Unknown;
} }
CX86Ops::x86Reg CRegInfo::Free8BitX86Reg ( void ) CX86Ops::x86Reg CRegInfo::Free8BitX86Reg()
{ {
if (GetX86Mapped(x86_EBX) == NotMapped && !GetX86Protected(x86_EBX)) {return x86_EBX; } if (GetX86Mapped(x86_EBX) == NotMapped && !GetX86Protected(x86_EBX)) {return x86_EBX; }
@ -463,7 +463,7 @@ CX86Ops::x86Reg CRegInfo::Free8BitX86Reg ( void )
return x86_Unknown; return x86_Unknown;
} }
CX86Ops::x86Reg CRegInfo::UnMap_8BitTempReg (void ) CX86Ops::x86Reg CRegInfo::UnMap_8BitTempReg()
{ {
int count; int count;
@ -480,7 +480,7 @@ CX86Ops::x86Reg CRegInfo::UnMap_8BitTempReg (void )
return x86_Unknown; return x86_Unknown;
} }
CRegInfo::x86Reg CRegInfo::Get_MemoryStack ( void ) const CRegInfo::x86Reg CRegInfo::Get_MemoryStack() const
{ {
for (int i = 0, n = sizeof(x86_Registers)/ sizeof(x86_Registers[0]); i < n; i++) for (int i = 0, n = sizeof(x86_Registers)/ sizeof(x86_Registers[0]); i < n; i++)
{ {
@ -868,7 +868,7 @@ void CRegInfo::UnProtectGPR(DWORD Reg) {
SetX86Protected(GetMipsRegMapLo(Reg),false); SetX86Protected(GetMipsRegMapLo(Reg),false);
} }
void CRegInfo::ResetX86Protection (void) void CRegInfo::ResetX86Protection()
{ {
for (int count = 0; count < 10; count ++) for (int count = 0; count < 10; count ++)
{ {
@ -893,7 +893,7 @@ BOOL CRegInfo::RegInStack( int Reg, FPU_STATE Format) {
return FALSE; return FALSE;
} }
void CRegInfo::UnMap_AllFPRs ( void ) void CRegInfo::UnMap_AllFPRs()
{ {
for (;;) { for (;;) {
int StackPos = StackTopPos(); int StackPos = StackTopPos();
@ -1051,7 +1051,7 @@ void CRegInfo::UnMap_GPR (DWORD Reg, bool WriteBackValue)
SetMipsRegState(Reg,STATE_UNKNOWN); SetMipsRegState(Reg,STATE_UNKNOWN);
} }
CX86Ops::x86Reg CRegInfo::UnMap_TempReg ( void ) CX86Ops::x86Reg CRegInfo::UnMap_TempReg()
{ {
CX86Ops::x86Reg Reg = x86_Unknown; CX86Ops::x86Reg Reg = x86_Unknown;
@ -1126,7 +1126,7 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
return FALSE; return FALSE;
} }
void CRegInfo::WriteBackRegisters () void CRegInfo::WriteBackRegisters()
{ {
UnMap_AllFPRs(); UnMap_AllFPRs();

View File

@ -74,84 +74,84 @@ public:
void ChangeFPURegFormat ( int Reg, FPU_STATE OldFormat, FPU_STATE NewFormat, FPU_ROUND RoundingModel ); void ChangeFPURegFormat ( int Reg, FPU_STATE OldFormat, FPU_STATE NewFormat, FPU_ROUND RoundingModel );
void Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format); void Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format);
BOOL RegInStack ( int Reg, FPU_STATE Format ); BOOL RegInStack ( int Reg, FPU_STATE Format );
void UnMap_AllFPRs ( void ); void UnMap_AllFPRs ();
void UnMap_FPR ( int Reg, int WriteBackValue ); void UnMap_FPR ( int Reg, int WriteBackValue );
x86FpuValues StackPosition ( int Reg ); x86FpuValues StackPosition( int Reg );
x86Reg FreeX86Reg ( void ); x86Reg FreeX86Reg ();
x86Reg Free8BitX86Reg ( void ); x86Reg Free8BitX86Reg ();
void Map_GPR_32bit ( int MipsReg, bool SignValue, int MipsRegToLoad ); void Map_GPR_32bit ( int MipsReg, bool SignValue, int MipsRegToLoad );
void Map_GPR_64bit ( int MipsReg, int MipsRegToLoad ); void Map_GPR_64bit ( int MipsReg, int MipsRegToLoad );
x86Reg Get_MemoryStack ( void ) const; x86Reg Get_MemoryStack () const;
x86Reg Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool LoadValue = true ); x86Reg Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool LoadValue = true );
x86Reg Map_TempReg ( x86Reg Reg, int MipsReg, BOOL LoadHiWord ); x86Reg Map_TempReg ( x86Reg Reg, int MipsReg, BOOL LoadHiWord );
void ProtectGPR ( DWORD Reg ); void ProtectGPR ( DWORD Reg );
void UnProtectGPR ( DWORD Reg ); void UnProtectGPR ( DWORD Reg );
void ResetX86Protection ( void ); void ResetX86Protection ();
x86Reg UnMap_TempReg ( void ); x86Reg UnMap_TempReg ();
void UnMap_GPR ( DWORD Reg, bool WriteBackValue ); void UnMap_GPR ( DWORD Reg, bool WriteBackValue );
bool UnMap_X86reg ( x86Reg Reg ); bool UnMap_X86reg ( x86Reg Reg );
void WriteBackRegisters ( void ); void WriteBackRegisters ();
inline bool IsKnown(int Reg) const { return ((GetMipsRegState(Reg) & STATE_KNOWN_VALUE) != 0); } bool IsKnown(int Reg) const { return ((GetMipsRegState(Reg) & STATE_KNOWN_VALUE) != 0); }
inline bool IsUnknown(int Reg) const { return ((GetMipsRegState(Reg) & STATE_KNOWN_VALUE) == 0); } bool IsUnknown(int Reg) const { return ((GetMipsRegState(Reg) & STATE_KNOWN_VALUE) == 0); }
inline bool IsModified(int Reg) const { return ((GetMipsRegState(Reg) & STATE_MODIFIED) != 0); } bool IsModified(int Reg) const { return ((GetMipsRegState(Reg) & STATE_MODIFIED) != 0); }
inline bool IsMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_X86_MAPPED)); } bool IsMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_X86_MAPPED)); }
inline bool IsConst(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_X86_MAPPED)) == STATE_KNOWN_VALUE); } bool IsConst(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_X86_MAPPED)) == STATE_KNOWN_VALUE); }
inline bool IsSigned(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_SIGN)) == (STATE_KNOWN_VALUE | STATE_SIGN)); } bool IsSigned(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_SIGN)) == (STATE_KNOWN_VALUE | STATE_SIGN)); }
inline bool IsUnsigned(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_SIGN)) == STATE_KNOWN_VALUE); } bool IsUnsigned(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_SIGN)) == STATE_KNOWN_VALUE); }
inline bool Is32Bit(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT)) == (STATE_KNOWN_VALUE | STATE_32BIT)); } bool Is32Bit(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT)) == (STATE_KNOWN_VALUE | STATE_32BIT)); }
inline bool Is64Bit(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT)) == STATE_KNOWN_VALUE); } bool Is64Bit(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT)) == STATE_KNOWN_VALUE); }
inline bool Is32BitMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)); } bool Is32BitMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)); }
inline bool Is64BitMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_X86_MAPPED)); } bool Is64BitMapped(int Reg) const { return ((GetMipsRegState(Reg) & (STATE_KNOWN_VALUE | STATE_32BIT | STATE_X86_MAPPED)) == (STATE_KNOWN_VALUE | STATE_X86_MAPPED)); }
inline REG_STATE GetMipsRegState ( int Reg ) const { return m_MIPS_RegState[Reg]; } REG_STATE GetMipsRegState ( int Reg ) const { return m_MIPS_RegState[Reg]; }
inline unsigned __int64 GetMipsReg ( int Reg ) const { return m_MIPS_RegVal[Reg].UDW; } unsigned __int64 GetMipsReg ( int Reg ) const { return m_MIPS_RegVal[Reg].UDW; }
inline __int64 GetMipsReg_S ( int Reg ) const { return m_MIPS_RegVal[Reg].DW; } __int64 GetMipsReg_S ( int Reg ) const { return m_MIPS_RegVal[Reg].DW; }
inline DWORD GetMipsRegLo ( int Reg ) const { return m_MIPS_RegVal[Reg].UW[0]; } DWORD GetMipsRegLo ( int Reg ) const { return m_MIPS_RegVal[Reg].UW[0]; }
inline long GetMipsRegLo_S ( int Reg ) const { return m_MIPS_RegVal[Reg].W[0]; } long GetMipsRegLo_S ( int Reg ) const { return m_MIPS_RegVal[Reg].W[0]; }
inline DWORD GetMipsRegHi ( int Reg ) const { return m_MIPS_RegVal[Reg].UW[1]; } DWORD GetMipsRegHi ( int Reg ) const { return m_MIPS_RegVal[Reg].UW[1]; }
inline long GetMipsRegHi_S ( int Reg ) const { return m_MIPS_RegVal[Reg].W[1]; } long GetMipsRegHi_S ( int Reg ) const { return m_MIPS_RegVal[Reg].W[1]; }
inline CX86Ops::x86Reg GetMipsRegMapLo ( int Reg ) const { return m_RegMapLo[Reg]; } CX86Ops::x86Reg GetMipsRegMapLo ( int Reg ) const { return m_RegMapLo[Reg]; }
inline CX86Ops::x86Reg GetMipsRegMapHi ( int Reg ) const { return m_RegMapHi[Reg]; } CX86Ops::x86Reg GetMipsRegMapHi ( int Reg ) const { return m_RegMapHi[Reg]; }
inline DWORD GetX86MapOrder ( x86Reg Reg ) const { return m_x86reg_MapOrder[Reg]; } DWORD GetX86MapOrder ( x86Reg Reg ) const { return m_x86reg_MapOrder[Reg]; }
inline bool GetX86Protected ( x86Reg Reg ) const { return m_x86reg_Protected[Reg]; } bool GetX86Protected ( x86Reg Reg ) const { return m_x86reg_Protected[Reg]; }
inline REG_MAPPED GetX86Mapped ( x86Reg Reg ) const { return m_x86reg_MappedTo[Reg]; } REG_MAPPED GetX86Mapped ( x86Reg Reg ) const { return m_x86reg_MappedTo[Reg]; }
inline DWORD GetBlockCycleCount ( void ) const { return m_CycleCount; } DWORD GetBlockCycleCount() const { return m_CycleCount; }
inline void SetMipsReg ( int Reg, unsigned __int64 Value ) { m_MIPS_RegVal[Reg].UDW = Value; } void SetMipsReg ( int Reg, unsigned __int64 Value ) { m_MIPS_RegVal[Reg].UDW = Value; }
inline void SetMipsReg_S ( int Reg, __int64 Value) { m_MIPS_RegVal[Reg].DW = Value; } void SetMipsReg_S ( int Reg, __int64 Value) { m_MIPS_RegVal[Reg].DW = Value; }
inline void SetMipsRegLo ( int Reg, DWORD Value ) { m_MIPS_RegVal[Reg].UW[0] = Value; } void SetMipsRegLo ( int Reg, DWORD Value ) { m_MIPS_RegVal[Reg].UW[0] = Value; }
inline void SetMipsRegHi ( int Reg, DWORD Value ) { m_MIPS_RegVal[Reg].UW[1] = Value; } void SetMipsRegHi ( int Reg, DWORD Value ) { m_MIPS_RegVal[Reg].UW[1] = Value; }
inline void SetMipsRegMapLo ( int GetMipsReg, x86Reg Reg ) { m_RegMapLo[GetMipsReg] = Reg; } void SetMipsRegMapLo ( int GetMipsReg, x86Reg Reg ) { m_RegMapLo[GetMipsReg] = Reg; }
inline void SetMipsRegMapHi ( int GetMipsReg, x86Reg Reg ) { m_RegMapHi[GetMipsReg] = Reg; } void SetMipsRegMapHi ( int GetMipsReg, x86Reg Reg ) { m_RegMapHi[GetMipsReg] = Reg; }
inline void SetMipsRegState ( int GetMipsReg, REG_STATE State ) { m_MIPS_RegState[GetMipsReg] = State; } void SetMipsRegState ( int GetMipsReg, REG_STATE State ) { m_MIPS_RegState[GetMipsReg] = State; }
inline void SetX86MapOrder ( x86Reg Reg, DWORD Order ) { m_x86reg_MapOrder[Reg] = Order; } void SetX86MapOrder ( x86Reg Reg, DWORD Order ) { m_x86reg_MapOrder[Reg] = Order; }
inline void SetX86Protected ( x86Reg Reg, bool Protected ) { m_x86reg_Protected[Reg] = Protected; } void SetX86Protected ( x86Reg Reg, bool Protected ) { m_x86reg_Protected[Reg] = Protected; }
inline void SetX86Mapped ( x86Reg Reg, REG_MAPPED Mapping ) { m_x86reg_MappedTo[Reg] = Mapping; } void SetX86Mapped ( x86Reg Reg, REG_MAPPED Mapping ) { m_x86reg_MappedTo[Reg] = Mapping; }
inline void SetBlockCycleCount ( DWORD CyleCount ) { m_CycleCount = CyleCount; } void SetBlockCycleCount(DWORD CyleCount) { m_CycleCount = CyleCount; }
inline int & StackTopPos ( void ) { return m_Stack_TopPos; } int & StackTopPos() { return m_Stack_TopPos; }
inline int & FpuMappedTo( int Reg) { return x86fpu_MappedTo[Reg]; } int & FpuMappedTo(int Reg) { return x86fpu_MappedTo[Reg]; }
inline FPU_STATE & FpuState(int Reg) { return x86fpu_State[Reg]; } FPU_STATE & FpuState(int Reg) { return x86fpu_State[Reg]; }
inline FPU_ROUND & FpuRoundingModel(int Reg) { return x86fpu_RoundingModel[Reg]; } FPU_ROUND & FpuRoundingModel(int Reg) { return x86fpu_RoundingModel[Reg]; }
inline bool & FpuBeenUsed (void ) { return m_Fpu_Used; } bool & FpuBeenUsed() { return m_Fpu_Used; }
inline FPU_ROUND GetRoundingModel ( void ) const { return m_RoundingModel; } FPU_ROUND GetRoundingModel() const { return m_RoundingModel; }
inline void SetRoundingModel ( FPU_ROUND RoundingModel ) { m_RoundingModel = RoundingModel; } void SetRoundingModel(FPU_ROUND RoundingModel) { m_RoundingModel = RoundingModel; }
private: private:
const char * RoundingModelName ( FPU_ROUND RoundType ); const char * RoundingModelName(FPU_ROUND RoundType);
x86Reg UnMap_8BitTempReg ( void ); x86Reg UnMap_8BitTempReg();
//r4k //r4k
REG_STATE m_MIPS_RegState[32]; REG_STATE m_MIPS_RegState[32];

View File

@ -103,7 +103,7 @@ void CCodeSection::UnlinkParent( CCodeSection * Parent, bool AllowDelete, bool C
} }
} }
CCodeSection::~CCodeSection ( void ) CCodeSection::~CCodeSection()
{ {
while (ParentSection.size() > 0) while (ParentSection.size() > 0)
{ {
@ -132,7 +132,7 @@ CCodeSection::~CCodeSection ( void )
} }
} }
DWORD CCodeSection::GetNewTestValue(void) DWORD CCodeSection::GetNewTestValue()
{ {
static DWORD LastTest = 0; static DWORD LastTest = 0;
if (LastTest == 0xFFFFFFFF) { LastTest = 0; } if (LastTest == 0xFFFFFFFF) { LastTest = 0; }
@ -140,7 +140,7 @@ DWORD CCodeSection::GetNewTestValue(void)
return LastTest; return LastTest;
} }
void CRegInfo::Initialize ( void ) void CRegInfo::Initialize()
{ {
int count; int count;

View File

@ -168,7 +168,7 @@ void CX86Ops::BreakPointNotification (const wchar_t * const FileName, const int
g_Notify->BreakPoint(FileName,LineNumber); g_Notify->BreakPoint(FileName,LineNumber);
} }
void CX86Ops::X86HardBreakPoint (void) void CX86Ops::X86HardBreakPoint()
{ {
CPU_Message(" int 3"); CPU_Message(" int 3");
PUTDST8(m_RecompPos,0xCC); PUTDST8(m_RecompPos,0xCC);

View File

@ -76,7 +76,7 @@ protected:
static void AndVariableToX86Reg ( void * Variable, const char * VariableName, x86Reg Reg ); static void AndVariableToX86Reg ( void * Variable, const char * VariableName, x86Reg Reg );
static void AndVariableDispToX86Reg ( void * Variable, const char * VariableName, x86Reg Reg, x86Reg AddrReg, Multipler Multiply); static void AndVariableDispToX86Reg ( void * Variable, const char * VariableName, x86Reg Reg, x86Reg AddrReg, Multipler Multiply);
static void AndX86RegToX86Reg ( x86Reg Destination, x86Reg Source ); static void AndX86RegToX86Reg ( x86Reg Destination, x86Reg Source );
static void X86HardBreakPoint ( void ); static void X86HardBreakPoint ();
static void X86BreakPoint ( const wchar_t * FileName, int LineNumber ); static void X86BreakPoint ( const wchar_t * FileName, int LineNumber );
static void Call_Direct ( void * FunctAddress, const char * FunctName ); static void Call_Direct ( void * FunctAddress, const char * FunctName );
static void Call_Indirect ( void * FunctAddress, const char * FunctName ); static void Call_Indirect ( void * FunctAddress, const char * FunctName );
@ -182,12 +182,12 @@ protected:
static void OrX86RegToVariable ( void * Variable, const char * VariableName, x86Reg Reg ); static void OrX86RegToVariable ( void * Variable, const char * VariableName, x86Reg Reg );
static void OrX86RegToX86Reg ( x86Reg Destination, x86Reg Source ); static void OrX86RegToX86Reg ( x86Reg Destination, x86Reg Source );
static void Push ( x86Reg reg ); static void Push ( x86Reg reg );
static void Pushad ( void ); static void Pushad ();
static void PushImm32 ( DWORD Value ); static void PushImm32 ( DWORD Value );
static void PushImm32 ( const char * String, DWORD Value ); static void PushImm32 ( const char * String, DWORD Value );
static void Pop ( x86Reg reg ); static void Pop ( x86Reg reg );
static void Popad ( void ); static void Popad ();
static void Ret ( void ); static void Ret ();
static void Seta ( x86Reg reg ); static void Seta ( x86Reg reg );
static void Setae ( x86Reg reg ); static void Setae ( x86Reg reg );
static void SetaVariable ( void * Variable, const char * VariableName ); static void SetaVariable ( void * Variable, const char * VariableName );
@ -224,7 +224,7 @@ protected:
static void XorVariableToX86reg ( void * Variable, const char * VariableName, x86Reg reg ); static void XorVariableToX86reg ( void * Variable, const char * VariableName, x86Reg reg );
static void fpuAbs ( void ); static void fpuAbs ();
static void fpuAddDword ( void * Variable, const char * VariableName ); static void fpuAddDword ( void * Variable, const char * VariableName );
static void fpuAddDwordRegPointer ( x86Reg x86Pointer ); static void fpuAddDwordRegPointer ( x86Reg x86Pointer );
static void fpuAddQword ( void * Variable, const char * VariableName ); static void fpuAddQword ( void * Variable, const char * VariableName );
@ -265,9 +265,9 @@ protected:
static void fpuMulQwordRegPointer ( x86Reg X86Pointer ); static void fpuMulQwordRegPointer ( x86Reg X86Pointer );
static void fpuMulReg ( x86FpuValues reg ); static void fpuMulReg ( x86FpuValues reg );
static void fpuMulRegPop ( x86FpuValues reg ); static void fpuMulRegPop ( x86FpuValues reg );
static void fpuNeg ( void ); static void fpuNeg ();
static void fpuRound ( void ); static void fpuRound ();
static void fpuSqrt ( void ); static void fpuSqrt ();
static void fpuStoreControl ( void * Variable, const char * VariableName ); static void fpuStoreControl ( void * Variable, const char * VariableName );
static void fpuStoreDword ( int * StackPos, void * Variable, const char * VariableName, BOOL pop ); static void fpuStoreDword ( int * StackPos, void * Variable, const char * VariableName, BOOL pop );
static void fpuStoreDwordFromX86Reg ( int * StackPos,x86Reg Reg, BOOL pop ); static void fpuStoreDwordFromX86Reg ( int * StackPos,x86Reg Reg, BOOL pop );
@ -278,7 +278,7 @@ protected:
static void fpuStoreIntegerQwordFromX86Reg ( int * StackPos, x86Reg Reg, BOOL pop ); static void fpuStoreIntegerQwordFromX86Reg ( int * StackPos, x86Reg Reg, BOOL pop );
static void fpuStoreQword ( int * StackPos, void * Variable, const char * VariableName, BOOL pop ); static void fpuStoreQword ( int * StackPos, void * Variable, const char * VariableName, BOOL pop );
static void fpuStoreQwordFromX86Reg ( int * StackPos, x86Reg Reg, BOOL pop ); static void fpuStoreQwordFromX86Reg ( int * StackPos, x86Reg Reg, BOOL pop );
static void fpuStoreStatus ( void ); static void fpuStoreStatus ();
static void fpuSubDword ( void * Variable, const char * VariableName ); static void fpuSubDword ( void * Variable, const char * VariableName );
static void fpuSubDwordRegPointer ( x86Reg X86Pointer ); static void fpuSubDwordRegPointer ( x86Reg X86Pointer );
static void fpuSubDwordReverse ( void * Variable, const char * VariableName ); static void fpuSubDwordReverse ( void * Variable, const char * VariableName );

View File

@ -31,10 +31,10 @@ RomInformation::RomInformation (CN64Rom * RomInfo) :
{ {
} }
RomInformation::~RomInformation(void) { RomInformation::~RomInformation()
if (m_DeleteRomInfo) { {
if (m_DeleteRomInfo)
delete m_pRomInfo; delete m_pRomInfo;
}
} }
#include <windows.h> #include <windows.h>

View File

@ -19,9 +19,9 @@ class RomInformation
friend DWORD CALLBACK RomInfoProc ( HWND, DWORD, DWORD, DWORD ); friend DWORD CALLBACK RomInfoProc ( HWND, DWORD, DWORD, DWORD );
public: public:
RomInformation(const char * RomFile ); RomInformation(const char* RomFile);
RomInformation(CN64Rom * RomInfo ); RomInformation(CN64Rom* RomInfo);
~RomInformation(void); ~RomInformation();
void DisplayInformation (HWND hParent) const; void DisplayInformation(HWND hParent) const;
}; };

View File

@ -11,7 +11,7 @@
#include "stdafx.h" #include "stdafx.h"
#pragma comment(lib, "winmm.lib") #pragma comment(lib, "winmm.lib")
CSpeedLimitor::CSpeedLimitor(void) CSpeedLimitor::CSpeedLimitor()
{ {
m_Frames = 0; m_Frames = 0;
m_LastTime = 0; m_LastTime = 0;
@ -26,19 +26,21 @@ CSpeedLimitor::CSpeedLimitor(void)
} }
} }
CSpeedLimitor::~CSpeedLimitor(void) { CSpeedLimitor::~CSpeedLimitor()
{
TIMECAPS Caps; TIMECAPS Caps;
timeGetDevCaps(&Caps, sizeof(Caps)); timeGetDevCaps(&Caps, sizeof(Caps));
timeEndPeriod(Caps.wPeriodMin); timeEndPeriod(Caps.wPeriodMin);
} }
void CSpeedLimitor::SetHertz (DWORD Hertz ) { void CSpeedLimitor::SetHertz(DWORD Hertz)
{
m_Speed = Hertz; m_Speed = Hertz;
m_BaseSpeed = Hertz; m_BaseSpeed = Hertz;
FixSpeedRatio(); FixSpeedRatio();
} }
void CSpeedLimitor::FixSpeedRatio ( void ) void CSpeedLimitor::FixSpeedRatio()
{ {
m_Ratio = 1000.0f / static_cast<double>(m_Speed); m_Ratio = 1000.0f / static_cast<double>(m_Speed);
m_Frames = 0; m_Frames = 0;
@ -73,7 +75,7 @@ bool CSpeedLimitor::Timer_Process (DWORD * FrameRate ) {
} }
} }
void CSpeedLimitor::IncreaseSpeed ( void ) void CSpeedLimitor::IncreaseSpeed()
{ {
if (m_Speed >= 60) if (m_Speed >= 60)
{ {
@ -91,7 +93,7 @@ void CSpeedLimitor::IncreaseSpeed ( void )
FixSpeedRatio(); FixSpeedRatio();
} }
void CSpeedLimitor::DecreaseSpeed ( void ) void CSpeedLimitor::DecreaseSpeed()
{ {
if (m_Speed > 60) if (m_Speed > 60)
{ {

View File

@ -14,19 +14,19 @@ class CSpeedLimitor :
private CGameSettings private CGameSettings
{ {
public: public:
CSpeedLimitor ( void ); CSpeedLimitor();
~CSpeedLimitor ( void ); ~CSpeedLimitor();
void SetHertz ( const DWORD Hertz ); void SetHertz(const DWORD Hertz);
bool Timer_Process ( DWORD * const FrameRate ); bool Timer_Process(DWORD* const FrameRate);
void IncreaseSpeed ( void ); void IncreaseSpeed();
void DecreaseSpeed ( void ); void DecreaseSpeed();
private: private:
CSpeedLimitor(const CSpeedLimitor&); // Disable copy constructor CSpeedLimitor(const CSpeedLimitor&); // Disable copy constructor
CSpeedLimitor& operator=(const CSpeedLimitor&); // Disable assignment CSpeedLimitor& operator=(const CSpeedLimitor&); // Disable assignment
void FixSpeedRatio ( void ); void FixSpeedRatio();
DWORD m_Speed, m_BaseSpeed, m_Frames, m_LastTime; DWORD m_Speed, m_BaseSpeed, m_Frames, m_LastTime;
double m_Ratio; double m_Ratio;