From c73a5fef2dda9369441bf6436c4f889a02aab6b8 Mon Sep 17 00:00:00 2001 From: AmbientMalice Date: Wed, 15 Jul 2015 09:32:05 +1000 Subject: [PATCH 001/103] Copy V8 combiner from GLideN64 to Glide64. This isn't hugely useful, since Vigilante 8 is a complete mess on Glide64, but this fixes one graphics issue. --- Source/Glide64/Combine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Glide64/Combine.cpp b/Source/Glide64/Combine.cpp index d62da3faf..8c7a3b537 100644 --- a/Source/Glide64/Combine.cpp +++ b/Source/Glide64/Combine.cpp @@ -15901,7 +15901,11 @@ void CombineBlender () } A_BLEND (GR_BLEND_SRC_ALPHA, GR_BLEND_ONE); break; - + + case 0x5000: /* Vigilante 8 explosions */ + A_BLEND (GR_BLEND_ONE_MINUS_SRC_ALPHA, GR_BLEND_SRC_ALPHA); + break; + default: A_BLEND (GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA); } From a77ad1e4c76f7fe0fa29f5ea38068ae6ee43e2f0 Mon Sep 17 00:00:00 2001 From: dsx- Date: Sat, 18 Jul 2015 00:22:38 +0800 Subject: [PATCH 002/103] Update Nushi Tsuri 2 rdb entry game is compatible, turns out i didnt have a good rom --- Config/Project64.rdb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index bfaa1c893..6b047cd1d 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -4223,7 +4223,8 @@ Culling=1 [5B9B1618-1B43C649-C:4A] Good Name=Nushi Duri 64 - Shiokaze ni Notte (J) Internal Name=ǼÂÞØ64¼µ¶¾ÞÆɯà -Status=Unsupported +Status=Compatible +Plugin Note=[video] missing:lots; use Glide64 //================ O ================ [812289D0-C2E53296-C:50] From 2a45e5f7929fe2a1fad9aec178b6a9c64870275b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 12:45:55 -0400 Subject: [PATCH 003/103] Declare a couple constants to help clean the code rewrites. --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index b5feb9b2f..f7cacbbfc 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5372,11 +5372,14 @@ void CMipsMemoryVM::TLB_Unmaped( DWORD Vaddr, DWORD Len ) void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) { - if (_this->m_AllocatedRdramSize == g_Settings->LoadDword(Game_RDRamSize)) + const size_t new_size = g_Settings -> LoadDword(Game_RDRamSize); + const size_t old_size = _this -> m_AllocatedRdramSize; + + if (old_size == new_size) { return; } - if (_this->m_AllocatedRdramSize == 0x400000) + if (old_size == 0x400000) { if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) { From 62d316f7ae89661f4d0ba807c8d701eb01825f7d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 12:50:00 -0400 Subject: [PATCH 004/103] centralized m_AllocatedRdramSize writeback outside the if/else --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index f7cacbbfc..06a85da6d 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5386,14 +5386,12 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) WriteTrace(TraceError,__FUNCTION__ ": failed to allocate extended memory"); g_Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR)); } - _this->m_AllocatedRdramSize = 0x800000; } else { VirtualFree(_this->m_RDRAM + 0x400000, 0x400000,MEM_DECOMMIT); - _this->m_AllocatedRdramSize = 0x400000; } - + _this->m_AllocatedRdramSize = new_size; } void CMipsMemoryVM::ChangeSpStatus() From 188091e32a2536dc4dad05d392908f976ba70487 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 12:51:44 -0400 Subject: [PATCH 005/103] flipped the if/else blocks for better branch prediction --- .../Project64/N64 System/Mips/Memory Virtual Mem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 06a85da6d..afabe3497 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5379,18 +5379,18 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) { return; } - if (old_size == 0x400000) + if (old_size == 0x800000) + { + VirtualFree(_this->m_RDRAM + 0x400000, 0x400000, MEM_DECOMMIT); + } + else { if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) { WriteTrace(TraceError,__FUNCTION__ ": failed to allocate extended memory"); - g_Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR)); + g_Notify -> FatalError(GS(MSG_MEM_ALLOC_ERROR)); } } - else - { - VirtualFree(_this->m_RDRAM + 0x400000, 0x400000,MEM_DECOMMIT); - } _this->m_AllocatedRdramSize = new_size; } From 51975fb00dd1e8012c03e8e1ede191977f71a053 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 13:12:40 -0400 Subject: [PATCH 006/103] unbiased the algorithm from just checking if only 4 or 8 MB --- .../N64 System/Mips/Memory Virtual Mem.cpp | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index afabe3497..58156b8a4 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5379,15 +5379,27 @@ void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) { return; } - if (old_size == 0x800000) + if (old_size > new_size) { - VirtualFree(_this->m_RDRAM + 0x400000, 0x400000, MEM_DECOMMIT); + VirtualFree( + _this->m_RDRAM + new_size, + old_size - new_size, + MEM_DECOMMIT + ); } else - { - if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) + { + void * result; + + result = VirtualAlloc( + _this->m_RDRAM + old_size, + new_size - old_size, + MEM_COMMIT, + PAGE_READWRITE + ); + if (result == NULL) { - WriteTrace(TraceError,__FUNCTION__ ": failed to allocate extended memory"); + WriteTrace(TraceError, __FUNCTION__": failed to allocate extended memory"); g_Notify -> FatalError(GS(MSG_MEM_ALLOC_ERROR)); } } From 81b6e2c68d1edde916d3704ecf552b6d9a17bcee Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sat, 25 Jul 2015 23:20:36 +0900 Subject: [PATCH 007/103] Heiwa Pachinko World 64 (J) freeze fix Heiwa Pachinko World 64 (J) freeze fix #537 --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index b5feb9b2f..b1f2c1be3 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -3411,7 +3411,7 @@ void CMipsMemoryVM::UpdateHalfLine() g_SystemTimer->UpdateTimers(); NextViTimer = g_SystemTimer->GetTimer(CSystemTimer::ViTimer); } - m_HalfLine = (DWORD)(NextViTimer / g_System->ViRefreshRate()); + m_HalfLine = (DWORD)(*g_NextTimer / g_System->ViRefreshRate()); m_HalfLine &= ~1; m_HalfLine |= m_FieldSerration; m_HalfLineCheck = NextViTimer; From aa8a611a0832bb26137dd1b7e3a21a29d5591c90 Mon Sep 17 00:00:00 2001 From: luigiblood Date: Sun, 26 Jul 2015 00:44:59 +0200 Subject: [PATCH 008/103] Adding English version of F-Zero XP to RDB --- Config/Project64.rdb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index bfaa1c893..a8998d004 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -1952,6 +1952,16 @@ RDRAM Size=8 Culling=1 AllowROMWrites=Yes +[C6E39C0A-D2726676-C:45] +Good Name=F-ZERO X + Expansion Kit (U) [CART HACK] +Status=Compatible +Core Note=(see GameFAQ) +Plugin Note=[video] (see GameFAQ) +32bit=No +RDRAM Size=8 +Culling=1 +AllowROMWrites=Yes + [3CECBCB8-6126BF07-C:50] Good Name=F1 Racing Championship (E) (M5) Internal Name=F1RacingChampionship From cf7f74f1b1837f38c887fa5faad7777024c7a908 Mon Sep 17 00:00:00 2001 From: luigiblood Date: Mon, 27 Jul 2015 15:34:36 +0200 Subject: [PATCH 009/103] Use actual CIC IDs (8303 for 64DD, 5167 for 64DD conversions) --- Source/Project64/N64 System/Mips/Dma.cpp | 2 +- Source/Project64/N64 System/N64 Class.cpp | 4 ++-- Source/Project64/N64 System/N64 Rom Class.cpp | 4 ++-- Source/Project64/N64 System/N64 Types.h | 4 ++-- Source/Project64/N64 System/Rom Information Class.cpp | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index 896903129..cd09cbe47 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -22,7 +22,7 @@ void CDMA::OnFirstDMA() switch (g_Rom->CicChipID()) { case CIC_NUS_6101: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break; - case CIC_NUS_8303: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break; + case CIC_NUS_5167: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break; case CIC_UNKNOWN: case CIC_NUS_6102: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break; case CIC_NUS_6103: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break; diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index f71d65c21..b7f90d87b 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -810,8 +810,8 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU ) case CIC_NUS_6101: m_Reg.m_GPR[22].DW=0x000000000000003F; break; - case CIC_NUS_DDIPL: //64DD IPL - case CIC_NUS_8303: //64DD CIC + case CIC_NUS_8303: //64DD IPL CIC + case CIC_NUS_5167: //64DD CONVERSION CIC m_Reg.m_GPR[22].DW=0x00000000000000DD; break; case CIC_UNKNOWN: diff --git a/Source/Project64/N64 System/N64 Rom Class.cpp b/Source/Project64/N64 System/N64 Rom Class.cpp index c63ba1d09..30b6390fe 100644 --- a/Source/Project64/N64 System/N64 Rom Class.cpp +++ b/Source/Project64/N64 System/N64 Rom Class.cpp @@ -246,8 +246,8 @@ void CN64Rom::CalculateCicChip() case 0x000000D6497E414B: m_CicChip = CIC_NUS_6103; break; case 0x0000011A49F60E96: m_CicChip = CIC_NUS_6105; break; case 0x000000D6D5BE5580: m_CicChip = CIC_NUS_6106; break; - case 0x000001053BC19870: m_CicChip = CIC_NUS_8303; break; //64DD CONVERSION CIC - case 0x000000D2E53EF008: m_CicChip = CIC_NUS_DDIPL; break; //64DD IPL + case 0x000001053BC19870: m_CicChip = CIC_NUS_5167; break; //64DD CONVERSION CIC + case 0x000000D2E53EF008: m_CicChip = CIC_NUS_8303; break; //64DD IPL default: if (bHaveDebugger()) g_Notify->DisplayError(L"Unknown CIC checksum:\n%I64X.", CRC); diff --git a/Source/Project64/N64 System/N64 Types.h b/Source/Project64/N64 System/N64 Types.h index 4412b9ebd..9855fc7f9 100644 --- a/Source/Project64/N64 System/N64 Types.h +++ b/Source/Project64/N64 System/N64 Types.h @@ -51,8 +51,8 @@ enum SYSTEM_TYPE { enum CICChip { CIC_UNKNOWN = -1, CIC_NUS_6101 = 1, CIC_NUS_6102 = 2, CIC_NUS_6103 = 3, - CIC_NUS_6104 = 4, CIC_NUS_6105 = 5, CIC_NUS_6106 = 6, CIC_NUS_8303 = 7, - CIC_NUS_DDIPL = 8 + CIC_NUS_6104 = 4, CIC_NUS_6105 = 5, CIC_NUS_6106 = 6, CIC_NUS_5167 = 7, + CIC_NUS_8303 = 8 }; enum Country { diff --git a/Source/Project64/N64 System/Rom Information Class.cpp b/Source/Project64/N64 System/Rom Information Class.cpp index 235617b20..6eca5542a 100644 --- a/Source/Project64/N64 System/Rom Information Class.cpp +++ b/Source/Project64/N64 System/Rom Information Class.cpp @@ -126,12 +126,12 @@ DWORD CALLBACK RomInfoProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam) { if (_this->m_pRomInfo->CicChipID() == CIC_UNKNOWN) { sprintf(&String[1],"Unknown"); } - else if (_this->m_pRomInfo->CicChipID() == CIC_NUS_DDIPL) { - sprintf(&String[1], "64DD IPL"); - } else if (_this->m_pRomInfo->CicChipID() == CIC_NUS_8303) { sprintf(&String[1], "CIC-NUS-8303"); } + else if (_this->m_pRomInfo->CicChipID() == CIC_NUS_5167) { + sprintf(&String[1], "CIC-NUS-5167"); + } else { sprintf(&String[1],"CIC-NUS-610%d",_this->m_pRomInfo->CicChipID()); } From 2f812afca76f538bb7b417a27a716d1f84529fa5 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Tue, 28 Jul 2015 13:30:21 -0700 Subject: [PATCH 010/103] Implement edge case in SPECIAL_DSRL32 When m_Opcode.sa == 0, the results for cpu recompiler do not match cpu interpreter. For example with dsrl32 t9, t8, 0x0, and t8 = 0xC0C0C0C000000000 the result of t9 for cpu recompiler = 0xFFFFFFFFC0C0C0C0, while cpu interpreter = 0xC0C0C0C0C0C0C0C0. This commit fixes the Killer Instinct health bar issue. --- .../N64 System/Recompiler/Recompiler Ops.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 78219f823..6ae9a99b5 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -3933,9 +3933,16 @@ void CRecompilerOps::SPECIAL_DSRL32() { if (IsConst(m_Opcode.rt)) { if (m_Opcode.rt != m_Opcode.rd) UnMap_GPR(m_Opcode.rd, false); - - m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32_ZERO); - m_RegWorkingSet.SetMipsRegLo(m_Opcode.rd, (DWORD)(GetMipsReg(m_Opcode.rt) >> (m_Opcode.sa + 32))); + + if (m_Opcode.sa == 0) { + MIPS_DWORD Value; + Value.UW[0] = Value.UW[1] = GetMipsRegHi(m_Opcode.rt); + m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_64); + m_RegWorkingSet.SetMipsReg(m_Opcode.rd, Value.UDW); + } else { + m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32_ZERO); + m_RegWorkingSet.SetMipsRegLo(m_Opcode.rd, (DWORD)(GetMipsReg(m_Opcode.rt) >> (m_Opcode.sa + 32))); + } } else if (IsMapped(m_Opcode.rt)) { ProtectGPR(m_Opcode.rt); if (Is64Bit(m_Opcode.rt)) { From 8e75ec2ce7f945380513303abeaf47ea9773d449 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Tue, 28 Jul 2015 17:41:53 -0400 Subject: [PATCH 011/103] #549 changed switch/case table to cascaded range checks --- .../N64 System/Mips/Memory Labels Class.cpp | 62 ++++++++----------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 8b7c57402..62fba4f7d 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -12,7 +12,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) { - DWORD Count, Finish, Value = 0; + DWORD Count, Finish, Current, Value = 0; Finish = strlen(HexValue); if (Finish > 8 ) @@ -23,33 +23,25 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) for (Count = 0; Count < Finish; Count++) { Value = (Value << 4); - switch ( HexValue[Count] ) + Current = HexValue[Count]; + if(Current >= '0' && Current <= '9') { - case '0': break; - case '1': Value += 1; break; - case '2': Value += 2; break; - case '3': Value += 3; break; - case '4': Value += 4; break; - case '5': Value += 5; break; - case '6': Value += 6; break; - case '7': Value += 7; break; - case '8': Value += 8; break; - case '9': Value += 9; break; - case 'A': Value += 10; break; - case 'a': Value += 10; break; - case 'B': Value += 11; break; - case 'b': Value += 11; break; - case 'C': Value += 12; break; - case 'c': Value += 12; break; - case 'D': Value += 13; break; - case 'd': Value += 13; break; - case 'E': Value += 14; break; - case 'e': Value += 14; break; - case 'F': Value += 15; break; - case 'f': Value += 15; break; - default: - Value = (Value >> 4); - Count = Finish; + Value += Current - '0'; + } + else + { + if(Current < 'A') + Current += 'A' + + if (Current >= 'A' && Current <= 'F') + { + Value += Current + 10 - 'A'; + } + else + { + Value = (Value >> 4); + Count = Finish; + } } } return Value; @@ -80,9 +72,9 @@ stdstr CMemoryLabel::LabelName ( DWORD Address ) const //{ // return (*theIterator).second; //} - + char strLabelName[100]; - sprintf(strLabelName,"0x%08X",Address); + sprintf(strLabelName,"0x%08X",Address); return stdstr(strLabelName); } @@ -109,7 +101,7 @@ void CMemoryLabel::LoadLabelList ( char * file ) } SetFilePointer(hFile,0,NULL,FILE_BEGIN); - + DWORD FileSize = GetFileSize(hFile,NULL); void * FileContents = VirtualAlloc(NULL,FileSize,MEM_COMMIT,PAGE_READWRITE ); @@ -128,7 +120,7 @@ void CMemoryLabel::LoadLabelList ( char * file ) ProcessCODFile((BYTE *)FileContents, FileSize); } - VirtualFree(FileContents, 0, MEM_RELEASE); + VirtualFree(FileContents, 0, MEM_RELEASE); CloseHandle(hFile); m_NewLabels = 0; @@ -152,7 +144,7 @@ void CMemoryLabel::SaveLabelList() HANDLE hFile = CreateFile(CurrentLabelFile.c_str(),GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); SetFilePointer(hFile,0,NULL,FILE_BEGIN); - + for (StringMap::iterator Item = m_LabelList.begin(); Item != m_LabelList.end(); Item++) { char Text[300]; @@ -160,9 +152,9 @@ void CMemoryLabel::SaveLabelList() sprintf(Text, "0x%08X,%s\r\n",(*Item).first,((*Item).second).c_str()); - WriteFile( hFile,Text,strlen(Text),&dwWritten,NULL ); + WriteFile( hFile,Text,strlen(Text),&dwWritten,NULL ); } - + CloseHandle(hFile); } @@ -186,7 +178,7 @@ void CMemoryLabel::ProcessCODFile(BYTE * File, DWORD FileLen) return; } CurrentPos += 1; - + if (strchr(CurrentPos,',') - CurrentPos != 8) { return; From f60bdc19925e1b08199d4cdb74ee5af076d60a33 Mon Sep 17 00:00:00 2001 From: dsx- Date: Wed, 29 Jul 2015 21:56:43 +0800 Subject: [PATCH 012/103] Update Jangou Simulation RDB entry game no longer crashes --- Config/Project64.rdb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 50feb56c3..0dd6091fc 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -2818,8 +2818,7 @@ Status=Compatible [C73AD016-48C5537D-C:4A] Good Name=Jangou Simulation Mahjong Dou 64 (J) Internal Name=Ï°¼Þ¬ÝÄÞ³64 -Status=Only intro/part OK -Core Note=crashes +Status=Compatible [C99936D1-23D1D65D-C:4A] Good Name=Japan Pro Golf Tour 64 (J) [CART HACK] From 6f98061e571e0663213d274c564d26136d8bd388 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Wed, 29 Jul 2015 18:23:14 -0400 Subject: [PATCH 013/103] #549 stupid typos --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 62fba4f7d..6e2892bf4 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -31,7 +31,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) else { if(Current < 'A') - Current += 'A' + Current += 'A' - 'a'; if (Current >= 'A' && Current <= 'F') { From 837f7990587fa2f9982946b42c208b2bbc6d53c7 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Thu, 30 Jul 2015 18:35:33 -0400 Subject: [PATCH 014/103] #549 fixed incorrect case conversion math, simplified a couple of expressions --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 6e2892bf4..c4ee5a4f6 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -23,15 +23,15 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) for (Count = 0; Count < Finish; Count++) { Value = (Value << 4); - Current = HexValue[Count]; + Current = HexValue[Count] - '0'; if(Current >= '0' && Current <= '9') { Value += Current - '0'; } else { - if(Current < 'A') - Current += 'A' - 'a'; + if(Current > 'F') + Current -= 32; //32 is the distance between A and a if (Current >= 'A' && Current <= 'F') { From d57d951d3925889717d79b2a723a20e91cc5c895 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Thu, 30 Jul 2015 18:37:15 -0400 Subject: [PATCH 015/103] #549 removed a vestigial bit of expression from a direction I ended up not going in --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index c4ee5a4f6..1047a7c67 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -23,7 +23,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) for (Count = 0; Count < Finish; Count++) { Value = (Value << 4); - Current = HexValue[Count] - '0'; + Current = HexValue[Count]; if(Current >= '0' && Current <= '9') { Value += Current - '0'; @@ -35,7 +35,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) if (Current >= 'A' && Current <= 'F') { - Value += Current + 10 - 'A'; + Value += Current - 55; //55 is the code for 'A' less 10 } else { From f22c476741ae3827ef20979ff7aef6b478f1cb3c Mon Sep 17 00:00:00 2001 From: dsx- Date: Sat, 1 Aug 2015 16:07:11 +0800 Subject: [PATCH 016/103] update twisted edge rdb entry --- Config/Project64.rdb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 0dd6091fc..ed2a32e4a 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -3094,7 +3094,7 @@ Good Name=King Hill 64 - Extreme Snowboarding (J) Internal Name=KING HILL 64 Status=Issues (core) Core Note=no sound -Plugin Note=[video] errors:menu snowflakes +Plugin Note=[video] errors:menu snowflakes; use Glide64 RDRAM Size=8 [75BC6AD6-78552BC9-C:4A] @@ -6779,7 +6779,7 @@ Good Name=Twisted Edge Extreme Snowboarding (E) Internal Name=TWISTED EDGE Status=Issues (core) Core Note=no sound -Plugin Note=[video] errors:menu snowflakes; +Plugin Note=[video] errors:menu snowflakes; use Glide64 RDRAM Size=8 [BBC99D32-117DAA80-C:45] @@ -6787,7 +6787,7 @@ Good Name=Twisted Edge Extreme Snowboarding (U) Internal Name=TWISTED EDGE Status=Issues (core) Core Note=no sound -Plugin Note=[video] errors:menu snowflakes; +Plugin Note=[video] errors:menu snowflakes; use Glide64 Culling=1 RDRAM Size=8 From 1db30a6647373384670a56b559efffacb16dd40c Mon Sep 17 00:00:00 2001 From: dsx- Date: Sat, 1 Aug 2015 16:09:15 +0800 Subject: [PATCH 017/103] update heiwa pachinko rdb entry --- Config/Project64.rdb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index ed2a32e4a..5105a3d4f 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -2416,8 +2416,8 @@ Counter Factor=1 [3E70E866-4438BAE8-C:4A] Good Name=Heiwa Pachinko World 64 (J) Internal Name=HEIWA ÊßÁݺ Ü°ÙÄÞ64 -Status=Uncertain -Plugin Note=[video] unsupported; use Glide64; errors:? +Status=Issues (plugin) +Plugin Note=[video] use Glide64; errors:various RDRAM Size=8 [AE90DBEB-79B89123-C:50] From 70873db2987fecc84b82102f3fb82742204b3752 Mon Sep 17 00:00:00 2001 From: dsx- Date: Sat, 1 Aug 2015 16:09:56 +0800 Subject: [PATCH 018/103] update robot ponkottsu rdb entry --- Config/Project64.rdb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 5105a3d4f..bd9c45bc7 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -5081,8 +5081,7 @@ RDRAM Size=8 [272B690F-AD0A7A77-C:4A] Good Name=Robot Ponkottsu 64 - 7tsu no Umi no Caramel (J) Internal Name=Robopon64 -Status=Uncertain -Core Note=TLB used? +Status=Compatible Clear Frame=1 Save Type=16kbit Eeprom From 9468e17614a7c2034d7152b8529ee04898b333b2 Mon Sep 17 00:00:00 2001 From: dsx- Date: Sat, 1 Aug 2015 16:21:22 +0800 Subject: [PATCH 019/103] update mario no photopi rdb entry --- Config/Project64.rdb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index bd9c45bc7..10f9f32e8 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -3495,9 +3495,8 @@ Primary Frame Buffer=1 [9A9890AC-F0C313DF-C:4A] Good Name=Mario no Photopi (J) Internal Name=ÏصÉÌ«ÄËß° -Status=Needs video plugin -Plugin Note=[video] HLE not supported; major errors -HLE GFX=No +Status=Needs RSP plugin +Plugin Note=[rsp] needs semaphore lock [9C663069-80F24A80-C:50] Good Name=Mario Party (E) (M3) From 0772341b6afbe0826d5b8efcc566833307747e8a Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sat, 1 Aug 2015 17:48:38 +0900 Subject: [PATCH 020/103] Fix DMA Sram access when not word aligned --- Source/Project64/N64 System/Mips/Sram.cpp | 135 +++++++++++++++++++++- 1 file changed, 130 insertions(+), 5 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Sram.cpp b/Source/Project64/N64 System/Mips/Sram.cpp index 8e642d778..e23e832f0 100644 --- a/Source/Project64/N64 System/Mips/Sram.cpp +++ b/Source/Project64/N64 System/Mips/Sram.cpp @@ -53,6 +53,8 @@ bool CSram::LoadSram() void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len) { DWORD dwRead; + DWORD i; + BYTE tmp[4]; if (m_hFile == NULL) { @@ -61,13 +63,76 @@ void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len) return; } } - SetFilePointer(m_hFile,StartOffset,NULL,FILE_BEGIN); - ReadFile(m_hFile,dest,len,&dwRead,NULL); + DWORD Offset = StartOffset & 3; + if (Offset == 0) + { + SetFilePointer(m_hFile, StartOffset, NULL, FILE_BEGIN); + ReadFile(m_hFile, dest, len, &dwRead, NULL); + } + else + { + SetFilePointer(m_hFile, StartOffset - Offset, NULL, FILE_BEGIN); + + ReadFile(m_hFile, tmp, 4, &dwRead, NULL); + for (i = 0; i < (4 - Offset); i++) + { + dest[i + Offset] = tmp[i]; + } + for (i = 4 - Offset; i < len - Offset; i += 4) + { + ReadFile(m_hFile, tmp, 4, &dwRead, NULL); + switch (Offset) + { + case 1: + dest[i + 2] = tmp[0]; + dest[i + 3] = tmp[1]; + dest[i + 4] = tmp[2]; + dest[i - 3] = tmp[3]; + break; + case 2: + dest[i + 4] = tmp[0]; + dest[i + 5] = tmp[1]; + dest[i - 2] = tmp[2]; + dest[i - 1] = tmp[3]; + break; + case 3: + dest[i + 6] = tmp[0]; + dest[i - 1] = tmp[1]; + dest[i] = tmp[2]; + dest[i + 1] = tmp[3]; + break; + default: + break; + } + } + ReadFile(m_hFile, tmp, 4, &dwRead, NULL); + switch (Offset) + { + case 1: + dest[i - 3] = tmp[3]; + break; + case 2: + dest[i - 2] = tmp[2]; + dest[i - 1] = tmp[3]; + break; + case 3: + dest[i - 1] = tmp[1]; + dest[i] = tmp[2]; + dest[i + 1] = tmp[3]; + break; + default: + break; + } + } } void CSram::DmaToSram(BYTE * Source, int StartOffset, int len) { + DWORD dwWritten; + DWORD i; + BYTE tmp[4]; + if (m_ReadOnly) { return; @@ -80,8 +145,68 @@ void CSram::DmaToSram(BYTE * Source, int StartOffset, int len) return; } } - DWORD dwWritten; - SetFilePointer(m_hFile,StartOffset,NULL,FILE_BEGIN); - WriteFile(m_hFile,Source,len,&dwWritten,NULL); + DWORD Offset = StartOffset & 3; + if (Offset == 0) + { + SetFilePointer(m_hFile, StartOffset, NULL, FILE_BEGIN); + WriteFile(m_hFile, Source, len, &dwWritten, NULL); + } + else + { + for (i = 0; i < (4 - Offset); i++) + { + tmp[i] = Source[i + Offset]; + } + SetFilePointer(m_hFile, StartOffset - Offset, NULL, FILE_BEGIN); + WriteFile(m_hFile, tmp, (4 - Offset), &dwWritten, NULL); + + SetFilePointer(m_hFile, Offset, NULL, FILE_CURRENT); + for (i = 4 - Offset; i < len - Offset; i += 4) + { + switch (Offset) + { + case 1: + tmp[0] = Source[i + 2]; + tmp[1] = Source[i + 3]; + tmp[2] = Source[i + 4]; + tmp[3] = Source[i - 3]; + break; + case 2: + tmp[0] = Source[i + 4]; + tmp[1] = Source[i + 5]; + tmp[2] = Source[i - 2]; + tmp[3] = Source[i - 1]; + break; + case 3: + tmp[0] = Source[i + 6]; + tmp[1] = Source[i - 1]; + tmp[2] = Source[i]; + tmp[3] = Source[i + 1]; + break; + default: + break; + } + WriteFile(m_hFile, tmp, 4, &dwWritten, NULL); + } + switch (Offset) + { + case 1: + tmp[0] = Source[i - 3]; + break; + case 2: + tmp[0] = Source[i - 2]; + tmp[0] = Source[i - 1]; + break; + case 3: + tmp[0] = Source[i - 1]; + tmp[0] = Source[i]; + tmp[0] = Source[i + 1]; + break; + default: + break; + } + SetFilePointer(m_hFile, 4 - Offset, NULL, FILE_CURRENT); + WriteFile(m_hFile, tmp, Offset, &dwWritten, NULL); + } FlushFileBuffers(m_hFile); } From 936db1c3f4da7bf760e680993bd112aed4a7cc0d Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sat, 1 Aug 2015 18:16:11 +0900 Subject: [PATCH 021/103] Fix PI_DMA_READ fix PI_DMA_READ like a PI_DMA_WRITE. --- Source/Project64/N64 System/Mips/Dma.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index cd09cbe47..b802f3dd1 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -35,12 +35,18 @@ void CDMA::OnFirstDMA() void CDMA::PI_DMA_READ() { // PI_STATUS_REG |= PI_STATUS_DMA_BUSY; + DWORD PI_RD_LEN_REG = ((g_Reg->PI_RD_LEN_REG) & 0x00FFFFFFul) + 1; - if ( g_Reg->PI_DRAM_ADDR_REG + g_Reg->PI_RD_LEN_REG + 1 > g_MMU->RdramSize()) + if ((PI_RD_LEN_REG & 1) != 0) + { + PI_RD_LEN_REG += 1; + } + + if ( g_Reg->PI_DRAM_ADDR_REG + PI_RD_LEN_REG > g_MMU->RdramSize()) { if (bHaveDebugger()) { - g_Notify->DisplayError(L"PI_DMA_READ not in Memory: %08X", g_Reg->PI_DRAM_ADDR_REG + g_Reg->PI_RD_LEN_REG + 1); + g_Notify->DisplayError(L"PI_DMA_READ not in Memory: %08X", g_Reg->PI_DRAM_ADDR_REG + PI_RD_LEN_REG); } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; @@ -58,9 +64,9 @@ void CDMA::PI_DMA_READ() VirtualProtect(ROM, g_Rom->GetRomSize(), PAGE_READWRITE, &OldProtect); g_Reg->PI_CART_ADDR_REG -= 0x10000000; - if (g_Reg->PI_CART_ADDR_REG + g_Reg->PI_RD_LEN_REG < g_Rom->GetRomSize()) + if (g_Reg->PI_CART_ADDR_REG + PI_RD_LEN_REG < g_Rom->GetRomSize()) { - for (i = 0; i < g_Reg->PI_RD_LEN_REG; i++) + for (i = 0; i < PI_RD_LEN_REG; i++) { *(ROM + ((g_Reg->PI_CART_ADDR_REG + i) ^ 3)) = *(RDRAM + ((g_Reg->PI_DRAM_ADDR_REG + i) ^ 3)); } @@ -100,7 +106,7 @@ void CDMA::PI_DMA_READ() m_Sram.DmaToSram( g_MMU->Rdram() + g_Reg->PI_DRAM_ADDR_REG, g_Reg->PI_CART_ADDR_REG - 0x08000000, - g_Reg->PI_RD_LEN_REG + 1 + PI_RD_LEN_REG ); g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; @@ -112,7 +118,7 @@ void CDMA::PI_DMA_READ() m_FlashRam.DmaToFlashram( g_MMU->Rdram()+g_Reg->PI_DRAM_ADDR_REG, g_Reg->PI_CART_ADDR_REG - 0x08000000, - g_Reg->PI_RD_LEN_REG + 1 + PI_RD_LEN_REG ); g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; From 4dac8354ccd79d4911593e11242931a1757052a6 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sun, 2 Aug 2015 21:31:15 +0900 Subject: [PATCH 022/103] Fix error message displayed always fix error message displayed always when play 64dd and enable debugger. --- Source/Project64/N64 System/Mips/Dma.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index b802f3dd1..68b7492c9 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -54,6 +54,7 @@ void CDMA::PI_DMA_READ() return; } + //Write ROM Area (for 64DD Convert) if (g_Reg->PI_CART_ADDR_REG >= 0x10000000 && g_Reg->PI_CART_ADDR_REG <= 0x1FBFFFFF && g_Settings->LoadBool(Game_AllowROMWrites)) { DWORD i; @@ -93,6 +94,11 @@ void CDMA::PI_DMA_READ() } VirtualProtect(ROM, g_Rom->GetRomSize(), PAGE_READONLY, &OldProtect); + + g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; + g_Reg->MI_INTR_REG |= MI_INTR_PI; + g_Reg->CheckInterrupts(); + return; } if ( g_Reg->PI_CART_ADDR_REG >= 0x08000000 && g_Reg->PI_CART_ADDR_REG <= 0x08010000) @@ -136,7 +142,7 @@ void CDMA::PI_DMA_READ() } if (bHaveDebugger()) { - g_Notify->DisplayError(L"PI_DMA_READ where are you dmaing to ?"); + g_Notify->DisplayError(L"PI_DMA_READ where are you dmaing to ?: %08X", g_Reg->PI_CART_ADDR_REG); } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; From 3c2da3cf2ec205d135b2581eff58a66d53781a4c Mon Sep 17 00:00:00 2001 From: Jeremy517 Date: Mon, 10 Aug 2015 00:02:44 -0700 Subject: [PATCH 023/103] Fix ROM Browser for network shares This part of cleanPathString was supposed to de-dupe backslashes in the directory name, and then insert a backslash to the start of directory if the directory originally started with \\ (so that the string again started with \\). However, because the call to rDirectory.replace was specifying a length of 1, it was always replacing \ with \ instead of replacing \\ with \. When the backslash was then inserted at the start of the directory, the directory string now began with \\\ instead of \\. This broke the ROM browser when using a network share (such as \\myserver\Emulation\Games). --- Source/Common/path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Common/path.cpp b/Source/Common/path.cpp index 578db233b..94e1c41d1 100644 --- a/Source/Common/path.cpp +++ b/Source/Common/path.cpp @@ -1022,7 +1022,7 @@ void CPath::cleanPathString(stdstr& rDirectory) const pos = rDirectory.find( DIR_DOUBLEDELIM ); while ( pos != std::string::npos ) { - rDirectory.replace( pos, 1, &DIRECTORY_DELIMITER ); + rDirectory.replace( pos, 2, &DIRECTORY_DELIMITER ); pos = rDirectory.find( DIR_DOUBLEDELIM, pos + 1 ); } if (AppendEnd) From b188bdae3c47861621af67d7b592f671cccd93fb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Aug 2015 22:21:51 -0400 Subject: [PATCH 024/103] forgot to recycle `del = EleSpec[RSPOpC.rs].B[el];` in VABS --- Source/RSP/Interpreter Ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/RSP/Interpreter Ops.c b/Source/RSP/Interpreter Ops.c index 61d09889f..cdb87cfec 100644 --- a/Source/RSP/Interpreter Ops.c +++ b/Source/RSP/Interpreter Ops.c @@ -923,7 +923,7 @@ void RSP_Vector_VABS (void) { if (RSP_Vect[RSPOpC.rd].HW[el] > 0) { result.HW[el] = RSP_Vect[RSPOpC.rt].UHW[del]; } else if (RSP_Vect[RSPOpC.rd].HW[el] < 0) { - if (RSP_Vect[RSPOpC.rt].UHW[EleSpec[RSPOpC.rs].B[el]] == 0x8000) { + if (RSP_Vect[RSPOpC.rt].UHW[del] == 0x8000) { result.HW[el] = 0x7FFF; } else { result.HW[el] = RSP_Vect[RSPOpC.rt].HW[del] * -1; From 90bda7406541feee0fe3612f80e41990d93b5424 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Mon, 17 Aug 2015 23:26:34 +0900 Subject: [PATCH 025/103] Update Fuurai no Shiren 2 RDB --- Config/Project64.rdb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 10f9f32e8..ccc4f94af 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -2122,15 +2122,10 @@ Culling=1 [F774EAEE-F0D8B13E-C:4A] Good Name=Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou! (J) -Internal Name=F3 ̳ײɼÚÝ2 -Status=Uncertain -Core Note=? -Plugin Note=[video] (see GameFAQ) -32bit=No -Clear Frame=2 +Internal Name=F3 フウライノシレン2 +Status=Issues (plugin) +Plugin Note=[video] missing:graphics (see GameFAQ) Counter Factor=1 -Culling=1 -Self Texture=1 //================ G ================ [68FCF726-49658CBC-C:50] From a09640f430351361c8e7b2bffb8152f59452b2fe Mon Sep 17 00:00:00 2001 From: AmbientMalice Date: Tue, 18 Aug 2015 17:48:56 +1000 Subject: [PATCH 026/103] Make Mempak use core instead of plugin by default. This is kinda crude, but this should fix PJ64 complaining about missing mem pak files in certain situations\configurations. --- Source/nragev20/configs/Controller1.cpf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/nragev20/configs/Controller1.cpf b/Source/nragev20/configs/Controller1.cpf index 441313e1d..5d92a97df 100644 --- a/Source/nragev20/configs/Controller1.cpf +++ b/Source/nragev20/configs/Controller1.cpf @@ -1,5 +1,5 @@ Plugged=1 -RawData=1 +RawData=0 PakType=1 RealN64Range=1 RapidFireEnabled=0 From 44397889b93e03bd0b0560da0fe73cfaf61d1d87 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Tue, 18 Aug 2015 23:26:49 +0900 Subject: [PATCH 027/103] Update Fuurai no Shiren 2 RDB add 32bit=No --- Config/Project64.rdb | 1 + 1 file changed, 1 insertion(+) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index ccc4f94af..d26ee2cb4 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -2126,6 +2126,7 @@ Internal Name=F3 フウライノシレン2 Status=Issues (plugin) Plugin Note=[video] missing:graphics (see GameFAQ) Counter Factor=1 +32bit=No //================ G ================ [68FCF726-49658CBC-C:50] From 64770befded11c6702cbc29710d307ea363c690d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Aug 2015 19:51:12 -0400 Subject: [PATCH 028/103] fixed duplicate debug string: "Write" typo'd to "Read" --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index c7eef5303..96499ddee 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -167,7 +167,7 @@ bool CMipsMemoryVM::Initialize() m_TLB_ReadMap = (DWORD *)VirtualAlloc(NULL,0xFFFFF * sizeof(DWORD),MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); if (m_TLB_ReadMap == NULL) { - WriteTraceF(TraceError,__FUNCTION__ ": Failed to Allocate m_TLB_ReadMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); + WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_ReadMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); FreeMemory(); return false; } @@ -175,7 +175,7 @@ bool CMipsMemoryVM::Initialize() m_TLB_WriteMap = (DWORD *)VirtualAlloc(NULL,0xFFFFF * sizeof(DWORD),MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); if (m_TLB_WriteMap == NULL) { - WriteTraceF(TraceError,__FUNCTION__ ": Failed to Allocate m_TLB_ReadMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); + WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_WriteMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); FreeMemory(); return false; } From b44324147d62492c5b310974fd997214d4e210e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Aug 2015 13:47:15 -0400 Subject: [PATCH 029/103] reduced the compiler errors if building without ATL --- Source/Project64/N64 System/Mips/Memory Class.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Project64/N64 System/Mips/Memory Class.h b/Source/Project64/N64 System/Mips/Memory Class.h index 8be3c994b..d2416838d 100644 --- a/Source/Project64/N64 System/Mips/Memory Class.h +++ b/Source/Project64/N64 System/Mips/Memory Class.h @@ -10,6 +10,15 @@ ****************************************************************************/ #pragma once +/* + * If compiling without ATL included, MSVC could mis-treat `interface` as a + * built-in keyword, but what we want essentially is a structure. + */ +//#undef interface +#ifndef interface +#define interface struct +#endif + interface CMipsMemory_CallBack { //Protected memory has been written to, returns true if that memory has been unprotected From 39a1abe44ee4810a85d085d2b57e2795159cf7d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Aug 2015 18:37:07 -0400 Subject: [PATCH 030/103] re-did my earlier fix in a safer way --- Source/Project64/N64 System/Mips/Memory Class.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Class.h b/Source/Project64/N64 System/Mips/Memory Class.h index d2416838d..a35049058 100644 --- a/Source/Project64/N64 System/Mips/Memory Class.h +++ b/Source/Project64/N64 System/Mips/Memory Class.h @@ -10,14 +10,7 @@ ****************************************************************************/ #pragma once -/* - * If compiling without ATL included, MSVC could mis-treat `interface` as a - * built-in keyword, but what we want essentially is a structure. - */ -//#undef interface -#ifndef interface -#define interface struct -#endif +#include interface CMipsMemory_CallBack { From 1a833539188fd7d9f6ff14f53c888f31658ee535 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Aug 2015 23:00:41 -0400 Subject: [PATCH 031/103] removed some surviving remnants of old Unicode refs --- Source/Project64/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 0e82bd905..775184ab0 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -22,7 +22,7 @@ void InitializeLog ( void) { LogFilePath.CreateDirectory(); } - LogFilePath.SetNameExtension(_T("Project64.log")); + LogFilePath.SetNameExtension("Project64.log"); LogFile = new CTraceFileLog(LogFilePath, g_Settings->LoadDword(Debugger_AppLogFlush) != 0, Log_New,500); #ifdef VALIDATE_DEBUG @@ -97,7 +97,7 @@ void InitializeLog ( void) void FixDirectories ( void ) { CPath Directory(CPath::MODULE_DIRECTORY); - Directory.AppendDirectory(_T("Config")); + Directory.AppendDirectory("Config"); if (!Directory.DirectoryExists()) Directory.CreateDirectory(); Directory.UpDirectory(); From da232c590a7707a7c56ff6c51689469564ff3dc5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Aug 2015 22:30:45 -0400 Subject: [PATCH 032/103] better chances at safe TLB paddr allocation to integers --- .../N64 System/Mips/Memory Virtual Mem.cpp | 62 ++++++++++++------- .../N64 System/Mips/Memory Virtual Mem.h | 4 +- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 96499ddee..a629148a8 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -50,24 +50,26 @@ void CMipsMemoryVM::Reset( bool /*EraseMemory*/ ) { if (m_TLB_ReadMap) { - memset(m_TLB_ReadMap,0,(0xFFFFF * sizeof(DWORD))); - memset(m_TLB_WriteMap,0,(0xFFFFF * sizeof(DWORD))); - for (DWORD address = 0x80000000; address < 0xC0000000; address += 0x1000) + size_t address; + + memset(m_TLB_ReadMap , 0, 0xFFFFF * sizeof(size_t)); + memset(m_TLB_WriteMap, 0, 0xFFFFF * sizeof(size_t)); + for (address = 0x80000000; address < 0xC0000000; address += 0x1000) { - m_TLB_ReadMap[address >> 12] = ((DWORD)m_RDRAM + (address & 0x1FFFFFFF)) - address; - m_TLB_WriteMap[address >> 12] = ((DWORD)m_RDRAM + (address & 0x1FFFFFFF)) - address; + m_TLB_ReadMap[address >> 12] = ((size_t)m_RDRAM + (address & 0x1FFFFFFF)) - address; + m_TLB_WriteMap[address >> 12] = ((size_t)m_RDRAM + (address & 0x1FFFFFFF)) - address; } if (g_Settings->LoadDword(Rdb_TLB_VAddrStart) != 0) { - DWORD Start = g_Settings->LoadDword(Rdb_TLB_VAddrStart); //0x7F000000; - DWORD Len = g_Settings->LoadDword(Rdb_TLB_VAddrLen); //0x01000000; - DWORD PAddr = g_Settings->LoadDword(Rdb_TLB_PAddrStart); //0x10034b30; - DWORD End = Start + Len; - for (DWORD address = Start; address < End; address += 0x1000) + size_t Start = g_Settings->LoadDword(Rdb_TLB_VAddrStart); //0x7F000000; + size_t Len = g_Settings->LoadDword(Rdb_TLB_VAddrLen); //0x01000000; + size_t PAddr = g_Settings->LoadDword(Rdb_TLB_PAddrStart); //0x10034b30; + size_t End = Start + Len; + for (address = Start; address < End; address += 0x1000) { - m_TLB_ReadMap[address >> 12] = ((DWORD)m_RDRAM + (address - Start + PAddr)) - address; - m_TLB_WriteMap[address >> 12] = ((DWORD)m_RDRAM + (address - Start + PAddr)) - address; + m_TLB_ReadMap[address >> 12] = ((size_t)m_RDRAM + (address - Start + PAddr)) - address; + m_TLB_WriteMap[address >> 12] = ((size_t)m_RDRAM + (address - Start + PAddr)) - address; } } } @@ -164,18 +166,28 @@ bool CMipsMemoryVM::Initialize() } CPifRam::Reset(); - m_TLB_ReadMap = (DWORD *)VirtualAlloc(NULL,0xFFFFF * sizeof(DWORD),MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); + m_TLB_ReadMap = (size_t *)VirtualAlloc( + NULL, + 0xFFFFF * sizeof(size_t), + MEM_RESERVE | MEM_COMMIT, + PAGE_READWRITE + ); if (m_TLB_ReadMap == NULL) { - WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_ReadMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); + WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_ReadMap (Size: 0x%X)",0xFFFFF * sizeof(size_t)); FreeMemory(); return false; } - m_TLB_WriteMap = (DWORD *)VirtualAlloc(NULL,0xFFFFF * sizeof(DWORD),MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); + m_TLB_WriteMap = (size_t *)VirtualAlloc( + NULL, + 0xFFFFF * sizeof(size_t), + MEM_RESERVE | MEM_COMMIT, + PAGE_READWRITE + ); if (m_TLB_WriteMap == NULL) { - WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_WriteMap (Size: 0x%X)",0xFFFFF * sizeof(DWORD)); + WriteTraceF(TraceError,__FUNCTION__": Failed to Allocate m_TLB_WriteMap (Size: 0x%X)",0xFFFFF * sizeof(size_t)); FreeMemory(); return false; } @@ -5349,22 +5361,28 @@ LPCTSTR CMipsMemoryVM::LabelName ( DWORD Address ) const void CMipsMemoryVM::TLB_Mapped( DWORD VAddr, DWORD Len, DWORD PAddr, bool bReadOnly ) { - for (DWORD count = VAddr, VEnd = VAddr + Len; count < VEnd; count += 0x1000) + size_t count, VEnd; + + VEnd = VAddr + Len; + for (count = VAddr; count < VEnd; count += 0x1000) { - DWORD Index = count >> 12; - m_TLB_ReadMap[Index] = ((DWORD)m_RDRAM + (count - VAddr + PAddr)) - count; + size_t Index = count >> 12; + m_TLB_ReadMap[Index] = ((size_t)m_RDRAM + (count - VAddr + PAddr)) - count; if (!bReadOnly) { - m_TLB_WriteMap[Index] = ((DWORD)m_RDRAM + (count - VAddr + PAddr)) - count; + m_TLB_WriteMap[Index] = ((size_t)m_RDRAM + (count - VAddr + PAddr)) - count; } } } void CMipsMemoryVM::TLB_Unmaped( DWORD Vaddr, DWORD Len ) { - for (DWORD count = Vaddr, End = Vaddr + Len; count < End; count += 0x1000) + size_t count, End; + + End = Vaddr + Len; + for (count = Vaddr; count < End; count += 0x1000) { - DWORD Index = count >> 12; + size_t Index = count >> 12; m_TLB_ReadMap[Index] = NULL; m_TLB_WriteMap[Index] = NULL; } diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h index efd810e6b..4f11f477c 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h @@ -166,6 +166,6 @@ private: mutable char m_strLabelName[100]; //BIG look up table to quickly translate the tlb to real mem address - DWORD * m_TLB_ReadMap; - DWORD * m_TLB_WriteMap; + size_t * m_TLB_ReadMap; + size_t * m_TLB_WriteMap; }; From 152b365fcc4e2a52423c83d3d58ed5f0f23c7872 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 17:23:47 -0400 Subject: [PATCH 033/103] more Unicode compile ref. errors to _T() fixed --- Source/Project64/Multilanguage/Language Class.cpp | 2 +- Source/Project64/N64 System/C Core/Logging.cpp | 4 ++-- Source/Project64/N64 System/Recompiler/x86CodeLog.cpp | 2 +- Source/Project64/User Interface/Gui Class.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Project64/Multilanguage/Language Class.cpp b/Source/Project64/Multilanguage/Language Class.cpp index c82846c1e..1144ab209 100644 --- a/Source/Project64/Multilanguage/Language Class.cpp +++ b/Source/Project64/Multilanguage/Language Class.cpp @@ -765,7 +765,7 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH|FF_DONTCARE, - _T("Arial") + "Arial" ); SendDlgItemMessage(hDlg,IDC_SELECT_LANG,WM_SETFONT,(WPARAM)hTextFont,TRUE); } diff --git a/Source/Project64/N64 System/C Core/Logging.cpp b/Source/Project64/N64 System/C Core/Logging.cpp index bc9dacb18..7969199fc 100644 --- a/Source/Project64/N64 System/C Core/Logging.cpp +++ b/Source/Project64/N64 System/C Core/Logging.cpp @@ -896,8 +896,8 @@ void StartLog (void) } CPath LogFile(CPath::MODULE_DIRECTORY); - LogFile.AppendDirectory(_T("Logs")); - LogFile.SetNameExtension(_T("cpudebug.log")); + LogFile.AppendDirectory("Logs"); + LogFile.SetNameExtension("cpudebug.log"); hLogFile = CreateFile(LogFile,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); diff --git a/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp b/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp index 1417f9128..ec7f2cce7 100644 --- a/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp +++ b/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp @@ -31,7 +31,7 @@ void Start_x86_Log (void) { CPath LogFileName(CPath::MODULE_DIRECTORY); LogFileName.AppendDirectory("Logs"); - LogFileName.SetNameExtension(_T("CPUoutput.log")); + LogFileName.SetNameExtension("CPUoutput.log"); if (hCPULogFile) { Stop_x86_Log(); } hCPULogFile = CreateFile(LogFileName,GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index dd50c3b83..a6f953fc5 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -1057,7 +1057,7 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH|FF_DONTCARE, - _T("Arial") + "Arial" ); hAuthorFont = ::CreateFont @@ -1075,7 +1075,7 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH|FF_DONTCARE, - _T("Arial") + "Arial" ); hPageHeadingFont = ::CreateFont @@ -1093,7 +1093,7 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH|FF_DONTCARE, - _T("Arial Bold") + "Arial Bold" ); SendDlgItemMessage(hWnd,IDC_VERSION,WM_SETFONT,(WPARAM)hTextFont,TRUE); From 074b2cc0079b6e0f746b642a691ea71623713066 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 18:29:55 -0400 Subject: [PATCH 034/103] explicitly included --- Source/Project64/N64 System/C Core/Logging.cpp | 2 ++ Source/Project64/User Interface/Settings/Settings Page.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Source/Project64/N64 System/C Core/Logging.cpp b/Source/Project64/N64 System/C Core/Logging.cpp index bc9dacb18..cb0c661b6 100644 --- a/Source/Project64/N64 System/C Core/Logging.cpp +++ b/Source/Project64/N64 System/C Core/Logging.cpp @@ -10,6 +10,8 @@ ****************************************************************************/ #include "stdafx.h" +#include + void LoadLogSetting (HKEY hKey,char * String, BOOL * Value); void SaveLogOptions (void); diff --git a/Source/Project64/User Interface/Settings/Settings Page.h b/Source/Project64/User Interface/Settings/Settings Page.h index 2e043c66e..d7faa703d 100644 --- a/Source/Project64/User Interface/Settings/Settings Page.h +++ b/Source/Project64/User Interface/Settings/Settings Page.h @@ -10,6 +10,8 @@ ****************************************************************************/ #pragma once +#include + class CSettingsPage { public: From 6b34e8b89ad209cba19ff65a194585246041720c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 18:34:12 -0400 Subject: [PATCH 035/103] explicit to fix anti-ATL build errors --- Source/Project64/N64 System/Cheat Class.cpp | 1 + Source/Project64/User Interface/Gui Class.cpp | 2 ++ Source/Project64/User Interface/Rom Browser Class.cpp | 2 ++ Source/Project64/User Interface/Settings Config.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index edb972975..c4b330ba4 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -10,6 +10,7 @@ ****************************************************************************/ #include "stdafx.h" +#include #include "Settings/SettingType/SettingsType-Cheats.h" enum { WM_EDITCHEAT = WM_USER + 0x120 }; diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index dd50c3b83..7dc876590 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#include #include "Settings/SettingType/SettingsType-Application.h" extern "C" diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index b1fc3e800..45ce7f787 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" +#include + CRomBrowser::CRomBrowser (HWND & MainWindow, HWND & StatusWindow ) : m_MainWindow(MainWindow), m_StatusWindow(StatusWindow), diff --git a/Source/Project64/User Interface/Settings Config.h b/Source/Project64/User Interface/Settings Config.h index aa2704b84..34ad0371d 100644 --- a/Source/Project64/User Interface/Settings Config.h +++ b/Source/Project64/User Interface/Settings Config.h @@ -1,5 +1,7 @@ #pragma once +#include + class CConfigSettingSection; class CSettingsPage; From 7ce4f3db93442e7295fd2060f5b4cf05cfaefc0a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 18:34:34 -0400 Subject: [PATCH 036/103] explicit to fix anti-ATL build errors --- Source/Project64/N64 System/N64 Class.cpp | 1 + Source/Project64/User Interface/Main Menu Class.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index b7f90d87b..be17193fd 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -13,6 +13,7 @@ #pragma warning(disable:4355) // Disable 'this' : used in base member initializer list #include +#include CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) : CSystemEvents(this, Plugins), diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index ddbc44ce0..b98ce91cb 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -1,5 +1,8 @@ #include "stdafx.h" +#include +#include + CMainMenu::CMainMenu ( CMainGui * hMainWindow ): CBaseMenu(), m_ResetAccelerators(true) From 7b4b5a6827ca3530d7f63f883de4ffcac8837c13 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 18:35:13 -0400 Subject: [PATCH 037/103] explicit to fix just a few build errors w/o ATL --- Source/Project64/User Interface/Rom Browser Class.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index 45ce7f787..d15f6a240 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include +#include CRomBrowser::CRomBrowser (HWND & MainWindow, HWND & StatusWindow ) : m_MainWindow(MainWindow), From d00937a997f2f1d58f058f626ab354dc3a237095 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Aug 2015 18:35:36 -0400 Subject: [PATCH 038/103] explicit to fix 6 unresolved macros w/o ATL --- Source/Project64/N64 System/Cheat Class.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index c4b330ba4..4151c04e6 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -11,6 +11,7 @@ #include "stdafx.h" #include +#include #include "Settings/SettingType/SettingsType-Cheats.h" enum { WM_EDITCHEAT = WM_USER + 0x120 }; From b3b77ed8c5a2057785d49f77ff5fd8fa64993588 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sun, 30 Aug 2015 14:16:41 +0900 Subject: [PATCH 039/103] Update Project64.rdb add new entry --- Config/Project64.rdb | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index d26ee2cb4..825580ae8 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -8602,3 +8602,44 @@ Core Note=slow Good Name=Yoshi's Story BootEmu (PD) Internal Name=YOSHI BOOT EMU Status=Unsupported + +[5A4C57FE-AA6807C4-C:41] +Good Name=NUS-64 Aging Cassette +Internal Name=AGING ROM +Status=Needs RSP plugin + +[BB0598C7-AE917C5D-C:0] +Good Name=64GB Checker V1.05 +Internal Name=64GB Checker V1.05 +Status=Compatible + +[816BE37F-9BCE6CAA-C:0] +Good Name=Dolphin Controller Test +Internal Name=Dolphin Controller Test +Status=Compatible + +[6F46DA42-D971A312-C:45] +Good Name=Ronaldinho's Soccer 64 +Internal Name=RONALDINHO SOCCER +Status=Compatible +Plugin Note=[video] errors:shadows; use Glide64 +AiCountPerBytes=200 +Counter Factor=1 +Culling=1 + +[A01B8D3B-E0FAC46F-C:0] +Good Name=Photo Viewer +Internal Name=Photo Viewer +Status=Compatible + +[2F33EFCA-6CA95A9C-C:0] +Good Name=funnelcube (PD) +Internal Name=funnelcube +Status=Compatible + +[D55891EB-2BEFD9C8-C:0] +Good Name=MGC 2011 Demo (PD) +Internal Name=shut up and code +CPU Type=Interpreter +RDRAM Size=8 +Status=Unsupported From f39b6612aeb1c9d3d036409e33a238afcb5f5741 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Sun, 30 Aug 2015 18:16:29 +0900 Subject: [PATCH 040/103] Update Project64.rdb update Derby Stallion 64 --- Config/Project64.rdb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 825580ae8..7d69fc49f 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -1386,14 +1386,16 @@ Status=Compatible [A5F667E1-DA1FBD1F-C:4A] Good Name=Derby Stallion 64 (J) Internal Name=DERBYSTALLION 64 +Save Type=FlashRam Status=Compatible AiCountPerBytes=200 -Sync Audio=0 [96BA4EFB-C9988E4E-C:0] Good Name=Derby Stallion 64 (J) (Beta) Internal Name= -Status=Unsupported +Save Type=FlashRam +Status=Compatible +CRC-Recalc=Yes [630AA37D-896BD7DB-C:50] Good Name=Destruction Derby 64 (E) (M3) From 834299c0412b29edfc19591c600330cf21b23680 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Aug 2015 22:56:21 -0400 Subject: [PATCH 041/103] replaced all in-line assembly in Virtual Memory unit --- .../N64 System/Mips/Memory Virtual Mem.cpp | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index a629148a8..e635a02da 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -40,6 +40,23 @@ CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnl m_IMEM = NULL; } +static unsigned long swap32by8(unsigned long word) +{ + const unsigned long swapped = +#if defined(_MSC_VER) + _byteswap_ulong(word) +#elif defined(__GNUC__) + __builtin_bswap32(word) +#else + (word & 0x000000FFul) << 24 + | (word & 0x0000FF00ul) << 8 + | (word & 0x00FF0000ul) >> 8 + | (word & 0xFF000000ul) >> 24 +#endif + ; + return (swapped & 0xFFFFFFFFul); +} + CMipsMemoryVM::~CMipsMemoryVM() { g_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); @@ -2653,32 +2670,16 @@ bool CMipsMemoryVM::LW_NonMemory(DWORD PAddr, DWORD* Value) case 0x1FC00000: if (PAddr < 0x1FC007C0) { -/* DWORD ToSwap = *(DWORD *)(&PifRom[PAddr - 0x1FC00000]); - _asm - { - mov eax,ToSwap - bswap eax - mov ToSwap,eax - } - * Value = ToSwap;*/ +/* *Value = *(DWORD *)(&PifRom[PAddr - 0x1FC00000]); + *Value = swap32by8(*Value); */ g_Notify->BreakPoint(__FILEW__,__LINE__); return true; } else if (PAddr < 0x1FC00800) { -#ifdef _M_IX86 BYTE * PIF_Ram = g_MMU->PifRam(); - DWORD ToSwap = *(DWORD *)(&PIF_Ram[PAddr - 0x1FC007C0]); - _asm - { - mov eax,ToSwap - bswap eax - mov ToSwap,eax - } - *Value = ToSwap; -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif + *Value = *(DWORD *)(&PIF_Ram[PAddr - 0x1FC007C0]); + *Value = swap32by8(*Value); return true; } else @@ -3375,16 +3376,7 @@ bool CMipsMemoryVM::SW_NonMemory(DWORD PAddr, DWORD Value) } else if (PAddr < 0x1FC00800) { -#ifdef _M_IX86 - _asm - { - mov eax,Value - bswap eax - mov Value,eax - } -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif + Value = swap32by8(Value); *(DWORD *)(&m_PifRam[PAddr - 0x1FC007C0]) = Value; if (PAddr == 0x1FC007FC) { From e576dbbaa458b513c37adb9fdcdb88a5e3fe9024 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Tue, 1 Sep 2015 07:51:36 -0700 Subject: [PATCH 042/103] Fix a mistake I made in SPECIAL_DSRL32 --- .../N64 System/Recompiler/Recompiler Ops.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 6ae9a99b5..6d76a1dfe 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -3934,15 +3934,8 @@ void CRecompilerOps::SPECIAL_DSRL32() { if (m_Opcode.rt != m_Opcode.rd) UnMap_GPR(m_Opcode.rd, false); - if (m_Opcode.sa == 0) { - MIPS_DWORD Value; - Value.UW[0] = Value.UW[1] = GetMipsRegHi(m_Opcode.rt); - m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_64); - m_RegWorkingSet.SetMipsReg(m_Opcode.rd, Value.UDW); - } else { - m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32_ZERO); - m_RegWorkingSet.SetMipsRegLo(m_Opcode.rd, (DWORD)(GetMipsReg(m_Opcode.rt) >> (m_Opcode.sa + 32))); - } + m_RegWorkingSet.SetMipsRegState(m_Opcode.rd, CRegInfo::STATE_CONST_64); + m_RegWorkingSet.SetMipsReg(m_Opcode.rd, (DWORD)(GetMipsRegHi(m_Opcode.rt) >> m_Opcode.sa)); } else if (IsMapped(m_Opcode.rt)) { ProtectGPR(m_Opcode.rt); if (Is64Bit(m_Opcode.rt)) { From ec6a1e0c238981974738197f7c3342c7dc13c6f7 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Tue, 1 Sep 2015 08:07:25 -0700 Subject: [PATCH 043/103] Fix issue with displaying the value of EIP Before, it would only display 1 byte, instead of the full address stored in EIP. --- .../N64 System/Mips/Memory Virtual Mem.cpp | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index a629148a8..13b0dfeab 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -2147,9 +2147,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2159,9 +2159,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2171,9 +2171,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2183,9 +2183,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2206,9 +2206,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to half word\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to half word\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2218,8 +2218,8 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %02X",MemAddress, - *(unsigned char *)lpEP->ContextRecord->Eip); + g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X",MemAddress, + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2236,8 +2236,8 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) if (!SH_NonMemory(MemAddress,*(WORD *)ReadPos)) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %02X",MemAddress, - *(unsigned char *)lpEP->ContextRecord->Eip); + g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X",MemAddress, + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)(ReadPos + 2); @@ -2255,9 +2255,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2267,9 +2267,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2279,9 +2279,9 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to load word\n\nMIPS Address: %08X\nX86 Address: %02X", + g_Notify->DisplayError(L"Failed to load word\n\nMIPS Address: %08X\nX86 Address: %08X", (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM, - *(unsigned char *)lpEP->ContextRecord->Eip); + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2291,8 +2291,8 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %08X\nX86 Address: %02X",MemAddress, - *(unsigned char *)lpEP->ContextRecord->Eip); + g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X",MemAddress, + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)ReadPos; @@ -2310,8 +2310,8 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %02X",MemAddress, - *(unsigned char *)lpEP->ContextRecord->Eip); + g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X",MemAddress, + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)(ReadPos + 1); @@ -2329,8 +2329,8 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer ) { if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { - g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %08X\nX86 Address: %02X",MemAddress, - *(unsigned char *)lpEP->ContextRecord->Eip); + g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X",MemAddress, + (unsigned char *)lpEP->ContextRecord->Eip); } } lpEP->ContextRecord->Eip = (DWORD)(ReadPos + 4); From 8968430b045d608d886c01a043d67dcd4b57a6e7 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Tue, 1 Sep 2015 08:16:42 -0700 Subject: [PATCH 044/103] Fix issue with AiUpdate Some plugins like Jabo's needs this thread to be created each time initiated. --- Source/Project64/Plugins/Audio Plugin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Project64/Plugins/Audio Plugin.cpp b/Source/Project64/Plugins/Audio Plugin.cpp index 6255b519d..d2d1651d0 100644 --- a/Source/Project64/Plugins/Audio Plugin.cpp +++ b/Source/Project64/Plugins/Audio Plugin.cpp @@ -135,8 +135,13 @@ bool CAudioPlugin::Initiate(CN64System * System, CMainGui * RenderWindow) if (System != NULL) { - if (AiUpdate && !m_hAudioThread) + if (AiUpdate) { + if (m_hAudioThread) + { + WriteTraceF(TraceAudio, __FUNCTION__ ": Terminate Audio Thread"); + TerminateThread(m_hAudioThread, 0); + } m_hAudioThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AudioThread, (LPVOID)this, 0, &ThreadID); } From 7909b1850600bf3bfb2673f10830a73d425693ad Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Tue, 1 Sep 2015 08:50:59 -0700 Subject: [PATCH 045/103] Write to VI_V_CURRENT_LINE_REG As of now, it's never being written to, so graphics plugins do not have any access to that register. z64gl reads this register, so that's why it has this screen shaking problem in certain games like Star Wars Rogue Squadron. --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index a629148a8..20112914a 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -3426,6 +3426,7 @@ void CMipsMemoryVM::UpdateHalfLine() m_HalfLine = (DWORD)(*g_NextTimer / g_System->ViRefreshRate()); m_HalfLine &= ~1; m_HalfLine |= m_FieldSerration; + g_Reg->VI_V_CURRENT_LINE_REG = m_HalfLine; m_HalfLineCheck = NextViTimer; } From a4a69a8a3ae4ce12bc44b26797b66abb5707e359 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 2 Sep 2015 22:41:40 -0700 Subject: [PATCH 046/103] Add support for ViStatusChanged in LoadState Calls ViStatusChanged if the value of VI_STATUS_REG changes after loading a save state. --- Source/Project64/N64 System/N64 Class.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index be17193fd..13e28b0de 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1576,9 +1576,10 @@ bool CN64System::LoadState() bool CN64System::LoadState(LPCSTR FileName) { - DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0; + DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status; bool LoadedZipFile = false, AudioResetOnLoad; - + old_status = g_Reg->VI_STATUS_REG; + WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName); char drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT]; @@ -1753,6 +1754,11 @@ bool CN64System::LoadState(LPCSTR FileName) m_Audio.SetFrequency(m_Reg.AI_DACRATE_REG, g_System->SystemType()); } + if (old_status != g_Reg->VI_STATUS_REG) + { + g_Plugins->Gfx()->ViStatusChanged(); + } + //Fix Random Register while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) { From abf71cdd1a3f4f2067ce4fbbc0fc83044ab110b4 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 2 Sep 2015 22:44:24 -0700 Subject: [PATCH 047/103] Add support for ViWidthChanged in LoadState Calls ViWidthChanged if the value of VI_WIDTH_REG changes after loading a save state. --- Source/Project64/N64 System/N64 Class.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 13e28b0de..3887a952a 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1576,9 +1576,10 @@ bool CN64System::LoadState() bool CN64System::LoadState(LPCSTR FileName) { - DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status; + DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width; bool LoadedZipFile = false, AudioResetOnLoad; old_status = g_Reg->VI_STATUS_REG; + old_width = g_Reg->VI_WIDTH_REG; WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName); @@ -1759,6 +1760,11 @@ bool CN64System::LoadState(LPCSTR FileName) g_Plugins->Gfx()->ViStatusChanged(); } + if (old_width != g_Reg->VI_WIDTH_REG) + { + g_Plugins->Gfx()->ViWidthChanged(); + } + //Fix Random Register while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) { From 6adb89e04174644e73e1ba7b2130c8284ee5ce57 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 2 Sep 2015 22:47:21 -0700 Subject: [PATCH 048/103] Add support for DacrateChanged in LoadState Calls DacrateChanged if the value of AI_DACRATE_REG changes after loading a save state. --- Source/Project64/N64 System/N64 Class.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 3887a952a..20cc5d64d 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1576,10 +1576,11 @@ bool CN64System::LoadState() bool CN64System::LoadState(LPCSTR FileName) { - DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width; + DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width, old_dacrate; bool LoadedZipFile = false, AudioResetOnLoad; old_status = g_Reg->VI_STATUS_REG; old_width = g_Reg->VI_WIDTH_REG; + old_dacrate = g_Reg->AI_DACRATE_REG; WriteTraceF((TraceType)(TraceDebug | TraceRecompiler),__FUNCTION__ "(%s): Start",FileName); @@ -1765,6 +1766,11 @@ bool CN64System::LoadState(LPCSTR FileName) g_Plugins->Gfx()->ViWidthChanged(); } + if (old_dacrate != g_Reg->AI_DACRATE_REG) + { + g_Plugins->Audio()->DacrateChanged(g_System->SystemType()); + } + //Fix Random Register while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) { From 6d4cb1c2e3268a34bae7c5272533ec9c87de3474 Mon Sep 17 00:00:00 2001 From: purplemarshmallow Date: Sat, 5 Sep 2015 11:02:07 +0200 Subject: [PATCH 049/103] rdb: add settings for G.A.S.P fixes G.A.S.P!! Fighter's NEXTream crash with recompiler #583 --- Config/Project64.rdb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index d26ee2cb4..a59730abd 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -1,4 +1,4 @@ -// ============ RDB for PJ64 v2.2. GoodN64 v321 ===================================== +// ============ RDB for PJ64 v2.2. GoodN64 v321 ===================================== // PJ64 v2.2 Official RDB // Not for use with PJ64 v1.6 or previous //---- START OF RDB FILE HEADER --------------------------------------------------------- @@ -2133,6 +2133,11 @@ Counter Factor=1 Good Name=G.A.S.P!! Fighters' NEXTream (E) Internal Name=G.A.S.P!!Fighters'NE Status=Compatible +SMM-Cache=0 +SMM-FUNC=0 +SMM-PI DMA=0 +SMM-Protect=1 +SMM-TLB=0 Culling=1 RDRAM Size=8 @@ -2140,6 +2145,11 @@ RDRAM Size=8 Good Name=G.A.S.P!! Fighters' NEXTream (J) Internal Name=G.A.S.P!!Fighters'NE Status=Compatible +SMM-Cache=0 +SMM-FUNC=0 +SMM-PI DMA=0 +SMM-Protect=1 +SMM-TLB=0 RDRAM Size=8 [457B9CD9-09C55352-C:4A] From 4a03a8d1e488a2804b115c8a3984d3e86e05ff89 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Sep 2015 12:16:36 -0400 Subject: [PATCH 050/103] PIF RAM mutual DMA x64 breakpoints replaced with fast C --- .../N64 System/Mips/Memory Virtual Mem.cpp | 2 +- .../N64 System/Mips/Memory Virtual Mem.h | 2 + Source/Project64/N64 System/Mips/Pif Ram.cpp | 64 ++++--------------- 3 files changed, 15 insertions(+), 53 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 0c628c5e2..6245405a6 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -40,7 +40,7 @@ CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnl m_IMEM = NULL; } -static unsigned long swap32by8(unsigned long word) +unsigned long swap32by8(unsigned long word) { const unsigned long swapped = #if defined(_MSC_VER) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h index 4f11f477c..34ff27fc2 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h @@ -10,6 +10,8 @@ ****************************************************************************/ #pragma once +extern unsigned long swap32by8(unsigned long word); + class CMipsMemoryVM : public CMipsMemory, public CTransVaddr, diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index 3dacf5796..db011df2e 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -302,34 +302,14 @@ void CPifRam::SI_DMA_READ() } else { -#ifdef _M_IX86 - _asm + size_t i; + + for (i = 0; i < 64; i += 4) { - mov edi, dword ptr [SI_DRAM_ADDR_REG] - mov edi, dword ptr [edi] - add edi, RDRAM - mov ecx, PifRamPos - mov edx, 0 - memcpyloop: - mov eax, dword ptr [ecx + edx] - bswap eax - mov dword ptr [edi + edx],eax - mov eax, dword ptr [ecx + edx + 4] - bswap eax - mov dword ptr [edi + edx + 4],eax - mov eax, dword ptr [ecx + edx + 8] - bswap eax - mov dword ptr [edi + edx + 8],eax - mov eax, dword ptr [ecx + edx + 12] - bswap eax - mov dword ptr [edi + edx + 12],eax - add edx, 16 - cmp edx, 64 - jb memcpyloop + *(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i] = swap32by8( + *(unsigned __int32 *)&PifRamPos[i] + ); } -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif } if (LogOptions.LogPRDMAMemStores) @@ -413,34 +393,14 @@ void CPifRam::SI_DMA_WRITE() } else { -#ifdef _M_IX86 - _asm + size_t i; + + for (i = 0; i < 64; i += 4) { - mov ecx, dword ptr [SI_DRAM_ADDR_REG] - mov ecx, dword ptr [ecx] - add ecx, RDRAM - mov edi, PifRamPos - mov edx, 0 - memcpyloop: - mov eax, dword ptr [ecx + edx] - bswap eax - mov dword ptr [edi + edx],eax - mov eax, dword ptr [ecx + edx + 4] - bswap eax - mov dword ptr [edi + edx + 4],eax - mov eax, dword ptr [ecx + edx + 8] - bswap eax - mov dword ptr [edi + edx + 8],eax - mov eax, dword ptr [ecx + edx + 12] - bswap eax - mov dword ptr [edi + edx + 12],eax - add edx, 16 - cmp edx, 64 - jb memcpyloop + *(unsigned __int32 *)&PifRamPos[i] = swap32by8( + *(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i] + ); } -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif } if (LogOptions.LogPRDMAMemLoads) From 19f34eed4e9791b876e90fb9d71254d404c37951 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 11:27:07 -0700 Subject: [PATCH 051/103] Implement SLTI in RSP Recompiler --- Source/RSP/Recompiler Ops.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index b936c072d..cc72855db 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -481,8 +481,20 @@ void Compile_ADDIU ( void ) { } void Compile_SLTI ( void ) { +#ifndef Compile_Immediates Cheat_r4300iOpcode(RSP_Opcode_SLTI,"RSP_Opcode_SLTI"); +#endif + int Immediate; + + CPU_Message(" %X %s", CompilePC, RSPOpcodeName(RSPOpC.Hex, CompilePC)); + if (RSPOpC.rt == 0) return; + + Immediate = (short)RSPOpC.immediate; + XorX86RegToX86Reg(x86_ECX, x86_ECX); + CompConstToVariable(Immediate, &RSP_GPR[RSPOpC.rs].UW, GPR_Name(RSPOpC.rs)); + Setl(x86_ECX); + MoveX86regToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); } void Compile_SLTIU ( void ) { From 720d8c8dd77a068b076c5656c041f8e0297b5e79 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 11:28:49 -0700 Subject: [PATCH 052/103] Implement SLTIU in RSP Recompiler --- Source/RSP/Recompiler Ops.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index cc72855db..27ae3cc61 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -498,8 +498,20 @@ void Compile_SLTI ( void ) { } void Compile_SLTIU ( void ) { +#ifndef Compile_Immediates Cheat_r4300iOpcode(RSP_Opcode_SLTIU,"RSP_Opcode_SLTIU"); +#endif + int Immediate; + + CPU_Message(" %X %s", CompilePC, RSPOpcodeName(RSPOpC.Hex, CompilePC)); + if (RSPOpC.rt == 0) return; + + Immediate = (short)RSPOpC.immediate; + XorX86RegToX86Reg(x86_ECX, x86_ECX); + CompConstToVariable(Immediate, &RSP_GPR[RSPOpC.rs].UW, GPR_Name(RSPOpC.rs)); + Setb(x86_ECX); + MoveX86regToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); } void Compile_ANDI ( void ) { From 2ff2165bd92cb89b8d4e79e356043d57699a0c75 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 11:49:37 -0700 Subject: [PATCH 053/103] Optimize ADDI in RSP Recompiler No need to add 0 to a variable. I've seen ADDI V0, V0, 0x0000 in Super Smash Bros audio microcode. --- Source/RSP/Recompiler Ops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 27ae3cc61..b46b1a3e4 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -444,7 +444,9 @@ void Compile_ADDI ( void ) { if (RSPOpC.rt == 0) return; if (RSPOpC.rt == RSPOpC.rs) { - AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + if(Immediate != 0) { + AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + } } else if (RSPOpC.rs == 0) { MoveConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); } else if ((IsRegConst(RSPOpC.rs) & 1) != 0) { From 48fcced3bc51fcb6fa1ba8637199989bbcbcfe7e Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 12:18:28 -0700 Subject: [PATCH 054/103] Optimize ADDIU in RSP Recompiler The second part happens in Hydro Thunder LLE audio. --- Source/RSP/Recompiler Ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index b46b1a3e4..5b17818da 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -472,12 +472,16 @@ void Compile_ADDIU ( void ) { if (RSPOpC.rt == 0) return; if (RSPOpC.rt == RSPOpC.rs) { - AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + if(Immediate != 0) { + AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + } } else if (RSPOpC.rs == 0) { MoveConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); } else { MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].UW, GPR_Name(RSPOpC.rs), x86_EAX); - AddConstToX86Reg(x86_EAX, Immediate); + if(Immediate != 0) { + AddConstToX86Reg(x86_EAX, Immediate); + } MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); } } From 4b4c37e9bd1e1cfb2570cde2d13c24fdfc2e73e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Sep 2015 15:47:44 -0400 Subject: [PATCH 055/103] first pass--compiles on VS2013 w/o ATL --- .../Project64/N64 System/Debugger/Debugger - Memory Dump.cpp | 3 +++ .../N64 System/Debugger/Debugger - Memory Search.cpp | 3 +++ Source/Project64/N64 System/Debugger/Debugger - TLB.cpp | 3 +++ .../Project64/N64 System/Debugger/Debugger - View Memory.cpp | 3 +++ Source/Project64/N64 System/Debugger/Debugger.cpp | 3 +++ Source/Project64/User Interface/Gui Class.cpp | 2 ++ Source/Project64/User Interface/Main Menu Class.cpp | 2 ++ Source/Project64/User Interface/Settings Config.cpp | 4 +++- .../Settings/Settings Page - Advanced Options.cpp | 3 +++ .../User Interface/Settings/Settings Page - Directories.cpp | 3 +++ .../Settings/Settings Page - Game - General.cpp | 3 +++ .../User Interface/Settings/Settings Page - Game - Plugin.cpp | 3 +++ .../Settings/Settings Page - Game - Recompiler.cpp | 3 +++ .../User Interface/Settings/Settings Page - Game - Status.cpp | 3 +++ .../User Interface/Settings/Settings Page - Game Browser.cpp | 3 +++ .../Settings/Settings Page - Keyboard Shortcuts.cpp | 3 +++ .../User Interface/Settings/Settings Page - Options.cpp | 3 +++ .../User Interface/Settings/Settings Page - Plugin.cpp | 3 +++ Source/Project64/User Interface/Settings/Settings Page.cpp | 3 +++ .../Project64/User Interface/WTL Controls/ModifiedEditBox.cpp | 2 ++ .../Project64/User Interface/WTL Controls/PartialGroupBox.cpp | 3 ++- 21 files changed, 59 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp index 5ecb12c52..efeeeacd9 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Debugger UI.h" CDumpMemory::CDumpMemory(CDebugger * debugger) : @@ -593,3 +595,4 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC, // } // return false; //} +#endif diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp index 5bd447889..9ea8ddc66 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Debugger UI.h" CDebugMemorySearch::CDebugMemorySearch(CDebugger * debugger) : @@ -787,3 +789,4 @@ bool CDebugMemorySearch::SearchForValue (DWORD Value, MemorySize Size, DWORD &St } return false; } +#endif diff --git a/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp b/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp index 4f4037824..4662fbb4a 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Debugger UI.h" CDebugTlb::CDebugTlb(CDebugger * debugger) : @@ -285,3 +287,4 @@ void CDebugTlb::RefreshTLBWindow (void) } } } +#endif diff --git a/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp b/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp index 441a973c9..7973689fb 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Debugger UI.h" CDebugMemoryView::CDebugMemoryView(CDebugger * debugger) : @@ -470,3 +472,4 @@ void CDebugMemoryView::RefreshMemory ( bool ResetCompare ) Insert_MemoryLineDump ( count ); } } +#endif diff --git a/Source/Project64/N64 System/Debugger/Debugger.cpp b/Source/Project64/N64 System/Debugger/Debugger.cpp index 304f735f9..ea190aaf3 100644 --- a/Source/Project64/N64 System/Debugger/Debugger.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Debugger UI.h" CPj64Module _Module; @@ -130,3 +132,4 @@ void CDebugger::Debug_ShowMemorySearch() m_MemorySearch->ShowWindow(); } } +#endif diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 21fbc3094..024510c94 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -10,6 +10,7 @@ ****************************************************************************/ #include "stdafx.h" +#ifdef WINDOWS_UI #include #include "Settings/SettingType/SettingsType-Application.h" @@ -1253,3 +1254,4 @@ BOOL set_about_field( temp_string ); } +#endif diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index b98ce91cb..a82f66da5 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" +#ifdef WINDOWS_UI #include #include @@ -1240,3 +1241,4 @@ void CMainMenu::ResetMenu(void) WriteTrace(TraceDebug,__FUNCTION__ ": Done"); } +#endif diff --git a/Source/Project64/User Interface/Settings Config.cpp b/Source/Project64/User Interface/Settings Config.cpp index a1ae1d426..566d3c2c8 100644 --- a/Source/Project64/User Interface/Settings Config.cpp +++ b/Source/Project64/User Interface/Settings Config.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Config.h" #include "Settings/Settings Page.h" #include "Settings/SettingType/SettingsType-Application.h" @@ -339,4 +341,4 @@ void CSettingConfig::BoldChangedPages ( HTREEITEM hItem ) ::EnableWindow(GetDlgItem(IDC_RESET_ALL), true); } } - +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp b/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp index c91c6e1bc..9e0d7b17a 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" CAdvancedOptionsPage::CAdvancedOptionsPage (HWND hParent, const RECT & rcDispay ) @@ -70,3 +72,4 @@ void CAdvancedOptionsPage::ResetPage() { CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp b/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp index a793e3ad3..087ed820f 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" COptionsDirectoriesPage::COptionsDirectoriesPage (HWND hParent, const RECT & rcDispay ) : @@ -351,3 +353,4 @@ void COptionsDirectoriesPage::ResetPage() SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp index 169a38d87..e5df2baab 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" #include "Settings Page - Game - General.h" @@ -113,3 +115,4 @@ void CGameGeneralPage::ResetPage() { CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp index 5e61a4cb7..5baa50686 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" #include "Settings Page - Game - Plugin.h" @@ -345,3 +347,4 @@ void CGamePluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ ) break; } } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp index 91325cfa5..648d0edf1 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" #include "Settings Page - Game - Recompiler.h" @@ -94,3 +96,4 @@ void CGameRecompilePage::ResetPage() { CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp index 8dbc855f2..43360cff5 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" #include "Settings Page - Game - Status.h" @@ -70,3 +72,4 @@ void CGameStatusPage::ResetPage() { CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp index b0ed6195f..6a9171810 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" COptionsGameBrowserPage::COptionsGameBrowserPage (HWND hParent, const RECT & rcDispay ) : @@ -253,3 +255,4 @@ void COptionsGameBrowserPage::ResetPage() } CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp index 97514eace..df720dd89 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" COptionsShortCutsPage::COptionsShortCutsPage (HWND hParent, const RECT & rcDispay ) : @@ -378,3 +380,4 @@ void COptionsShortCutsPage::ResetPage() m_CurrentKeys.ResetContent(); CSettingsPageImpl::ResetPage(); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Options.cpp b/Source/Project64/User Interface/Settings/Settings Page - Options.cpp index 49441f3ea..5187435d8 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Options.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Options.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" CGeneralOptionsPage::CGeneralOptionsPage(CSettingConfig * SettingsConfig, HWND hParent, const RECT & rcDispay ) : @@ -75,3 +77,4 @@ void CGeneralOptionsPage::OnBasicMode ( UINT Code, int id, HWND ctl ) CheckBoxChanged(Code,id,ctl); m_SettingsConfig->UpdateAdvanced((int)::SendMessage(ctl, BM_GETCHECK, 0, 0) == 0); } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp index 9a1d603c2..8658164ba 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" COptionPluginPage::COptionPluginPage (HWND hParent, const RECT & rcDispay ) @@ -331,3 +333,4 @@ void COptionPluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ ) break; } } +#endif diff --git a/Source/Project64/User Interface/Settings/Settings Page.cpp b/Source/Project64/User Interface/Settings/Settings Page.cpp index 6c63fdd5f..f7b26d581 100644 --- a/Source/Project64/User Interface/Settings/Settings Page.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page.cpp @@ -9,6 +9,8 @@ * * ****************************************************************************/ #include "stdafx.h" + +#ifdef WINDOWS_UI #include "Settings Page.h" CConfigSettingSection::CConfigSettingSection( LPCWSTR PageTitle ) : @@ -39,3 +41,4 @@ CSettingsPage * CConfigSettingSection::GetPage ( int PageNo ) } return m_Pages[PageNo]; } +#endif diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp index 6c3d5854b..826655802 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp +++ b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp @@ -10,6 +10,7 @@ ****************************************************************************/ #include "stdafx.h" +#ifdef WINDOWS_UI CModifiedEditBox::CModifiedEditBox(bool bString /* = true */, HWND hWnd /* = NULL */) : CEdit(hWnd), m_Changed(false), @@ -103,3 +104,4 @@ void CModifiedEditBox::SetTextField (HWND hWnd) ::SendMessage(m_TextField,WM_SETFONT,(WPARAM)m_BoldFont,0); } } +#endif diff --git a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp index 1772d2ab5..b50b99619 100644 --- a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp +++ b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp @@ -10,6 +10,7 @@ ****************************************************************************/ #include "stdafx.h" +#ifdef WINDOWS_UI BOOL CPartialGroupBox::Attach(HWND hWnd) { ATLASSUME(m_hWnd == NULL); @@ -118,5 +119,5 @@ void CPartialGroupBox::OnPaint(HDC /*hDC*/) dc.DrawTextW(grptext,-1,fontrect,DT_SINGLELINE|DT_LEFT); } - } +#endif From dd73e6dff76356b2a8fb9fbb18dd8f78a19eebe3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Sep 2015 15:47:58 -0400 Subject: [PATCH 056/103] second pass--compiles on VS2008 Express (doesn't link) --- Source/Project64/User Interface.h | 8 ++++++++ Source/Project64/main.cpp | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Source/Project64/User Interface.h b/Source/Project64/User Interface.h index f430de71d..713f18a9d 100644 --- a/Source/Project64/User Interface.h +++ b/Source/Project64/User Interface.h @@ -44,8 +44,14 @@ struct WINDOWS_PAINTSTRUCT { class CN64System; +#define WINDOWS_UI +// Remove this to test compilation outside of the Windows ATL environment. + +#ifdef WINDOWS_UI #include +#endif #include + #include ".\\User Interface\\Rom Browser.h" #include ".\\User Interface\\Gui Class.h" #include ".\\User Interface\\Menu Class.h" @@ -54,4 +60,6 @@ class CN64System; #include ".\\User Interface\\Notification Class.h" #include ".\\User Interface\\Frame Per Second Class.h" #include ".\\User Interface\\resource.h" +#ifdef WINDOWS_UI #include ".\\User Interface\\Settings Config.h" +#endif diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 775184ab0..60cb62acc 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -178,7 +178,20 @@ const char * AppName ( void ) return Name.c_str(); } -int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/) +#ifndef WINDOWS_UI +int main(int argc, char* argv[]) +{ +#error Cross-platform [graphical?] interface has not yet been implemented. +// Remove this #error to compile, but linking will fail with about 10 errors. + + while (argc >= 0) + { + puts(argv[--argc]); + } + return 0; +} +#else +int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/) { FixDirectories(); @@ -280,3 +293,4 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / CloseTrace(); return true; } +#endif From d9082a0c51ad5156d62560d5d0b7d3a3eacf8cf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Sep 2015 16:36:08 -0400 Subject: [PATCH 057/103] [RSP] bad DMEM offsets when (offset < 0) --- Source/RSP/RSP Command.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index cc95a272b..e83178bfa 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -26,6 +26,8 @@ #include #include +#include + #include "opcode.h" #include "RSP.h" #include "CPU.h" @@ -1090,11 +1092,12 @@ char * RSPLc2Name ( DWORD OpCode, DWORD PC ) { sprintf( CommandName, - "%s\t$v%d[%d], 0x%04X(%s)", + "%s\t$v%d[%d], %c0x%03X(%s)", mnemonics_lwc2[command.rd], command.rt, command.del, - command.voffset, + (command.voffset < 0) ? '-' : '+', + abs(command.voffset), GPR_Name(command.base) ); } @@ -1123,11 +1126,12 @@ char * RSPSc2Name ( DWORD OpCode, DWORD PC ) { sprintf( CommandName, - "%s\t$v%d[%d], 0x%04X(%s)", + "%s\t$v%d[%d], %c0x%03X(%s)", mnemonics_swc2[command.rd], command.rt, command.del, - command.voffset, + (command.voffset < 0) ? '-' : '+', + abs(command.voffset), GPR_Name(command.base) ); } From e9c1c231207720fcea9b45d01f33d17994fb5402 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 13:39:41 -0700 Subject: [PATCH 058/103] Implement RegConst in Compile_LB --- Source/RSP/Recompiler Ops.c | 11 +++++++++++ Source/RSP/X86.c | 19 +++++++++++++++++++ Source/RSP/X86.h | 1 + 3 files changed, 31 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 5b17818da..a1803fed0 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -620,6 +620,17 @@ void Compile_LB ( void ) { CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); + if (IsRegConst(RSPOpC.base) == TRUE) { + char Address[32]; + DWORD Addr = (MipsRegConst(RSPOpC.base) + Offset) ^ 3; + Addr &= 0xfff; + + sprintf(Address, "Dmem + %Xh", Addr); + MoveSxVariableToX86regByte(RSPInfo.DMEM + Addr, Address, x86_EAX); + MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + return; + } + MoveVariableToX86reg(&RSP_GPR[RSPOpC.base].UW, GPR_Name(RSPOpC.base), x86_EBX); if (Offset != 0) AddConstToX86Reg(x86_EBX, Offset); XorConstToX86Reg(x86_EBX, 3); diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index b27d714d3..6344d4a01 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -1824,6 +1824,25 @@ void MoveSxX86RegPtrDispToX86RegHalf(int AddrReg, BYTE Disp, int Destination) { PUTDST8(RecompPos, Disp); } +void MoveSxVariableToX86regByte(void *Variable, char *VariableName, int x86reg) { + CPU_Message(" movsx %s, byte ptr [%s]",x86_Name(x86reg),VariableName); + + PUTDST16(RecompPos, 0xbe0f); + + switch (x86reg) { + case x86_EAX: PUTDST8(RecompPos,0x05); break; + case x86_EBX: PUTDST8(RecompPos,0x1D); break; + case x86_ECX: PUTDST8(RecompPos,0x0D); break; + case x86_EDX: PUTDST8(RecompPos,0x15); break; + case x86_ESI: PUTDST8(RecompPos,0x35); break; + case x86_EDI: PUTDST8(RecompPos,0x3D); break; + case x86_ESP: PUTDST8(RecompPos,0x25); break; + case x86_EBP: PUTDST8(RecompPos,0x2D); break; + default: DisplayError("MoveSxVariableToX86regByte\nUnknown x86 Register"); + } + PUTDST32(RecompPos,Variable); +} + void MoveSxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { CPU_Message(" movsx %s, word ptr [%s]",x86_Name(x86reg),VariableName); diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index 9ce5950ae..8378073f2 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -141,6 +141,7 @@ void MoveSxX86RegHalfToX86Reg ( int Source, int Destination ); void MoveSxX86RegPtrDispToX86RegHalf( int AddrReg, BYTE Disp, int Destination ); void MoveSxN64MemToX86regByte ( int x86reg, int AddrReg ); void MoveSxN64MemToX86regHalf ( int x86reg, int AddrReg ); +void MoveSxVariableToX86regByte ( void *Variable, char *VariableName, int x86reg ); void MoveSxVariableToX86regHalf ( void *Variable, char *VariableName, int x86reg ); void MoveZxX86RegHalfToX86Reg ( int Source, int Destination ); void MoveZxX86RegPtrDispToX86RegHalf( int AddrReg, BYTE Disp, int Destination ); From 48baf1df7cda41c775c8ce9462322ce156647918 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 13:48:51 -0700 Subject: [PATCH 059/103] Optimize LH in RSP Recompiler Star Wars Battle For Naboo LLE graphics uses unaligned LH --- Source/RSP/Recompiler Ops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index a1803fed0..9701136af 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -655,8 +655,15 @@ void Compile_LH ( void ) { Addr &= 0xfff; if ((Addr & 1) != 0) { - CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC); - Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH"); + if ((Addr & 2) == 0) { + CompilerWarning("Unaligned LH at constant address PC = %04X", CompilePC); + Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LH,"RSP_Opcode_LH"); + } else { + char Address[32]; + sprintf(Address, "Dmem + %Xh", Addr); + MoveSxVariableToX86regHalf(RSPInfo.DMEM + (Addr ^ 2), Address, x86_EAX); + MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + } } else { char Address[32]; sprintf(Address, "Dmem + %Xh", Addr); From 237b21a5967fb31990d2400e90092b437e09b4b8 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 14:36:42 -0700 Subject: [PATCH 060/103] Optimize LW in RSP Recompiler --- Source/RSP/Recompiler Ops.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 9701136af..157fc6e2d 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -715,9 +715,18 @@ void Compile_LW ( void ) { if (IsRegConst(RSPOpC.base) == TRUE) { DWORD Addr = (MipsRegConst(RSPOpC.base) + Offset) & 0xfff; - if ((Addr & 3) != 0) { + if ((Addr & 1) != 0) { CompilerWarning("Unaligned LW at constant address PC = %04X", CompilePC); Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LW,"RSP_Opcode_LW"); + } else if ((Addr & 2) != 0) { + char Address[32]; + sprintf(Address, "Dmem + %Xh", Addr - 2); + MoveVariableToX86regHalf(RSPInfo.DMEM + Addr - 2, Address, x86_EAX); + sprintf(Address, "Dmem + %Xh", Addr); + MoveVariableToX86regHalf(RSPInfo.DMEM + Addr + 4, Address, x86_ECX); + + MoveX86regHalfToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UHW[1], GPR_Name(RSPOpC.rt)); + MoveX86regHalfToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UHW[0], GPR_Name(RSPOpC.rt)); } else { char Address[32]; sprintf(Address, "Dmem + %Xh", Addr); From e0bd5442e4a0c0ed07dd88096015ac4234031b2e Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 15:05:26 -0700 Subject: [PATCH 061/103] Implement RegConst in Compile_LBU --- Source/RSP/Recompiler Ops.c | 11 +++++++++++ Source/RSP/X86.c | 19 +++++++++++++++++++ Source/RSP/X86.h | 1 + 3 files changed, 31 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 157fc6e2d..7e3eec757 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -787,6 +787,17 @@ void Compile_LBU ( void ) { CPU_Message(" %X %s",CompilePC,RSPOpcodeName(RSPOpC.Hex,CompilePC)); + if (IsRegConst(RSPOpC.base) == TRUE) { + char Address[32]; + DWORD Addr = (MipsRegConst(RSPOpC.base) + Offset) ^ 3; + Addr &= 0xfff; + + sprintf(Address, "Dmem + %Xh", Addr); + MoveZxVariableToX86regByte(RSPInfo.DMEM + Addr, Address, x86_EAX); + MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + return; + } + MoveVariableToX86reg(&RSP_GPR[RSPOpC.base].UW, GPR_Name(RSPOpC.base), x86_EBX); XorX86RegToX86Reg(x86_EAX, x86_EAX); diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index 6344d4a01..4716e359a 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -1982,6 +1982,25 @@ void MoveZxX86RegPtrDispToX86RegHalf(int AddrReg, BYTE Disp, int Destination) { PUTDST8(RecompPos, Disp); } +void MoveZxVariableToX86regByte(void *Variable, char *VariableName, int x86reg) { + CPU_Message(" movzx %s, byte ptr [%s]",x86_Name(x86reg),VariableName); + + PUTDST16(RecompPos, 0xb60f); + + switch (x86reg) { + case x86_EAX: PUTDST8(RecompPos,0x05); break; + case x86_EBX: PUTDST8(RecompPos,0x1D); break; + case x86_ECX: PUTDST8(RecompPos,0x0D); break; + case x86_EDX: PUTDST8(RecompPos,0x15); break; + case x86_ESI: PUTDST8(RecompPos,0x35); break; + case x86_EDI: PUTDST8(RecompPos,0x3D); break; + case x86_ESP: PUTDST8(RecompPos,0x25); break; + case x86_EBP: PUTDST8(RecompPos,0x2D); break; + default: DisplayError("MoveZxVariableToX86regByte\nUnknown x86 Register"); + } + PUTDST32(RecompPos,Variable); +} + void MoveZxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { CPU_Message(" movzx %s, word ptr [%s]",x86_Name(x86reg),VariableName); diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index 8378073f2..4a260507e 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -147,6 +147,7 @@ void MoveZxX86RegHalfToX86Reg ( int Source, int Destination ); void MoveZxX86RegPtrDispToX86RegHalf( int AddrReg, BYTE Disp, int Destination ); void MoveZxN64MemToX86regByte ( int x86reg, int AddrReg ); void MoveZxN64MemToX86regHalf ( int x86reg, int AddrReg ); +void MoveZxVariableToX86regByte ( void *Variable, char *VariableName, int x86reg ); void MoveZxVariableToX86regHalf ( void *Variable, char *VariableName, int x86reg ); void MulX86reg ( int x86reg ); void NegateX86reg ( int x86reg ); From 67d2fc95a3f8169928e55d2d6441d0142c5bf01a Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Mon, 7 Sep 2015 15:10:19 -0700 Subject: [PATCH 062/103] Optimize LHU in RSP Recompiler --- Source/RSP/Recompiler Ops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 7e3eec757..e8b4107b1 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -824,8 +824,15 @@ void Compile_LHU ( void ) { Addr &= 0xfff; if ((Addr & 1) != 0) { - CompilerWarning("Unaligned LHU at constant address PC = %04X", CompilePC); - Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LHU,"RSP_Opcode_LHU"); + if ((Addr & 2) == 0) { + CompilerWarning("Unaligned LHU at constant address PC = %04X", CompilePC); + Cheat_r4300iOpcodeNoMessage(RSP_Opcode_LHU, "RSP_Opcode_LHU"); + } else { + char Address[32]; + sprintf(Address, "Dmem + %Xh", Addr); + MoveZxVariableToX86regHalf(RSPInfo.DMEM + (Addr ^ 2), Address, x86_ECX); + MoveX86regToVariable(x86_ECX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + } return; } else { char Address[32]; From 7841409ef241c1f5fb8a03f483a0b28dcb16d30f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Sep 2015 10:33:30 -0400 Subject: [PATCH 063/103] removed redundant include --- Source/Project64/User Interface.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Project64/User Interface.h b/Source/Project64/User Interface.h index f430de71d..862731f8c 100644 --- a/Source/Project64/User Interface.h +++ b/Source/Project64/User Interface.h @@ -49,7 +49,6 @@ class CN64System; #include ".\\User Interface\\Rom Browser.h" #include ".\\User Interface\\Gui Class.h" #include ".\\User Interface\\Menu Class.h" -#include ".\\User Interface\\Menu Class.h" #include ".\\User Interface\\Main Menu Class.h" #include ".\\User Interface\\Notification Class.h" #include ".\\User Interface\\Frame Per Second Class.h" From 62e9622ef9cce8008be8b2ff1f87338996ec9225 Mon Sep 17 00:00:00 2001 From: AmbientMalice Date: Thu, 10 Sep 2015 13:48:32 +1000 Subject: [PATCH 064/103] Add Duke 64 Prototype to RDB. There's an article about the prototype here. It's supposedly PAL, but the rom seems to have an NTSC header - so I'm confused. --- Config/Project64.rdb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Config/Project64.rdb b/Config/Project64.rdb index 669f1b125..da651b96a 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -1708,6 +1708,12 @@ Internal Name=DUKE NUKEM Status=Compatible Plugin Note=[video] depth problem; use Glide64 +[FF14C1DA-167FDE92-C:45] +Good Name=Duke Nukem 64 (Prototype) +Internal Name=duke +Status=Compatible +Plugin Note=[video] depth problem; use Glide64 + [1E12883D-D3B92718-C:46] Good Name=Duke Nukem 64 (F) Internal Name=DUKE NUKEM From c80ce699417ccf2d4db742ad12f7c0d880fb7412 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Sep 2015 18:18:59 -0400 Subject: [PATCH 065/103] [RSP] Scalar memory load/stores show signed hex offset. --- Source/RSP/RSP Command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index e83178bfa..7297dc795 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -1228,10 +1228,11 @@ char * RSPOpcodeName ( DWORD OpCode, DWORD PC ) case RSP_SB: case RSP_SH: case RSP_SW: - sprintf(CommandName, "%s\t%s, 0x%04X(%s)", + sprintf(CommandName, "%s\t%s, %c0x%04X(%s)", mnemonics_primary[command.op], GPR_Name(command.rt), - command.offset, + ((int16_t)command.offset < 0) ? '-' : '+', + abs((int16_t)command.offset), GPR_Name(command.base) ); break; From b4d58cfb177226651f7e67fc95e03fb7dbc935b8 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 13 Sep 2015 17:28:02 +1000 Subject: [PATCH 066/103] Set VERSION_BUILD to 9999 --- Source/Glide64/Version.h | 2 +- Source/Project64/Version.h | 2 +- Source/RSP/Version.h | 2 +- Source/nragev20/Version.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Glide64/Version.h b/Source/Glide64/Version.h index 5cba9de90..10280e683 100644 --- a/Source/Glide64/Version.h +++ b/Source/Glide64/Version.h @@ -23,7 +23,7 @@ #define VERSION_MAJOR 2 #define VERSION_MINOR 0 #define VERSION_REVISION 0 -#define VERSION_BUILD 5 +#define VERSION_BUILD 9999 #define VER_FILE_DESCRIPTION_STR "Glide 64 for Project64" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD diff --git a/Source/Project64/Version.h b/Source/Project64/Version.h index ff88e0b3a..becdd7831 100644 --- a/Source/Project64/Version.h +++ b/Source/Project64/Version.h @@ -14,7 +14,7 @@ #define VERSION_MAJOR 2 #define VERSION_MINOR 2 #define VERSION_REVISION 0 -#define VERSION_BUILD 3 +#define VERSION_BUILD 9999 #define VER_FILE_DESCRIPTION_STR "Project 64" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD diff --git a/Source/RSP/Version.h b/Source/RSP/Version.h index e5c65881d..909f9602b 100644 --- a/Source/RSP/Version.h +++ b/Source/RSP/Version.h @@ -30,7 +30,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 7 #define VERSION_REVISION 0 -#define VERSION_BUILD 13 +#define VERSION_BUILD 9999 #define VER_FILE_DESCRIPTION_STR "RSP emulation Plugin" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD diff --git a/Source/nragev20/Version.h b/Source/nragev20/Version.h index 082b821b8..17e3a9216 100644 --- a/Source/nragev20/Version.h +++ b/Source/nragev20/Version.h @@ -26,7 +26,7 @@ #define VERSION_MAJOR 2 #define VERSION_MINOR 4 #define VERSION_REVISION 0 -#define VERSION_BUILD 4 +#define VERSION_BUILD 9999 #define VER_FILE_DESCRIPTION_STR "N-Rage for Project64" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD From 897b27fc1d261a6b5598b392f14c49e1ba87355d Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 13 Sep 2015 17:30:59 +1000 Subject: [PATCH 067/103] Add some build scripts --- Source/Script/UpdateVersion.cmd | 56 +++++++++++++++++++++++++++++++++ Source/Script/build.cmd | 41 ++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 Source/Script/UpdateVersion.cmd create mode 100644 Source/Script/build.cmd diff --git a/Source/Script/UpdateVersion.cmd b/Source/Script/UpdateVersion.cmd new file mode 100644 index 000000000..0c499a439 --- /dev/null +++ b/Source/Script/UpdateVersion.cmd @@ -0,0 +1,56 @@ +@echo off +SETLOCAL + +set origdir=%cd% +cd /d %~dp0..\.. +set base_dir=%cd% +cd /d %origdir% + + +if exist "C:\Program Files\Git\usr\bin\sed.exe" ( set SED="C:\Program Files\Git\usr\bin\sed.exe") +if exist "C:\Program Files (x86)\Git\bin\sed.exe" ( set SED="C:\Program Files (x86)\Git\bin\sed.exe") + +if %SED% == "" ( + echo can not find sed.exe + goto :end +) + +SETLOCAL EnableDelayedExpansion +FOR /F "tokens=1 delims=" %%A in ('git describe --tags --long') do SET current_tag=%%A +FOR /F "tokens=1 delims=" %%A in ('echo !current_tag! ^| !sed! "s/v[0-9]*\.[0-9]*-\([0-9]*\).*/\1/"') do SET commits_since_tag=%%A + +call :setVersion %base_dir%\Source\Project64\version.h !commits_since_tag! +call :setVersion %base_dir%\Source\nragev20\version.h !commits_since_tag! +call :setVersion %base_dir%\Source\RSP\version.h !commits_since_tag! +call :setVersion %base_dir%\Source\Glide64\version.h !commits_since_tag! + +ENDLOCAL + +goto :eof + +:setVersion +set version_file=%~1 +set out_file=%~1.out +set build_no=%~2 + +if exist "%out_file%" del "%out_file%" + +SETLOCAL DisableDelayedExpansion +FOR /F "usebackq delims=" %%a in (`"findstr /n ^^ %version_file%"`) do ( + set "line=%%a" + SETLOCAL EnableDelayedExpansion + set "line=!line:9999=%build_no%!" + set "line=!line:*:=!" + echo(!line!>>!out_file! + ENDLOCAL +) +ENDLOCAL + +if exist "%out_file%" ( + if exist "%version_file%" ( + del "%version_file%" + move "%out_file%" "%version_file%" + ) +) + +goto :eof \ No newline at end of file diff --git a/Source/Script/build.cmd b/Source/Script/build.cmd new file mode 100644 index 000000000..e4dbe30d3 --- /dev/null +++ b/Source/Script/build.cmd @@ -0,0 +1,41 @@ +@ECHO OFF +SETLOCAL + +set BuildMode=Release +if not "%1" == "" set BuildMode=%1 +if "%1" == "debug" set BuildMode=Debug +if "%1" == "release" set BuildMode=Release + +set MSVC-BUILDER= +set origdir=%cd% +cd /d %~dp0..\..\ +set base_dir=%cd% +cd /d %origdir% + +if exist "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe") +if exist "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" ( set MSVC-BUILDER="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe") + +if %MSVC-BUILDER% == "" ( + echo can not find visual studio 2008 + goto :end +) + +:: Build Win32 version of the software +IF EXIST "%base_dir%\output.txt" del "%base_dir%\output.txt" +%MSVC-BUILDER% "%base_dir%\Project64.vs2008.sln" /build "%BuildMode%|Win32" /out "%base_dir%\output.txt" +set Result=%ERRORLEVEL% +type "%base_dir%\output.txt" +echo Done - ERRORLEVEL: %Result% +IF %Result% NEQ 0 goto :EndErr + +echo Build ok +goto :end + +:EndErr +ENDLOCAL +echo Build failed +exit /B 1 + +:End +ENDLOCAL +exit /B 0 \ No newline at end of file From 0bee1ef3c4c89cfd088cd62de040079445a6093c Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 13 Sep 2015 19:52:45 +1000 Subject: [PATCH 068/103] Move package_zip.bat --- Source/{Installer => Script}/package_zip.bat | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Source/{Installer => Script}/package_zip.bat (100%) diff --git a/Source/Installer/package_zip.bat b/Source/Script/package_zip.bat similarity index 100% rename from Source/Installer/package_zip.bat rename to Source/Script/package_zip.bat From a3513059e1a721debc342680e79a6b03e1d54628 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 13 Sep 2015 19:54:43 +1000 Subject: [PATCH 069/103] Renme package_zip.bet to package_zip.cmd --- Source/Script/{package_zip.bat => package_zip.cmd} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Source/Script/{package_zip.bat => package_zip.cmd} (100%) diff --git a/Source/Script/package_zip.bat b/Source/Script/package_zip.cmd similarity index 100% rename from Source/Script/package_zip.bat rename to Source/Script/package_zip.cmd From c8dbcb2c30e9026f3fd01e04d8ceb053c40211b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Sep 2015 16:30:53 -0400 Subject: [PATCH 070/103] little whitespace trolololz to new build scripts --- Source/Script/UpdateVersion.cmd | 4 ++-- Source/Script/build.cmd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Script/UpdateVersion.cmd b/Source/Script/UpdateVersion.cmd index 0c499a439..0824a4db0 100644 --- a/Source/Script/UpdateVersion.cmd +++ b/Source/Script/UpdateVersion.cmd @@ -39,7 +39,7 @@ SETLOCAL DisableDelayedExpansion FOR /F "usebackq delims=" %%a in (`"findstr /n ^^ %version_file%"`) do ( set "line=%%a" SETLOCAL EnableDelayedExpansion - set "line=!line:9999=%build_no%!" + set "line=!line:9999=%build_no%!" set "line=!line:*:=!" echo(!line!>>!out_file! ENDLOCAL @@ -53,4 +53,4 @@ if exist "%out_file%" ( ) ) -goto :eof \ No newline at end of file +goto :eof diff --git a/Source/Script/build.cmd b/Source/Script/build.cmd index e4dbe30d3..f287eab38 100644 --- a/Source/Script/build.cmd +++ b/Source/Script/build.cmd @@ -38,4 +38,4 @@ exit /B 1 :End ENDLOCAL -exit /B 0 \ No newline at end of file +exit /B 0 From 4efcf0e5e407b6c76c271848354d109b4b2df332 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 14 Sep 2015 08:20:08 +1000 Subject: [PATCH 071/103] Add zip of package --- Source/Script/package_zip.cmd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Script/package_zip.cmd b/Source/Script/package_zip.cmd index c1a2e3dd6..d43ece42f 100644 --- a/Source/Script/package_zip.cmd +++ b/Source/Script/package_zip.cmd @@ -1,5 +1,13 @@ @echo off +if exist "C:\Program Files\7-Zip\7z.exe" ( set zip="C:\Program Files\7-Zip\7z.exe") + + +if %zip% == "" ( + echo can not find 7z.exe + goto :end +) + SET current_dir=%cd% cd /d %~dp0..\..\ SET base_dir=%cd% @@ -26,3 +34,7 @@ copy "%base_dir%\Plugin\GFX\Jabo_Direct3D8.dll" "%base_dir%\Bin\Package\Plugin\G copy "%base_dir%\Plugin\GFX\PJ64Glide64.dll" "%base_dir%\Bin\Package\Plugin\GFX" copy "%base_dir%\Plugin\Input\PJ64_NRage.dll" "%base_dir%\Bin\Package\Plugin\Input" copy "%base_dir%\Plugin\RSP\RSP 1.7.dll" "%base_dir%\Bin\Package\Plugin\RSP" + +cd %base_dir%\Bin\Package +%zip% a -tzip -r ../project64 * +cd /d %current_dir% From e6f5e495f27bab9038ff042046e43d0682d3051b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Sep 2015 15:55:11 -0400 Subject: [PATCH 072/103] macro'd out all sources of VS Express linker errors --- .../Project64/N64 System/C Core/Logging.cpp | 6 ++- Source/Project64/N64 System/Cheat Class.cpp | 4 ++ Source/Project64/N64 System/N64 Class.cpp | 12 ++++++ Source/Project64/N64 System/N64 Class.h | 4 ++ Source/Project64/Plugins/Plugin Class.cpp | 5 +++ .../User Interface/Notification Class.cpp | 37 ++++++++++++++++++- 6 files changed, 65 insertions(+), 3 deletions(-) diff --git a/Source/Project64/N64 System/C Core/Logging.cpp b/Source/Project64/N64 System/C Core/Logging.cpp index d0f6f73c1..fbba81047 100644 --- a/Source/Project64/N64 System/C Core/Logging.cpp +++ b/Source/Project64/N64 System/C Core/Logging.cpp @@ -65,7 +65,11 @@ void EnterLogOptions(HWND hwndOwner) psh.pfnCallback = NULL; LoadLogOptions(&TempOptions,TRUE); - PropertySheet(&psh); +#if defined(WINDOWS_UI) + PropertySheet(&psh); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif SaveLogOptions(); LoadLogOptions(&LogOptions, FALSE); return; diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index 4151c04e6..0ec58f1e0 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -988,6 +988,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP Style = GetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE); SetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE,TVS_CHECKBOXES |TVS_SHOWSELALWAYS| Style); +#if defined(WINDOWS_UI) //Creats an image list from the bitmap in the resource section HIMAGELIST hImageList; HBITMAP hBmp; @@ -998,6 +999,9 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP DeleteObject(hBmp); TreeView_SetImageList((HWND)_this->m_hCheatTree,hImageList,TVSIL_STATE); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif _this->m_hSelectedItem = NULL; diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 20cc5d64d..5caf4aff2 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -308,11 +308,15 @@ void CN64System::StartEmulation2 ( bool NewThread ) { g_Notify->DisplayMessage(5,L"Copy Plugins"); g_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync)); +#if defined(WINDOWS_UI) m_SyncWindow = new CMainGui(false); m_SyncPlugins = new CPlugins( g_Settings->LoadString(Directory_PluginSync) ); m_SyncPlugins->SetRenderWindows(m_SyncWindow,m_SyncWindow); m_SyncCPU = new CN64System(m_SyncPlugins, true); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } if (CpuType == CPU_Recompiler || CpuType == CPU_SyncCores) @@ -563,7 +567,11 @@ void CN64System::Reset (bool bInitReg, bool ClearMenory) RefreshGameSettings(); m_Audio.Reset(); m_MMU_VM.Reset(ClearMenory); +#if defined(WINDOWS_UI) Debug_Reset(); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif Mempak::Close(); m_CyclesToSkip = 0; @@ -2066,5 +2074,9 @@ void CN64System::TLB_Unmaped ( DWORD VAddr, DWORD Len ) void CN64System::TLB_Changed() { +#if defined(WINDOWS_UI) Debug_RefreshTLBWindow(); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 5a2c5540b..4693098cf 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -25,8 +25,12 @@ class CN64System : private CSystemEvents, protected CN64SystemSettings, public CGameSettings, +#if defined(WINDOWS_UI) protected CDebugSettings, public CDebugger +#else + protected CDebugSettings +#endif { public: CN64System ( CPlugins * Plugins, bool SavesReadOnly ); diff --git a/Source/Project64/Plugins/Plugin Class.cpp b/Source/Project64/Plugins/Plugin Class.cpp index fec424706..cbfa7886a 100644 --- a/Source/Project64/Plugins/Plugin Class.cpp +++ b/Source/Project64/Plugins/Plugin Class.cpp @@ -261,7 +261,12 @@ bool CPlugins::Initiate ( CN64System * System ) bool CPlugins::ResetInUiThread ( CN64System * System ) { +#if defined(WINDOWS_UI) return m_RenderWindow->ResetPlugins(this, System); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); + return false; +#endif } bool CPlugins::Reset ( CN64System * System ) diff --git a/Source/Project64/User Interface/Notification Class.cpp b/Source/Project64/User Interface/Notification Class.cpp index 1bc9df7f8..f07c89216 100644 --- a/Source/Project64/User Interface/Notification Class.cpp +++ b/Source/Project64/User Interface/Notification Class.cpp @@ -118,7 +118,11 @@ void CNotification::DisplayMessage ( int DisplayTime, const wchar_t * Message, } else { +#if defined(WINDOWS_UI) m_hWnd->SetStatusText(0, Msg); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } } @@ -136,8 +140,12 @@ void CNotification::DisplayMessage2 ( const wchar_t * Message, va_list ap ) con wchar_t Msg[1000]; _vsnwprintf( Msg,sizeof(Msg) - 1 ,Message, ap ); va_end( ap ); - + +#if defined(WINDOWS_UI) m_hWnd->SetStatusText(1,Msg); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } void CNotification::SetGfxPlugin( CGfxPlugin * Plugin ) @@ -148,11 +156,15 @@ void CNotification::SetGfxPlugin( CGfxPlugin * Plugin ) void CNotification::SetWindowCaption (const wchar_t * Caption) { static const size_t TITLE_SIZE = 256; - wchar_t WinTitle[TITLE_SIZE]; + _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).ToUTF16().c_str()); WinTitle[TITLE_SIZE - 1] = 0; +#if defined(WINDOWS_UI) m_hWnd->Caption(WinTitle); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } void CNotification::FatalError ( const wchar_t * Message, ... ) const @@ -257,7 +269,12 @@ void CNotification::AddRecentRom ( const char * ImagePath ) void CNotification::RefreshMenu ( void ) { if (m_hWnd == NULL) { return; } + +#if defined(WINDOWS_UI) m_hWnd->RefreshMenu(); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } void CNotification::HideRomBrowser ( void ) @@ -280,13 +297,23 @@ void CNotification::ShowRomBrowser ( void ) void CNotification::BringToTop ( void ) { if (m_hWnd == NULL) { return; } + +#if defined(WINDOWS_UI) m_hWnd->BringToTop(); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } void CNotification::MakeWindowOnTop ( bool OnTop ) { if (m_hWnd == NULL) { return; } + +#if defined(WINDOWS_UI) m_hWnd->MakeWindowOnTop(OnTop); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif } void CNotification::ChangeFullScreen ( void ) const @@ -298,7 +325,13 @@ void CNotification::ChangeFullScreen ( void ) const bool CNotification::ProcessGuiMessages ( void ) const { if (m_hWnd == NULL) { return false; } + +#if defined(WINDOWS_UI) return m_hWnd->ProcessGuiMessages(); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); + return false; +#endif } void CNotification::BreakPoint ( const wchar_t * FileName, const int LineNumber ) From 1a67309f661a516a62704347b0dd9260e08308a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Sep 2015 16:03:23 -0400 Subject: [PATCH 073/103] got the command-line build of PJ64 to link and run --- Source/Project64/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 60cb62acc..d93626246 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -181,13 +181,16 @@ const char * AppName ( void ) #ifndef WINDOWS_UI int main(int argc, char* argv[]) { -#error Cross-platform [graphical?] interface has not yet been implemented. -// Remove this #error to compile, but linking will fail with about 10 errors. - while (argc >= 0) { puts(argv[--argc]); } + putchar('\n'); + + fprintf( + stderr, + "Cross-platform (graphical/terminal?) UI not yet implemented.\n" + ); return 0; } #else From c38f41e34bbaf01a42d6054a23549e23f1cc940f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Sep 2015 16:04:25 -0400 Subject: [PATCH 074/103] fixed a crash because I wrote >= when I meant > --- Source/Project64/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index d93626246..70a921c93 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -181,7 +181,7 @@ const char * AppName ( void ) #ifndef WINDOWS_UI int main(int argc, char* argv[]) { - while (argc >= 0) + while (argc > 0) { puts(argv[--argc]); } From a0409357b8580f549e3477c90af82b9ca55f6e1f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Sep 2015 22:55:23 -0400 Subject: [PATCH 075/103] COP1 FP 32-bit round to integer doable with intrinsics? --- .../N64 System/Interpreter/Interpreter Ops.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 1a5e31e8a..064cc3c4d 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -2364,7 +2364,10 @@ __inline void Float_RoundToInteger32( int * Dest, float * Source ) fistp dword ptr [edi] } #else - g_Notify->BreakPoint(__FILEW__,__LINE__); + __m128 xmm; + + xmm = _mm_load_ss(Source); + *(Dest) = _mm_cvt_ss2si(xmm); #endif } @@ -2379,7 +2382,10 @@ __inline void Float_RoundToInteger64( __int64 * Dest, float * Source ) fistp qword ptr [edi] } #else - g_Notify->BreakPoint(__FILEW__,__LINE__); + __m128 xmm; + + xmm = _mm_load_ss(Source); + *(Dest) = _mm_cvtss_si64(xmm); #endif } From 659f1033732c5947e604fad7423d1984e5e3c2e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Sep 2015 12:42:36 -0400 Subject: [PATCH 076/103] Try SSE intrinsics to match COP1 FP64 round to 32-bit. --- Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 064cc3c4d..b52d0be0e 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -2592,7 +2592,10 @@ __inline void Double_RoundToInteger32( DWORD * Dest, double * Source ) fistp dword ptr [edi] } #else - g_Notify->BreakPoint(__FILEW__,__LINE__); + __m128d xmm; + + xmm = _mm_load_sd(Source); + *(Dest) = _mm_cvtsd_si32(xmm); #endif } From b6eb1c3234cb5b24918bc69a4086a44d471e9e70 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Sep 2015 15:03:05 -0400 Subject: [PATCH 077/103] Try to use intrinsics for COP1 single-precision square root? --- .../N64 System/Interpreter/Interpreter Ops.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 064cc3c4d..f101efabf 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -2419,12 +2419,12 @@ void R4300iOp::COP1_S_DIV() void R4300iOp::COP1_S_SQRT() { + float * Dest = (float *)(_FPR_S[m_Opcode.fd]); + float * Source = (float *)(_FPR_S[m_Opcode.fs]); + TEST_COP1_USABLE_EXCEPTION _controlfp(*_RoundingModel,_MCW_RC); - #ifdef _M_IX86 - float * Dest = (float *)_FPR_S[m_Opcode.fd]; - float * Source = (float *)_FPR_S[m_Opcode.fs]; _asm { push esi @@ -2436,7 +2436,11 @@ void R4300iOp::COP1_S_SQRT() pop esi } #else - g_Notify->BreakPoint(__FILEW__,__LINE__); + __m128 xmm; + + xmm = _mm_load_ss(Source); + xmm = _mm_sqrt_ss(xmm); + *(Dest) = _mm_cvtss_f32(xmm); #endif } From bd21c8ab546ca49321122afab257c8d9e2f47f03 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Sep 2015 17:47:01 -0400 Subject: [PATCH 078/103] Temporarily force interpreter mode when running 64-bit PJ64. --- Source/Project64/N64 System/N64 Class.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 5caf4aff2..f2bdd8c0b 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -911,8 +911,11 @@ void CN64System::ExecuteCPU() switch ((CPU_TYPE)g_Settings->LoadDword(Game_CpuType)) { +// Currently the compiler is 32-bit only. We might have to ignore that RDB setting for now. +#ifndef _WIN64 case CPU_Recompiler: ExecuteRecompiler(); break; case CPU_SyncCores: ExecuteSyncCPU(); break; +#endif default: ExecuteInterpret(); break; } g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false); From 88a82537c770e640a891faea5552ab0982cdffcb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Sep 2015 18:55:27 -0400 Subject: [PATCH 079/103] replaced Flash RAM breakpoints in x64 --- Source/Project64/N64 System/Mips/FlashRam.cpp | 49 ++++++------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/Source/Project64/N64 System/Mips/FlashRam.cpp b/Source/Project64/N64 System/Mips/FlashRam.cpp index da270396b..be14d04d5 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.cpp +++ b/Source/Project64/N64 System/Mips/FlashRam.cpp @@ -70,25 +70,14 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len) FlipBuffer[count] = 0xFF; } -#ifdef _M_IX86 - _asm + for (count = 0; (int)count < len; count += 4) { - mov edi, dest - lea ecx, [FlipBuffer] - mov edx, 0 - mov ebx, len + register DWORD eax; - memcpyloop: - mov eax, dword ptr [ecx + edx] - ;bswap eax - mov dword ptr [edi + edx],eax - add edx, 4 - cmp edx, ebx - jb memcpyloop + eax = *(unsigned __int32 *)&FlipBuffer[count]; + // eax = swap32by8(eax); // ; bswap eax + *(unsigned __int32 *)(dest + count) = eax; } -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif break; case FLASHRAM_MODE_STATUS: if (StartOffset != 0 && len != 8) @@ -198,28 +187,18 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) } { BYTE FlipBuffer[128]; - memset(FlipBuffer,0,sizeof(FlipBuffer)); - -#ifdef _M_IX86 - DWORD dwWritten; + register size_t edx; BYTE * FlashRamPointer = m_FlashRamPointer; - _asm - { - lea edi, [FlipBuffer] - mov ecx, FlashRamPointer - mov edx, 0 - memcpyloop: - mov eax, dword ptr [ecx + edx] - ;bswap eax - mov dword ptr [edi + edx],eax - add edx, 4 - cmp edx, 128 - jb memcpyloop + memset(FlipBuffer,0,sizeof(FlipBuffer)); + for (edx = 0; edx < 128; edx += 4) + { + register DWORD eax; + + eax = *(unsigned __int32 *)&FlashRamPointer[edx]; + // eax = swap32by8(eax); // ; bswap eax + *(unsigned __int32 *)(FlipBuffer + edx) = eax; } -#else - g_Notify->BreakPoint(__FILEW__,__LINE__); -#endif SetFilePointer(m_hFile,m_FlashRAM_Offset,NULL,FILE_BEGIN); WriteFile(m_hFile,FlipBuffer,128,&dwWritten,NULL); From f35036e3db756a2522523cc43a8ed1c8cedefd71 Mon Sep 17 00:00:00 2001 From: tony971 Date: Wed, 16 Sep 2015 00:43:30 -0400 Subject: [PATCH 080/103] Add fix for multiplayer timings in Mario Kart 64 (cheat) --- Config/Project64.cht | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Config/Project64.cht b/Config/Project64.cht index da5e4036e..11c03485d 100644 --- a/Config/Project64.cht +++ b/Config/Project64.cht @@ -741,6 +741,7 @@ Cheat6="Have Bonus Mode and All Gold Cups",E86E1A80 59??,E86E1A7F 59??,E86E1A7E Cheat6_O=$5A Off,$4F On Cheat7="Press F9\For Full Debug Menu",8818C80F 0002 Cheat7_N=Press F9 at the Press Start Menu to access the Debug Menu +Cheat8="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -750,6 +751,7 @@ Cheat0="Have Bonus Mode and All Gold Cups",E86E0B30 59??,E86E0B2F 59??,E86E0B2E Cheat0_O=$5A Off,$4F On Cheat1="Press F9\For Full Debug Menu",8818B5BF 0002 Cheat1_N=Press F9 at the Press Start Menu to access the Debug Menu +Cheat2="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -5759,6 +5761,7 @@ Cheat18="Have Bonus Mode and All Gold Cups",50000401 0000,1018ED10 00?? Cheat18_O=$5A Off,$4F On Cheat17="Press F9\For Full Debug Menu",8818EDEF 0002 Cheat17_N=Press F9 at the Press Start Menu to access the Debug Menu +Cheat19="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -12709,6 +12712,7 @@ Cheat4="Off-Road Tires\Player 3",50000418 0000,110F8744 0100 Cheat5="Off-Road Tires\Player 4",50000418 0000,110F951C 0100 Cheat6="Press F9\For Full Debug Menu",8818EE4F 0002 Cheat6_N=Press F9 at the Press Start Menu to access the Debug Menu +Cheat7="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- From dbfc51612b4b07b3cc8b1a332717562574c4adfe Mon Sep 17 00:00:00 2001 From: tony971 Date: Thu, 17 Sep 2015 02:30:59 -0400 Subject: [PATCH 081/103] Move Mario Kart multiplayer timing fix to rdb --- Config/Project64.cht | 4 ---- Config/Project64.rdb | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Config/Project64.cht b/Config/Project64.cht index 11c03485d..da5e4036e 100644 --- a/Config/Project64.cht +++ b/Config/Project64.cht @@ -741,7 +741,6 @@ Cheat6="Have Bonus Mode and All Gold Cups",E86E1A80 59??,E86E1A7F 59??,E86E1A7E Cheat6_O=$5A Off,$4F On Cheat7="Press F9\For Full Debug Menu",8818C80F 0002 Cheat7_N=Press F9 at the Press Start Menu to access the Debug Menu -Cheat8="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -751,7 +750,6 @@ Cheat0="Have Bonus Mode and All Gold Cups",E86E0B30 59??,E86E0B2F 59??,E86E0B2E Cheat0_O=$5A Off,$4F On Cheat1="Press F9\For Full Debug Menu",8818B5BF 0002 Cheat1_N=Press F9 at the Press Start Menu to access the Debug Menu -Cheat2="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -5761,7 +5759,6 @@ Cheat18="Have Bonus Mode and All Gold Cups",50000401 0000,1018ED10 00?? Cheat18_O=$5A Off,$4F On Cheat17="Press F9\For Full Debug Menu",8818EDEF 0002 Cheat17_N=Press F9 at the Press Start Menu to access the Debug Menu -Cheat19="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- @@ -12712,7 +12709,6 @@ Cheat4="Off-Road Tires\Player 3",50000418 0000,110F8744 0100 Cheat5="Off-Road Tires\Player 4",50000418 0000,110F951C 0100 Cheat6="Press F9\For Full Debug Menu",8818EE4F 0002 Cheat6_N=Press F9 at the Press Start Menu to access the Debug Menu -Cheat7="Fix Multiplayer Timings",81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //---- diff --git a/Config/Project64.rdb b/Config/Project64.rdb index da651b96a..19b49068b 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -3470,6 +3470,7 @@ Self Texture=1 Good Name=Mario Kart 64 (E) (V1.0) Internal Name=MARIOKART64 Status=Compatible +Cheat0=81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //Multiplayer timing fix Plugin Note=[video] (see GameFAQ) Culling=1 Primary Frame Buffer=1 @@ -3478,6 +3479,7 @@ Primary Frame Buffer=1 Good Name=Mario Kart 64 (E) (V1.1) Internal Name=MARIOKART64 Status=Compatible +Cheat0=81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //Multiplayer timing fix Plugin Note=[video] (see GameFAQ) Culling=1 Primary Frame Buffer=1 @@ -3486,6 +3488,7 @@ Primary Frame Buffer=1 Good Name=Mario Kart 64 (J) (V1.0) Internal Name=MARIOKART64 Status=Compatible +Cheat0=81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //Multiplayer timing fix Plugin Note=[video] (see GameFAQ) Culling=1 Primary Frame Buffer=1 @@ -3494,6 +3497,7 @@ Primary Frame Buffer=1 Good Name=Mario Kart 64 (J) (V1.1) Internal Name=MARIOKART64 Status=Compatible +Cheat0=81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //Multiplayer timing fix Plugin Note=[video] (see GameFAQ) Culling=1 Primary Frame Buffer=1 @@ -3502,6 +3506,7 @@ Primary Frame Buffer=1 Good Name=Mario Kart 64 (U) Internal Name=MARIOKART64 Status=Compatible +Cheat0=81001A38 2409,81001A3A 0002,81001A3C 2409,81001A3E 0002,81001C90 240A,81001C92 0002,81001C94 240A,81001C96 0002 //Multiplayer timing fix Plugin Note=[video] (see GameFAQ) Culling=1 Primary Frame Buffer=1 From fadcfe966022751a80cc2811018041b290fa847d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 18:52:58 -0400 Subject: [PATCH 082/103] fixed 20 repeated warnings about undeclared intrinsic --- Source/3rd Party/7zip/CpuArch.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/3rd Party/7zip/CpuArch.h b/Source/3rd Party/7zip/CpuArch.h index 01930c7e6..47092eca6 100644 --- a/Source/3rd Party/7zip/CpuArch.h +++ b/Source/3rd Party/7zip/CpuArch.h @@ -98,6 +98,7 @@ Stop_Compiling_Bad_Endian #endif #if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300) +#include #pragma intrinsic(_byteswap_ulong) #pragma intrinsic(_byteswap_uint64) From 8f9e963cb028041bbd4b3e19f8c68d2a61be9cd8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 19:31:32 -0400 Subject: [PATCH 083/103] conversion from 'LRESULT' ... possible loss of data --- Source/RSP/breakpoint.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Source/RSP/breakpoint.c b/Source/RSP/breakpoint.c index 3e7f0f6e9..b56bcecf1 100644 --- a/Source/RSP/breakpoint.c +++ b/Source/RSP/breakpoint.c @@ -138,12 +138,18 @@ void ShowBPPanel ( void ) void RefreshBpoints ( HWND hList ) { char Message[100]; - int count, location; + LRESULT location; + int count; for (count = 0; count < NoOfBpoints; count ++ ) { sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location); - location = SendMessage(hList,LB_ADDSTRING,0,(LPARAM)Message); - SendMessage(hList,LB_SETITEMDATA,(WPARAM)location,(LPARAM)BPoint[count].Location); + location = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)Message); + SendMessage( + hList, + LB_SETITEMDATA, + (WPARAM)location, + (LPARAM)BPoint[count].Location + ); } } @@ -154,9 +160,18 @@ void RemoveAllBpoint ( void ) void RemoveBpoint ( HWND hList, int index ) { - DWORD location; - - location = SendMessage(hList,LB_GETITEMDATA,(WPARAM)index,0); + LRESULT response; + uint32_t location; + + response = SendMessage(hList, LB_GETITEMDATA, (WPARAM)index, 0); + if (response < 0 || response > 0x7FFFFFFFL) + { + DisplayError( + "LB_GETITEMDATA response for %i out of DWORD range.", + index + ); + } + location = (uint32_t)response; RemoveRSPBreakPoint(location); } From c04f856b79ba235a1fd0c98ee3be673513a6add4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 19:58:49 -0400 Subject: [PATCH 084/103] Attempt the POSIX `ssize_t` type for signed addr compares. --- Source/RSP/Recompiler Ops.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index e8b4107b1..e1ec096c5 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -133,13 +133,17 @@ void Cheat_r4300iOpcodeNoMessage(p_func FunctAddress, char * FunctName) { void x86_SetBranch8b(void * JumpByte, void * Destination) { /* calculate 32-bit relative offset */ - signed int n = (BYTE*)Destination - ((BYTE*)JumpByte + 1); + size_t n = (BYTE*)Destination - ((BYTE*)JumpByte + 1); + SSIZE_T signed_n = (SSIZE_T)n; /* check limits, no pun intended */ - if (n > 0x80 || n < -0x7F) { - CompilerWarning("FATAL: Jump out of 8b range %i (PC = %04X)", n, CompilePC); - } else - *(BYTE*)(JumpByte) = (BYTE)n; + if (signed_n > +128 || signed_n < -127) { + CompilerWarning( + "FATAL: Jump out of 8b range %i (PC = %04X)", n, CompilePC + ); + } else { + *(uint8_t *)(JumpByte) = (uint8_t)(n & 0xFF); + } } void x86_SetBranch32b(void * JumpByte, void * Destination) { From 17f79654894dc8b6cd0c52c18160dab27297325b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 20:39:44 -0400 Subject: [PATCH 085/103] Have run-time error-checking when dumping DMEM/IMEM. --- Source/RSP/RSP Command.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index 7297dc795..057f52f27 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -196,9 +196,23 @@ void DumpRSPCode (void) SetFilePointer(hLogFile,0,NULL,FILE_BEGIN); for (location = 0; location < 0x1000; location += 4) { + unsigned int characters_to_write; + int characters_converted; + RSP_LW_IMEM(location, &OpCode); - sprintf(string," 0x%03X\t%s\r\n",location, RSPOpcodeName ( OpCode, location )); - WriteFile( hLogFile,string,strlen(string),&dwWritten,NULL ); + characters_converted = sprintf( + &string[0], + " 0x%03X\t%s\r\n", + location, + RSPOpcodeName(OpCode, location) + ); + + if (characters_converted < 0) { + DisplayError("Failed to sprintf IMEM from 0x%03X.", location); + break; + } + characters_to_write = (unsigned)characters_converted; + WriteFile(hLogFile, string, characters_to_write, &dwWritten, NULL); } CloseHandle(hLogFile); } @@ -237,9 +251,23 @@ void DumpRSPData (void) for (location = 0; location < 0x1000; location += 4) { + unsigned int characters_to_write; + int characters_converted; + RSP_LW_DMEM(location, &value); - sprintf(string," 0x%03X\t0x%08X\r\n", location, value); - WriteFile( hLogFile,string,strlen(string),&dwWritten,NULL ); + characters_converted = sprintf( + &string[0], + " 0x%03X\t0x%08X\r\n", + location, + value + ); + + if (characters_converted < 0) { + DisplayError("Failed to sprintf DMEM from 0x%03X.", location); + break; + } + characters_to_write = (unsigned)characters_converted; + WriteFile(hLogFile, string, characters_to_write, &dwWritten, NULL); } CloseHandle(hLogFile); } From 17b7b0857cb9639ef410ab4467770cd93fbad93b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 21:49:00 -0400 Subject: [PATCH 086/103] Have error-checking when drawing RSP command window. --- Source/RSP/RSP Command.c | 54 +++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index 7297dc795..0abd751fb 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -247,6 +247,7 @@ void DumpRSPData (void) void DrawRSPCommand ( LPARAM lParam ) { char Command[150], Offset[30], Instruction[30], Arguments[40]; + int printed_offset, printed_instruction, printed_arguments; LPDRAWITEMSTRUCT ditem; COLORREF oldColor = {0}; int ResetColor; @@ -260,26 +261,31 @@ void DrawRSPCommand ( LPARAM lParam ) if (strchr(Command,'\t')) { p1 = strchr(Command,'\t'); - sprintf(Offset,"%.*s",p1 - Command, Command); + printed_offset = sprintf(Offset, "%.*s", p1 - Command, Command); p1++; if (strchr(p1,'\t')) { p2 = strchr(p1,'\t'); - sprintf(Instruction,"%.*s",p2 - p1, p1); - sprintf(Arguments,"%s",p2 + 1); + printed_instruction = sprintf(Instruction, "%.*s", p2 - p1, p1); + printed_arguments = sprintf(Arguments, "%s", p2 + 1); } else { - sprintf(Instruction,"%s",p1); - sprintf(Arguments,"\0"); + printed_instruction = sprintf(Instruction, "%s", p1); + printed_arguments = sprintf(Arguments, "\0"); } - sprintf(Command,"\0"); + Command[0] = '\0'; } else { - sprintf(Offset,"\0"); - sprintf(Instruction,"\0"); - sprintf(Arguments,"\0"); + printed_offset = sprintf(Offset, "\0"); + printed_instruction = sprintf(Instruction, "\0"); + printed_arguments = sprintf(Arguments, "\0"); + } + + if (printed_offset < 0 || printed_instruction < 0 || printed_arguments < 0) + { + DisplayError("Failed to sprintf from item %u.", ditem -> itemID); } if (*PrgCount == RSPCommandLine[ditem->itemID].Location) @@ -310,23 +316,43 @@ void DrawRSPCommand ( LPARAM lParam ) FillRect( ditem->hDC, &ditem->rcItem,hBrush); SetBkMode( ditem->hDC, TRANSPARENT ); - if (strlen (Command) == 0 ) + if (Command[0] == '\0') { SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83, ditem->rcItem.bottom); - DrawText(ditem->hDC,Offset,strlen(Offset), &TextRect,DT_SINGLELINE | DT_VCENTER); + DrawText( + ditem->hDC, + &Offset[0], printed_offset, + &TextRect, + DT_SINGLELINE | DT_VCENTER + ); SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165, ditem->rcItem.bottom); - DrawText(ditem->hDC,Instruction,strlen(Instruction), &TextRect,DT_SINGLELINE | DT_VCENTER); + DrawText( + ditem->hDC, + &Instruction[0], printed_instruction, + &TextRect, + DT_SINGLELINE | DT_VCENTER + ); SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right, ditem->rcItem.bottom); - DrawText(ditem->hDC,Arguments,strlen(Arguments), &TextRect,DT_SINGLELINE | DT_VCENTER); + DrawText( + ditem->hDC, + &Arguments[0], printed_arguments, + &TextRect, + DT_SINGLELINE | DT_VCENTER + ); } else { - DrawText(ditem->hDC,Command,strlen(Command), &ditem->rcItem,DT_SINGLELINE | DT_VCENTER); + DrawText( + ditem->hDC, + &Command[0], (signed int)strlen(Command), + &ditem->rcItem, + DT_SINGLELINE | DT_VCENTER + ); } if (ResetColor == TRUE) { From 6a194b4926df20970056c8bec4d9fcf38c556dea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2015 21:59:06 -0400 Subject: [PATCH 087/103] [RSP] warning C4267: conversion, possible loss of data --- Source/RSP/RSP Command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index 7297dc795..b6d957355 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -470,8 +470,10 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM case IDC_LIST: if (HIWORD(wParam) == LBN_DBLCLK ) { - DWORD Location, Selected; - Selected = SendMessage(hList,LB_GETCURSEL,(WPARAM)0, (LPARAM)0); + LRESULT Selected; + DWORD Location; + + Selected = SendMessage(hList, LB_GETCURSEL, 0, 0); Location = RSPCommandLine[Selected].Location; if (Location != (DWORD)-1) { From 789ec9565d017d931e84666298f46a9781431518 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 20 Sep 2015 06:23:47 +1000 Subject: [PATCH 088/103] Add git,properties --- git.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 git.properties diff --git a/git.properties b/git.properties new file mode 100644 index 000000000..80bc17042 --- /dev/null +++ b/git.properties @@ -0,0 +1 @@ +GIT_DESCRIBE=$(git describe --tags --long) From 27293ef7de2eaa38a581f1a117ef450e223edb79 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 20 Sep 2015 19:38:34 +1000 Subject: [PATCH 089/103] remove git.properties --- git.properties | 1 - 1 file changed, 1 deletion(-) delete mode 100644 git.properties diff --git a/git.properties b/git.properties deleted file mode 100644 index 80bc17042..000000000 --- a/git.properties +++ /dev/null @@ -1 +0,0 @@ -GIT_DESCRIBE=$(git describe --tags --long) From b6a8c54fde2a81208be532edbbfad03c3545896b Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 20 Sep 2015 13:21:26 -0700 Subject: [PATCH 090/103] Implement case 7 in Compile_Cop0_MF --- Source/RSP/Recompiler Ops.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index e8b4107b1..36cc9b8d5 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -41,6 +41,7 @@ #pragma warning(disable : 4152) // nonstandard extension, function/data pointer conversion in expression +extern BOOL AudioHle, GraphicsHle; UWORD32 Recp, RecpResult, SQroot, SQrootResult; DWORD ESP_RegSave = 0, EBP_RegSave = 0; DWORD BranchCompare = 0; @@ -1646,7 +1647,6 @@ void Compile_Cop0_MF ( void ) { MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); break; case 4: - case 7: MoveConstToVariable(RSPOpC.Hex, &RSPOpC.Hex, "RSPOpC.Hex" ); Call_Direct(RSP_Cop0_MF,"RSP_Cop0_MF"); if (NextInstruction == NORMAL) @@ -1661,6 +1661,28 @@ void Compile_Cop0_MF ( void ) { BreakPoint(); } break; + case 7: + if (AudioHle || GraphicsHle) + { + MoveConstToVariable(0, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt)); + } else { + MoveVariableToX86reg(RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG", x86_EAX); + MoveConstToVariable(0, &RSP_Running, "RSP_Running"); + MoveConstToVariable(1, RSPInfo.SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG"); + MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].W, GPR_Name(RSPOpC.rt)); + if (NextInstruction == NORMAL) + { + MoveConstToVariable(CompilePC + 4, PrgCount, "RSP PC"); + Ret(); + NextInstruction = FINISH_SUB_BLOCK; + } else if (NextInstruction == DELAY_SLOT) { + NextInstruction = DELAY_SLOT_EXIT; + } else { + CompilerWarning("MF error\nWeird Delay Slot.\n\nNextInstruction = %X\nEmulation will now stop", NextInstruction); + BreakPoint(); + } + } + break; case 8: MoveVariableToX86reg(RSPInfo.DPC_START_REG, "DPC_START_REG", x86_EAX); MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); From aa70b43ffce30417d0ad71644b66fb4173bda684 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 20 Sep 2015 14:57:45 -0700 Subject: [PATCH 091/103] Implement case 4 in Compile_Cop0_MF --- Source/RSP/Recompiler Ops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 36cc9b8d5..17f4ce600 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -1647,8 +1647,14 @@ void Compile_Cop0_MF ( void ) { MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); break; case 4: - MoveConstToVariable(RSPOpC.Hex, &RSPOpC.Hex, "RSPOpC.Hex" ); - Call_Direct(RSP_Cop0_MF,"RSP_Cop0_MF"); + MoveVariableToX86reg(&RSP_MfStatusCount, "RSP_MfStatusCount", x86_ECX); + MoveVariableToX86reg(RSPInfo.SP_STATUS_REG, "SP_STATUS_REG", x86_EAX); + CompConstToX86reg(x86_ECX, 10); + JbLabel8("label", 10); + MoveConstToVariable(0, &RSP_Running, "RSP_Running"); + IncX86reg(x86_ECX); + MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt)); + MoveX86regToVariable(x86_ECX, &RSP_MfStatusCount, "RSP_MfStatusCount"); if (NextInstruction == NORMAL) { MoveConstToVariable(CompilePC + 4,PrgCount,"RSP PC"); From 387b5739eed9fde1d945a3e03215c3906402c1a5 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 22 Sep 2015 09:45:20 +1000 Subject: [PATCH 092/103] Add initial script to upload beta to the forum --- Source/Script/upload_beta.vbs | 352 ++++++++++++++++++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 Source/Script/upload_beta.vbs diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs new file mode 100644 index 000000000..b1543d619 --- /dev/null +++ b/Source/Script/upload_beta.vbs @@ -0,0 +1,352 @@ +' On Error Resume Next + +if WScript.Arguments.Count < 3 then + WScript.StdOut.WriteLine "Missing parameters" + WScript.StdOut.WriteLine "[password] [file to upload] [BuildUr]" + WScript.Quit +end if + +Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_") +IE.Visible = True + +Login IE +PostThread IE + +Sub Wait(IE) + Dim complete + complete = False + + For count = 0 to 1000 + WScript.Sleep 100 + WScript.StdOut.WriteLine count & ": IE.ReadyState: " & IE.ReadyState + if IE.ReadyState >= 4 then + WScript.StdOut.WriteLine count & ": IE.Busy: " & IE.Busy + if not IE.Busy then + WScript.StdOut.WriteLine count & ": IE.document.readyState: " & IE.document.readyState + if StrComp(IE.document.readyState, "complete", vbTextCompare) = 0 then + complete = true + exit for + end if + end if + end if + Next + + if not complete then + WScript.StdOut.WriteLine "Failed to wait for IE" + WScript.Quit + end if +End Sub + +Sub Navigate(IE, url) + WScript.StdOut.WriteLine "Navigating to: " & url + IE.Navigate url + Wait IE +End Sub + +Sub ValidateLoggedIn(IE) + WScript.StdOut.WriteLine "validate login succsess" + Navigate IE, "http://forum.pj64-emu.com/" + Wait IE + + Dim LoggedIn + LoggedIn = False + Set NodeList = IE.document.getElementsByTagName("a") + For Each Elem In NodeList + if lcase(Mid(Elem.href,1,39)) = "http://forum.pj64-emu.com/member.php?u=" then + if lcase(Mid(Elem.parentElement.innerHTML,1,11)) = "welcome, 200) then + WScript.StdOut.WriteLine "failed to get job details (" & BuildUrl & "api/xml?wrapper=changes)" + WScript.Quit + end if + + Dim xmlDoc + Set xmlDoc = oReq.responseXML + Set objLst = xmlDoc.getElementsByTagName("freeStyleBuild") + + Dim PostTitle, PostContent + For each elem in objLst + set childNodes = elem.childNodes + for each node in childNodes + if lcase(node.nodeName)="fulldisplayname" then + PostTitle = node.text + end if + if lcase(node.nodeName)="changeset" then + for each item in node.childNodes + dim commitId, comment + + commitId = "" + comment = "" + + for each itemDetail in item.childNodes + if lcase(itemDetail.nodeName)="commitid" then + commitId = itemDetail.text + end if + if lcase(itemDetail.nodeName)="comment" then + comment = Replace(Replace(itemDetail.text, vbLf, " "), vbCr, " ") + end if + next + + if (Len(comment) > 0 and Len(commitId) > 0) then + PostContent = PostContent & "[*]" & comment & " (commit: [URL=""https://github.com/project64/project64/commit/" & commitId & """]"& commitId & "[/URL])" & vbCr + end if + next + end if + next + Next + + if (Len(PostContent) > 0) then + PostContent = "Changes:"&vbCr&"[LIST=1]" & vbCr & PostContent & "[/LIST]" + else + PostContent = "No code changes" + end if + + WScript.StdOut.WriteLine "PostTitle = """ & PostTitle & """" + WScript.StdOut.WriteLine "PostContent = """ & PostContent & """" + + Dim SetTitle + SetTitle = False + Set NodeList = IE.document.getElementsByTagName("input") + For Each Elem In NodeList + if lcase(Elem.name) = "subject" then + Elem.value = PostTitle + SetTitle = true + exit for + end if + Next + + if not SetTitle then + WScript.StdOut.WriteLine "failed to set post title" + WScript.Quit + end if + + Dim SetMessage + SetMessage = False + Set NodeList = IE.document.getElementsByTagName("textarea") + For Each Elem In NodeList + WScript.StdOut.WriteLine Elem.name + if lcase(Elem.name) = "message" then + Elem.value = PostContent + SetMessage = true + exit for + end if + Next + + if not SetMessage then + WScript.StdOut.WriteLine "failed to set post message" + WScript.Quit + end if + +end sub + +sub UploadFile(FileToUpload) + WScript.StdOut.WriteLine "UploadFile start" + + On Error resume next + set IE = Nothing + + Set Shell = CreateObject("Shell.Application") + For i = 0 to Shell.Windows.Count -1 + set Win = Shell.Windows.Item(i) + If TypeName(win.Document) = "HTMLDocument" Then + if StrComp(win.Document.title, "Manage Attachments - Project64 Forums", vbTextCompare) = 0 then + set IE = win + end if + End If + + if not IE is nothing then + exit for + end if + Next + if IE is nothing then + WScript.StdOut.WriteLine "Failed to find upload window" + exit sub + end if + + WScript.StdOut.WriteLine "Found window" + Set objShell = CreateObject("Wscript.Shell") + WScript.StdOut.WriteLine "activate: " & win.Document.title & " - " & IE.name + Dim activated + For count = 0 to 100 + activated = objShell.AppActivate(win.Document.title & " - " & IE.name, True) + if activated then + exit for + end if + WScript.StdOut.WriteLine count & ": " & activated + WScript.Sleep 100 + Next + + if not activated then + WScript.StdOut.WriteLine "Failed to activate window" + WScript.Quit + end if + + Set NodeList = IE.document.getElementsByTagName("input") + For Each Elem In NodeList + if StrComp(Elem.name, "attachment[]", vbTextCompare) = 0 then + Elem.focus() + objShell.SendKeys " " + + WScript.StdOut.WriteLine "Uploading: " & FileToUpload + Wscript.Sleep 1000 + a=Split(FileToUpload,"\") + b=ubound(a) + For i=0 to b + objShell.SendKeys a(i) + if i < b then + objShell.SendKeys "\" + else + objShell.SendKeys "{ENTER}" + end if + Wscript.Sleep 100 + Next + exit for + end if + Next + + For Each Elem In NodeList + if StrComp(Elem.name, "upload", vbTextCompare) = 0 then + Elem.click + Wait IE + exit for + end if + Next + + Dim UploadDone + UploadDone = False + For count = 0 to 1000 + WScript.StdOut.WriteLine count & ": Waiting for upload done" + Set NodeList = ie.document.getElementsByTagName("legend") + For Each Elem In NodeList + if (len(Elem.innerHTML) > 19) and lcase(Mid(Elem.innerHTML, 1, 19)) = "current attachments" then + UploadDone = true + WScript.StdOut.WriteLine "Upload done" + exit for + end if + Next + if UploadDone then + exit for + end if + Next + + if not UploadDone then + WScript.StdOut.WriteLine "Failed to uplad file" + WScript.Quit + end if + + Set NodeList = IE.document.getElementsByTagName("input") + For Each Elem In NodeList + if lcase(Elem.value) = "close this window" then + Elem.click + exit for + end if + Next +end sub + From 90f32fad8b5fde99b39a1d2022c146a764a17a14 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Sep 2015 22:02:58 -0400 Subject: [PATCH 093/103] URL --- Source/Script/upload_beta.vbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs index b1543d619..0b15211d8 100644 --- a/Source/Script/upload_beta.vbs +++ b/Source/Script/upload_beta.vbs @@ -2,7 +2,7 @@ if WScript.Arguments.Count < 3 then WScript.StdOut.WriteLine "Missing parameters" - WScript.StdOut.WriteLine "[password] [file to upload] [BuildUr]" + WScript.StdOut.WriteLine "[password] [file to upload] [BuildUrl]" WScript.Quit end if From 306fa2b699cf7eb3c909047e89dbb77e8009c9fc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Sep 2015 22:03:39 -0400 Subject: [PATCH 094/103] s/succsess/success --- Source/Script/upload_beta.vbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs index 0b15211d8..71540cc4a 100644 --- a/Source/Script/upload_beta.vbs +++ b/Source/Script/upload_beta.vbs @@ -44,7 +44,7 @@ Sub Navigate(IE, url) End Sub Sub ValidateLoggedIn(IE) - WScript.StdOut.WriteLine "validate login succsess" + WScript.StdOut.WriteLine "validate login success" Navigate IE, "http://forum.pj64-emu.com/" Wait IE From 9bb404d8fb257f0623a7fde4319ebc149d1e9ec6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Sep 2015 22:04:00 -0400 Subject: [PATCH 095/103] s/welecome/welcome --- Source/Script/upload_beta.vbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs index 71540cc4a..a5f5b285a 100644 --- a/Source/Script/upload_beta.vbs +++ b/Source/Script/upload_beta.vbs @@ -55,7 +55,7 @@ Sub ValidateLoggedIn(IE) if lcase(Mid(Elem.href,1,39)) = "http://forum.pj64-emu.com/member.php?u=" then if lcase(Mid(Elem.parentElement.innerHTML,1,11)) = "welcome, Date: Mon, 21 Sep 2015 22:05:06 -0400 Subject: [PATCH 096/103] s/quiting/quitting --- Source/Script/upload_beta.vbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs index a5f5b285a..5feb42f0b 100644 --- a/Source/Script/upload_beta.vbs +++ b/Source/Script/upload_beta.vbs @@ -114,7 +114,7 @@ Sub Login(IE) Navigate IE, "http://forum.pj64-emu.com/" Wait IE - WScript.StdOut.WriteLine "Quiting IE2" + WScript.StdOut.WriteLine "Quitting IE2" IE2.Quit ValidateLoggedIn IE WScript.StdOut.WriteLine "Login Done" From 4e6d5c06ab8c42e7d07c32976d0678d8ee8f08f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Sep 2015 22:06:35 -0400 Subject: [PATCH 097/103] s/uplad/upload --- Source/Script/upload_beta.vbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Script/upload_beta.vbs b/Source/Script/upload_beta.vbs index 5feb42f0b..2c9bf4cc2 100644 --- a/Source/Script/upload_beta.vbs +++ b/Source/Script/upload_beta.vbs @@ -337,7 +337,7 @@ sub UploadFile(FileToUpload) Next if not UploadDone then - WScript.StdOut.WriteLine "Failed to uplad file" + WScript.StdOut.WriteLine "Failed to upload file" WScript.Quit end if From d15d8eff4a14ff86957b500cd8638ec4d1730144 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 23 Sep 2015 02:57:33 -0400 Subject: [PATCH 098/103] Pif Ram: Get rid of pointer casts Less undefined behavior --- Source/Project64/N64 System/Mips/Pif Ram.cpp | 39 +++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index db011df2e..b355985d3 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -173,13 +173,13 @@ void CPifRam::PifRamWrite() { ResponseValue = (ResponseValue << 8) | ((Response[(z - 1)*2] << 4) + Response[(z - 1)*2+1]); } - *(QWORD *)&m_PifRam[48] = ResponseValue; + std::memcpy(&m_PifRam[48], &ResponseValue, sizeof(QWORD)); ResponseValue = 0; for (int z = 7; z > 0; z--) { ResponseValue = (ResponseValue << 8) | ((Response[((z + 8) - 1)*2] << 4) + Response[((z + 8) - 1)*2+1]); } - *(QWORD *)&m_PifRam[56] = ResponseValue; + std::memcpy(&m_PifRam[56], &ResponseValue, sizeof(QWORD)); } break; case 0x08: @@ -302,13 +302,14 @@ void CPifRam::SI_DMA_READ() } else { - size_t i; - - for (i = 0; i < 64; i += 4) + for (size_t i = 0; i < 64; i += 4) { - *(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i] = swap32by8( - *(unsigned __int32 *)&PifRamPos[i] - ); + unsigned __int32 pif_ram_dword; + std::memcpy(&pif_ram_dword, &PifRamPos[i], sizeof(unsigned __int32)); + + pif_ram_dword = swap32by8(pif_ram_dword); + + std::memcpy(&RDRAM[SI_DRAM_ADDR_REG + i], &pif_ram_dword, sizeof(unsigned __int32)); } } @@ -379,10 +380,9 @@ void CPifRam::SI_DMA_WRITE() if ((int)SI_DRAM_ADDR_REG < 0) { - int count, RdramPos; + int RdramPos = (int)SI_DRAM_ADDR_REG; - RdramPos = (int)SI_DRAM_ADDR_REG; - for (count = 0; count < 0x40; count++, RdramPos++) + for (int count = 0; count < 0x40; count++, RdramPos++) { if (RdramPos < 0) { @@ -393,13 +393,14 @@ void CPifRam::SI_DMA_WRITE() } else { - size_t i; - - for (i = 0; i < 64; i += 4) + for (size_t i = 0; i < 64; i += 4) { - *(unsigned __int32 *)&PifRamPos[i] = swap32by8( - *(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i] - ); + unsigned __int32 rdram_dword; + std::memcpy(&rdram_dword, &RDRAM[SI_DRAM_ADDR_REG + i], sizeof(unsigned __int32)); + + rdram_dword = swap32by8(rdram_dword); + + std::memcpy(&PifRamPos[i], &rdram_dword, sizeof(unsigned __int32)); } } @@ -616,7 +617,9 @@ void CPifRam::ReadControllerCommand (int Control, BYTE * Command) { if (Command[0] != 1) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); } if (Command[1] != 4) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); } } - *(DWORD *)&Command[3] = g_BaseSystem->GetButtons(Control); + + const DWORD buttons = g_BaseSystem->GetButtons(Control); + std::memcpy(&Command[3], &buttons, sizeof(DWORD)); } break; case 0x02: //read from controller pack From fb98d402a02c446767a970d7d642749f7e3abcf0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 23 Sep 2015 03:51:10 -0400 Subject: [PATCH 099/103] Remove unimplemented function declarations --- Source/Common/Log Class.h | 1 - Source/Project64/N64 System/Mips/Memory Virtual Mem.h | 1 - Source/Project64/N64 System/N64 Class.cpp | 1 - Source/Project64/N64 System/N64 Class.h | 7 ------- Source/Project64/N64 System/Recompiler/Code Block.h | 1 - Source/Project64/N64 System/Recompiler/Code Section.h | 1 - .../Project64/N64 System/Recompiler/Recompiler Class.h | 9 --------- Source/Project64/N64 System/Recompiler/Recompiler Ops.h | 1 - Source/Project64/Plugins/RSP Plugin.h | 1 - Source/Project64/User Interface/Rom Browser.h | 1 - 10 files changed, 24 deletions(-) diff --git a/Source/Common/Log Class.h b/Source/Common/Log Class.h index 1ba18d229..e507ef1a6 100644 --- a/Source/Common/Log Class.h +++ b/Source/Common/Log Class.h @@ -25,7 +25,6 @@ public: void LogF ( LPCTSTR Message, ... ); void LogArgs ( LPCTSTR Message, va_list & args ); bool Empty ( void ); - void Reset ( void ); void Close ( void ); inline void SetMaxFileSize ( ULONG Size ) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h index 34ff27fc2..128983cb2 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h @@ -67,7 +67,6 @@ public: //Compilation Functions void ResetMemoryStack(); - void ResetTLB(); void Compile_LB(); void Compile_LBU(); diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index f2bdd8c0b..777f34d93 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1389,7 +1389,6 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) g_Notify->DisplayError(L"Sync Error"); g_Notify->BreakPoint(__FILEW__,__LINE__); -// AddEvent(CloseCPU); } bool CN64System::SaveState() diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 4693098cf..f262c230a 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -100,7 +100,6 @@ private: void ExecuteCPU (); void RefreshScreen (); - bool InternalEvent (); void DumpSyncErrors ( CN64System * SecondCPU ); void StartEmulation2 ( bool NewThread ); bool SetActiveSystem ( bool bActive = true ); @@ -111,12 +110,6 @@ private: void ExecuteInterpret(); void ExecuteSyncCPU(); - void AddEvent(SystemEvent Event); - - //Notification of changing conditions - void FunctionStarted(DWORD NewFuncAddress, DWORD OldFuncAddress, DWORD ReturnAddress); - void FunctionEnded(DWORD ReturnAddress, DWORD StackPos); - //Mark information saying that the CPU has stopped void CpuStopped(); diff --git a/Source/Project64/N64 System/Recompiler/Code Block.h b/Source/Project64/N64 System/Recompiler/Code Block.h index 326979c5c..fe80196e9 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.h +++ b/Source/Project64/N64 System/Recompiler/Code Block.h @@ -52,7 +52,6 @@ private: void DetermineLoops (); void LogSectionInfo (); bool SetSection ( CCodeSection * & Section, CCodeSection * CurrentSection, DWORD TargetPC, bool LinkAllowed, DWORD CurrentPC ); - bool SetJumpInfo ( CCodeSection * & Section, DWORD TargetPC, DWORD CurrentPC ); bool AnalyzeInstruction ( DWORD PC, DWORD & TargetPC, DWORD & ContinuePC, bool & LikelyBranch, bool & IncludeDelaySlot, bool & EndBlock, bool & PermLoop ); diff --git a/Source/Project64/N64 System/Recompiler/Code Section.h b/Source/Project64/N64 System/Recompiler/Code Section.h index 3ab11c7a9..979aafd9d 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.h +++ b/Source/Project64/N64 System/Recompiler/Code Section.h @@ -25,7 +25,6 @@ public: void SetJumpAddress ( DWORD JumpPC, DWORD TargetPC, bool PermLoop ); void SetContinueAddress ( DWORD JumpPC, DWORD TargetPC ); void CompileCop1Test (); - bool CreateSectionLinkage (); bool GenerateX86Code ( DWORD Test ); void GenerateSectionLinkage (); void CompileExit ( DWORD JumpPC, DWORD TargetPC, CRegInfo &ExitRegSet, CExitInfo::EXIT_REASON reason, bool CompileNow, void (*x86Jmp)(const char * Label, DWORD Value)); diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.h b/Source/Project64/N64 System/Recompiler/Recompiler Class.h index d1f40fa58..0f17d71b9 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.h @@ -39,8 +39,6 @@ public: void Reset(); void ResetRecompCode(bool bAllocate); - bool GenerateX86Code (CCodeBlock & BlockInfo, CCodeSection * Section, DWORD Test ); - //Self modifying code methods void ClearRecompCode_Virt ( DWORD VirtualAddress, int length, REMOVE_REASON Reason ); void ClearRecompCode_Phys ( DWORD PhysicalAddress, int length, REMOVE_REASON Reason ); @@ -55,11 +53,6 @@ private: CRecompiler& operator=(const CRecompiler&); // Disable assignment CCompiledFunc * CompilerCode(); - bool Compiler4300iBlock ( CCompiledFunc * info ); - - // Compiling code - bool CreateSectionLinkage ( CCodeSection * Section ); - bool DisplaySectionInformation (CCodeSection * Section, DWORD ID, DWORD Test); // Main loops for the different look up methods void RecompilerMain_VirtualTable(); @@ -70,8 +63,6 @@ private: void RecompilerMain_Lookup_validate(); void RecompilerMain_Lookup_validate_TLB(); - void RemoveFunction (CCompiledFunc * FunInfo, bool DelaySlot, REMOVE_REASON Reason ); - CCompiledFuncList m_Functions; CRegisters & m_Registers; CProfiling & m_Profile; diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h index b01ed89d0..6ce00179c 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h @@ -203,7 +203,6 @@ protected: static void ExitCodeBlock(); static void CompileReadTLBMiss(DWORD VirtualAddress, x86Reg LookUpReg); static void CompileReadTLBMiss(x86Reg AddressReg, x86Reg LookUpReg); - static void CompileWriteTLBMiss(DWORD VirtualAddress, x86Reg LookUpReg); static void CompileWriteTLBMiss(x86Reg AddressReg, x86Reg LookUpReg); static void UpdateSyncCPU(CRegInfo & RegSet, DWORD Cycles); static void UpdateCounters(CRegInfo & RegSet, bool CheckTimer, bool ClearValues = false); diff --git a/Source/Project64/Plugins/RSP Plugin.h b/Source/Project64/Plugins/RSP Plugin.h index 690d0b48d..bdc963807 100644 --- a/Source/Project64/Plugins/RSP Plugin.h +++ b/Source/Project64/Plugins/RSP Plugin.h @@ -66,7 +66,6 @@ private: virtual int GetSettingStartRange() const { return FirstRSPSettings; } bool LoadFunctions ( void ); - bool Initiate_1_0 ( CPlugins * Plugins, CN64System * System ); void UnloadPluginDetails ( void ); RSPDEBUG_INFO m_RSPDebug; diff --git a/Source/Project64/User Interface/Rom Browser.h b/Source/Project64/User Interface/Rom Browser.h index 05d651a53..f0df7e4fa 100644 --- a/Source/Project64/User Interface/Rom Browser.h +++ b/Source/Project64/User Interface/Rom Browser.h @@ -208,7 +208,6 @@ public: void ShowRomList ( void ); bool ShowingRomBrowser ( void ) { return m_ShowingRomBrowser; } LPCSTR CurrentedSelectedRom ( void ) { return m_SelectedRom.c_str(); } - void Store7ZipInfo ( C7zip & ZipFile, int FileNo ); static void GetFieldInfo ( ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault = false ); }; From adfa096230a242b2acf3c090f4d9d88b2df3d485 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 23 Sep 2015 05:00:51 -0400 Subject: [PATCH 100/103] Correct order of class initialization lists --- Source/Project64/N64 System/Mips/FlashRam.cpp | 2 +- .../N64 System/Mips/Memory Virtual Mem.cpp | 8 +++---- Source/Project64/N64 System/Mips/Sram.cpp | 4 ++-- .../N64 System/Mips/System Events.cpp | 4 ++-- Source/Project64/N64 System/N64 Class.cpp | 24 +++++++++---------- .../N64 System/Recompiler/Code Block.cpp | 4 ++-- .../N64 System/Recompiler/Code Section.cpp | 6 ++--- .../N64 System/Recompiler/Function Info.cpp | 2 +- .../Recompiler/Recompiler Class.cpp | 4 ++-- Source/Project64/Plugins/Audio Plugin.cpp | 6 ++--- .../Project64/Plugins/Controller Plugin.cpp | 4 ++-- Source/Project64/Plugins/Plugin Base.cpp | 16 ++++++------- Source/Project64/Plugins/Plugin Class.cpp | 6 ++--- Source/Project64/Plugins/RSP Plugin.cpp | 4 ++-- .../SettingType/SettingsType-Application.cpp | 16 ++++++------- .../User Interface/Notification Class.cpp | 6 ++--- .../User Interface/Rom Browser Class.cpp | 6 ++--- .../WTL Controls/ModifiedComboBox.h | 8 +++---- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Source/Project64/N64 System/Mips/FlashRam.cpp b/Source/Project64/N64 System/Mips/FlashRam.cpp index be14d04d5..6d4ba3a1f 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.cpp +++ b/Source/Project64/N64 System/Mips/FlashRam.cpp @@ -11,9 +11,9 @@ #include "stdafx.h" CFlashram::CFlashram(bool ReadOnly): + m_FlashRamPointer(NULL), m_FlashFlag(FLASHRAM_MODE_NOPES), m_FlashStatus(0), - m_FlashRamPointer(NULL), m_FlashRAM_Offset(0), m_ReadOnly(ReadOnly), m_hFile(NULL) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 6245405a6..c21d5abca 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -16,14 +16,12 @@ BYTE * CMipsMemoryVM::m_Reserve1 = NULL; BYTE * CMipsMemoryVM::m_Reserve2 = NULL; CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnly ) : - + CPifRam(SavesReadOnly), CFlashram(SavesReadOnly), CSram(SavesReadOnly), CDMA(*this,*this), m_CBClass(CallBack), - m_TLB_ReadMap(NULL), - m_TLB_WriteMap(NULL), m_RomMapped(false), m_Rom(NULL), m_RomSize(0), @@ -32,7 +30,9 @@ CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnl m_HalfLine(0), m_HalfLineCheck(false), m_FieldSerration(0), - m_TempValue(0) + m_TempValue(0), + m_TLB_ReadMap(NULL), + m_TLB_WriteMap(NULL) { g_Settings->RegisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); m_RDRAM = NULL; diff --git a/Source/Project64/N64 System/Mips/Sram.cpp b/Source/Project64/N64 System/Mips/Sram.cpp index e23e832f0..689ed2338 100644 --- a/Source/Project64/N64 System/Mips/Sram.cpp +++ b/Source/Project64/N64 System/Mips/Sram.cpp @@ -11,8 +11,8 @@ #include "stdafx.h" CSram::CSram ( bool ReadOnly ) : - m_hFile(NULL), - m_ReadOnly(ReadOnly) + m_ReadOnly(ReadOnly), + m_hFile(NULL) { } diff --git a/Source/Project64/N64 System/Mips/System Events.cpp b/Source/Project64/N64 System/Mips/System Events.cpp index a4e7639b7..2bd74cb24 100644 --- a/Source/Project64/N64 System/Mips/System Events.cpp +++ b/Source/Project64/N64 System/Mips/System Events.cpp @@ -11,9 +11,9 @@ #include "stdafx.h" CSystemEvents::CSystemEvents(CN64System * System, CPlugins * Plugins) : - m_bDoSomething(false), m_System(System), - m_Plugins(Plugins) + m_Plugins(Plugins), + m_bDoSomething(false) { } diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index f2bdd8c0b..4b8e60eea 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -17,33 +17,33 @@ CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) : CSystemEvents(this, Plugins), + m_Cheats(NULL), + m_EndEmulation(false), + m_SaveUsing((SAVE_CHIP_TYPE)g_Settings->LoadDword(Game_SaveChip)), + m_Plugins(Plugins), + m_SyncCPU(NULL), m_SyncPlugins(NULL), m_SyncWindow(NULL), - m_Reg(this,this), m_MMU_VM(this,SavesReadOnly), m_TLB(this), + m_Reg(this,this), m_FPS(g_Notify), - m_Plugins(Plugins), - m_Cheats(NULL), - m_SyncCPU(NULL), m_Recomp(NULL), m_InReset(false), - m_EndEmulation(false), - m_bCleanFrameBox(true), - m_bInitialized(false), m_NextTimer(0), m_SystemTimer(m_NextTimer), + m_bCleanFrameBox(true), + m_bInitialized(false), + m_RspBroke(true), m_DMAUsed(false), - m_CPU_Handle(NULL), - m_CPU_ThreadID(0), m_TestTimer(false), m_NextInstruction(0), m_JumpToLocation(0), m_TLBLoadAddress(0), m_TLBStoreAddress(0), - m_SaveUsing((SAVE_CHIP_TYPE)g_Settings->LoadDword(Game_SaveChip)), - m_RspBroke(true), - m_SyncCount(0) + m_SyncCount(0), + m_CPU_Handle(NULL), + m_CPU_ThreadID(0) { DWORD gameHertz = g_Settings->LoadDword(Game_ScreenHertz); if (gameHertz == 0) diff --git a/Source/Project64/N64 System/Recompiler/Code Block.cpp b/Source/Project64/N64 System/Recompiler/Code Block.cpp index a5eb42dd1..adcae84cd 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Block.cpp @@ -17,8 +17,8 @@ CCodeBlock::CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos) : m_VAddrFirst(VAddrEnter), m_VAddrLast(VAddrEnter), m_CompiledLocation(RecompPos), - m_Test(1), - m_EnterSection(NULL) + m_EnterSection(NULL), + m_Test(1) { CCodeSection * baseSection = new CCodeSection(this, VAddrEnter, 0, false); if (baseSection == NULL) diff --git a/Source/Project64/N64 System/Recompiler/Code Section.cpp b/Source/Project64/N64 System/Recompiler/Code Section.cpp index 2db6b2948..6da875477 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Section.cpp @@ -88,17 +88,17 @@ static bool DelaySlotEffectsJump(DWORD JumpPC) { CCodeSection::CCodeSection( CCodeBlock * CodeBlock, DWORD EnterPC, DWORD ID, bool LinkAllowed) : m_BlockInfo(CodeBlock), + m_SectionID(ID), m_EnterPC(EnterPC), m_EndPC((DWORD)-1), - m_SectionID(ID), m_ContinueSection(NULL), m_JumpSection(NULL), + m_EndSection(false), m_LinkAllowed(LinkAllowed), - m_CompiledLocation(NULL), m_Test(0), m_Test2(0), + m_CompiledLocation(NULL), m_InLoop(false), - m_EndSection(false), m_DelaySlot(false) { CPU_Message(__FUNCTION__ ": ID %d EnterPC 0x%08X",ID,EnterPC); diff --git a/Source/Project64/N64 System/Recompiler/Function Info.cpp b/Source/Project64/N64 System/Recompiler/Function Info.cpp index b273d1e3e..38b694ff1 100644 --- a/Source/Project64/N64 System/Recompiler/Function Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Function Info.cpp @@ -14,8 +14,8 @@ CCompiledFunc::CCompiledFunc( const CCodeBlock & CodeBlock ) : m_EnterPC(CodeBlock.VAddrEnter()), m_MinPC(CodeBlock.VAddrFirst()), m_MaxPC(CodeBlock.VAddrLast()), - m_Function((Func)CodeBlock.CompiledLocation()), m_Hash(CodeBlock.Hash()), + m_Function((Func)CodeBlock.CompiledLocation()), m_Next(NULL) { m_MemContents[0] = CodeBlock.MemContents(0); diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp index cdfb5e5de..56fee2bbb 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp @@ -13,8 +13,8 @@ CRecompiler::CRecompiler(CRegisters & Registers, CProfiling & Profile, bool & EndEmulation ) : m_Registers(Registers), m_Profile(Profile), - PROGRAM_COUNTER(Registers.m_PROGRAM_COUNTER), - m_EndEmulation(EndEmulation) + m_EndEmulation(EndEmulation), + PROGRAM_COUNTER(Registers.m_PROGRAM_COUNTER) { if (g_MMU != NULL) { diff --git a/Source/Project64/Plugins/Audio Plugin.cpp b/Source/Project64/Plugins/Audio Plugin.cpp index d2d1651d0..8d7c6e52e 100644 --- a/Source/Project64/Plugins/Audio Plugin.cpp +++ b/Source/Project64/Plugins/Audio Plugin.cpp @@ -11,12 +11,12 @@ #include "stdafx.h" CAudioPlugin::CAudioPlugin() : - m_hAudioThread(NULL), - AiDacrateChanged(NULL), AiLenChanged(NULL), AiReadLength(NULL), ProcessAList(NULL), - AiUpdate(NULL) + m_hAudioThread(NULL), + AiUpdate(NULL), + AiDacrateChanged(NULL) { } diff --git a/Source/Project64/Plugins/Controller Plugin.cpp b/Source/Project64/Plugins/Controller Plugin.cpp index 8369ce6ca..b935a02d9 100644 --- a/Source/Project64/Plugins/Controller Plugin.cpp +++ b/Source/Project64/Plugins/Controller Plugin.cpp @@ -11,13 +11,13 @@ #include "stdafx.h" CControl_Plugin::CControl_Plugin(void) : - m_AllocatedControllers(false), WM_KeyDown(NULL), WM_KeyUp(NULL), RumbleCommand(NULL), GetKeys(NULL), ReadController(NULL), - ControllerCommand(NULL) + ControllerCommand(NULL), + m_AllocatedControllers(false) { memset(&m_PluginControllers, 0, sizeof(m_PluginControllers)); memset(&m_Controllers, 0, sizeof(m_Controllers)); diff --git a/Source/Project64/Plugins/Plugin Base.cpp b/Source/Project64/Plugins/Plugin Base.cpp index 0e1f0f8d5..49a73dce0 100644 --- a/Source/Project64/Plugins/Plugin Base.cpp +++ b/Source/Project64/Plugins/Plugin Base.cpp @@ -11,18 +11,18 @@ #include "stdafx.h" CPlugin::CPlugin() : - m_hDll(NULL), - m_Initialized(false), - m_RomOpen(false), - RomOpen(NULL), - RomClosed(NULL), - CloseDLL(NULL), - PluginOpened(NULL), DllAbout(NULL), DllConfig(NULL), + CloseDLL(NULL), + RomOpen(NULL), + RomClosed(NULL), + PluginOpened(NULL), SetSettingInfo(NULL), SetSettingInfo2(NULL), - SetSettingInfo3(NULL) + SetSettingInfo3(NULL), + m_hDll(NULL), + m_Initialized(false), + m_RomOpen(false) { memset(&m_PluginInfo, 0, sizeof(m_PluginInfo)); } diff --git a/Source/Project64/Plugins/Plugin Class.cpp b/Source/Project64/Plugins/Plugin Class.cpp index cbfa7886a..45ef88b18 100644 --- a/Source/Project64/Plugins/Plugin Class.cpp +++ b/Source/Project64/Plugins/Plugin Class.cpp @@ -11,9 +11,9 @@ #include "stdafx.h" CPlugins::CPlugins (const stdstr & PluginDir): - m_PluginDir(PluginDir), - m_Gfx(NULL), m_Audio(NULL), m_RSP(NULL), m_Control(NULL), - m_RenderWindow(NULL), m_DummyWindow(NULL) + m_RenderWindow(NULL), m_DummyWindow(NULL), + m_PluginDir(PluginDir), m_Gfx(NULL), m_Audio(NULL), + m_RSP(NULL), m_Control(NULL) { CreatePlugins(); g_Settings->RegisterChangeCB(Plugin_RSP_Current,this,(CSettings::SettingChangedFunc)PluginChanged); diff --git a/Source/Project64/Plugins/RSP Plugin.cpp b/Source/Project64/Plugins/RSP Plugin.cpp index e660a8cd0..5239068db 100644 --- a/Source/Project64/Plugins/RSP Plugin.cpp +++ b/Source/Project64/Plugins/RSP Plugin.cpp @@ -15,9 +15,9 @@ void DummyFunc1(BOOL /*a*/) {} CRSP_Plugin::CRSP_Plugin(void) : DoRspCycles(NULL), EnableDebugging(NULL), + m_CycleCount(0), GetDebugInfo(NULL), - InitiateDebugger(NULL), - m_CycleCount(0) + InitiateDebugger(NULL) { memset(&m_RSPDebug, 0, sizeof(m_RSPDebug)); } diff --git a/Source/Project64/Settings/SettingType/SettingsType-Application.cpp b/Source/Project64/Settings/SettingType/SettingsType-Application.cpp index 08fad99ce..0115aaa84 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Application.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-Application.cpp @@ -15,41 +15,41 @@ bool CSettingTypeApplication::m_UseRegistry = false; CIniFile * CSettingTypeApplication::m_SettingsIniFile = NULL; CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ) : - m_Section(FixSectionName(Section)), - m_KeyName(Name), m_DefaultStr(""), m_DefaultValue(DefaultValue), m_DefaultSetting(Default_Constant), + m_Section(FixSectionName(Section)), + m_KeyName(Name), m_KeyNameIdex(m_KeyName) { } CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bool DefaultValue ) : - m_Section(FixSectionName(Section)), - m_KeyName(Name), m_DefaultStr(""), m_DefaultValue(DefaultValue), m_DefaultSetting(Default_Constant), + m_Section(FixSectionName(Section)), + m_KeyName(Name), m_KeyNameIdex(m_KeyName) { } CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ) : - m_Section(FixSectionName(Section)), - m_KeyName(Name), m_DefaultStr(DefaultValue), m_DefaultValue(0), m_DefaultSetting(Default_Constant), + m_Section(FixSectionName(Section)), + m_KeyName(Name), m_KeyNameIdex(m_KeyName) { } CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ) : - m_Section(FixSectionName(Section)), - m_KeyName(Name), m_DefaultStr(""), m_DefaultValue(0), m_DefaultSetting(DefaultSetting), + m_Section(FixSectionName(Section)), + m_KeyName(Name), m_KeyNameIdex(m_KeyName) { } diff --git a/Source/Project64/User Interface/Notification Class.cpp b/Source/Project64/User Interface/Notification Class.cpp index f07c89216..7769d536c 100644 --- a/Source/Project64/User Interface/Notification Class.cpp +++ b/Source/Project64/User Interface/Notification Class.cpp @@ -7,10 +7,10 @@ CNotification & Notify ( void ) return g_Notify; } -CNotification::CNotification ( ) : - m_NextMsg(0), +CNotification::CNotification() : + m_hWnd(NULL), m_gfxPlugin(NULL), - m_hWnd(NULL) + m_NextMsg(0) { _tzset(); } diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index d15f6a240..748f6c1e4 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -6,14 +6,14 @@ CRomBrowser::CRomBrowser (HWND & MainWindow, HWND & StatusWindow ) : m_MainWindow(MainWindow), m_StatusWindow(StatusWindow), + m_ShowingRomBrowser(false), m_RefreshThread(NULL), m_RomIniFile(NULL), m_NotesIniFile(NULL), m_ExtIniFile(NULL), m_ZipIniFile(NULL), - m_WatchThreadID(0), - m_ShowingRomBrowser(false), - m_AllowSelectionLastRom(true) + m_AllowSelectionLastRom(true), + m_WatchThreadID(0) { if (g_Settings) { diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h b/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h index 843b64d6f..e6da4a608 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h +++ b/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h @@ -19,14 +19,14 @@ class CModifiedComboBoxT : public: // Constructors CModifiedComboBoxT(TParam defaultValue, HWND hWnd = NULL, bool AllwaysSelected = true) : - CComboBox(hWnd), - m_defaultValue(defaultValue), - m_AllwaysSelected(AllwaysSelected), + CComboBox(hWnd), m_Changed(false), m_Reset(false), + m_defaultValue(defaultValue), m_BoldFont(NULL), m_OriginalFont(NULL), - m_TextField(NULL) + m_TextField(NULL), + m_AllwaysSelected(AllwaysSelected) { } From 7c2f30e8400c05a9e603307a01f6a363d5c08e46 Mon Sep 17 00:00:00 2001 From: Emmet Young Date: Wed, 23 Sep 2015 23:23:11 +1000 Subject: [PATCH 101/103] Add support for Visual Studio 2015, xdebug appears to no longer be available in Visual Studio 2015. So for now memtest must be disabled for Debug builds to operate correctly. --- Source/3rd Party/wx/include/msvc/wx/setup.h | 4 ++++ Source/3rd Party/wx/include/wx/platform.h | 6 ++++-- Source/Common/MemTest.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/3rd Party/wx/include/msvc/wx/setup.h b/Source/3rd Party/wx/include/msvc/wx/setup.h index 36bd70701..a44838d04 100644 --- a/Source/3rd Party/wx/include/msvc/wx/setup.h +++ b/Source/3rd Party/wx/include/msvc/wx/setup.h @@ -62,6 +62,10 @@ #define wxCOMPILER_PREFIX vc100 #elif _MSC_VER == 1700 #define wxCOMPILER_PREFIX vc110 + #elif _MSC_VER == 1800 + #define wxCOMPILER_PREFIX vc120 + #elif _MSC_VER == 1900 + #define wxCOMPILER_PREFIX vc140 #else #error "Unknown MSVC compiler version, please report to wx-dev." #endif diff --git a/Source/3rd Party/wx/include/wx/platform.h b/Source/3rd Party/wx/include/wx/platform.h index 05b132af1..710b273f1 100644 --- a/Source/3rd Party/wx/include/wx/platform.h +++ b/Source/3rd Party/wx/include/wx/platform.h @@ -437,7 +437,9 @@ # elif __VISUALC__ < 1800 # define __VISUALC11__ # elif __VISUALC__ < 1900 -# define __VISUALC12__ +# define __VISUALC12__ +# elif __VISUALC__ < 2000 +# define __VISUALC14__ # else # pragma message("Please update wx/platform.h to recognize this VC++ version") # endif @@ -523,7 +525,7 @@ # define wxVISUALC_VERSION(major) 0 # define wxCHECK_VISUALC_VERSION(major) 0 #else -# define wxVISUALC_VERSION(major) ( (6 + major) * 100 ) +# define wxVISUALC_VERSION(major) ( (6 + (major >= 14 ? 1 : 0) + major) * 100 ) # define wxCHECK_VISUALC_VERSION(major) ( __VISUALC__ >= wxVISUALC_VERSION(major) ) #endif diff --git a/Source/Common/MemTest.h b/Source/Common/MemTest.h index 1fce02e68..eb2635e36 100644 --- a/Source/Common/MemTest.h +++ b/Source/Common/MemTest.h @@ -1,5 +1,8 @@ #ifdef _DEBUG + +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) #define MEM_LEAK_TEST +#endif #ifdef MEM_LEAK_TEST From 660ecf4de80fb07f50d144f17c36eebfcf2fe6ac Mon Sep 17 00:00:00 2001 From: Matilin Torre Date: Wed, 23 Sep 2015 15:56:11 +0200 Subject: [PATCH 102/103] Improves French Translation * spelling * less capitals * accented capitals * typography: ellipsis dots and apostrophes * consistency --- Lang/French.pj.Lang | 530 ++++++++++++++++++++++---------------------- 1 file changed, 265 insertions(+), 265 deletions(-) diff --git a/Lang/French.pj.Lang b/Lang/French.pj.Lang index 2ff55cdc2..c53dcccf2 100644 --- a/Lang/French.pj.Lang +++ b/Lang/French.pj.Lang @@ -8,17 +8,17 @@ #4 # "6 Mai 2015" // Date //About DLL Dialog -#5 # "Langue en cours" +#5 # "Langue actuelle" #6 # "Auteur" #7 # "Version" #8 # "Date" -#9 # "Visiter le Site Web" -#10 # "Base de données des ROMs (.RDB)" -#11 # "Fichier des Codes Cheats (.CHT)" -#12 # "Info sur les ROM étendues (.RDX)" +#9 # "Visiter le site web" +#10 # "Base de données des ROM (.rdb)" +#11 # "Fichier des cheats (.cht)" +#12 # "Infos sur les ROM étendues (.rdx)" //About INI title -#20 # "A Propos Des Fichiers Config" +#20 # "À propos des fichiers de configuration" /********************************************************************************* * Menu * @@ -26,55 +26,55 @@ //File Menu #100# "&Fichier" #101# "&Ouvrir une ROM" -#102# "&Info sur la ROM..." -#103# "Démarrer l'Emulation" -#104# "Arrêter l'Emulation" -#105# "Choisir le Répertoire ROM..." -#106# "Rafraîchir la Liste de ROM" -#107# "ROM Récente" -#108# "Répertoires ROM Récente" +#102# "&Infos sur la ROM…" +#103# "Démarrer l’émulation" +#104# "Arrêter l’émulation" +#105# "Choisir le répertoire des ROM…" +#106# "Rafraîchir la liste des ROM" +#107# "ROM récentes" +#108# "Répertoires des ROM récentes" #109# "&Quitter" //System Menu #120# "&Système" #121# "&Redémarrer" #122# "&Pause" -#123# "&Capture d'Ecran" +#123# "&Capture d’écran" #124# "Limiter les FPS" -#125# "&Sauvegarder l'Etat" -#126# "Sauvegarder Sous..." -#127# "&Charger un Etat" -#128# "Charger..." -#129# "Sauvegarder l'&Etat en Cours" -#130# "Cheats..." -#131# "Bouton GameShark (Cheats)" +#125# "&Sauvegarder l’état" +#126# "Sauvegarder sous…" +#127# "&Charger un état" +#128# "Charger…" +#129# "Sauvegarder l’&état actuel" +#130# "Cheats…" +#131# "Bouton GameShark (cheats)" #132# "R&eprendre" -#133# "Redémarrage &Logiciel" -#134# "Redémarrage &Matériel" +#133# "Redémarrage &logiciel" +#134# "Redémarrage &matériel" //Options Menu #140# "&Options" #141# "&Plein écran" -#142# "&Afficher la Fenêtre au Premier Plan" -#143# "Configurer le Plugin Graphique..." -#144# "Configurer le Plugin Audio..." -#145# "Configurer le Plugin Contrôleur..." -#146# "Configurer le Plugin RSP..." -#147# "Afficher l'Utilisation du CPU" -#148# "&Paramètres..." +#142# "&Toujours visible" +#143# "Configurer le plugin graphique…" +#144# "Configurer le plugin audio…" +#145# "Configurer le plugin contrôleur…" +#146# "Configurer le plugin RSP…" +#147# "Afficher l’utilisation du CPU" +#148# "&Paramètres…" //Debugger Menu -#160# "&Débugeur" +#160# "&Débogueur" //Language Menu #175# "&Langage" -//Help MenuAide" +//Help Menu #180# "&Aide" -#181# "A Propos Des Fichiers Conf&ig" -#182# "&A Propos De Project64" -#183# "&Forum de Support" -#184# "Site &Web" +#181# "À propos des fichiers de conf&iguration" +#182# "À &propos de Project64" +#183# "&Forum de support" +#184# "Site &web" //Current Save Slot menu #190# "Défaut" @@ -90,94 +90,94 @@ #200# "Emplacement 10" //Pop up Menu -#210# "Lancer le Jeu" -#211# "Information sur la ROM" -#212# "Editer les Paramètres du Jeu" -#213# "Editer les Cheats" -#214# "Plugin Graphiques" +#210# "Lancer le jeu" +#211# "Informations sur la ROM" +#212# "Éditer les paramètres du jeu" +#213# "Éditer les cheats" +#214# "Plugin graphique" //Alternate Name to save Slot -#220# "Sauvegarder l'Emplacement - Défaut" -#221# "Sauvegarder l'Emplacement - 1" -#222# "Sauvegarder l'Emplacement - 2" -#223# "Sauvegarder l'Emplacement - 3" -#224# "Sauvegarder l'Emplacement - 4" -#225# "Sauvegarder l'Emplacement - 5" -#226# "Sauvegarder l'Emplacement - 6" -#227# "Sauvegarder l'Emplacement - 7" -#228# "Sauvegarder l'Emplacement - 8" -#229# "Sauvegarder l'Emplacement - 9" -#230# "Sauvegarder l'Emplacement - 10" +#220# "Emplacement de sauvegarde - Défaut" +#221# "Emplacement de sauvegarde - 1" +#222# "Emplacement de sauvegarde - 2" +#223# "Emplacement de sauvegarde - 3" +#224# "Emplacement de sauvegarde - 4" +#225# "Emplacement de sauvegarde - 5" +#226# "Emplacement de sauvegarde - 6" +#227# "Emplacement de sauvegarde - 7" +#228# "Emplacement de sauvegarde - 8" +#229# "Emplacement de sauvegarde - 9" +#230# "Emplacement de sauvegarde - 10" // Menu Descriptions -#250# "Ouvrir une Image ROM N64" -#251# "Afficher les informations concernant l'image chargé" -#252# "Lancer l'émulation d'une image ROM chargé" -#253# "Arrêter l'émulation d'une image ROM chargé" -#254# "Sélectionner le répertoire de la ROM" -#255# "Rafraîchir la liste de ROMS en cours dans le navigateur de ROM" -#256# "Quitter l'application" -#257# "Redémarrer l'image de la ROM en cours (recharger tous les changements de paramètres)" -#258# "Mettre en pause/reprendre l'émulation de la ROM lancé en cours" -#259# "Générer une image bitmap de l'écran en cours" +#250# "Ouvrir une image ROM N64" +#251# "Afficher les informations concernant l’image chargée" +#252# "Lancer l’émulation de l’image ROM chargée" +#253# "Arrêter l’émulation de l’image ROM chargée" +#254# "Sélectionner le répertoire des ROM" +#255# "Rafraîchir la liste actuelle des ROM dans le navigateur de ROM" +#256# "Quitter l’application" +#257# "Redémarrer l’image ROM actuelle (recharger tous les changements de paramètres)" +#258# "Mettre en pause/reprendre l’émulation de la ROM lancée" +#259# "Générer une image bitmap de l’écran actuel" #260# "Limiter les FPS à la bonne vitesse de la N64" -#261# "Sauvegarder l'état du système en cours" -#262# "Sauvegarder l'état du système en cours dans l'emplacement du fichier sélectionné" -#263# "Charger l'état du système sauvegardé" -#264# "Choisir un fichier d'état système sauvegardé à charger" -#265# "Activer/Désactiver les cheats GameShark" -#266# "Le bouton GameShark est utilisé avec des cheats spécifique." -#267# "Basculer l'émulation du mode fenêtré vers le mode plein écran." +#261# "Sauvegarder l’état actuel du système" +#262# "Sauvegarder l’état actuel du système à l’emplacement du fichier sélectionné" +#263# "Charger l’état du système sauvegardé" +#264# "Choisir un fichier d’état système sauvegardé à charger" +#265# "Activer/désactiver les cheats GameShark" +#266# "Le bouton GameShark est utilisé avec des cheats spécifiques." +#267# "Basculer l’émulation du mode fenêtré vers le mode plein écran." #268# "Permet de mettre la fenêtre Project64 au premier plan" #269# "Configurer le plugin graphique" #270# "Configurer le plugin audio" #271# "Configurer le plugin contrôleur (ex : choisir les touches)" #272# "Configurer le plugin RSP" -#273# "Afficher l'utilisation du CPU de l'émulateur répartie sur les différentes tâches" +#273# "Afficher l’utilisation du CPU de l’émulateur répartie sur les différentes tâches" #274# "Voir/changer les paramètres pour cette application" -#275# "Voir le manuel pour l'application" -#276# "Voir la FAQ pour l'application" -#278# "A Propos de l'application et des auteurs" -#277# "A Propos des auteurs sur les fichiers de support" -#279# "Ouvrir l'image ROM ouverte précédemment" +#275# "Voir le manuel pour l’application" +#276# "Voir la FAQ pour l’application" +#278# "À propos de l’application et des auteurs" +#277# "À propos des auteurs sur les fichiers de support" +#279# "Ouvrir l’image ROM ouverte précédemment" #280# "Choisir ce répertoire comme votre répertoire de jeu" -#281# "Changer l'application pour utiliser cette langue" -#282# "Choisir l'emplacement de sauvegarde pour l'état sauvegardé" +#281# "Changer l’application pour utiliser cette langue" +#282# "Choisir l’emplacement de sauvegarde pour l’état sauvegardé" #283# "Jouer au jeu sélectionné" -#284# "Information concernant le jeu sélectionné" -#285# "Editer les paramètres pour le jeu sélectionné" -#286# "Editer les cheats pour le jeu sélectionné" +#284# "Informations concernant le jeu sélectionné" +#285# "Éditer les paramètres pour le jeu sélectionné" +#286# "Éditer les cheats pour le jeu sélectionné" /********************************************************************************* * ROM Browser * *********************************************************************************/ //ROM Browser Fields -#300# "Nom du Fichier" -#301# "Nom Interne" -#302# "Nom Correcte (GOODN64)" +#300# "Nom du fichier" +#301# "Nom interne" +#302# "Nom correct (GoodN64)" #303# "Statut" #304# "Taille de la ROM" #305# "Notes (noyau)" #306# "Notes (plugins par défaut)" #307# "Notes (utilisateur)" -#308# "ID de la Cartouche" +#308# "ID de la cartouche" #309# "Constructeur" #310# "Pays" #311# "Développeur" #312# "CRC1" #313# "CRC2" #314# "Puce CIC" -#315# "Date de Sortie" +#315# "Date de sortie" #316# "Genre" #317# "Joueurs" -#318# "Forcer le Feedback" -#319# "Format de Fichier" +#318# "Forcer le feedback" +#319# "Format de fichier" //Select ROM -#320# "Sélectionner le Répertoire ROM en cours" +#320# "Sélectionner le répertoire de ROM actuel" //Messages -#340# "Mauvaise ROM ? Utilisez GoodN64 & vérifier la mise à jour de RDB" +#340# "Mauvaise ROM ? Utilisez GoodN64 et vérifiez la mise à jour de RDB" /********************************************************************************* * Options * @@ -189,122 +189,122 @@ #401# "Plugins" #402# "Répertoires" #403# "Options" -#404# "Sélection de la ROM" -#405# "Avancée" -#406# "Paramètre Général" -#407# "Intégration du Shell" +#404# "Navigateur de ROM" +#405# "Avancé" +#406# "Paramètres généraux" +#407# "Intégration au shell" #408# "Notes" -#409# "Raccourcis Clavier" +#409# "Raccourcis clavier" #410# "Statut" -#411# "Recompileur" +#411# "Recompilateur" //Plugin Dialog -#420# "A Propos De" +#420# "À propos" #421# " Plugin RSP (Reality Signal Processor) : " -#422# " Plugin Vidéo (graphique) : " -#423# " Plugin Audio (son) : " -#424# " Plugin Input (contrôleur) : " +#422# " Plugin vidéo (graphique) : " +#423# " Plugin audio (son) : " +#424# " Plugin input (contrôleur) : " #425# "Graphismes HLE" #426# "Audio HLE" -#427# "** Utiliser le Système de Plugin **" +#427# "** Utiliser le plugin système **" //Directory Dialog -#440# " Répertoire Plugins : " -#441# " Répertoire ROM : " -#442# " Répertoire des Sauvegardes N64 natif : " -#443# " Répertoire des Etats Sauvegardés : " -#444# " Répertoire des Captures d'Ecrans : " -#445# "Dernier Dossier d'où la ROM a été ouverte" -#446# "Sélectionner le Répertoire Plugin" -#447# "Sélectionner le Répertoire ROM" -#448# "Sélectionner le Répertoire des Sauvegardes N64 natif" -#449# "Sélectionner le Répertoire des Etats Sauvegardés" -#450# "Sélectionner le Répertoire des Copies d'Ecrans" -#451# " Répertoire du Pack de Texture : " -#452# "Sélectionner le Répertoire du Pack de Texture" +#440# " Répertoire des plugins : " +#441# " Répertoire des ROM : " +#442# " Répertoire des sauvegardes N64 natives : " +#443# " Répertoire des sauvegardes d’état : " +#444# " Répertoire des captures d’écran : " +#445# "Dernier répertoire d’où la ROM a été ouverte" +#446# "Sélectionner le répertoire des plugins" +#447# "Sélectionner le répertoire des ROM" +#448# "Sélectionner le répertoire des sauvegardes N64 natives" +#449# "Sélectionner le répertoire des sauvegardes d’état" +#450# "Sélectionner le répertoire des captures d’écran" +#451# " Répertoire du pack de textures : " +#452# "Sélectionner le répertoire du pack de texture" //Options (general) Tab -#460# "Emulation en pause quand la fenêtre n'est pas active" -#461# "Entrer en mode Plein Ecran pendant le Chargement d'une ROM" -#462# "Cacher les Paramètres Avancées" -#463# "Retenir les Cheats Sélectionnés" -#464# "Désactiver l'Ecran de Veille pendant le Lancement d'une ROM" -#465# "Afficher la Vitesse" -#466# "Vitesse Affiché" +#460# "Émulation en pause quand la fenêtre est inactive" +#461# "Passer en plein écran au chargement d’une ROM" +#462# "Cacher les paramètres avancés" +#463# "Retenir les cheats sélectionnés" +#464# "Désactiver l’écran de veille quand une ROM est lancée" +#465# "Afficher la vitesse" +#466# "Vitesse affichée :" #467# "Vérifier si Project64 est déjà lancé" //ROM Browser Tab -#480# "Max de ROMS à retenir (0-10) :" -#481# "ROMs" +#480# "Max de ROM à retenir (0-10) :" +#481# "ROM" #482# "Max de répertoires ROM à retenir (0-10) :" #483# "répertoires" -#484# "Utiliser le Navigateur de ROM" -#485# "Utiliser la Récursivité du Répertoire" -#486# "Champs Disponible :" -#487# "Champs dans l'ordre :" +#484# "Utiliser le navigateur de ROM" +#485# "Utiliser également les sous-répertoires" +#486# "Champs disponibles :" +#487# "Champs dans l’ordre :" #488# "Ajouter ->" #489# "<- Supprimer" #490# "Haut" #491# "Bas" -#492# "Rafraîchir Automatique le Navigateur" +#492# "Rafraîchir automatiquement le navigateur" //Advanced Options -#500# "La plupart de ces changements ne prendront pas effet jusqu'à ce qu'une nouvelle ROM soit ouverte ou que la ROM en cours soit redémarré." -#501# "Noyau par Défaut" -#502# "Style du Noyau du CPU :" -#503# "Méthodes Self mod" -#504# "Taille de la Mémoire par Défaut :" -#505# "Lien Avancée du Bloc :" -#506# "Démarrer l'émulation après le chargement des ROMS" +#500# "La plupart de ces changements ne prendront pas effet avant qu’une nouvelle ROM soit ouverte ou que la ROM actuelle soit redémarrée." +#501# "Noyau par défaut" +#502# "Style de noyau CPU :" +#503# "Méthodes Self Mod" +#504# "Taille de la mémoire par défaut :" +#505# "Liaison de blocs avancée" +#506# "Démarrer l’émulation au chargement d’une ROM" #507# "Préférer les réglages du fichier RDB à ceux par défaut" -#508# "Compresser Automatiquement les Etats Sauvegardés" -#509# "Activer le Débugeur" +#508# "Compresser automatiquement les sauvegardes d’état" +#509# "Activer le débogueur" #510# "Cache" #511# "PI DMA" -#512# "Lance le Changement" -#513# "Mémoire Protégé" -#514# "TLB Non Défini" +#512# "Lancer si modifié" +#513# "Protéger la mémoire" +#514# "TLB unmapping" //ROM Options -#520# "Style de Noyau :" -#521# "Taux Rafraîchissement VI :" -#522# "Taille de la Mémoire :" -#523# "Lien Avancée du Bloc" -#524# "Type de Sauvegarde :" -#525# "Compteur (Facteur) :" -#526# "Augmentation Compilé du Tampon" +#520# "Style de noyau CPU :" +#521# "Taux de rafraîchissement VI :" +#522# "Taille de la mémoire :" +#523# "Liaison de blocs avancée" +#524# "Type de sauvegarde :" +#525# "Facteur compteur :" +#526# "Plus grand tampon de compilation" #527# "Utiliser le TLB" -#528# "Registre en Cache" -#529# "Retarder l'Interruption SI" -#530# "SP Rapide" +#528# "Mettre en cache les registres" +#529# "Retarder l’interruption SI" +#530# "SP rapide" #531# "Défaut" -#532# "Signal Audio RSP" -#533# "Correction du Timing Audio" -#534# "Méthode Fonction Recherche :" -#535# "Méthode Personnalisé self mod" -#536# "Synchronisation Audio" -#537# "Compteur AI par byte" -#538# "Moteur 32-bit" -#539# "Retarder l'Interruption DP" +#532# "Signal audio RSP" +#533# "Correction du timing audio" +#534# "Méthode de recherche de fonctions :" +#535# "Méthode self mod personnalisée" +#536# "Synchronisation audio" +#537# "Compteur AI par octet" +#538# "Moteur 32 bits" +#539# "Retarder l’interruption DP" //Core Styles #540# "Interpréteur" -#541# "Recompileur" -#542# "Synchroniser les Noyaux" +#541# "Recompilateur" +#542# "Synchroniser les noyaux" //Self Mod Methods #560# "Aucun" #561# "Cache" -#562# "Mémoire Protégé" -#563# "Vérifier la Mémoire & le Cache" -#564# "Changer la Mémoire & le Cache" -#565# "Vérifier la Mémoire Avancée" -#566# "Vider le Code du Cache" +#562# "Protéger la mémoire" +#563# "Vérifier la mémoire et le cache" +#564# "Changer la mémoire et le cache" +#565# "Vérifier la mémoire avancée" +#566# "Vider le code du cache" //Function Lookup method -#570# "Table de Recherche Physique" -#571# "Table de Recherche Virtuelle" -#572# "Changer la Mémoire" +#570# "Table de recherche physique" +#571# "Table de recherche virtuelle" +#572# "Changer la mémoire" //RDRAM Size #580# "4 Mo" @@ -316,59 +316,59 @@ //Save Type #620# "Par défaut" -#621# "4-kbit EEPROM" -#622# "16-kbit EEPROM" -#623# "32-kbyte SRAM" +#621# "4 kbit EEPROM" +#622# "16 kbit EEPROM" +#623# "32 ko SRAM" #624# "Flash RAM" //Shell Integration Tab -#640# "Associer Fichier d'Extension :" +#640# "Associer l’extension de fichier :" //ROM Notes #660# "Statut ROM :" -#661# "Note Noyau :" -#662# "Note Plugin :" +#661# "Note noyau :" +#662# "Note plugin :" // Accelerator Selector -#680# "Etat du CPU :" -#681# "Menu Objet :" -#682# "Touches en Cours :" -#683# "Sélectionner Nouveau Raccourci :" -#684# "Actuellement Assigné à :" +#680# "État du CPU :" +#681# "Menu objet :" +#682# "Touches actuelles :" +#683# "Sélectionner nouveau raccourci :" +#684# "Actuellement assigné à :" #685# "Assigner" #686# "Supprimer" -#687# "Tout Redémarrer" -#688# "Le jeu ne se lance pas" -#689# "Le jeu fonctionne" -#690# "Le jeu fonctionne (Fenêtré)" -#691# "Le jeu fonctionne (Plein Ecran)" +#687# "Tout Réinitialiser" +#688# "Aucun jeu lancé" +#689# "Un jeu est lancé" +#690# "Un jeu est lancé (fenêtré)" +#691# "Un jeu est lancé (plein écran)" // Frame Rate Option -#700# "Interruptions Vertical par secondes" -#701# "Afficher les listes par secondes" -#702# "Pourcentage à Pleine Vitesse" +#700# "Interruptions verticales par seconde" +#701# "Listes d’affichage par seconde" +#702# "Pourcentage de la vitesse normale" // Increase speed -#710# "Augmenter la Vitesse du Jeu" -#711# "Diminuer la Vitesse du Jeu" +#710# "Augmenter la vitesse du jeu" +#711# "Diminuer la vitesse du jeu" //Bottom page buttons -#720# "Redémarrer la Page" -#721# "Tout Redémarrer" +#720# "Réinitialiser la page" +#721# "Tout réinitialiser" #722# "Appliquer" /********************************************************************************* * ROM Information * *********************************************************************************/ //ROM Info Title -#800# "Information ROM" +#800# "Informations sur la ROM" //ROM Info Text #801# "Nom de la ROM :" -#802# "Nom du Fichier :" -#803# "Localisation :" +#802# "Nom du fichier :" +#803# "Emplacement :" #804# "Taille de la ROM :" -#805# "ID Cartouche :" +#805# "ID cartouche :" #806# "Développeur :" #807# "Pays :" #808# "CRC1 :" @@ -383,114 +383,114 @@ #1000# "Cheats" #1001# "Cheats :" #1002# " Notes : " -#1003# "Tout Marquer" -#1004# "Rien Marquer" +#1003# "Tout cocher" +#1004# "Tout décocher" //Add Cheat -#1005# "Ajouter un Cheat" +#1005# "Ajouter un cheat" #1006# "Nom :" #1007# "Code :" #1008# "Insérer" #1009# "Vider" -#1010# " Notes Cheat : " -#1011# "Ajout à la BDD" +#1010# " Notes cheat : " +#1011# "Ajouter à la BDD" //Code extension -#1012# "Code Extensions" -#1013# "Veuillez choisir une valeur a utilisé pour :" +#1012# "Extensions de code" +#1013# "Veuillez choisir une valeur à utiliser pour :" #1014# "OK" #1015# "Annuler" //Digital Value -#1016# "Quantité de Chiffre" -#1017# "Veuillez Choisir une Valeur pour :" +#1016# "Nombre quantité" +#1017# "Veuillez choisir une valeur pour :" #1018# "&Valeur" #1019# "depuis" #1020# "vers" #1021# "&Notes :" -#1022# "Ajouter un Cheat" -#1023# "Nouveau Cheat" +#1022# "Ajouter un cheat" +#1023# "nouveau cheat" #1024# " " #1025# "Options :" -#1026# "