git-svn-id: https://localhost/svn/Project64/trunk@43 111125ac-702d-7242-af9c-5ba8ae61c1ef
This commit is contained in:
parent
0db60d35c2
commit
f92a2c67ba
|
@ -1256,28 +1256,25 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
|
||||||
|
|
||||||
void CMipsMemoryVM::ResetMemoryStack ( void)
|
void CMipsMemoryVM::ResetMemoryStack ( void)
|
||||||
{
|
{
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
|
||||||
#ifdef tofix
|
|
||||||
x86Reg Reg, TempReg;
|
x86Reg Reg, TempReg;
|
||||||
|
|
||||||
CPU_Message(" ResetMemoryStack");
|
CPU_Message(" ResetMemoryStack");
|
||||||
x86reg = Map_MemoryStack(Section, x86_Any, false);
|
Reg = Map_MemoryStack( x86_Any, false);
|
||||||
if (x86reg >= 0) { UnMap_X86reg(Section,x86reg); }
|
if (Reg >= 0) { UnMap_X86reg(Reg); }
|
||||||
|
|
||||||
x86reg = Map_TempReg(x86_Any, 29, FALSE);
|
Reg = Map_TempReg(x86_Any, 29, FALSE);
|
||||||
if (_Settings->LoadBool(Game_UseTlb))
|
if (_Settings->LoadBool(Game_UseTlb))
|
||||||
{
|
{
|
||||||
TempReg = Map_TempReg(x86_Any,-1,FALSE);
|
TempReg = Map_TempReg(x86_Any,-1,FALSE);
|
||||||
MoveX86RegToX86Reg(x86reg,TempReg);
|
MoveX86RegToX86Reg(Reg,TempReg);
|
||||||
ShiftRightUnsignImmed(TempReg,12);
|
ShiftRightUnsignImmed(TempReg,12);
|
||||||
MoveVariableDispToX86Reg(m_TLB_ReadMap,"m_TLB_ReadMap",TempReg,TempReg,4);
|
MoveVariableDispToX86Reg(m_TLB_ReadMap,"m_TLB_ReadMap",TempReg,TempReg,4);
|
||||||
AddX86RegToX86Reg(x86reg,TempReg);
|
AddX86RegToX86Reg(Reg,TempReg);
|
||||||
} else {
|
} else {
|
||||||
AndConstToX86Reg(x86reg,0x1FFFFFFF);
|
AndConstToX86Reg(Reg,0x1FFFFFFF);
|
||||||
AddConstToX86Reg(x86reg,(DWORD)m_RDRAM);
|
AddConstToX86Reg(Reg,(DWORD)m_RDRAM);
|
||||||
}
|
}
|
||||||
MoveX86regToVariable(x86reg, g_MemoryStack, "MemoryStack");
|
MoveX86regToVariable(Reg,&(_Recompiler->MemoryStackPos()), "MemoryStack");
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
|
int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
|
||||||
|
@ -2517,16 +2514,14 @@ void CMipsMemoryVM::Compile_LW (void)
|
||||||
if (Opcode.rt == 0) return;
|
if (Opcode.rt == 0) return;
|
||||||
|
|
||||||
x86Reg TempReg1, TempReg2;
|
x86Reg TempReg1, TempReg2;
|
||||||
#ifdef tofix
|
if (Opcode.base == 29 && bFastSP()) {
|
||||||
if (Opcode.base == 29 && SPHack) {
|
|
||||||
char String[100];
|
char String[100];
|
||||||
|
|
||||||
Map_GPR_32bit(Opcode.rt,TRUE,-1);
|
Map_GPR_32bit(Opcode.rt,TRUE,-1);
|
||||||
TempReg1 = Map_MemoryStack(x86_Any,true);
|
TempReg1 = Map_MemoryStack(x86_Any,true);
|
||||||
sprintf(String,"%Xh",(short)Opcode.offset);
|
sprintf(String,"%Xh",(short)Opcode.offset);
|
||||||
MoveVariableDispToX86Reg((void *)((DWORD)(short)Opcode.offset),String,cMipsRegLo(Opcode.rt),TempReg1,1);
|
MoveVariableDispToX86Reg((void *)((DWORD)(short)Opcode.offset),String,cMipsRegMapLo(Opcode.rt),TempReg1,1);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
if (IsConst(Opcode.base)) {
|
if (IsConst(Opcode.base)) {
|
||||||
DWORD Address = cMipsRegLo(Opcode.base) + (short)Opcode.offset;
|
DWORD Address = cMipsRegLo(Opcode.base) + (short)Opcode.offset;
|
||||||
Map_GPR_32bit(Opcode.rt,TRUE,-1);
|
Map_GPR_32bit(Opcode.rt,TRUE,-1);
|
||||||
|
@ -2575,14 +2570,15 @@ void CMipsMemoryVM::Compile_LW (void)
|
||||||
MoveN64MemToX86reg(cMipsRegMapLo(Opcode.rt),cMipsRegMapLo(Opcode.rt));
|
MoveN64MemToX86reg(cMipsRegMapLo(Opcode.rt),cMipsRegMapLo(Opcode.rt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef tofix
|
|
||||||
}
|
}
|
||||||
if (SPHack && Opcode.rt == 29)
|
if (bFastSP() && Opcode.rt == 29)
|
||||||
{
|
{
|
||||||
|
_Notify->BreakPoint(__FILE__,__LINE__);
|
||||||
|
#ifdef tofix
|
||||||
ResetX86Protection();
|
ResetX86Protection();
|
||||||
_MMU->ResetMemoryStack(m_Section);
|
_MMU->ResetMemoryStack(m_Section);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMipsMemoryVM::Compile_LWC1 (void)
|
void CMipsMemoryVM::Compile_LWC1 (void)
|
||||||
|
@ -2852,7 +2848,7 @@ void CMipsMemoryVM::Compile_LD (void)
|
||||||
Compile_LW(cMipsRegMapHi(Opcode.rt),Address);
|
Compile_LW(cMipsRegMapHi(Opcode.rt),Address);
|
||||||
Compile_LW(cMipsRegMapLo(Opcode.rt),Address + 4);
|
Compile_LW(cMipsRegMapLo(Opcode.rt),Address + 4);
|
||||||
#ifdef tofix
|
#ifdef tofix
|
||||||
if (SPHack && Opcode.rt == 29) { _MMU->ResetMemoryStack(m_Section); }
|
if (bFastSP() && Opcode.rt == 29) { _MMU->ResetMemoryStack(m_Section); }
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2895,12 +2891,11 @@ void CMipsMemoryVM::Compile_LD (void)
|
||||||
MoveN64MemToX86reg(cMipsRegMapHi(Opcode.rt),TempReg1);
|
MoveN64MemToX86reg(cMipsRegMapHi(Opcode.rt),TempReg1);
|
||||||
MoveN64MemDispToX86reg(cMipsRegMapLo(Opcode.rt),TempReg1,4);
|
MoveN64MemDispToX86reg(cMipsRegMapLo(Opcode.rt),TempReg1,4);
|
||||||
}
|
}
|
||||||
#ifdef tofix
|
if (bFastSP() && Opcode.rt == 29)
|
||||||
if (SPHack && Opcode.rt == 29) {
|
{
|
||||||
ResetX86Protection();
|
ResetX86Protection();
|
||||||
_MMU->ResetMemoryStack(m_Section);
|
_MMU->ResetMemoryStack();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMipsMemoryVM::Compile_LDC1 (void)
|
void CMipsMemoryVM::Compile_LDC1 (void)
|
||||||
|
@ -3156,21 +3151,19 @@ void CMipsMemoryVM::Compile_SW (void)
|
||||||
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
|
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
|
||||||
|
|
||||||
x86Reg TempReg1, TempReg2;
|
x86Reg TempReg1, TempReg2;
|
||||||
#ifdef tofix
|
if (Opcode.base == 29 && bFastSP()) {
|
||||||
if (Opcode.base == 29 && SPHack) {
|
|
||||||
if (IsMapped(Opcode.rt)) { ProtectGPR(Opcode.rt); }
|
if (IsMapped(Opcode.rt)) { ProtectGPR(Opcode.rt); }
|
||||||
TempReg1 = Map_MemoryStack(x86_Any,true);
|
TempReg1 = Map_MemoryStack(x86_Any,true);
|
||||||
|
|
||||||
if (IsConst(Opcode.rt)) {
|
if (IsConst(Opcode.rt)) {
|
||||||
MoveConstToMemoryDisp (cMipsRegLo(Opcode.rt),TempReg1, (DWORD)((short)Opcode.offset));
|
MoveConstToMemoryDisp (cMipsRegLo(Opcode.rt),TempReg1, (DWORD)((short)Opcode.offset));
|
||||||
} else if (IsMapped(Opcode.rt)) {
|
} else if (IsMapped(Opcode.rt)) {
|
||||||
MoveX86regToMemory(cMipsRegLo(Opcode.rt),TempReg1,(DWORD)((short)Opcode.offset));
|
MoveX86regToMemory(cMipsRegMapLo(Opcode.rt),TempReg1,(DWORD)((short)Opcode.offset));
|
||||||
} else {
|
} else {
|
||||||
TempReg2 = Map_TempReg(x86_Any,Opcode.rt,FALSE);
|
TempReg2 = Map_TempReg(x86_Any,Opcode.rt,FALSE);
|
||||||
MoveX86regToMemory(TempReg2,TempReg1,(DWORD)((short)Opcode.offset));
|
MoveX86regToMemory(TempReg2,TempReg1,(DWORD)((short)Opcode.offset));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
if (IsConst(Opcode.base)) {
|
if (IsConst(Opcode.base)) {
|
||||||
DWORD Address = cMipsRegLo(Opcode.base) + (short)Opcode.offset;
|
DWORD Address = cMipsRegLo(Opcode.base) + (short)Opcode.offset;
|
||||||
|
|
||||||
|
@ -3224,9 +3217,7 @@ void CMipsMemoryVM::Compile_SW (void)
|
||||||
MoveX86regToN64Mem(Map_TempReg(x86_Any,Opcode.rt,FALSE),TempReg1);
|
MoveX86regToN64Mem(Map_TempReg(x86_Any,Opcode.rt,FALSE),TempReg1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef tofix
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMipsMemoryVM::Compile_SWC1 (void)
|
void CMipsMemoryVM::Compile_SWC1 (void)
|
||||||
|
|
|
@ -24,7 +24,6 @@ class CMipsMemoryVM :
|
||||||
//Current Half line
|
//Current Half line
|
||||||
void UpdateHalfLine ( void );
|
void UpdateHalfLine ( void );
|
||||||
DWORD m_HalfLine;
|
DWORD m_HalfLine;
|
||||||
DWORD m_MemoryStack;
|
|
||||||
DWORD m_TempValue;
|
DWORD m_TempValue;
|
||||||
|
|
||||||
//Initilizing and reseting information about the memory system
|
//Initilizing and reseting information about the memory system
|
||||||
|
|
|
@ -798,8 +798,8 @@ void CN64System::ExecuteInterpret (CC_Core & C_Core) {
|
||||||
void CN64System::ExecuteRecompiler (CC_Core & C_Core)
|
void CN64System::ExecuteRecompiler (CC_Core & C_Core)
|
||||||
{
|
{
|
||||||
//execute opcodes while no errors
|
//execute opcodes while no errors
|
||||||
m_Recomp = new CRecompiler(m_Profile,m_EndEmulation);
|
|
||||||
InitializeCPUCore();
|
InitializeCPUCore();
|
||||||
|
m_Recomp = new CRecompiler(m_Profile,m_EndEmulation);
|
||||||
SetActiveSystem();
|
SetActiveSystem();
|
||||||
m_Recomp->Run();
|
m_Recomp->Run();
|
||||||
}
|
}
|
||||||
|
@ -912,23 +912,20 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) {
|
||||||
if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) { ErrorFound = true; }
|
if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) { ErrorFound = true; }
|
||||||
if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { ErrorFound = true; }
|
if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { ErrorFound = true; }
|
||||||
|
|
||||||
for (int z = 0; z < 0x100; z++)
|
/*for (int z = 0; z < 0x100; z++)
|
||||||
{
|
{
|
||||||
if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z])
|
if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z])
|
||||||
{
|
{
|
||||||
ErrorFound = true;
|
ErrorFound = true;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (bSPHack())
|
if (bFastSP() && m_Recomp)
|
||||||
{
|
{
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)))
|
||||||
#ifdef tofix
|
|
||||||
if (_MMU->m_MemoryStack != (DWORD)(RDRAM + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)))
|
|
||||||
{
|
{
|
||||||
ErrorFound = true;
|
ErrorFound = true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_SystemTimer.CurrentType() != SecondCPU->m_SystemTimer.CurrentType()) { ErrorFound = true; }
|
if (m_SystemTimer.CurrentType() != SecondCPU->m_SystemTimer.CurrentType()) { ErrorFound = true; }
|
||||||
|
@ -1010,15 +1007,12 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) {
|
||||||
{
|
{
|
||||||
Error.LogF("RoundingModel: %X %X\r\n",m_Reg.m_RoundingModel,SecondCPU->m_Reg.m_RoundingModel);
|
Error.LogF("RoundingModel: %X %X\r\n",m_Reg.m_RoundingModel,SecondCPU->m_Reg.m_RoundingModel);
|
||||||
}
|
}
|
||||||
if (_Settings->LoadBool(Game_SPHack))
|
if (bFastSP() && m_Recomp)
|
||||||
{
|
{
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)))
|
||||||
#ifdef tofix
|
|
||||||
if (_MMU->m_MemoryStack != (DWORD)(RDRAM + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)))
|
|
||||||
{
|
{
|
||||||
Error.LogF("MemoryStack = %X should be: %X\r\n",_MMU->m_MemoryStack, (DWORD)(_MMU->RDRAM + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)));
|
Error.LogF("MemoryStack = %X should be: %X\r\n",m_Recomp->MemoryStackPos(), (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF)));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
Error.Log("\r\n");
|
Error.Log("\r\n");
|
||||||
Error.Log("Information:\r\n");
|
Error.Log("Information:\r\n");
|
||||||
|
@ -1347,10 +1341,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
|
||||||
unzReadCurrentFile(file,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8);
|
unzReadCurrentFile(file,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8);
|
||||||
unzReadCurrentFile(file,m_Reg.m_SerialInterface,sizeof(DWORD)*4);
|
unzReadCurrentFile(file,m_Reg.m_SerialInterface,sizeof(DWORD)*4);
|
||||||
unzReadCurrentFile(file,(void *const)&_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32);
|
unzReadCurrentFile(file,(void *const)&_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32);
|
||||||
unzReadCurrentFile(file,_MMU->PifRam(),0x40);
|
unzReadCurrentFile(file,m_MMU_VM.PifRam(),0x40);
|
||||||
unzReadCurrentFile(file,_MMU->Rdram(),SaveRDRAMSize);
|
unzReadCurrentFile(file,m_MMU_VM.Rdram(),SaveRDRAMSize);
|
||||||
unzReadCurrentFile(file,_MMU->Dmem(),0x1000);
|
unzReadCurrentFile(file,m_MMU_VM.Dmem(),0x1000);
|
||||||
unzReadCurrentFile(file,_MMU->Imem(),0x1000);
|
unzReadCurrentFile(file,m_MMU_VM.Imem(),0x1000);
|
||||||
unzCloseCurrentFile(file);
|
unzCloseCurrentFile(file);
|
||||||
unzClose(file);
|
unzClose(file);
|
||||||
LoadedZipFile = true;
|
LoadedZipFile = true;
|
||||||
|
@ -1377,8 +1371,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
|
||||||
if (result == IDNO) { return FALSE; }
|
if (result == IDNO) { return FALSE; }
|
||||||
}
|
}
|
||||||
Reset(false,true);
|
Reset(false,true);
|
||||||
_MMU->UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(Game_RDRamSize) - 4);
|
m_MMU_VM.UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(Game_RDRamSize) - 4);
|
||||||
_MMU->UnProtectMemory(0xA4000000,0xA4001FFC);
|
m_MMU_VM.UnProtectMemory(0xA4000000,0xA4001FFC);
|
||||||
_Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize);
|
_Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize);
|
||||||
|
|
||||||
ReadFile( hSaveFile,&NextVITimer,sizeof(NextVITimer),&dwRead,NULL);
|
ReadFile( hSaveFile,&NextVITimer,sizeof(NextVITimer),&dwRead,NULL);
|
||||||
|
@ -1398,14 +1392,11 @@ bool CN64System::LoadState(LPCSTR FileName) {
|
||||||
ReadFile( hSaveFile,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13,&dwRead,NULL);
|
ReadFile( hSaveFile,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13,&dwRead,NULL);
|
||||||
ReadFile( hSaveFile,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8,&dwRead,NULL);
|
ReadFile( hSaveFile,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8,&dwRead,NULL);
|
||||||
ReadFile( hSaveFile,m_Reg.m_SerialInterface,sizeof(DWORD)*4,&dwRead,NULL);
|
ReadFile( hSaveFile,m_Reg.m_SerialInterface,sizeof(DWORD)*4,&dwRead,NULL);
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
ReadFile( hSaveFile,(void *const)&_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32,&dwRead,NULL);
|
||||||
#ifdef tofix
|
ReadFile( hSaveFile,m_MMU_VM.PifRam(),0x40,&dwRead,NULL);
|
||||||
ReadFile( hSaveFile,_MMU->tlb,sizeof(TLB)*32,&dwRead,NULL);
|
ReadFile( hSaveFile,m_MMU_VM.Rdram(),SaveRDRAMSize,&dwRead,NULL);
|
||||||
ReadFile( hSaveFile,_MMU->PIF_Ram,0x40,&dwRead,NULL);
|
ReadFile( hSaveFile,m_MMU_VM.Dmem(),0x1000,&dwRead,NULL);
|
||||||
#endif
|
ReadFile( hSaveFile,m_MMU_VM.Imem(),0x1000,&dwRead,NULL);
|
||||||
ReadFile( hSaveFile,_MMU->Rdram(),SaveRDRAMSize,&dwRead,NULL);
|
|
||||||
ReadFile( hSaveFile,_MMU->Dmem(),0x1000,&dwRead,NULL);
|
|
||||||
ReadFile( hSaveFile,_MMU->Imem(),0x1000,&dwRead,NULL);
|
|
||||||
CloseHandle(hSaveFile);
|
CloseHandle(hSaveFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1433,9 +1424,7 @@ bool CN64System::LoadState(LPCSTR FileName) {
|
||||||
#ifdef TEST_SP_TRACKING
|
#ifdef TEST_SP_TRACKING
|
||||||
m_CurrentSP = GPR[29].UW[0];
|
m_CurrentSP = GPR[29].UW[0];
|
||||||
#endif
|
#endif
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); }
|
||||||
_MMU->m_MemoryStack = (DWORD)(_MMU->Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) {
|
if (_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) {
|
||||||
if (m_SyncCPU)
|
if (m_SyncCPU)
|
||||||
|
|
|
@ -19,10 +19,14 @@ public:
|
||||||
inline void SetVAddrFirst ( DWORD VAddr ) { m_VAddrFirst = VAddr; }
|
inline void SetVAddrFirst ( DWORD VAddr ) { m_VAddrFirst = VAddr; }
|
||||||
inline void SetVAddrLast ( DWORD VAddr ) { m_VAddrLast = VAddr; }
|
inline void SetVAddrLast ( DWORD VAddr ) { m_VAddrLast = VAddr; }
|
||||||
|
|
||||||
|
inline void IncSectionCount ( void ) { m_NoOfSections += 1; }
|
||||||
|
|
||||||
|
CCodeSection * ExistingSection ( DWORD Addr ) { return m_EnterSection.ExistingSection(Addr,NextTest()); }
|
||||||
|
|
||||||
EXIT_LIST m_ExitInfo;
|
EXIT_LIST m_ExitInfo;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AnalyseBlock ( void );
|
bool AnalyseBlock ( void );
|
||||||
void CompileExitCode ( void );
|
void CompileExitCode ( void );
|
||||||
|
|
||||||
DWORD m_VAddrEnter;
|
DWORD m_VAddrEnter;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,17 +5,24 @@ class CCodeBlock;
|
||||||
class CCodeSection :
|
class CCodeSection :
|
||||||
private CRecompilerOps
|
private CRecompilerOps
|
||||||
{
|
{
|
||||||
|
typedef std::list<CCodeSection *> SECTION_LIST;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID);
|
CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID);
|
||||||
~CCodeSection( void );
|
~CCodeSection( void );
|
||||||
|
|
||||||
void CompileCop1Test ( void );
|
void CompileCop1Test ( void );
|
||||||
bool GenerateX86Code ( DWORD Test );
|
bool CreateSectionLinkage ( void );
|
||||||
void GenerateSectionLinkage ( void );
|
bool GenerateX86Code ( DWORD Test );
|
||||||
void CompileSystemCheck ( DWORD TargetPC, const CRegInfo &RegSet );
|
void GenerateSectionLinkage ( void );
|
||||||
void CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(const char * Label, DWORD Value));
|
void CompileSystemCheck ( DWORD TargetPC, const CRegInfo &RegSet );
|
||||||
|
void CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(const char * Label, DWORD Value));
|
||||||
|
void DetermineLoop ( DWORD Test, DWORD Test2, DWORD TestID );
|
||||||
|
bool FixConstants ( DWORD Test );
|
||||||
|
CCodeSection * ExistingSection ( DWORD Addr, DWORD Test );
|
||||||
|
|
||||||
/* Block Connection info */
|
/* Block Connection info */
|
||||||
|
SECTION_LIST m_ParentSection;
|
||||||
CCodeBlock * const m_BlockInfo;
|
CCodeBlock * const m_BlockInfo;
|
||||||
const DWORD m_EnterPC;
|
const DWORD m_EnterPC;
|
||||||
const DWORD m_SectionID;
|
const DWORD m_SectionID;
|
||||||
|
@ -23,12 +30,12 @@ public:
|
||||||
CCodeSection * m_JumpSection;
|
CCodeSection * m_JumpSection;
|
||||||
bool m_LinkAllowed; // are other sections allowed to find block to link to it
|
bool m_LinkAllowed; // are other sections allowed to find block to link to it
|
||||||
DWORD m_Test;
|
DWORD m_Test;
|
||||||
|
DWORD m_Test2;
|
||||||
BYTE * m_CompiledLocation;
|
BYTE * m_CompiledLocation;
|
||||||
bool m_DelaySlotSection;
|
bool m_DelaySlotSection;
|
||||||
|
bool m_InLoop;
|
||||||
|
|
||||||
/* SECTION_LIST ParentSection;
|
/*
|
||||||
DWORD Test2;
|
|
||||||
bool InLoop;
|
|
||||||
|
|
||||||
|
|
||||||
/* Register Info */
|
/* Register Info */
|
||||||
|
@ -40,6 +47,10 @@ public:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void AddParent ( CCodeSection * Parent );
|
||||||
|
void InheritConstants ( void );
|
||||||
|
bool FillSectionInfo ( STEP_TYPE StartStepType );
|
||||||
|
void TestRegConstantStates ( CRegInfo & Base, CRegInfo & Reg );
|
||||||
|
void SyncRegState ( const CRegInfo & SyncTo );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,11 +31,16 @@ public:
|
||||||
//Self modifying code methods
|
//Self modifying code methods
|
||||||
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 );
|
||||||
|
|
||||||
|
inline DWORD & MemoryStackPos ( void ) { return m_MemoryStack; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCompiledFuncList m_Functions;
|
CCompiledFuncList m_Functions;
|
||||||
CProfiling & m_Profile;
|
CProfiling & m_Profile;
|
||||||
bool & m_EndEmulation;
|
bool & m_EndEmulation;
|
||||||
|
DWORD m_MemoryStack;
|
||||||
|
|
||||||
//Quick access to registers
|
//Quick access to registers
|
||||||
DWORD & PROGRAM_COUNTER;
|
DWORD & PROGRAM_COUNTER;
|
||||||
|
@ -44,16 +49,9 @@ private:
|
||||||
bool Compiler4300iBlock ( CCompiledFunc * info );
|
bool Compiler4300iBlock ( CCompiledFunc * info );
|
||||||
|
|
||||||
// Compiling code
|
// Compiling code
|
||||||
bool AnalyseBlock ( CCodeBlock & BlockInfo );
|
|
||||||
bool CreateSectionLinkage ( CCodeSection * Section );
|
bool CreateSectionLinkage ( CCodeSection * Section );
|
||||||
void DetermineLoop ( CCodeSection * Section, DWORD Test, DWORD Test2, DWORD TestID);
|
|
||||||
bool DisplaySectionInformation (CCodeSection * Section, DWORD ID, DWORD Test);
|
bool DisplaySectionInformation (CCodeSection * Section, DWORD ID, DWORD Test);
|
||||||
bool FixConstants ( CCodeSection * Section, DWORD Test );
|
|
||||||
bool InheritParentInfo ( CCodeSection * Section );
|
bool InheritParentInfo ( CCodeSection * Section );
|
||||||
void InheritConstants ( CCodeSection * Section );
|
|
||||||
bool FillSectionInfo ( CCodeSection * Section, STEP_TYPE StartStepType );
|
|
||||||
void SyncRegState ( CCodeSection * Section, CRegInfo * SyncTo );
|
|
||||||
CCodeSection * ExistingSection( CCodeSection * StartSection, DWORD Addr, 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 );
|
||||||
|
|
|
@ -1103,11 +1103,9 @@ void CRecompilerOps::ADDI (void) {
|
||||||
|
|
||||||
if (m_Opcode.rt == 0) { return; }
|
if (m_Opcode.rt == 0) { return; }
|
||||||
|
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Opcode.rs == 29 && m_Opcode.rt == 29) {
|
||||||
if (SPHack && m_Opcode.rs == 29 && m_Opcode.rt == 29) {
|
AddConstToX86Reg(Map_MemoryStack(x86_Any, true),(short)m_Opcode.immediate);
|
||||||
AddConstToX86Reg(Map_MemoryStack(m_Section, x86_Any, true),(short)m_Opcode.immediate);
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (IsConst(m_Opcode.rs)) {
|
if (IsConst(m_Opcode.rs)) {
|
||||||
if (IsMapped(m_Opcode.rt)) { UnMap_GPR(m_Opcode.rt, FALSE); }
|
if (IsMapped(m_Opcode.rt)) { UnMap_GPR(m_Opcode.rt, FALSE); }
|
||||||
|
@ -1117,12 +1115,13 @@ void CRecompilerOps::ADDI (void) {
|
||||||
Map_GPR_32bit(m_Opcode.rt,TRUE,m_Opcode.rs);
|
Map_GPR_32bit(m_Opcode.rt,TRUE,m_Opcode.rs);
|
||||||
AddConstToX86Reg(cMipsRegMapLo(m_Opcode.rt),(short)m_Opcode.immediate);
|
AddConstToX86Reg(cMipsRegMapLo(m_Opcode.rt),(short)m_Opcode.immediate);
|
||||||
}
|
}
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Opcode.rt == 29 && m_Opcode.rs != 29) {
|
||||||
if (SPHack && m_Opcode.rt == 29 && m_Opcode.rs != 29) {
|
|
||||||
ResetX86Protection();
|
ResetX86Protection();
|
||||||
|
_Notify->BreakPoint(__FILE__,__LINE__);
|
||||||
|
#ifdef tofix
|
||||||
_MMU->ResetMemoryStack(m_Section);
|
_MMU->ResetMemoryStack(m_Section);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRecompilerOps::ADDIU (void) {
|
void CRecompilerOps::ADDIU (void) {
|
||||||
|
@ -1130,15 +1129,13 @@ void CRecompilerOps::ADDIU (void) {
|
||||||
|
|
||||||
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; }
|
||||||
|
|
||||||
#ifdef tofix
|
if (bFastSP())
|
||||||
if (SPHack)
|
|
||||||
{
|
{
|
||||||
if (m_Opcode.rs == 29 && m_Opcode.rt == 29)
|
if (m_Opcode.rs == 29 && m_Opcode.rt == 29)
|
||||||
{
|
{
|
||||||
AddConstToX86Reg(Map_MemoryStack(m_Section, x86_Any, TRUE),(short)m_Opcode.immediate);
|
AddConstToX86Reg(Map_MemoryStack(x86_Any, TRUE),(short)m_Opcode.immediate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (IsConst(m_Opcode.rs)) {
|
if (IsConst(m_Opcode.rs)) {
|
||||||
if (IsMapped(m_Opcode.rt)) { UnMap_GPR(m_Opcode.rt, FALSE); }
|
if (IsMapped(m_Opcode.rt)) { UnMap_GPR(m_Opcode.rt, FALSE); }
|
||||||
|
@ -1149,12 +1146,10 @@ void CRecompilerOps::ADDIU (void) {
|
||||||
AddConstToX86Reg(cMipsRegMapLo(m_Opcode.rt),(short)m_Opcode.immediate);
|
AddConstToX86Reg(cMipsRegMapLo(m_Opcode.rt),(short)m_Opcode.immediate);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Opcode.rt == 29 && m_Opcode.rs != 29) {
|
||||||
if (SPHack && m_Opcode.rt == 29 && m_Opcode.rs != 29) {
|
|
||||||
ResetX86Protection();
|
ResetX86Protection();
|
||||||
_MMU->ResetMemoryStack(m_Section);
|
_MMU->ResetMemoryStack();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRecompilerOps::SLTIU (void) {
|
void CRecompilerOps::SLTIU (void) {
|
||||||
|
@ -1211,22 +1206,7 @@ void CRecompilerOps::SLTIU (void) {
|
||||||
*((BYTE *)(Jump))=(BYTE)(m_RecompPos - Jump - 1);
|
*((BYTE *)(Jump))=(BYTE)(m_RecompPos - Jump - 1);
|
||||||
SetbVariable(&m_BranchCompare,"m_BranchCompare");
|
SetbVariable(&m_BranchCompare,"m_BranchCompare");
|
||||||
Map_GPR_32bit(m_Opcode.rt,FALSE, -1);
|
Map_GPR_32bit(m_Opcode.rt,FALSE, -1);
|
||||||
MoveVariableToX86reg(&m_BranchCompare,"m_BranchCompare",cMipsRegMapLo(m_Opcode.rt));
|
MoveVariableToX86reg(&m_BranchCompare,"m_BranchCompare",cMipsRegMapLo(m_Opcode.rt));
|
||||||
|
|
||||||
|
|
||||||
/*SetbVariable(&m_BranchCompare,"m_BranchCompare");
|
|
||||||
JmpLabel8("Continue",0);
|
|
||||||
Jump[1] = m_RecompPos - 1;
|
|
||||||
CPU_Message("");
|
|
||||||
CPU_Message(" Low Compare:");
|
|
||||||
*((BYTE *)(Jump[0]))=(BYTE)(m_RecompPos - Jump[0] - 1);
|
|
||||||
CompConstToVariable((short)m_Opcode.immediate,&_GPR[m_Opcode.rs].W[0],CRegName::GPR_Lo[m_Opcode.rs]);
|
|
||||||
SetbVariable(&m_BranchCompare,"m_BranchCompare");
|
|
||||||
CPU_Message("");
|
|
||||||
CPU_Message(" Continue:");
|
|
||||||
*((BYTE *)(Jump[1]))=(BYTE)(m_RecompPos - Jump[1] - 1);
|
|
||||||
Map_GPR_32bit(m_Opcode.rt,FALSE, -1);
|
|
||||||
MoveVariableToX86reg(&m_BranchCompare,"m_BranchCompare",cMipsRegMapLo(m_Opcode.rt));*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1369,19 +1349,18 @@ void CRecompilerOps::LUI (void) {
|
||||||
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;}
|
||||||
|
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Opcode.rt == 29) {
|
||||||
if (SPHack && m_Opcode.rt == 29) {
|
x86Reg Reg = Map_MemoryStack(x86_Any, false);
|
||||||
x86Reg Reg = Map_MemoryStack(m_Section, x86_Any, false);
|
|
||||||
DWORD Address;
|
DWORD Address;
|
||||||
|
|
||||||
TranslateVaddr (((short)m_Opcode.offset << 16), &Address);
|
_TransVaddr->TranslateVaddr(((short)m_Opcode.offset << 16), Address);
|
||||||
if (x86reg < 0) {
|
if (Reg < 0) {
|
||||||
MoveConstToVariable((DWORD)(Address + RDRAM), g_MemoryStack, "MemoryStack");
|
MoveConstToVariable((DWORD)(Address + _MMU->Rdram()), &(_Recompiler->MemoryStackPos()), "MemoryStack");
|
||||||
} else {
|
} else {
|
||||||
MoveConstToX86reg((DWORD)(Address + RDRAM), x86reg);
|
MoveConstToX86reg((DWORD)(Address + _MMU->Rdram()), Reg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
UnMap_GPR(m_Opcode.rt, FALSE);
|
UnMap_GPR(m_Opcode.rt, FALSE);
|
||||||
MipsRegLo(m_Opcode.rt) = ((short)m_Opcode.offset << 16);
|
MipsRegLo(m_Opcode.rt) = ((short)m_Opcode.offset << 16);
|
||||||
MipsRegState(m_Opcode.rt) = CRegInfo::STATE_CONST_32;
|
MipsRegState(m_Opcode.rt) = CRegInfo::STATE_CONST_32;
|
||||||
|
@ -2658,12 +2637,10 @@ void CRecompilerOps::SPECIAL_OR (void) {
|
||||||
OrVariableToX86Reg(&_GPR[m_Opcode.rs].W[1],CRegName::GPR_Hi[m_Opcode.rs],MipsRegMapHi(m_Opcode.rd));
|
OrVariableToX86Reg(&_GPR[m_Opcode.rs].W[1],CRegName::GPR_Hi[m_Opcode.rs],MipsRegMapHi(m_Opcode.rd));
|
||||||
OrVariableToX86Reg(&_GPR[m_Opcode.rs].W[0],CRegName::GPR_Lo[m_Opcode.rs],cMipsRegMapLo(m_Opcode.rd));
|
OrVariableToX86Reg(&_GPR[m_Opcode.rs].W[0],CRegName::GPR_Lo[m_Opcode.rs],cMipsRegMapLo(m_Opcode.rd));
|
||||||
}
|
}
|
||||||
#ifdef tofix
|
if (bFastSP() && m_Opcode.rd == 29) {
|
||||||
if (SPHack && m_Opcode.rd == 29) {
|
|
||||||
ResetX86Protection();
|
ResetX86Protection();
|
||||||
_MMU->ResetMemoryStack(m_Section);
|
_MMU->ResetMemoryStack();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRecompilerOps::SPECIAL_XOR (void) {
|
void CRecompilerOps::SPECIAL_XOR (void) {
|
||||||
|
@ -3942,7 +3919,7 @@ void CRecompilerOps::COP1_CT(void) {
|
||||||
BeforeCallDirect(m_RegWorkingSet);
|
BeforeCallDirect(m_RegWorkingSet);
|
||||||
Call_Direct(ChangeDefaultRoundingModel, "ChangeDefaultRoundingModel");
|
Call_Direct(ChangeDefaultRoundingModel, "ChangeDefaultRoundingModel");
|
||||||
AfterCallDirect(m_RegWorkingSet);
|
AfterCallDirect(m_RegWorkingSet);
|
||||||
m_RegWorkingSet.CurrentRoundingModel() = CRegInfo::RoundUnknown;
|
m_RegWorkingSet.SetRoundingModel(CRegInfo::RoundUnknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************** COP1: S functions ************************/
|
/************************** COP1: S functions ************************/
|
||||||
|
@ -4688,7 +4665,7 @@ void CRecompilerOps::BeforeCallDirect ( CRegInfo & RegSet )
|
||||||
void CRecompilerOps::AfterCallDirect ( CRegInfo & RegSet )
|
void CRecompilerOps::AfterCallDirect ( CRegInfo & RegSet )
|
||||||
{
|
{
|
||||||
Popad();
|
Popad();
|
||||||
RegSet.CurrentRoundingModel() = CRegInfo::RoundUnknown;
|
RegSet.SetRoundingModel(CRegInfo::RoundUnknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRecompilerOps::EnterCodeBlock ( void )
|
void CRecompilerOps::EnterCodeBlock ( void )
|
||||||
|
|
|
@ -2,7 +2,8 @@ class CCodeSection;
|
||||||
|
|
||||||
class CRecompilerOps :
|
class CRecompilerOps :
|
||||||
protected CX86Ops,
|
protected CX86Ops,
|
||||||
protected CSystemRegisters
|
protected CSystemRegisters,
|
||||||
|
protected CRecompilerSettings
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
enum BRANCH_TYPE
|
enum BRANCH_TYPE
|
||||||
|
@ -281,6 +282,10 @@ protected:
|
||||||
{
|
{
|
||||||
m_RegWorkingSet.Map_GPR_64bit(Reg,MipsRegToLoad);
|
m_RegWorkingSet.Map_GPR_64bit(Reg,MipsRegToLoad);
|
||||||
}
|
}
|
||||||
|
static inline x86Reg Map_MemoryStack ( x86Reg Reg, bool bMapRegister )
|
||||||
|
{
|
||||||
|
return m_RegWorkingSet.Map_MemoryStack(Reg,bMapRegister);
|
||||||
|
}
|
||||||
static inline x86Reg Map_TempReg ( x86Reg Reg, int MipsReg, BOOL LoadHiWord )
|
static inline 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);
|
||||||
|
|
|
@ -34,16 +34,16 @@ void CRegInfo::Initilize ( void )
|
||||||
x86fpu_RoundingModel[count] = RoundDefault;
|
x86fpu_RoundingModel[count] = RoundDefault;
|
||||||
}
|
}
|
||||||
Fpu_Used = false;
|
Fpu_Used = false;
|
||||||
RoundingModel = RoundUnknown;
|
m_RoundingModel = RoundUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
|
void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
|
||||||
{
|
{
|
||||||
if (CurrentRoundingModel() == RoundMethod)
|
if (GetRoundingModel() == RoundMethod)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CPU_Message(" FixRoundModel: CurrentRoundingModel: %s targetRoundModel: %s",RoundingModelName(CurrentRoundingModel()),RoundingModelName(RoundMethod));
|
CPU_Message(" FixRoundModel: CurrentRoundingModel: %s targetRoundModel: %s",RoundingModelName(GetRoundingModel()),RoundingModelName(RoundMethod));
|
||||||
|
|
||||||
m_fpuControl = 0;
|
m_fpuControl = 0;
|
||||||
fpuStoreControl(&m_fpuControl, "m_fpuControl");
|
fpuStoreControl(&m_fpuControl, "m_fpuControl");
|
||||||
|
@ -57,7 +57,7 @@ void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
|
||||||
MoveVariableToX86reg(&_Reg->m_RoundingModel,"m_RoundingModel", RoundReg);
|
MoveVariableToX86reg(&_Reg->m_RoundingModel,"m_RoundingModel", RoundReg);
|
||||||
ShiftLeftSignImmed(RoundReg,2);
|
ShiftLeftSignImmed(RoundReg,2);
|
||||||
OrX86RegToX86Reg(reg,RoundReg);
|
OrX86RegToX86Reg(reg,RoundReg);
|
||||||
x86Protected(RoundReg) = false;
|
SetX86Protected(RoundReg,false);
|
||||||
} else {
|
} else {
|
||||||
switch (RoundMethod) {
|
switch (RoundMethod) {
|
||||||
case RoundTruncate: OrConstToX86Reg(0x0C00, reg); break;
|
case RoundTruncate: OrConstToX86Reg(0x0C00, reg); break;
|
||||||
|
@ -69,9 +69,9 @@ void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MoveX86regToVariable(reg, &m_fpuControl, "m_fpuControl");
|
MoveX86regToVariable(reg, &m_fpuControl, "m_fpuControl");
|
||||||
x86Protected(reg) = false;
|
SetX86Protected(reg,false);
|
||||||
fpuLoadControl(&m_fpuControl, "m_fpuControl");
|
fpuLoadControl(&m_fpuControl, "m_fpuControl");
|
||||||
CurrentRoundingModel() = RoundMethod;
|
SetRoundingModel(RoundMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFormat, FPU_ROUND RoundingModel)
|
void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFormat, FPU_ROUND RoundingModel)
|
||||||
|
@ -102,11 +102,11 @@ void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFo
|
||||||
|
|
||||||
void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
|
void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
|
||||||
{
|
{
|
||||||
if (CurrentRoundingModel() != RoundDefault)
|
if (GetRoundingModel() != RoundDefault)
|
||||||
{
|
{
|
||||||
FixRoundModel(RoundDefault);
|
FixRoundModel(RoundDefault);
|
||||||
}
|
}
|
||||||
CPU_Message("CurrentRoundingModel: %s FpuRoundingModel(StackTopPos()): %s",RoundingModelName(CurrentRoundingModel()),RoundingModelName(FpuRoundingModel(StackTopPos())));
|
CPU_Message("CurrentRoundingModel: %s FpuRoundingModel(StackTopPos()): %s",RoundingModelName(GetRoundingModel()),RoundingModelName(FpuRoundingModel(StackTopPos())));
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RegToLoad < 0) { DisplayError("Load_FPR_ToTop\nRegToLoad < 0 ???"); return; }
|
if (RegToLoad < 0) { DisplayError("Load_FPR_ToTop\nRegToLoad < 0 ???"); return; }
|
||||||
|
@ -246,7 +246,7 @@ void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
|
||||||
DisplayError("Load_FPR_ToTop\nUnkown format to load %d",Format);
|
DisplayError("Load_FPR_ToTop\nUnkown format to load %d",Format);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
x86Protected(TempReg) = FALSE;
|
SetX86Protected(TempReg,FALSE);
|
||||||
FpuRoundingModel(StackTopPos()) = RoundDefault;
|
FpuRoundingModel(StackTopPos()) = RoundDefault;
|
||||||
x86fpu_MappedTo[StackTopPos()] = Reg;
|
x86fpu_MappedTo[StackTopPos()] = Reg;
|
||||||
x86fpu_State[StackTopPos()] = Format;
|
x86fpu_State[StackTopPos()] = Format;
|
||||||
|
@ -268,12 +268,12 @@ CRegInfo::x86FpuValues CRegInfo::StackPosition (int Reg)
|
||||||
|
|
||||||
CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
|
CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
|
||||||
{
|
{
|
||||||
if (x86Mapped(x86_EDI) == NotMapped && !x86Protected(x86_EDI)) { return x86_EDI; }
|
if (GetX86Mapped(x86_EDI) == NotMapped && !GetX86Protected(x86_EDI)) { return x86_EDI; }
|
||||||
if (x86Mapped(x86_ESI) == NotMapped && !x86Protected(x86_ESI)) { return x86_ESI; }
|
if (GetX86Mapped(x86_ESI) == NotMapped && !GetX86Protected(x86_ESI)) { return x86_ESI; }
|
||||||
if (x86Mapped(x86_EBX) == NotMapped && !x86Protected(x86_EBX)) { return x86_EBX; }
|
if (GetX86Mapped(x86_EBX) == NotMapped && !GetX86Protected(x86_EBX)) { return x86_EBX; }
|
||||||
if (x86Mapped(x86_EAX) == NotMapped && !x86Protected(x86_EAX)) { return x86_EAX; }
|
if (GetX86Mapped(x86_EAX) == NotMapped && !GetX86Protected(x86_EAX)) { return x86_EAX; }
|
||||||
if (x86Mapped(x86_EDX) == NotMapped && !x86Protected(x86_EDX)) { return x86_EDX; }
|
if (GetX86Mapped(x86_EDX) == NotMapped && !GetX86Protected(x86_EDX)) { return x86_EDX; }
|
||||||
if (x86Mapped(x86_ECX) == NotMapped && !x86Protected(x86_ECX)) { return x86_ECX; }
|
if (GetX86Mapped(x86_ECX) == NotMapped && !GetX86Protected(x86_ECX)) { return x86_ECX; }
|
||||||
|
|
||||||
x86Reg Reg = UnMap_TempReg();
|
x86Reg Reg = UnMap_TempReg();
|
||||||
if (Reg != x86_Unknown) { return Reg; }
|
if (Reg != x86_Unknown) { return Reg; }
|
||||||
|
@ -283,7 +283,7 @@ CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
|
||||||
|
|
||||||
for (count = 0; count < 10; count ++)
|
for (count = 0; count < 10; count ++)
|
||||||
{
|
{
|
||||||
MapCount[count] = x86MapOrder((x86Reg)count);
|
MapCount[count] = GetX86MapOrder((x86Reg)count);
|
||||||
MapReg[count] = (x86Reg)count;
|
MapReg[count] = (x86Reg)count;
|
||||||
}
|
}
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++) {
|
||||||
|
@ -308,14 +308,14 @@ CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
|
||||||
x86Reg StackReg = x86_Unknown;
|
x86Reg StackReg = x86_Unknown;
|
||||||
for (count = 0; count < 10; count ++)
|
for (count = 0; count < 10; count ++)
|
||||||
{
|
{
|
||||||
if (MapCount[count] > 0 && x86Mapped(MapReg[count]) != Stack_Mapped)
|
if (MapCount[count] > 0 && GetX86Mapped(MapReg[count]) != Stack_Mapped)
|
||||||
{
|
{
|
||||||
if (UnMap_X86reg((x86Reg)MapReg[count]))
|
if (UnMap_X86reg((x86Reg)MapReg[count]))
|
||||||
{
|
{
|
||||||
return (x86Reg)MapReg[count];
|
return (x86Reg)MapReg[count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (x86Mapped(MapReg[count]) == Stack_Mapped) { StackReg = MapReg[count]; }
|
if (GetX86Mapped(MapReg[count]) == Stack_Mapped) { StackReg = MapReg[count]; }
|
||||||
}
|
}
|
||||||
if (StackReg != x86_Unknown) {
|
if (StackReg != x86_Unknown) {
|
||||||
UnMap_X86reg(StackReg);
|
UnMap_X86reg(StackReg);
|
||||||
|
@ -328,10 +328,10 @@ CX86Ops::x86Reg CRegInfo::FreeX86Reg ( void )
|
||||||
CX86Ops::x86Reg CRegInfo::Free8BitX86Reg ( void )
|
CX86Ops::x86Reg CRegInfo::Free8BitX86Reg ( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
if (x86Mapped(x86_EBX) == NotMapped && !x86Protected(x86_EBX)) {return x86_EBX; }
|
if (GetX86Mapped(x86_EBX) == NotMapped && !GetX86Protected(x86_EBX)) {return x86_EBX; }
|
||||||
if (x86Mapped(x86_EAX) == NotMapped && !x86Protected(x86_EAX)) {return x86_EAX; }
|
if (GetX86Mapped(x86_EAX) == NotMapped && !GetX86Protected(x86_EAX)) {return x86_EAX; }
|
||||||
if (x86Mapped(x86_EDX) == NotMapped && !x86Protected(x86_EDX)) {return x86_EDX; }
|
if (GetX86Mapped(x86_EDX) == NotMapped && !GetX86Protected(x86_EDX)) {return x86_EDX; }
|
||||||
if (x86Mapped(x86_ECX) == NotMapped && !x86Protected(x86_ECX)) {return x86_ECX; }
|
if (GetX86Mapped(x86_ECX) == NotMapped && !GetX86Protected(x86_ECX)) {return x86_ECX; }
|
||||||
|
|
||||||
|
|
||||||
x86Reg Reg = UnMap_8BitTempReg();
|
x86Reg Reg = UnMap_8BitTempReg();
|
||||||
|
@ -339,7 +339,7 @@ CX86Ops::x86Reg CRegInfo::Free8BitX86Reg ( void )
|
||||||
|
|
||||||
int count, MapCount[10], MapReg[10];
|
int count, MapCount[10], MapReg[10];
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++) {
|
||||||
MapCount[count] = x86MapOrder((x86Reg)count);
|
MapCount[count] = GetX86MapOrder((x86Reg)count);
|
||||||
MapReg[count] = count;
|
MapReg[count] = count;
|
||||||
}
|
}
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++) {
|
||||||
|
@ -377,9 +377,9 @@ CX86Ops::x86Reg CRegInfo::UnMap_8BitTempReg (void )
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++) {
|
||||||
if (!Is8BitReg((x86Reg)count)) { continue; }
|
if (!Is8BitReg((x86Reg)count)) { continue; }
|
||||||
if (MipsRegState((x86Reg)count) == Temp_Mapped) {
|
if (MipsRegState((x86Reg)count) == Temp_Mapped) {
|
||||||
if (x86Protected((x86Reg)count) == FALSE) {
|
if (GetX86Protected((x86Reg)count) == FALSE) {
|
||||||
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name((x86Reg)count));
|
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name((x86Reg)count));
|
||||||
x86Mapped((x86Reg)count) = CRegInfo::NotMapped;
|
SetX86Mapped((x86Reg)count, CRegInfo::NotMapped);
|
||||||
return (x86Reg)count;
|
return (x86Reg)count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,6 +387,67 @@ CX86Ops::x86Reg CRegInfo::UnMap_8BitTempReg (void )
|
||||||
return x86_Unknown;
|
return x86_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CRegInfo::x86Reg CRegInfo::Map_MemoryStack ( x86Reg Reg, bool bMapRegister)
|
||||||
|
{
|
||||||
|
x86Reg CurrentMap = x86_Unknown;
|
||||||
|
if (GetX86Mapped(x86_EAX) == Stack_Mapped) { CurrentMap = x86_EAX; }
|
||||||
|
else if (GetX86Mapped(x86_EBX) == Stack_Mapped) { CurrentMap = x86_EBX; }
|
||||||
|
else if (GetX86Mapped(x86_ECX) == Stack_Mapped) { CurrentMap = x86_ECX; }
|
||||||
|
else if (GetX86Mapped(x86_EDX) == Stack_Mapped) { CurrentMap = x86_EDX; }
|
||||||
|
else if (GetX86Mapped(x86_ESI) == Stack_Mapped) { CurrentMap = x86_ESI; }
|
||||||
|
else if (GetX86Mapped(x86_EDI) == Stack_Mapped) { CurrentMap = x86_EDI; }
|
||||||
|
else if (GetX86Mapped(x86_EBP) == Stack_Mapped) { CurrentMap = x86_EBP; }
|
||||||
|
else if (GetX86Mapped(x86_ESP) == Stack_Mapped) { CurrentMap = x86_ESP; }
|
||||||
|
|
||||||
|
if (!bMapRegister)
|
||||||
|
{
|
||||||
|
//if not mapping then just return what the current mapping is
|
||||||
|
return CurrentMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CurrentMap != x86_Unknown && CurrentMap == Reg)
|
||||||
|
{
|
||||||
|
//already mapped to correct reg
|
||||||
|
return CurrentMap;
|
||||||
|
}
|
||||||
|
// map a register
|
||||||
|
if (Reg == x86_Any)
|
||||||
|
{
|
||||||
|
if (CurrentMap != x86_Unknown)
|
||||||
|
{
|
||||||
|
return CurrentMap;
|
||||||
|
}
|
||||||
|
Reg = FreeX86Reg();
|
||||||
|
if (Reg == x86_Unknown)
|
||||||
|
{
|
||||||
|
DisplayError("Map_MemoryStack\n\nOut of registers");
|
||||||
|
BreakPoint(__FILE__,__LINE__);
|
||||||
|
}
|
||||||
|
SetX86Mapped(Reg,CRegInfo::Stack_Mapped);
|
||||||
|
CPU_Message(" regcache: allocate %s as Memory Stack",x86_Name(Reg));
|
||||||
|
MoveVariableToX86reg(&_Recompiler->MemoryStackPos(),"MemoryStack",Reg);
|
||||||
|
return Reg;
|
||||||
|
}
|
||||||
|
|
||||||
|
_Notify->BreakPoint(__FILE__,__LINE__);
|
||||||
|
#ifdef tofix
|
||||||
|
//move to a register/allocate register
|
||||||
|
UnMap_X86reg(Section, Reg);
|
||||||
|
if (CurrentMap >= 0)
|
||||||
|
{
|
||||||
|
CPU_Message(" regcache: change allocation of Memory Stack from %s to %s",x86_Name(CurrentMap),x86_Name(Reg));
|
||||||
|
Section->GetX86Mapped(Reg) = CRegInfo::Stack_Mapped;
|
||||||
|
Section->GetX86Mapped(CurrentMap) = CRegInfo::NotMapped;
|
||||||
|
MoveX86RegToX86Reg(CurrentMap,Reg);
|
||||||
|
} else {
|
||||||
|
Section->GetX86Mapped(Reg) = CRegInfo::Stack_Mapped;
|
||||||
|
CPU_Message(" regcache: allocate %s as Memory Stack",x86_Name(Reg));
|
||||||
|
MoveVariableToX86reg(g_MemoryStack,"MemoryStack",Reg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Reg;
|
||||||
|
}
|
||||||
|
|
||||||
void CRegInfo::Map_GPR_32bit (int MipsReg, BOOL SignValue, int MipsRegToLoad)
|
void CRegInfo::Map_GPR_32bit (int MipsReg, BOOL SignValue, int MipsRegToLoad)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
@ -412,19 +473,21 @@ void CRegInfo::Map_GPR_32bit (int MipsReg, BOOL SignValue, int MipsRegToLoad)
|
||||||
} else {
|
} else {
|
||||||
if (Is64Bit(MipsReg)) {
|
if (Is64Bit(MipsReg)) {
|
||||||
CPU_Message(" regcache: unallocate %s from high 32bit of %s",x86_Name(MipsRegMapHi(MipsReg)),CRegName::GPR_Hi[MipsReg]);
|
CPU_Message(" regcache: unallocate %s from high 32bit of %s",x86_Name(MipsRegMapHi(MipsReg)),CRegName::GPR_Hi[MipsReg]);
|
||||||
x86MapOrder(MipsRegMapHi(MipsReg)) = 0;
|
SetX86MapOrder(MipsRegMapHi(MipsReg),0);
|
||||||
x86Mapped(MipsRegMapHi(MipsReg)) = NotMapped;
|
SetX86Mapped(MipsRegMapHi(MipsReg),NotMapped);
|
||||||
x86Protected(MipsRegMapHi(MipsReg)) = FALSE;
|
SetX86Protected(MipsRegMapHi(MipsReg),FALSE);
|
||||||
MipsRegHi(MipsReg) = 0;
|
MipsRegHi(MipsReg) = 0;
|
||||||
}
|
}
|
||||||
Reg = MipsRegMapLo(MipsReg);
|
Reg = MipsRegMapLo(MipsReg);
|
||||||
}
|
}
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++)
|
||||||
if (x86MapOrder((x86Reg)count) > 0) {
|
{
|
||||||
x86MapOrder((x86Reg)count) += 1;
|
DWORD Count = GetX86MapOrder((x86Reg)count);
|
||||||
|
if ( Count > 0) {
|
||||||
|
SetX86MapOrder((x86Reg)count,Count + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x86MapOrder(Reg) = 1;
|
SetX86MapOrder(Reg,1);
|
||||||
|
|
||||||
if (MipsRegToLoad > 0) {
|
if (MipsRegToLoad > 0) {
|
||||||
if (IsUnknown(MipsRegToLoad)) {
|
if (IsUnknown(MipsRegToLoad)) {
|
||||||
|
@ -439,8 +502,8 @@ void CRegInfo::Map_GPR_32bit (int MipsReg, BOOL SignValue, int MipsRegToLoad)
|
||||||
} else if (MipsRegToLoad == 0) {
|
} else if (MipsRegToLoad == 0) {
|
||||||
XorX86RegToX86Reg(Reg,Reg);
|
XorX86RegToX86Reg(Reg,Reg);
|
||||||
}
|
}
|
||||||
x86Mapped(Reg) = GPR_Mapped;
|
SetX86Mapped(Reg,GPR_Mapped);
|
||||||
x86Protected(Reg) = TRUE;
|
SetX86Protected(Reg,TRUE);
|
||||||
MipsRegMapLo(MipsReg) = Reg;
|
MipsRegMapLo(MipsReg) = Reg;
|
||||||
MipsRegState(MipsReg) = SignValue ? STATE_MAPPED_32_SIGN : STATE_MAPPED_32_ZERO;
|
MipsRegState(MipsReg) = SignValue ? STATE_MAPPED_32_SIGN : STATE_MAPPED_32_ZERO;
|
||||||
}
|
}
|
||||||
|
@ -461,32 +524,37 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad)
|
||||||
if (IsUnknown(MipsReg) || IsConst(MipsReg)) {
|
if (IsUnknown(MipsReg) || IsConst(MipsReg)) {
|
||||||
x86Hi = FreeX86Reg();
|
x86Hi = FreeX86Reg();
|
||||||
if (x86Hi < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
if (x86Hi < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
||||||
x86Protected(x86Hi) = TRUE;
|
SetX86Protected(x86Hi,TRUE);
|
||||||
|
|
||||||
x86lo = FreeX86Reg();
|
x86lo = FreeX86Reg();
|
||||||
if (x86lo < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
if (x86lo < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
||||||
x86Protected(x86lo) = TRUE;
|
SetX86Protected(x86lo,TRUE);
|
||||||
|
|
||||||
CPU_Message(" regcache: allocate %s to hi word of %s",x86_Name(x86Hi),CRegName::GPR[MipsReg]);
|
CPU_Message(" regcache: allocate %s to hi word of %s",x86_Name(x86Hi),CRegName::GPR[MipsReg]);
|
||||||
CPU_Message(" regcache: allocate %s to low word of %s",x86_Name(x86lo),CRegName::GPR[MipsReg]);
|
CPU_Message(" regcache: allocate %s to low word of %s",x86_Name(x86lo),CRegName::GPR[MipsReg]);
|
||||||
} else {
|
} else {
|
||||||
x86lo = MipsRegMapLo(MipsReg);
|
x86lo = MipsRegMapLo(MipsReg);
|
||||||
if (Is32Bit(MipsReg)) {
|
if (Is32Bit(MipsReg)) {
|
||||||
x86Protected(x86lo) = TRUE;
|
SetX86Protected(x86lo,TRUE);
|
||||||
x86Hi = FreeX86Reg();
|
x86Hi = FreeX86Reg();
|
||||||
if (x86Hi < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
if (x86Hi < 0) { DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
|
||||||
x86Protected(x86Hi) = TRUE;
|
SetX86Protected(x86Hi,TRUE);
|
||||||
} else {
|
} else {
|
||||||
x86Hi = MipsRegMapHi(MipsReg);
|
x86Hi = MipsRegMapHi(MipsReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++)
|
||||||
if (x86MapOrder((x86Reg)count) > 0) { x86MapOrder((x86Reg)count) += 1; }
|
{
|
||||||
|
int MapOrder = GetX86MapOrder((x86Reg)count);
|
||||||
|
if (MapOrder > 0)
|
||||||
|
{
|
||||||
|
SetX86MapOrder((x86Reg)count,MapOrder + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x86MapOrder(x86Hi) = 1;
|
SetX86MapOrder(x86Hi,1);
|
||||||
x86MapOrder(x86lo) = 1;
|
SetX86MapOrder(x86lo,1);
|
||||||
if (MipsRegToLoad > 0) {
|
if (MipsRegToLoad > 0) {
|
||||||
if (IsUnknown(MipsRegToLoad)) {
|
if (IsUnknown(MipsRegToLoad)) {
|
||||||
MoveVariableToX86reg(&_GPR[MipsRegToLoad].UW[1],CRegName::GPR_Hi[MipsRegToLoad],x86Hi);
|
MoveVariableToX86reg(&_GPR[MipsRegToLoad].UW[1],CRegName::GPR_Hi[MipsRegToLoad],x86Hi);
|
||||||
|
@ -525,8 +593,8 @@ CPU_Message("Map_GPR_64bit 11");
|
||||||
XorX86RegToX86Reg(x86Hi,x86Hi);
|
XorX86RegToX86Reg(x86Hi,x86Hi);
|
||||||
XorX86RegToX86Reg(x86lo,x86lo);
|
XorX86RegToX86Reg(x86lo,x86lo);
|
||||||
}
|
}
|
||||||
x86Mapped(x86Hi) = GPR_Mapped;
|
SetX86Mapped(x86Hi,GPR_Mapped);
|
||||||
x86Mapped(x86lo) = GPR_Mapped;
|
SetX86Mapped(x86lo,GPR_Mapped);
|
||||||
MipsRegMapHi(MipsReg) = x86Hi;
|
MipsRegMapHi(MipsReg) = x86Hi;
|
||||||
MipsRegMapLo(MipsReg) = x86lo;
|
MipsRegMapLo(MipsReg) = x86lo;
|
||||||
MipsRegState(MipsReg) = STATE_MAPPED_64;
|
MipsRegState(MipsReg) = STATE_MAPPED_64;
|
||||||
|
@ -538,14 +606,14 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
|
|
||||||
if (Reg == x86_Any)
|
if (Reg == x86_Any)
|
||||||
{
|
{
|
||||||
if (x86Mapped(x86_EAX) == Temp_Mapped && !x86Protected(x86_EAX)) { Reg = x86_EAX; }
|
if (GetX86Mapped(x86_EAX) == Temp_Mapped && !GetX86Protected(x86_EAX)) { Reg = x86_EAX; }
|
||||||
else if (x86Mapped(x86_EBX) == Temp_Mapped && !x86Protected(x86_EBX)) { Reg = x86_EBX; }
|
else if (GetX86Mapped(x86_EBX) == Temp_Mapped && !GetX86Protected(x86_EBX)) { Reg = x86_EBX; }
|
||||||
else if (x86Mapped(x86_ECX) == Temp_Mapped && !x86Protected(x86_ECX)) { Reg = x86_ECX; }
|
else if (GetX86Mapped(x86_ECX) == Temp_Mapped && !GetX86Protected(x86_ECX)) { Reg = x86_ECX; }
|
||||||
else if (x86Mapped(x86_EDX) == Temp_Mapped && !x86Protected(x86_EDX)) { Reg = x86_EDX; }
|
else if (GetX86Mapped(x86_EDX) == Temp_Mapped && !GetX86Protected(x86_EDX)) { Reg = x86_EDX; }
|
||||||
else if (x86Mapped(x86_ESI) == Temp_Mapped && !x86Protected(x86_ESI)) { Reg = x86_ESI; }
|
else if (GetX86Mapped(x86_ESI) == Temp_Mapped && !GetX86Protected(x86_ESI)) { Reg = x86_ESI; }
|
||||||
else if (x86Mapped(x86_EDI) == Temp_Mapped && !x86Protected(x86_EDI)) { Reg = x86_EDI; }
|
else if (GetX86Mapped(x86_EDI) == Temp_Mapped && !GetX86Protected(x86_EDI)) { Reg = x86_EDI; }
|
||||||
else if (x86Mapped(x86_EBP) == Temp_Mapped && !x86Protected(x86_EBP)) { Reg = x86_EBP; }
|
else if (GetX86Mapped(x86_EBP) == Temp_Mapped && !GetX86Protected(x86_EBP)) { Reg = x86_EBP; }
|
||||||
else if (x86Mapped(x86_ESP) == Temp_Mapped && !x86Protected(x86_ESP)) { Reg = x86_ESP; }
|
else if (GetX86Mapped(x86_ESP) == Temp_Mapped && !GetX86Protected(x86_ESP)) { Reg = x86_ESP; }
|
||||||
|
|
||||||
if (Reg == x86_Any) {
|
if (Reg == x86_Any) {
|
||||||
Reg = FreeX86Reg();
|
Reg = FreeX86Reg();
|
||||||
|
@ -559,10 +627,10 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
}
|
}
|
||||||
else if (Reg == x86_Any8Bit)
|
else if (Reg == x86_Any8Bit)
|
||||||
{
|
{
|
||||||
if (x86Mapped(x86_EAX) == Temp_Mapped && !x86Protected(x86_EAX)) { Reg = x86_EAX; }
|
if (GetX86Mapped(x86_EAX) == Temp_Mapped && !GetX86Protected(x86_EAX)) { Reg = x86_EAX; }
|
||||||
else if (x86Mapped(x86_EBX) == Temp_Mapped && !x86Protected(x86_EBX)) { Reg = x86_EBX; }
|
else if (GetX86Mapped(x86_EBX) == Temp_Mapped && !GetX86Protected(x86_EBX)) { Reg = x86_EBX; }
|
||||||
else if (x86Mapped(x86_ECX) == Temp_Mapped && !x86Protected(x86_ECX)) { Reg = x86_ECX; }
|
else if (GetX86Mapped(x86_ECX) == Temp_Mapped && !GetX86Protected(x86_ECX)) { Reg = x86_ECX; }
|
||||||
else if (x86Mapped(x86_EDX) == Temp_Mapped && !x86Protected(x86_EDX)) { Reg = x86_EDX; }
|
else if (GetX86Mapped(x86_EDX) == Temp_Mapped && !GetX86Protected(x86_EDX)) { Reg = x86_EDX; }
|
||||||
|
|
||||||
if (Reg == x86_Any8Bit)
|
if (Reg == x86_Any8Bit)
|
||||||
{
|
{
|
||||||
|
@ -573,15 +641,15 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
return x86_Unknown;
|
return x86_Unknown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (x86Mapped(Reg) == GPR_Mapped) {
|
} else if (GetX86Mapped(Reg) == GPR_Mapped) {
|
||||||
if (x86Protected(Reg))
|
if (GetX86Protected(Reg))
|
||||||
{
|
{
|
||||||
WriteTrace(TraceError,"CRegInfo::Map_TempReg: Register is protected");
|
WriteTrace(TraceError,"CRegInfo::Map_TempReg: Register is protected");
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
_Notify->BreakPoint(__FILE__,__LINE__);
|
||||||
return x86_Unknown;
|
return x86_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
x86Protected(Reg) = true;
|
SetX86Protected(Reg,true);
|
||||||
x86Reg NewReg = FreeX86Reg();
|
x86Reg NewReg = FreeX86Reg();
|
||||||
for (count = 1; count < 32; count ++)
|
for (count = 1; count < 32; count ++)
|
||||||
{
|
{
|
||||||
|
@ -597,8 +665,8 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CPU_Message(" regcache: change allocation of %s from %s to %s",CRegName::GPR[count],x86_Name(Reg),x86_Name(NewReg));
|
CPU_Message(" regcache: change allocation of %s from %s to %s",CRegName::GPR[count],x86_Name(Reg),x86_Name(NewReg));
|
||||||
x86Mapped(NewReg) = GPR_Mapped;
|
SetX86Mapped(NewReg,GPR_Mapped);
|
||||||
x86MapOrder(NewReg) = x86MapOrder(Reg);
|
SetX86MapOrder(NewReg,GetX86MapOrder(Reg));
|
||||||
MipsRegMapLo(count) = NewReg;
|
MipsRegMapLo(count) = NewReg;
|
||||||
MoveX86RegToX86Reg(Reg,NewReg);
|
MoveX86RegToX86Reg(Reg,NewReg);
|
||||||
if (MipsReg == count && LoadHiWord == FALSE) { MipsReg = -1; }
|
if (MipsReg == count && LoadHiWord == FALSE) { MipsReg = -1; }
|
||||||
|
@ -612,8 +680,8 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CPU_Message(" regcache: change allocation of %s from %s to %s",CRegName::GPR_Hi[count],x86_Name(Reg),x86_Name(NewReg));
|
CPU_Message(" regcache: change allocation of %s from %s to %s",CRegName::GPR_Hi[count],x86_Name(Reg),x86_Name(NewReg));
|
||||||
x86Mapped(NewReg) = GPR_Mapped;
|
SetX86Mapped(NewReg,GPR_Mapped);
|
||||||
x86MapOrder(NewReg) = x86MapOrder(Reg);
|
SetX86MapOrder(NewReg,GetX86MapOrder(Reg));
|
||||||
MipsRegMapHi(count) = NewReg;
|
MipsRegMapHi(count) = NewReg;
|
||||||
MoveX86RegToX86Reg(Reg,NewReg);
|
MoveX86RegToX86Reg(Reg,NewReg);
|
||||||
if (MipsReg == count && LoadHiWord == TRUE) { MipsReg = -1; }
|
if (MipsReg == count && LoadHiWord == TRUE) { MipsReg = -1; }
|
||||||
|
@ -621,7 +689,7 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (x86Mapped(Reg) == Stack_Mapped)
|
else if (GetX86Mapped(Reg) == Stack_Mapped)
|
||||||
{
|
{
|
||||||
UnMap_X86reg(Reg);
|
UnMap_X86reg(Reg);
|
||||||
}
|
}
|
||||||
|
@ -661,38 +729,40 @@ CX86Ops::x86Reg CRegInfo::Map_TempReg (CX86Ops::x86Reg Reg, int MipsReg, BOOL Lo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x86Mapped(Reg) = Temp_Mapped;
|
SetX86Mapped(Reg,Temp_Mapped);
|
||||||
x86Protected(Reg) = TRUE;
|
SetX86Protected(Reg,TRUE);
|
||||||
for (count = 0; count < 10; count ++) {
|
for (count = 0; count < 10; count ++)
|
||||||
if (x86MapOrder((x86Reg)count) > 0) {
|
{
|
||||||
x86MapOrder((x86Reg)count) += 1;
|
int MapOrder = GetX86MapOrder((x86Reg)count);
|
||||||
|
if (MapOrder > 0) {
|
||||||
|
SetX86MapOrder((x86Reg)count,MapOrder + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x86MapOrder(Reg) = 1;
|
SetX86MapOrder(Reg,1);
|
||||||
return Reg;
|
return Reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRegInfo::ProtectGPR(DWORD Reg) {
|
void CRegInfo::ProtectGPR(DWORD Reg) {
|
||||||
if (IsUnknown(Reg) || IsConst(Reg)) { return; }
|
if (IsUnknown(Reg) || IsConst(Reg)) { return; }
|
||||||
if (Is64Bit(Reg)) {
|
if (Is64Bit(Reg)) {
|
||||||
x86Protected(MipsRegMapHi(Reg)) = TRUE;
|
SetX86Protected(MipsRegMapHi(Reg),TRUE);
|
||||||
}
|
}
|
||||||
x86Protected(MipsRegMapLo(Reg)) = TRUE;
|
SetX86Protected(MipsRegMapLo(Reg),TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRegInfo::UnProtectGPR(DWORD Reg) {
|
void CRegInfo::UnProtectGPR(DWORD Reg) {
|
||||||
if (IsUnknown(Reg) || IsConst(Reg)) { return; }
|
if (IsUnknown(Reg) || IsConst(Reg)) { return; }
|
||||||
if (Is64Bit(Reg)) {
|
if (Is64Bit(Reg)) {
|
||||||
x86Protected(MipsRegMapHi(Reg)) = false;
|
SetX86Protected(MipsRegMapHi(Reg),false);
|
||||||
}
|
}
|
||||||
x86Protected(MipsRegMapLo(Reg)) = false;
|
SetX86Protected(MipsRegMapLo(Reg),false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRegInfo::ResetX86Protection (void)
|
void CRegInfo::ResetX86Protection (void)
|
||||||
{
|
{
|
||||||
for (int count = 0; count < 10; count ++)
|
for (int count = 0; count < 10; count ++)
|
||||||
{
|
{
|
||||||
x86Protected((x86Reg)count) = false;
|
SetX86Protected((x86Reg)count, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,7 +868,7 @@ void CRegInfo::UnMap_FPR (int Reg, int WriteBackValue )
|
||||||
DisplayError("UnMap_FPR\nUnknown format to load %d",x86fpu_State[StackTopPos()]);
|
DisplayError("UnMap_FPR\nUnknown format to load %d",x86fpu_State[StackTopPos()]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
x86Protected(TempReg) = FALSE;
|
SetX86Protected(TempReg,FALSE);
|
||||||
FpuRoundingModel(RegPos) = RoundDefault;
|
FpuRoundingModel(RegPos) = RoundDefault;
|
||||||
x86fpu_MappedTo[RegPos] = -1;
|
x86fpu_MappedTo[RegPos] = -1;
|
||||||
x86fpu_State[RegPos] = FPU_Unknown;
|
x86fpu_State[RegPos] = FPU_Unknown;
|
||||||
|
@ -847,13 +917,14 @@ void CRegInfo::UnMap_GPR (DWORD Reg, bool WriteBackValue)
|
||||||
}
|
}
|
||||||
if (Is64Bit(Reg)) {
|
if (Is64Bit(Reg)) {
|
||||||
CPU_Message(" regcache: unallocate %s from %s",x86_Name(MipsRegMapHi(Reg)),CRegName::GPR_Hi[Reg]);
|
CPU_Message(" regcache: unallocate %s from %s",x86_Name(MipsRegMapHi(Reg)),CRegName::GPR_Hi[Reg]);
|
||||||
x86Mapped(MipsRegMapHi(Reg)) = NotMapped;
|
SetX86Mapped(MipsRegMapHi(Reg),NotMapped);
|
||||||
x86Protected(MipsRegMapHi(Reg)) = FALSE;
|
SetX86Protected(MipsRegMapHi(Reg),FALSE);
|
||||||
}
|
}
|
||||||
CPU_Message(" regcache: unallocate %s from %s",x86_Name(MipsRegMapLo(Reg)),CRegName::GPR_Lo[Reg]);
|
CPU_Message(" regcache: unallocate %s from %s",x86_Name(MipsRegMapLo(Reg)),CRegName::GPR_Lo[Reg]);
|
||||||
x86Mapped(MipsRegMapLo(Reg)) = NotMapped;
|
SetX86Mapped(MipsRegMapLo(Reg),NotMapped);
|
||||||
x86Protected(MipsRegMapLo(Reg)) = FALSE;
|
SetX86Protected(MipsRegMapLo(Reg),FALSE);
|
||||||
if (!WriteBackValue) {
|
if (!WriteBackValue)
|
||||||
|
{
|
||||||
MipsRegState(Reg) = STATE_UNKNOWN;
|
MipsRegState(Reg) = STATE_UNKNOWN;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -875,22 +946,22 @@ CX86Ops::x86Reg CRegInfo::UnMap_TempReg ( void )
|
||||||
{
|
{
|
||||||
CX86Ops::x86Reg Reg = x86_Unknown;
|
CX86Ops::x86Reg Reg = x86_Unknown;
|
||||||
|
|
||||||
if (x86Mapped(x86_EAX) == Temp_Mapped && !x86Protected(x86_EAX)) { Reg = x86_EAX; }
|
if (GetX86Mapped(x86_EAX) == Temp_Mapped && !GetX86Protected(x86_EAX)) { Reg = x86_EAX; }
|
||||||
else if (x86Mapped(x86_EBX) == Temp_Mapped && !x86Protected(x86_EBX)) { Reg = x86_EBX; }
|
else if (GetX86Mapped(x86_EBX) == Temp_Mapped && !GetX86Protected(x86_EBX)) { Reg = x86_EBX; }
|
||||||
else if (x86Mapped(x86_ECX) == Temp_Mapped && !x86Protected(x86_ECX)) { Reg = x86_ECX; }
|
else if (GetX86Mapped(x86_ECX) == Temp_Mapped && !GetX86Protected(x86_ECX)) { Reg = x86_ECX; }
|
||||||
else if (x86Mapped(x86_EDX) == Temp_Mapped && !x86Protected(x86_EDX)) { Reg = x86_EDX; }
|
else if (GetX86Mapped(x86_EDX) == Temp_Mapped && !GetX86Protected(x86_EDX)) { Reg = x86_EDX; }
|
||||||
else if (x86Mapped(x86_ESI) == Temp_Mapped && !x86Protected(x86_ESI)) { Reg = x86_ESI; }
|
else if (GetX86Mapped(x86_ESI) == Temp_Mapped && !GetX86Protected(x86_ESI)) { Reg = x86_ESI; }
|
||||||
else if (x86Mapped(x86_EDI) == Temp_Mapped && !x86Protected(x86_EDI)) { Reg = x86_EDI; }
|
else if (GetX86Mapped(x86_EDI) == Temp_Mapped && !GetX86Protected(x86_EDI)) { Reg = x86_EDI; }
|
||||||
else if (x86Mapped(x86_EBP) == Temp_Mapped && !x86Protected(x86_EBP)) { Reg = x86_EBP; }
|
else if (GetX86Mapped(x86_EBP) == Temp_Mapped && !GetX86Protected(x86_EBP)) { Reg = x86_EBP; }
|
||||||
else if (x86Mapped(x86_ESP) == Temp_Mapped && !x86Protected(x86_ESP)) { Reg = x86_ESP; }
|
else if (GetX86Mapped(x86_ESP) == Temp_Mapped && !GetX86Protected(x86_ESP)) { Reg = x86_ESP; }
|
||||||
|
|
||||||
if (Reg != x86_Unknown)
|
if (Reg != x86_Unknown)
|
||||||
{
|
{
|
||||||
if (x86Mapped(Reg) == Temp_Mapped)
|
if (GetX86Mapped(Reg) == Temp_Mapped)
|
||||||
{
|
{
|
||||||
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name(Reg));
|
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name(Reg));
|
||||||
}
|
}
|
||||||
x86Mapped(Reg) = NotMapped;
|
SetX86Mapped(Reg,NotMapped);
|
||||||
}
|
}
|
||||||
return Reg;
|
return Reg;
|
||||||
}
|
}
|
||||||
|
@ -899,11 +970,11 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (x86Mapped(Reg) == NotMapped && x86Protected(Reg) == FALSE) { return TRUE; }
|
if (GetX86Mapped(Reg) == NotMapped && GetX86Protected(Reg) == FALSE) { return TRUE; }
|
||||||
if (x86Mapped(Reg) == CRegInfo::Temp_Mapped) {
|
if (GetX86Mapped(Reg) == CRegInfo::Temp_Mapped) {
|
||||||
if (x86Protected(Reg) == FALSE) {
|
if (GetX86Protected(Reg) == FALSE) {
|
||||||
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name(Reg));
|
CPU_Message(" regcache: unallocate %s from temp storage",x86_Name(Reg));
|
||||||
x86Mapped(Reg) = NotMapped;
|
SetX86Mapped(Reg,NotMapped);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -916,7 +987,7 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
|
||||||
}
|
}
|
||||||
if (Is64Bit(count) && MipsRegMapHi(count) == Reg)
|
if (Is64Bit(count) && MipsRegMapHi(count) == Reg)
|
||||||
{
|
{
|
||||||
if (x86Protected(Reg) == FALSE)
|
if (GetX86Protected(Reg) == FALSE)
|
||||||
{
|
{
|
||||||
UnMap_GPR(count,TRUE);
|
UnMap_GPR(count,TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -925,7 +996,7 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
|
||||||
}
|
}
|
||||||
if (MipsRegMapLo(count) == Reg)
|
if (MipsRegMapLo(count) == Reg)
|
||||||
{
|
{
|
||||||
if (x86Protected(Reg) == FALSE)
|
if (GetX86Protected(Reg) == FALSE)
|
||||||
{
|
{
|
||||||
UnMap_GPR(count,TRUE);
|
UnMap_GPR(count,TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -933,14 +1004,11 @@ bool CRegInfo::UnMap_X86reg ( CX86Ops::x86Reg Reg )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (x86Mapped(Reg) == CRegInfo::Stack_Mapped) {
|
if (GetX86Mapped(Reg) == CRegInfo::Stack_Mapped) {
|
||||||
_Notify->BreakPoint(__FILE__,__LINE__);
|
|
||||||
#ifdef tofix
|
|
||||||
CPU_Message(" regcache: unallocate %s from Memory Stack",x86_Name(Reg));
|
CPU_Message(" regcache: unallocate %s from Memory Stack",x86_Name(Reg));
|
||||||
MoveX86regToVariable(Reg,g_MemoryStack,"MemoryStack");
|
MoveX86regToVariable(Reg,&(_Recompiler->MemoryStackPos()),"MemoryStack");
|
||||||
x86Mapped(Reg) = NotMapped;
|
SetX86Mapped(Reg,NotMapped);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -956,7 +1024,7 @@ void CRegInfo::WriteBackRegisters (void)
|
||||||
BOOL bEaxGprLo = FALSE;
|
BOOL bEaxGprLo = FALSE;
|
||||||
BOOL bEbxGprHi = FALSE;
|
BOOL bEbxGprHi = FALSE;
|
||||||
|
|
||||||
for (count = 0; count < 10; count ++) { x86Protected((CX86Ops::x86Reg)count) = FALSE; }
|
for (count = 0; count < 10; count ++) { SetX86Protected((CX86Ops::x86Reg)count,FALSE); }
|
||||||
for (count = 0; count < 10; count ++) { UnMap_X86reg ((CX86Ops::x86Reg)count); }
|
for (count = 0; count < 10; count ++) { UnMap_X86reg ((CX86Ops::x86Reg)count); }
|
||||||
|
|
||||||
/*************************************/
|
/*************************************/
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
x86Reg Free8BitX86Reg ( void );
|
x86Reg Free8BitX86Reg ( void );
|
||||||
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 Map_MemoryStack ( x86Reg Reg, bool bMapRegister );
|
||||||
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 );
|
||||||
|
@ -109,11 +110,16 @@ public:
|
||||||
inline CX86Ops::x86Reg & MipsRegMapHi ( int Reg ) { return RegMapHi[Reg]; }
|
inline CX86Ops::x86Reg & MipsRegMapHi ( int Reg ) { return RegMapHi[Reg]; }
|
||||||
inline bool & X86Protected ( x86Reg Reg ) { return x86reg_Protected[Reg]; }
|
inline bool & X86Protected ( x86Reg Reg ) { return x86reg_Protected[Reg]; }
|
||||||
|
|
||||||
inline DWORD & x86MapOrder( x86Reg Reg ) { return x86reg_MapOrder[Reg]; }
|
inline DWORD GetX86MapOrder ( x86Reg Reg ) const { return x86reg_MapOrder[Reg]; }
|
||||||
inline bool & x86Protected( x86Reg Reg ) { return x86reg_Protected[Reg]; }
|
inline bool GetX86Protected ( x86Reg Reg ) const { return x86reg_Protected[Reg]; }
|
||||||
inline REG_MAPPED & x86Mapped(x86Reg Reg) { return x86reg_MappedTo[Reg]; }
|
inline REG_MAPPED GetX86Mapped ( x86Reg Reg ) const { return x86reg_MappedTo[Reg]; }
|
||||||
|
|
||||||
|
inline DWORD GetBlockCycleCount ( void ) const { return m_CycleCount; }
|
||||||
|
|
||||||
|
inline void SetX86MapOrder ( x86Reg Reg, DWORD Order ) { x86reg_MapOrder[Reg] = Order; }
|
||||||
|
inline void SetX86Protected ( x86Reg Reg, bool Protected ) { x86reg_Protected[Reg] = Protected; }
|
||||||
|
inline void SetX86Mapped ( x86Reg Reg, REG_MAPPED Mapping ) { x86reg_MappedTo[Reg] = Mapping; }
|
||||||
|
|
||||||
inline DWORD GetBlockCycleCount ( void ) const { return m_CycleCount; }
|
|
||||||
inline void SetBlockCycleCount ( DWORD CyleCount ) { m_CycleCount = CyleCount; }
|
inline void SetBlockCycleCount ( DWORD CyleCount ) { m_CycleCount = CyleCount; }
|
||||||
|
|
||||||
inline int & StackTopPos ( void ) { return Stack_TopPos; }
|
inline int & StackTopPos ( void ) { return Stack_TopPos; }
|
||||||
|
@ -121,7 +127,9 @@ public:
|
||||||
inline FPU_STATE & FpuState(int Reg) { return x86fpu_State[Reg]; }
|
inline FPU_STATE & FpuState(int Reg) { return x86fpu_State[Reg]; }
|
||||||
inline FPU_ROUND & FpuRoundingModel(int Reg) { return x86fpu_RoundingModel[Reg]; }
|
inline FPU_ROUND & FpuRoundingModel(int Reg) { return x86fpu_RoundingModel[Reg]; }
|
||||||
inline bool & FpuBeenUsed (void ) { return Fpu_Used; }
|
inline bool & FpuBeenUsed (void ) { return Fpu_Used; }
|
||||||
inline FPU_ROUND & CurrentRoundingModel ( void ) { return RoundingModel; }
|
|
||||||
|
inline FPU_ROUND GetRoundingModel ( void ) const { return m_RoundingModel; }
|
||||||
|
inline void SetRoundingModel ( FPU_ROUND RoundingModel ) { m_RoundingModel = RoundingModel; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
x86Reg UnMap_8BitTempReg ( void );
|
x86Reg UnMap_8BitTempReg ( void );
|
||||||
|
@ -146,7 +154,7 @@ private:
|
||||||
FPU_ROUND x86fpu_RoundingModel[8];
|
FPU_ROUND x86fpu_RoundingModel[8];
|
||||||
|
|
||||||
bool Fpu_Used;
|
bool Fpu_Used;
|
||||||
FPU_ROUND RoundingModel;
|
FPU_ROUND m_RoundingModel;
|
||||||
|
|
||||||
bool compare(const CRegInfo& right) const;
|
bool compare(const CRegInfo& right) const;
|
||||||
const char * RoundingModelName ( FPU_ROUND RoundType );
|
const char * RoundingModelName ( FPU_ROUND RoundType );
|
||||||
|
|
|
@ -12,16 +12,15 @@ CCodeBlock::CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos, bool bDelaySlot) :
|
||||||
AnalyseBlock();
|
AnalyseBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCodeBlock::AnalyseBlock ( void )
|
bool CCodeBlock::AnalyseBlock ( void )
|
||||||
{
|
{
|
||||||
/*if (bLinkBlocks())
|
if (bLinkBlocks())
|
||||||
{
|
{
|
||||||
CCodeSection * Section = &ParentSection;
|
if (!m_EnterSection.CreateSectionLinkage ()) { return false; }
|
||||||
if (!CreateSectionLinkage (Section)) { return false; }
|
m_EnterSection.DetermineLoop(NextTest(),NextTest(), m_EnterSection.m_SectionID);
|
||||||
DetermineLoop(Section,CCodeSection::GetNewTestValue(),CCodeSection::GetNewTestValue(), Section->SectionID);
|
while (m_EnterSection.FixConstants(NextTest())) {}
|
||||||
while (FixConstants(Section,CCodeSection::GetNewTestValue())) {}
|
|
||||||
}
|
}
|
||||||
return true;*/
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCodeBlock::Compile()
|
bool CCodeBlock::Compile()
|
||||||
|
@ -224,70 +223,6 @@ DWORD CCodeSection::GetNewTestValue(void)
|
||||||
return LastTest;
|
return LastTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCodeSection::TestRegConstantStates( CRegInfo & Base, CRegInfo & Reg )
|
|
||||||
{
|
|
||||||
for (int count = 0; count < 32; count++) {
|
|
||||||
if (Reg.MipsRegState(count) != Base.MipsRegState(count)) {
|
|
||||||
Reg.MipsRegState(count) = CRegInfo::STATE_UNKNOWN;
|
|
||||||
}
|
|
||||||
if (Reg.IsConst(count))
|
|
||||||
{
|
|
||||||
if (Reg.Is32Bit(count))
|
|
||||||
{
|
|
||||||
if (Reg.MipsRegLo(count) != Base.MipsRegLo(count)) {
|
|
||||||
Reg.MipsRegState(count) = CRegInfo::STATE_UNKNOWN;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Reg.MipsReg(count) != Base.MipsReg(count)) {
|
|
||||||
Reg.MipsRegState(count) = CRegInfo::STATE_UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CCodeSection::AddParent(CCodeSection * Parent )
|
|
||||||
{
|
|
||||||
if (this == NULL) { return; }
|
|
||||||
if (Parent == NULL)
|
|
||||||
{
|
|
||||||
RegStart.Initilize();
|
|
||||||
RegWorking = RegStart;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check to see if we already have the parent in the list
|
|
||||||
for (SECTION_LIST::iterator iter = ParentSection.begin(); iter != ParentSection.end(); iter++)
|
|
||||||
{
|
|
||||||
if (*iter == Parent)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ParentSection.push_back(Parent);
|
|
||||||
|
|
||||||
if (ParentSection.size() == 1)
|
|
||||||
{
|
|
||||||
if (Parent->ContinueSection == this) {
|
|
||||||
RegStart = Parent->Cont.RegSet;
|
|
||||||
} else if (Parent->JumpSection == this) {
|
|
||||||
RegStart = Parent->Jump.RegSet;
|
|
||||||
} else {
|
|
||||||
_Notify->DisplayError("How are these sections joined?????");
|
|
||||||
}
|
|
||||||
RegWorking = RegStart;
|
|
||||||
} else {
|
|
||||||
if (Parent->ContinueSection == this) {
|
|
||||||
TestRegConstantStates(Parent->Cont.RegSet,RegStart);
|
|
||||||
}
|
|
||||||
if (Parent->JumpSection == this) {
|
|
||||||
TestRegConstantStates(Parent->Jump.RegSet,RegStart);
|
|
||||||
}
|
|
||||||
RegWorking = RegStart;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRegInfo::Initilize ( void )
|
void CRegInfo::Initilize ( void )
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
@ -358,7 +293,7 @@ bool CRegInfo::compare(const CRegInfo& right) const
|
||||||
if (x86fpu_RoundingModel[count] != right.x86fpu_RoundingModel[count]) { return false; }
|
if (x86fpu_RoundingModel[count] != right.x86fpu_RoundingModel[count]) { return false; }
|
||||||
}
|
}
|
||||||
if (Fpu_Used != right.Fpu_Used) { return false; }
|
if (Fpu_Used != right.Fpu_Used) { return false; }
|
||||||
if (RoundingModel != right.RoundingModel) { return false; }
|
if (GetRoundingModel() != right.GetRoundingModel()) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class CCodeSection;
|
class CCodeSection;
|
||||||
typedef std::list<CCodeSection *> SECTION_LIST;
|
|
||||||
|
|
||||||
|
|
||||||
class CCodeBlock;
|
class CCodeBlock;
|
||||||
|
|
|
@ -72,6 +72,10 @@ void CSpeedLimitor::IncreaeSpeed ( int Percent )
|
||||||
|
|
||||||
void CSpeedLimitor::DecreaeSpeed ( int Percent )
|
void CSpeedLimitor::DecreaeSpeed ( int Percent )
|
||||||
{
|
{
|
||||||
m_Speed -= m_BaseSpeed * ((float)Percent / 100);
|
ULONG Unit = m_BaseSpeed * ((float)Percent / 100);
|
||||||
FixSpeedRatio();
|
if (m_Speed > Unit)
|
||||||
|
{
|
||||||
|
m_Speed -= Unit;
|
||||||
|
FixSpeedRatio();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -45,7 +45,7 @@ enum SettingID {
|
||||||
Rdb_CounterFactor,
|
Rdb_CounterFactor,
|
||||||
Rdb_UseTlb,
|
Rdb_UseTlb,
|
||||||
Rdb_DelaySi,
|
Rdb_DelaySi,
|
||||||
Rdb_SPHack,
|
Rdb_FastSP,
|
||||||
Rdb_Status,
|
Rdb_Status,
|
||||||
Rdb_NotesCore,
|
Rdb_NotesCore,
|
||||||
Rdb_NotesPlugin,
|
Rdb_NotesPlugin,
|
||||||
|
@ -99,7 +99,7 @@ enum SettingID {
|
||||||
Game_CounterFactor,
|
Game_CounterFactor,
|
||||||
Game_UseTlb,
|
Game_UseTlb,
|
||||||
Game_DelaySI,
|
Game_DelaySI,
|
||||||
Game_SPHack,
|
Game_FastSP,
|
||||||
Game_FuncLookupMode,
|
Game_FuncLookupMode,
|
||||||
Game_RegCache,
|
Game_RegCache,
|
||||||
Game_BlockLinking,
|
Game_BlockLinking,
|
||||||
|
|
|
@ -10,7 +10,7 @@ bool CN64SystemSettings::m_bShowDListAListCount;
|
||||||
bool CN64SystemSettings::m_bFixedAudio;
|
bool CN64SystemSettings::m_bFixedAudio;
|
||||||
bool CN64SystemSettings::m_bSyncToAudio;
|
bool CN64SystemSettings::m_bSyncToAudio;
|
||||||
bool CN64SystemSettings::m_bDisplayFrameRate;
|
bool CN64SystemSettings::m_bDisplayFrameRate;
|
||||||
bool CN64SystemSettings::m_SPHack;
|
bool CN64SystemSettings::m_bFastSP;
|
||||||
DWORD CN64SystemSettings::m_ViRefreshRate;
|
DWORD CN64SystemSettings::m_ViRefreshRate;
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ CN64SystemSettings::CN64SystemSettings()
|
||||||
|
|
||||||
_Settings->RegisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
_Settings->RegisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
||||||
_Settings->RegisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
_Settings->RegisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
||||||
_Settings->RegisterChangeCB(Game_SPHack,NULL,RefreshSettings);
|
_Settings->RegisterChangeCB(Game_FastSP,NULL,RefreshSettings);
|
||||||
_Settings->RegisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
_Settings->RegisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
||||||
RefreshSettings(NULL);
|
RefreshSettings(NULL);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ CN64SystemSettings::~CN64SystemSettings()
|
||||||
|
|
||||||
_Settings->UnregisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
_Settings->UnregisterChangeCB(Game_FixedAudio,NULL,RefreshSettings);
|
||||||
_Settings->UnregisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
_Settings->UnregisterChangeCB(Game_SyncViaAudio,NULL,RefreshSettings);
|
||||||
_Settings->UnregisterChangeCB(Game_SPHack,NULL,RefreshSettings);
|
_Settings->UnregisterChangeCB(Game_FastSP,NULL,RefreshSettings);
|
||||||
_Settings->UnregisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
_Settings->UnregisterChangeCB(Game_ViRefreshRate,NULL,RefreshSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,6 @@ void CN64SystemSettings::RefreshSettings(void *)
|
||||||
|
|
||||||
m_bFixedAudio = _Settings->LoadBool(Game_FixedAudio);
|
m_bFixedAudio = _Settings->LoadBool(Game_FixedAudio);
|
||||||
m_bSyncToAudio = m_bFixedAudio ? _Settings->LoadBool(Game_SyncViaAudio) : false;
|
m_bSyncToAudio = m_bFixedAudio ? _Settings->LoadBool(Game_SyncViaAudio) : false;
|
||||||
m_SPHack = _Settings->LoadBool(Game_SPHack);
|
m_bFastSP = _Settings->LoadBool(Game_FastSP);
|
||||||
m_ViRefreshRate = _Settings->LoadDword(Game_ViRefreshRate);
|
m_ViRefreshRate = _Settings->LoadDword(Game_ViRefreshRate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ protected:
|
||||||
inline bool bLimitFPS ( void ) const { return m_bLimitFPS; }
|
inline bool bLimitFPS ( void ) const { return m_bLimitFPS; }
|
||||||
inline bool bFixedAudio ( void ) const { return m_bFixedAudio; }
|
inline bool bFixedAudio ( void ) const { return m_bFixedAudio; }
|
||||||
inline bool bSyncToAudio ( void ) const { return m_bSyncToAudio; }
|
inline bool bSyncToAudio ( void ) const { return m_bSyncToAudio; }
|
||||||
inline bool bSPHack ( void ) const { return m_SPHack; }
|
inline bool bFastSP ( void ) const { return m_bFastSP; }
|
||||||
inline DWORD ViRefreshRate ( void ) const { return m_ViRefreshRate; }
|
inline DWORD ViRefreshRate ( void ) const { return m_ViRefreshRate; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -28,7 +28,7 @@ private:
|
||||||
static bool m_bFixedAudio;
|
static bool m_bFixedAudio;
|
||||||
static bool m_bSyncToAudio;
|
static bool m_bSyncToAudio;
|
||||||
static bool m_bDisplayFrameRate;
|
static bool m_bDisplayFrameRate;
|
||||||
static bool m_SPHack;
|
static bool m_bFastSP;
|
||||||
static DWORD m_ViRefreshRate;
|
static DWORD m_ViRefreshRate;
|
||||||
|
|
||||||
static int m_RefCount;
|
static int m_RefCount;
|
||||||
|
|
|
@ -8,6 +8,7 @@ bool CRecompilerSettings::m_bSMM_PIDMA;
|
||||||
bool CRecompilerSettings::m_bSMM_TLB;
|
bool CRecompilerSettings::m_bSMM_TLB;
|
||||||
bool CRecompilerSettings::m_bProfiling;
|
bool CRecompilerSettings::m_bProfiling;
|
||||||
bool CRecompilerSettings::m_bRomInMemory;
|
bool CRecompilerSettings::m_bRomInMemory;
|
||||||
|
bool CRecompilerSettings::m_bFastSP;
|
||||||
bool CRecompilerSettings::m_RegCaching;
|
bool CRecompilerSettings::m_RegCaching;
|
||||||
bool CRecompilerSettings::m_bLinkBlocks;
|
bool CRecompilerSettings::m_bLinkBlocks;
|
||||||
DWORD CRecompilerSettings::m_RdramSize;
|
DWORD CRecompilerSettings::m_RdramSize;
|
||||||
|
@ -29,6 +30,7 @@ CRecompilerSettings::CRecompilerSettings()
|
||||||
_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
_Settings->RegisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->RegisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
|
_Settings->RegisterChangeCB(Game_FastSP,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
|
|
||||||
RefreshSettings();
|
RefreshSettings();
|
||||||
}
|
}
|
||||||
|
@ -48,6 +50,7 @@ CRecompilerSettings::~CRecompilerSettings()
|
||||||
_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
_Settings->UnregisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
_Settings->UnregisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
|
_Settings->UnregisterChangeCB(Game_FastSP,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRecompilerSettings::RefreshSettings()
|
void CRecompilerSettings::RefreshSettings()
|
||||||
|
@ -60,6 +63,7 @@ void CRecompilerSettings::RefreshSettings()
|
||||||
m_bShowRecompMemSize = _Settings->LoadBool(Debugger_ShowRecompMemSize);
|
m_bShowRecompMemSize = _Settings->LoadBool(Debugger_ShowRecompMemSize);
|
||||||
m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
|
m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
|
||||||
m_bRomInMemory = _Settings->LoadBool(Game_LoadRomToMemory);
|
m_bRomInMemory = _Settings->LoadBool(Game_LoadRomToMemory);
|
||||||
|
m_bFastSP = _Settings->LoadBool(Game_FastSP);
|
||||||
|
|
||||||
m_RegCaching = _Settings->LoadBool(Game_RegCache);
|
m_RegCaching = _Settings->LoadBool(Game_RegCache);
|
||||||
m_bLinkBlocks = _Settings->LoadBool(Game_BlockLinking);
|
m_bLinkBlocks = _Settings->LoadBool(Game_BlockLinking);
|
||||||
|
|
|
@ -19,6 +19,7 @@ class CRecompilerSettings
|
||||||
static bool m_bSMM_TLB;
|
static bool m_bSMM_TLB;
|
||||||
static bool m_bProfiling;
|
static bool m_bProfiling;
|
||||||
static bool m_bRomInMemory;
|
static bool m_bRomInMemory;
|
||||||
|
static bool m_bFastSP;
|
||||||
|
|
||||||
static bool m_RegCaching;
|
static bool m_RegCaching;
|
||||||
static bool m_bLinkBlocks;
|
static bool m_bLinkBlocks;
|
||||||
|
@ -30,18 +31,19 @@ public:
|
||||||
CRecompilerSettings();
|
CRecompilerSettings();
|
||||||
virtual ~CRecompilerSettings();
|
virtual ~CRecompilerSettings();
|
||||||
|
|
||||||
inline bool bShowRecompMemSize ( void ) const { return m_bShowRecompMemSize; }
|
static bool bShowRecompMemSize ( void ) { return m_bShowRecompMemSize; }
|
||||||
|
|
||||||
inline bool bSMM_StoreInstruc ( void ) const { return m_bSMM_StoreInstruc; }
|
static bool bSMM_StoreInstruc ( void ) { return m_bSMM_StoreInstruc; }
|
||||||
inline bool bSMM_Protect ( void ) const { return m_bSMM_Protect; }
|
static bool bSMM_Protect ( void ) { return m_bSMM_Protect; }
|
||||||
inline bool bSMM_ValidFunc ( void ) const { return m_bSMM_ValidFunc; }
|
static bool bSMM_ValidFunc ( void ) { return m_bSMM_ValidFunc; }
|
||||||
inline bool bSMM_PIDMA ( void ) const { return m_bSMM_PIDMA; }
|
static bool bSMM_PIDMA ( void ) { return m_bSMM_PIDMA; }
|
||||||
inline bool bSMM_TLB ( void ) const { return m_bSMM_TLB; }
|
static bool bSMM_TLB ( void ) { return m_bSMM_TLB; }
|
||||||
inline bool bProfiling ( void ) const { return m_bProfiling; }
|
static bool bProfiling ( void ) { return m_bProfiling; }
|
||||||
inline bool bRomInMemory ( void ) const { return m_bRomInMemory; }
|
static bool bRomInMemory ( void ) { return m_bRomInMemory; }
|
||||||
inline bool bRegCaching ( void ) const { return m_RegCaching; }
|
static bool bRegCaching ( void ) { return m_RegCaching; }
|
||||||
inline bool bLinkBlocks ( void ) const { return m_bLinkBlocks; }
|
static bool bLinkBlocks ( void ) { return m_bLinkBlocks; }
|
||||||
inline DWORD RdramSize ( void ) const { return m_RdramSize; }
|
static bool bFastSP ( void ) { return m_bFastSP; }
|
||||||
inline DWORD CountPerOp ( void ) const { return m_CountPerOp; }
|
static DWORD RdramSize ( void ) { return m_RdramSize; }
|
||||||
inline FUNC_LOOKUP_METHOD LookUpMode ( void ) const { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
|
static DWORD CountPerOp ( void ) { return m_CountPerOp; }
|
||||||
|
static FUNC_LOOKUP_METHOD LookUpMode ( void ) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
|
||||||
};
|
};
|
|
@ -102,7 +102,7 @@ void CSettings::AddHowToHandleSetting ()
|
||||||
AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor",2));
|
AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor",2));
|
||||||
AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB",true));
|
AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB",true));
|
||||||
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI",false));
|
AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI",false));
|
||||||
AddHandler(Rdb_SPHack, new CSettingTypeRDBYesNo("SP Hack",false));
|
AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP",true));
|
||||||
AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status","Unknown"));
|
AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status","Unknown"));
|
||||||
AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note",""));
|
AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note",""));
|
||||||
AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note",""));
|
AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note",""));
|
||||||
|
@ -148,7 +148,7 @@ void CSettings::AddHowToHandleSetting ()
|
||||||
AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB",Rdb_UseTlb));
|
AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB",Rdb_UseTlb));
|
||||||
AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI",Rdb_DelaySi));
|
AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI",Rdb_DelaySi));
|
||||||
AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal",Rdb_RspAudioSignal));
|
AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal",Rdb_RspAudioSignal));
|
||||||
AddHandler(Game_SPHack, new CSettingTypeGame("SP Hack",Rdb_SPHack));
|
AddHandler(Game_FastSP, new CSettingTypeGame("SP Hack",Rdb_FastSP));
|
||||||
AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0));
|
AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0));
|
||||||
AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio",Rdb_SyncViaAudio));
|
AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio",Rdb_SyncViaAudio));
|
||||||
AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX",Rdb_UseHleGfx));
|
AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX",Rdb_UseHleGfx));
|
||||||
|
|
|
@ -19,7 +19,7 @@ CGameRecompilePage::CGameRecompilePage (HWND hParent, const RECT & rcDispay )
|
||||||
AddModCheckBox(GetDlgItem(IDC_SMM_TLB),Game_SMM_TLB);
|
AddModCheckBox(GetDlgItem(IDC_SMM_TLB),Game_SMM_TLB);
|
||||||
AddModCheckBox(GetDlgItem(IDC_SMM_PROTECT),Game_SMM_Protect);
|
AddModCheckBox(GetDlgItem(IDC_SMM_PROTECT),Game_SMM_Protect);
|
||||||
AddModCheckBox(GetDlgItem(IDC_SMM_STORE),Game_SMM_StoreInstruc);
|
AddModCheckBox(GetDlgItem(IDC_SMM_STORE),Game_SMM_StoreInstruc);
|
||||||
AddModCheckBox(GetDlgItem(IDC_ROM_SPHACK),Game_SPHack);
|
AddModCheckBox(GetDlgItem(IDC_ROM_FASTSP),Game_FastSP);
|
||||||
|
|
||||||
CModifiedComboBox * ComboBox;
|
CModifiedComboBox * ComboBox;
|
||||||
ComboBox = AddModComboBox(GetDlgItem(IDC_CPU_TYPE),Game_CpuType);
|
ComboBox = AddModComboBox(GetDlgItem(IDC_CPU_TYPE),Game_CpuType);
|
||||||
|
|
|
@ -9,13 +9,13 @@ class CGameRecompilePage :
|
||||||
COMMAND_HANDLER_EX(IDC_CPU_TYPE,LBN_SELCHANGE,ComboBoxChanged)
|
COMMAND_HANDLER_EX(IDC_CPU_TYPE,LBN_SELCHANGE,ComboBoxChanged)
|
||||||
COMMAND_HANDLER_EX(IDC_FUNCFIND,LBN_SELCHANGE,ComboBoxChanged)
|
COMMAND_HANDLER_EX(IDC_FUNCFIND,LBN_SELCHANGE,ComboBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_ROM_REGCACHE,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_ROM_REGCACHE,CheckBoxChanged)
|
||||||
|
COMMAND_ID_HANDLER_EX(IDC_ROM_FASTSP,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_BLOCK_LINKING,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_BLOCK_LINKING,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_CACHE,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_CACHE,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_DMA,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_DMA,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_VALIDATE,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_VALIDATE,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_TLB,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_TLB,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_PROTECT,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_PROTECT,CheckBoxChanged)
|
||||||
COMMAND_ID_HANDLER_EX(IDC_ROM_SPHACK,CheckBoxChanged)
|
|
||||||
COMMAND_ID_HANDLER_EX(IDC_SMM_STORE,CheckBoxChanged)
|
COMMAND_ID_HANDLER_EX(IDC_SMM_STORE,CheckBoxChanged)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -740,7 +740,7 @@ BEGIN
|
||||||
208,1
|
208,1
|
||||||
CONTROL "Advanced Block Linking",IDC_BLOCK_LINKING,"Button",
|
CONTROL "Advanced Block Linking",IDC_BLOCK_LINKING,"Button",
|
||||||
BS_AUTOCHECKBOX | WS_TABSTOP,113,49,95,11
|
BS_AUTOCHECKBOX | WS_TABSTOP,113,49,95,11
|
||||||
CONTROL "SP Hack",IDC_ROM_SPHACK,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Fast SP",IDC_ROM_FASTSP,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,10,62,91,11
|
WS_TABSTOP,10,62,91,11
|
||||||
CONTROL "Store Instruction",IDC_SMM_STORE,"Button",
|
CONTROL "Store Instruction",IDC_SMM_STORE,"Button",
|
||||||
BS_AUTOCHECKBOX | WS_TABSTOP,116,91,89,8
|
BS_AUTOCHECKBOX | WS_TABSTOP,116,91,89,8
|
||||||
|
@ -1087,8 +1087,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,7,51,42
|
FILEVERSION 1,7,51,43
|
||||||
PRODUCTVERSION 1,7,51,42
|
PRODUCTVERSION 1,7,51,43
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -1106,14 +1106,14 @@ BEGIN
|
||||||
VALUE "Comments", "\0"
|
VALUE "Comments", "\0"
|
||||||
VALUE "CompanyName", " \0"
|
VALUE "CompanyName", " \0"
|
||||||
VALUE "FileDescription", "Project64\0"
|
VALUE "FileDescription", "Project64\0"
|
||||||
VALUE "FileVersion", "1, 7, 51, 42\0"
|
VALUE "FileVersion", "1, 7, 51, 43\0"
|
||||||
VALUE "InternalName", "Project64\0"
|
VALUE "InternalName", "Project64\0"
|
||||||
VALUE "LegalCopyright", "Copyright © 2004\0"
|
VALUE "LegalCopyright", "Copyright © 2010\0"
|
||||||
VALUE "LegalTrademarks", "\0"
|
VALUE "LegalTrademarks", "\0"
|
||||||
VALUE "OriginalFilename", "Project64.exe\0"
|
VALUE "OriginalFilename", "Project64.exe\0"
|
||||||
VALUE "PrivateBuild", "\0"
|
VALUE "PrivateBuild", "\0"
|
||||||
VALUE "ProductName", " Project64\0"
|
VALUE "ProductName", " Project64\0"
|
||||||
VALUE "ProductVersion", "1, 7, 51, 42\0"
|
VALUE "ProductVersion", "1, 7, 51, 43\0"
|
||||||
VALUE "SpecialBuild", "\0"
|
VALUE "SpecialBuild", "\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
|
@ -240,7 +240,7 @@
|
||||||
#define IDC_ROM_REGCACHE 1099
|
#define IDC_ROM_REGCACHE 1099
|
||||||
#define IDC_CONT_NAME 1100
|
#define IDC_CONT_NAME 1100
|
||||||
#define IDC_DIR_FRAME1 1101
|
#define IDC_DIR_FRAME1 1101
|
||||||
#define IDC_ROM_SPHACK 1101
|
#define IDC_ROM_FASTSP 1101
|
||||||
#define IDC_AUDIO_SIGNAL 1102
|
#define IDC_AUDIO_SIGNAL 1102
|
||||||
#define IDC_DIR_TEXTURE_FRAME 1102
|
#define IDC_DIR_TEXTURE_FRAME 1102
|
||||||
#define IDC_DIR_FRAME3 1103
|
#define IDC_DIR_FRAME3 1103
|
||||||
|
|
Loading…
Reference in New Issue