diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 504a3cc1f..2a7cd3edb 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -113,7 +113,7 @@ BOOL CMipsMemoryVM::Initialize ( void ) m_Rom = _Rom->GetRomAddress(); m_RomSize = _Rom->GetRomSize(); } - memset(m_PifRam,0,sizeof(m_PifRam)); + CPifRam::Reset(); m_TLB_ReadMap = (DWORD *)VirtualAlloc(NULL,0xFFFFF * sizeof(DWORD),MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); if (m_TLB_ReadMap == NULL) @@ -157,7 +157,7 @@ void CMipsMemoryVM::FreeMemory ( void ) VirtualFree( m_TLB_WriteMap, 0 , MEM_RELEASE); m_TLB_WriteMap = NULL; } - memset(m_PifRam,0,sizeof(m_PifRam)); + CPifRam::Reset(); } BYTE * CMipsMemoryVM::Rdram ( void ) @@ -1603,17 +1603,14 @@ int CMipsMemoryVM::LW_NonMemory ( DWORD PAddr, DWORD * Value ) { { if (m_RomWrittenTo) { - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix - *Value = WroteToRom; + *Value = m_RomWroteValue; //LogMessage("%X: Read crap from Rom %X from %X",PROGRAM_COUNTER,*Value,PAddr); - WrittenToRom = FALSE; + m_RomWrittenTo = FALSE; #ifdef ROM_IN_MAPSPACE { DWORD OldProtect; VirtualProtect(ROM,RomFileSize,PAGE_READONLY, &OldProtect); } -#endif #endif return TRUE; } @@ -2571,11 +2568,8 @@ void CMipsMemoryVM::Compile_LW (void) } if (bFastSP() && Opcode.rt == 29) { -_Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix ResetX86Protection(); - _MMU->ResetMemoryStack(m_Section); -#endif + ResetMemoryStack(); } } @@ -2788,8 +2782,6 @@ void CMipsMemoryVM::Compile_LWR (void) void CMipsMemoryVM::Compile_LWU (void) { OPCODE & Opcode = CRecompilerOps::m_Opcode; - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix x86Reg TempReg1, TempReg2; CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC)); @@ -2799,7 +2791,7 @@ void CMipsMemoryVM::Compile_LWU (void) if (IsConst(Opcode.base)) { DWORD Address = (cMipsRegLo(Opcode.base) + (short)Opcode.offset); Map_GPR_32bit(Opcode.rt,FALSE,0); - Compile_LW(cMipsRegLo(Opcode.rt),Address); + Compile_LW(cMipsRegMapLo(Opcode.rt),Address); return; } if (IsMapped(Opcode.rt)) { ProtectGPR(Opcode.rt); } @@ -2807,7 +2799,7 @@ void CMipsMemoryVM::Compile_LWU (void) ProtectGPR(Opcode.base); if (Opcode.offset != 0) { TempReg1 = Map_TempReg(x86_Any,-1,FALSE); - LeaSourceAndOffset(TempReg1,cMipsRegLo(Opcode.base),(short)Opcode.offset); + LeaSourceAndOffset(TempReg1,cMipsRegMapLo(Opcode.base),(short)Opcode.offset); } else { TempReg1 = Map_TempReg(x86_Any,Opcode.base,FALSE); } @@ -2822,13 +2814,12 @@ void CMipsMemoryVM::Compile_LWU (void) MoveVariableDispToX86Reg(m_TLB_ReadMap,"m_TLB_ReadMap",TempReg2,TempReg2,4); CompileReadTLBMiss(TempReg1,TempReg2); Map_GPR_32bit(Opcode.rt,FALSE,-1); - MoveZxHalfX86regPointerToX86reg(TempReg1, TempReg2,cMipsRegLo(Opcode.rt)); + MoveZxHalfX86regPointerToX86reg(TempReg1, TempReg2,cMipsRegMapLo(Opcode.rt)); } else { AndConstToX86Reg(TempReg1,0x1FFFFFFF); Map_GPR_32bit(Opcode.rt,TRUE,-1); - MoveZxN64MemToX86regHalf(cMipsRegLo(Opcode.rt), TempReg1); + MoveZxN64MemToX86regHalf(cMipsRegMapLo(Opcode.rt), TempReg1); } -#endif } void CMipsMemoryVM::Compile_LD (void) @@ -2845,13 +2836,10 @@ void CMipsMemoryVM::Compile_LD (void) Map_GPR_64bit(Opcode.rt,-1); Compile_LW(cMipsRegMapHi(Opcode.rt),Address); Compile_LW(cMipsRegMapLo(Opcode.rt),Address + 4); - if (Opcode.rt == 29) - { - _Notify->BreakPoint(__FILE__,__LINE__); + if (bFastSP() && Opcode.rt == 29) + { + ResetMemoryStack(); } -#ifdef tofix - if (bFastSP() && Opcode.rt == 29) { _MMU->ResetMemoryStack(m_Section); } -#endif return; } if (IsMapped(Opcode.rt)) { ProtectGPR(Opcode.rt); } diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index abced1c14..37392e86f 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -13,6 +13,7 @@ CPifRamSettings::CPifRamSettings() { _Settings->RegisterChangeCB(Debugger_ShowPifErrors,NULL,RefreshSettings); _Settings->RegisterChangeCB(Game_RDRamSize,NULL,RefreshSettings); + _Settings->RegisterChangeCB(Game_DelaySI,NULL,RefreshSettings); RefreshSettings(NULL); } } @@ -24,6 +25,7 @@ CPifRamSettings::~CPifRamSettings() { _Settings->UnregisterChangeCB(Debugger_ShowPifErrors,NULL,RefreshSettings); _Settings->UnregisterChangeCB(Game_RDRamSize,NULL,RefreshSettings); + _Settings->UnregisterChangeCB(Game_DelaySI,NULL,RefreshSettings); } } @@ -31,18 +33,25 @@ void CPifRamSettings::RefreshSettings(void *) { m_bShowPifRamErrors = _Settings->LoadBool(Debugger_ShowPifErrors); m_RdramSize = _Settings->LoadDword(Game_RDRamSize); + m_DelaySI = _Settings->LoadBool(Game_DelaySI); } CPifRam::CPifRam( bool SavesReadOnly ) : CEeprom(SavesReadOnly) { - memset(m_PifRam,0,sizeof(m_PifRam)); + Reset(); } CPifRam::~CPifRam( void ) { } +void CPifRam::Reset ( void ) +{ + memset(m_PifRam,0,sizeof(m_PifRam)); + memset(m_PifRom,0,sizeof(m_PifRom)); +} + void CPifRam::PifRamRead (void) { if (m_PifRam[0x3F] == 0x2) diff --git a/Source/Project64/N64 System/Mips/Pif Ram.h b/Source/Project64/N64 System/Mips/Pif Ram.h index 300c2533a..92e3c9088 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.h +++ b/Source/Project64/N64 System/Mips/Pif Ram.h @@ -28,6 +28,8 @@ public: CPifRam ( bool SavesReadOnly ); ~CPifRam ( void ); + void Reset ( void ); + void PifRamWrite ( void ); void PifRamRead ( void ); diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index ff05f5163..30d7a1a28 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -1294,10 +1294,7 @@ void CRecompilerOps::ADDI (void) { } if (bFastSP() && m_Opcode.rt == 29 && m_Opcode.rs != 29) { ResetX86Protection(); -_Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix - _MMU->ResetMemoryStack(m_Section); -#endif + _MMU->ResetMemoryStack(); } } @@ -1536,10 +1533,7 @@ void CRecompilerOps::ORI (void) { if (bFastSP() && m_Opcode.rt == 29 && m_Opcode.rs != 29) { ResetX86Protection(); - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix - _MMU->ResetMemoryStack(m_Section); -#endif + _MMU->ResetMemoryStack(); } } @@ -1929,8 +1923,8 @@ void CRecompilerOps::SPECIAL_JR (void) { CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); if (IsConst(m_Opcode.rs)) { m_Section->m_Jump.BranchLabel.Format("0x%08X",cMipsRegLo(m_Opcode.rs)); - m_Section->m_Jump.JumpPC = m_CompilePC; m_Section->m_Jump.TargetPC = cMipsRegLo(m_Opcode.rs); + m_Section->m_Jump.JumpPC = m_Section->m_Jump.TargetPC + 4; m_Section->m_Jump.FallThrough = TRUE; m_Section->m_Jump.LinkLocation = NULL; m_Section->m_Jump.LinkLocation2 = NULL; @@ -3807,7 +3801,7 @@ void CRecompilerOps::SPECIAL_DSRA (void) { CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); if (m_Opcode.rd == 0) { return; } - if (b32BitCore()) { _Notify->BreakPoint(__FILE__,__LINE__); } + if (IsConst(m_Opcode.rt)) { if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); } @@ -4480,8 +4474,6 @@ void CRecompilerOps::COP1_S_TRUNC_L (void) { } void CRecompilerOps::COP1_S_CEIL_L (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4489,12 +4481,9 @@ void CRecompilerOps::COP1_S_CEIL_L (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Float); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundUp); -#endif } void CRecompilerOps::COP1_S_FLOOR_L (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4502,7 +4491,6 @@ void CRecompilerOps::COP1_S_FLOOR_L (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Float); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Qword,CRegInfo::RoundDown); -#endif } void CRecompilerOps::COP1_S_ROUND_W (void) @@ -4528,7 +4516,6 @@ void CRecompilerOps::COP1_S_TRUNC_W (void) { void CRecompilerOps::COP1_S_CEIL_W (void) { // added by Witten _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4536,7 +4523,6 @@ void CRecompilerOps::COP1_S_CEIL_W (void) { // added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Float); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Float,CRegInfo::FPU_Dword,CRegInfo::RoundUp); -#endif } void CRecompilerOps::COP1_S_FLOOR_W (void) { @@ -4777,8 +4763,6 @@ void CRecompilerOps::COP1_D_MOV (void) { } void CRecompilerOps::COP1_D_TRUNC_L (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4789,12 +4773,9 @@ void CRecompilerOps::COP1_D_TRUNC_L (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundTruncate); -#endif } void CRecompilerOps::COP1_D_CEIL_L (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4805,12 +4786,9 @@ void CRecompilerOps::COP1_D_CEIL_L (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundUp); -#endif } void CRecompilerOps::COP1_D_FLOOR_L (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4821,12 +4799,9 @@ void CRecompilerOps::COP1_D_FLOOR_L (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDown); -#endif } void CRecompilerOps::COP1_D_ROUND_W (void) { - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4837,7 +4812,6 @@ void CRecompilerOps::COP1_D_ROUND_W (void) { Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundNearest); -#endif } void CRecompilerOps::COP1_D_TRUNC_W (void) { @@ -4854,8 +4828,6 @@ void CRecompilerOps::COP1_D_TRUNC_W (void) { } void CRecompilerOps::COP1_D_CEIL_W (void) { // added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4866,12 +4838,9 @@ void CRecompilerOps::COP1_D_CEIL_W (void) { // added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundUp); -#endif } void CRecompilerOps::COP1_D_FLOOR_W (void) { //added by Witten - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4882,7 +4851,6 @@ void CRecompilerOps::COP1_D_FLOOR_W (void) { //added by Witten Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Dword,CRegInfo::RoundDown); -#endif } void CRecompilerOps::COP1_D_CVT_S (void) { @@ -4912,8 +4880,6 @@ void CRecompilerOps::COP1_D_CVT_W (void) { } void CRecompilerOps::COP1_D_CVT_L (void) { - _Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC)); m_Section->CompileCop1Test(); @@ -4924,7 +4890,6 @@ void CRecompilerOps::COP1_D_CVT_L (void) { Load_FPR_ToTop(m_Opcode.fd,m_Opcode.fs,CRegInfo::FPU_Double); } ChangeFPURegFormat(m_Opcode.fd,CRegInfo::FPU_Double,CRegInfo::FPU_Qword,CRegInfo::RoundDefault); -#endif } void CRecompilerOps::COP1_D_CMP (void) { diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index b7fb033d1..b4a75c455 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -88,7 +88,7 @@ void CSettings::AddHowToHandleSetting () AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("","Disable Screen Saver",(DWORD)true)); AddHandler(Setting_AutoSleep, new CSettingTypeApplication("","Auto Sleep", (DWORD)true)); AddHandler(Setting_AutoStart, new CSettingTypeApplication("","Auto Start", (DWORD)true)); - AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (DWORD)true)); + AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (DWORD)false)); AddHandler(Setting_AutoZipInstantSave,new CSettingTypeApplication("","Auto Zip Saves", (DWORD)true)); AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("","Erase on default", (DWORD)true)); diff --git a/Source/Project64/User Interface/UI Resources.aps b/Source/Project64/User Interface/UI Resources.aps index 1cb6685db..d3faf10e2 100644 Binary files a/Source/Project64/User Interface/UI Resources.aps and b/Source/Project64/User Interface/UI Resources.aps differ diff --git a/Source/Project64/User Interface/UI Resources.rc b/Source/Project64/User Interface/UI Resources.rc index 6ed4c5b34..88d552385 100644 --- a/Source/Project64/User Interface/UI Resources.rc +++ b/Source/Project64/User Interface/UI Resources.rc @@ -925,8 +925,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,7,51,49 - PRODUCTVERSION 1,7,51,49 + FILEVERSION 1,7,51,50 + PRODUCTVERSION 1,7,51,50 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -943,12 +943,12 @@ BEGIN BEGIN VALUE "CompanyName", " " VALUE "FileDescription", "Project64" - VALUE "FileVersion", "1, 7, 51, 49" + VALUE "FileVersion", "1, 7, 51, 50" VALUE "InternalName", "Project64" VALUE "LegalCopyright", "Copyright © 2010" VALUE "OriginalFilename", "Project64.exe" VALUE "ProductName", " Project64" - VALUE "ProductVersion", "1, 7, 51, 49" + VALUE "ProductVersion", "1, 7, 51, 50" END END BLOCK "VarFileInfo"